From de376651f38f1e3c11c7b3df9f40e6b40c806fda Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 15 Jan 2025 01:48:46 +0000 Subject: [PATCH] CodeGen from PR 32143 in Azure/azure-rest-api-specs Merge 681d138f532e5eda7b27841af3867902cbd1d5ab into 698431b03e6c6f2142c0edae33000902eb5340d2 --- sdk/advisor/ci.mgmt.yml | 109 + sdk/agrifood/ci.mgmt.yml | 109 + sdk/alertsmanagement/ci.mgmt.yml | 109 + sdk/analysisservices/ci.mgmt.yml | 109 + sdk/apicenter/ci.mgmt.yml | 109 + sdk/apimanagement/ci.mgmt.yml | 109 + sdk/appcomplianceautomation/ci.mgmt.yml | 109 + sdk/appconfiguration/ci.mgmt.yml | 109 + sdk/applicationinsights/ci.mgmt.yml | 109 + sdk/appplatform/ci.mgmt.yml | 109 + sdk/arc-scvmm/ci.mgmt.yml | 109 + sdk/astronomer/ci.mgmt.yml | 109 + sdk/attestation/ci.mgmt.yml | 109 + sdk/authorization/ci.mgmt.yml | 109 + sdk/automanage/ci.mgmt.yml | 109 + sdk/automation/ci.mgmt.yml | 109 + sdk/avs/ci.mgmt.yml | 109 + sdk/azurelargeinstance/ci.mgmt.yml | 109 + sdk/azurestackhci/ci.mgmt.yml | 109 + .../api/Azure.Compute.Batch.net8.0.cs | 195 +- .../api/Azure.Compute.Batch.netstandard2.0.cs | 195 +- .../src/Generated/AutomaticOsUpgradePolicy.cs | 4 +- .../src/Generated/BatchClient.cs | 696 +- .../src/Generated/BatchClientOptions.cs | 8 +- .../src/Generated/BatchJob.cs | 4 +- .../src/Generated/BatchJobManagerTask.cs | 6 +- ...chJobNetworkConfiguration.Serialization.cs | 10 +- .../Generated/BatchJobNetworkConfiguration.cs | 16 +- .../src/Generated/BatchJobPreparationTask.cs | 6 +- .../src/Generated/BatchJobReleaseTask.cs | 6 +- .../BatchJobUpdateContent.Serialization.cs | 16 + .../src/Generated/BatchJobUpdateContent.cs | 6 +- .../src/Generated/BatchNode.cs | 4 +- .../BatchNodeCounts.Serialization.cs | 18 + .../src/Generated/BatchNodeCounts.cs | 16 +- ...atchNodeDeallocateContent.Serialization.cs | 149 + .../Generated/BatchNodeDeallocateContent.cs | 65 + .../Generated/BatchNodeDeallocateOption.cs | 57 + .../BatchNodeReimageContent.Serialization.cs | 149 + .../src/Generated/BatchNodeReimageContent.cs | 65 + .../src/Generated/BatchNodeReimageOption.cs | 57 + .../src/Generated/BatchNodeState.cs | 6 + .../Generated/BatchNodeUserCreateContent.cs | 4 +- .../Generated/BatchNodeUserUpdateContent.cs | 4 +- .../src/Generated/BatchPool.cs | 8 +- .../src/Generated/BatchPoolCreateContent.cs | 10 +- .../BatchPoolEnableAutoScaleContent.cs | 4 +- .../BatchPoolEvaluateAutoScaleContent.cs | 6 +- .../src/Generated/BatchPoolSpecification.cs | 10 +- .../BatchPoolUpdateContent.Serialization.cs | 206 +- .../src/Generated/BatchPoolUpdateContent.cs | 49 +- .../src/Generated/BatchPoolUsageMetrics.cs | 6 +- .../src/Generated/BatchStartTask.cs | 6 +- .../src/Generated/BatchTask.cs | 4 +- ...atchTaskContainerSettings.Serialization.cs | 33 +- .../Generated/BatchTaskContainerSettings.cs | 7 +- .../src/Generated/BatchTaskCreateContent.cs | 6 +- .../src/Generated/ComputeBatchModelFactory.cs | 36 +- ...erHostBatchBindMountEntry.Serialization.cs | 164 + .../ContainerHostBatchBindMountEntry.cs | 69 + .../src/Generated/ContainerHostDataPath.cs | 63 + .../src/Generated/DiffDiskPlacement.cs | 2 +- .../src/Generated/DiffDiskSettings.cs | 4 +- .../Generated/DiskEncryptionConfiguration.cs | 4 +- .../src/Generated/Docs/BatchClient.xml | 518 +- .../Generated/FileProperties.Serialization.cs | 6 +- .../src/Generated/FileProperties.cs | 9 +- .../Generated/ImageReference.Serialization.cs | 24 + .../src/Generated/ImageReference.cs | 14 +- .../src/Generated/InboundNatPool.cs | 6 +- .../Generated/ManagedDisk.Serialization.cs | 30 +- .../src/Generated/ManagedDisk.cs | 17 +- .../src/Generated/NetworkConfiguration.cs | 12 +- .../OutputFileBlobContainerDestination.cs | 4 +- .../src/Generated/SecurityEncryptionTypes.cs | 51 + .../src/Generated/SecurityProfile.cs | 6 +- .../src/Generated/SecurityTypes.cs | 3 + .../src/Generated/UpgradePolicy.cs | 4 +- .../VMDiskSecurityProfile.Serialization.cs | 149 + .../src/Generated/VMDiskSecurityProfile.cs | 65 + .../Generated/VirtualMachineConfiguration.cs | 4 +- .../src/Generated/WindowsUserConfiguration.cs | 4 +- .../Generated/Samples/Samples_BatchClient.cs | 1118 +- .../Azure.Compute.Batch/tsp-location.yaml | 3 +- .../src/Generated/ArmBatchModelFactory.cs | 2 +- .../src/Generated/BatchAccountPoolData.cs | 4 +- .../src/Generated/BatchAccountResource.cs | 4 +- .../Models/AutomaticOSUpgradePolicy.cs | 4 +- .../Models/BatchDiffDiskPlacement.cs | 2 +- .../Generated/Models/BatchImageReference.cs | 4 +- .../Generated/Models/BatchInboundNatPool.cs | 6 +- .../Models/BatchNetworkConfiguration.cs | 4 +- .../src/Generated/Models/BatchOSDisk.cs | 2 +- .../src/Generated/Models/DiffDiskSettings.cs | 4 +- .../BatchAccountRestOperations.cs | 8 +- .../src/autorest.md | 2 +- sdk/batch/ci.mgmt.yml | 109 + sdk/billing/ci.mgmt.yml | 109 + sdk/billingbenefits/ci.mgmt.yml | 109 + sdk/blueprint/ci.mgmt.yml | 109 + sdk/botservice/ci.mgmt.yml | 109 + sdk/cdn/ci.mgmt.yml | 109 + sdk/changeanalysis/ci.mgmt.yml | 109 + .../Configuration.json | 13 + .../src/autorest.md | 81 - .../tsp-location.yaml | 4 + .../tspCodeModel.json | 23735 ++++++++++++++++ sdk/chaos/ci.mgmt.yml | 109 + sdk/cognitiveservices/ci.mgmt.yml | 109 + sdk/communication/ci.mgmt.yml | 109 + .../src/autorest.md | 2 +- sdk/compute/ci.mgmt.yml | 109 + sdk/computefleet/ci.mgmt.yml | 109 + sdk/computeschedule/ci.mgmt.yml | 109 + ...sourceManager.ConfidentialLedger.net8.0.cs | 49 +- ...nager.ConfidentialLedger.netstandard2.0.cs | 49 +- .../Sample_ConfidentialLedgerCollection.cs | 16 +- .../Sample_ConfidentialLedgerResource.cs | 10 +- .../Samples/Sample_ManagedCcfCollection.cs | 10 +- .../Samples/Sample_ManagedCcfResource.cs | 10 +- .../Sample_SubscriptionResourceExtensions.cs | 6 +- .../ArmConfidentialLedgerModelFactory.cs | 22 +- .../Generated/ConfidentialLedgerCollection.cs | 20 +- .../Generated/ConfidentialLedgerResource.cs | 32 +- .../ConfidentialLedgerExtensions.cs | 20 +- ...ConfidentialLedgerResourceGroupResource.cs | 8 +- ...eConfidentialLedgerSubscriptionResource.cs | 12 +- .../src/Generated/ManagedCcfCollection.cs | 20 +- .../src/Generated/ManagedCcfResource.cs | 32 +- .../src/Generated/Models/ApplicationType.cs | 51 + ...fidentialLedgerProperties.Serialization.cs | 116 + .../Models/ConfidentialLedgerProperties.cs | 34 +- .../src/Generated/Models/EnclavePlatform.cs | 51 + .../ManagedCcfProperties.Serialization.cs | 16 + .../Generated/Models/ManagedCcfProperties.cs | 6 +- .../ConfidentialLedgerRestOperations.cs | 2 +- .../RestOperations/LedgerRestOperations.cs | 2 +- .../ManagedCCFRestOperations.cs | 2 +- .../src/autorest.md | 2 +- sdk/confidentialledger/ci.mgmt.yml | 109 + sdk/confluent/ci.mgmt.yml | 109 + sdk/connectedvmwarevsphere/ci.mgmt.yml | 109 + sdk/consumption/ci.mgmt.yml | 109 + sdk/containerapps/ci.mgmt.yml | 109 + sdk/containerinstance/ci.mgmt.yml | 109 + sdk/containerorchestratorruntime/ci.mgmt.yml | 109 + sdk/containerregistry/ci.mgmt.yml | 109 + .../Sample_AgentPoolSnapshotCollection.cs | 10 +- .../Sample_AgentPoolSnapshotResource.cs | 6 +- .../Sample_AgentPoolUpgradeProfileResource.cs | 2 +- ...ple_ContainerServiceAgentPoolCollection.cs | 88 +- ...ample_ContainerServiceAgentPoolResource.cs | 113 +- ...rviceMaintenanceConfigurationCollection.cs | 20 +- ...ServiceMaintenanceConfigurationResource.cs | 12 +- ...ontainerServiceManagedClusterCollection.cs | 147 +- ..._ContainerServiceManagedClusterResource.cs | 42 +- ...vicePrivateEndpointConnectionCollection.cs | 10 +- ...ervicePrivateEndpointConnectionResource.cs | 6 +- ...rviceTrustedAccessRoleBindingCollection.cs | 10 +- ...ServiceTrustedAccessRoleBindingResource.cs | 6 +- .../Samples/Sample_MachineCollection.cs | 164 + .../Samples/Sample_MachineResource.cs | 50 + ...le_ManagedClusterUpgradeProfileResource.cs | 2 +- .../Sample_MeshRevisionProfileCollection.cs | 8 +- .../Sample_MeshRevisionProfileResource.cs | 2 +- .../Sample_MeshUpgradeProfileCollection.cs | 8 +- .../Sample_MeshUpgradeProfileResource.cs | 2 +- .../Sample_SubscriptionResourceExtensions.cs | 8 +- .../Generated/AgentPoolSnapshotCollection.cs | 20 +- .../Generated/AgentPoolSnapshotResource.cs | 24 +- .../AgentPoolUpgradeProfileResource.cs | 4 +- .../ArmContainerServiceModelFactory.cs | 353 +- .../ContainerServiceAgentPoolCollection.cs | 36 +- ...ainerServiceAgentPoolData.Serialization.cs | 98 + .../ContainerServiceAgentPoolData.cs | 29 +- .../ContainerServiceAgentPoolResource.cs | 226 +- ...rviceMaintenanceConfigurationCollection.cs | 20 +- ...ServiceMaintenanceConfigurationResource.cs | 12 +- ...ontainerServiceManagedClusterCollection.cs | 36 +- ...ServiceManagedClusterData.Serialization.cs | 141 + .../ContainerServiceManagedClusterData.cs | 61 +- .../ContainerServiceManagedClusterResource.cs | 208 +- ...vicePrivateEndpointConnectionCollection.cs | 20 +- ...ervicePrivateEndpointConnectionResource.cs | 12 +- ...rviceTrustedAccessRoleBindingCollection.cs | 20 +- ...ServiceTrustedAccessRoleBindingResource.cs | 12 +- .../Extensions/ContainerServiceExtensions.cs | 66 +- .../MockableContainerServiceArmClient.cs | 24 +- ...leContainerServiceResourceGroupResource.cs | 8 +- ...bleContainerServiceSubscriptionResource.cs | 20 +- .../src/Generated/MachineCollection.cs | 395 + ...zation.cs => MachineData.Serialization.cs} | 126 +- ...{OSOptionProfileData.cs => MachineData.cs} | 35 +- .../MachineResource.Serialization.cs | 26 + ...nProfileResource.cs => MachineResource.cs} | 88 +- .../ManagedClusterUpgradeProfileResource.cs | 4 +- .../MeshRevisionProfileCollection.cs | 16 +- .../Generated/MeshRevisionProfileResource.cs | 4 +- .../Generated/MeshUpgradeProfileCollection.cs | 16 +- .../Generated/MeshUpgradeProfileResource.cs | 4 +- .../AdvancedNetworking.Serialization.cs | 233 + .../Generated/Models/AdvancedNetworking.cs | 99 + ...dNetworkingObservability.Serialization.cs} | 63 +- .../AdvancedNetworkingObservability.cs} | 24 +- ...dvancedNetworkingSecurity.Serialization.cs | 167 + .../Models/AdvancedNetworkingSecurity.cs | 66 + ...olDeleteMachinesParameter.Serialization.cs | 136 + .../AgentPoolDeleteMachinesParameter.cs | 77 + .../AgentPoolSecurityProfile.Serialization.cs | 198 + .../Models/AgentPoolSecurityProfile.cs | 71 + .../AgentPoolUpgradeSettings.Serialization.cs | 32 +- .../Models/AgentPoolUpgradeSettings.cs | 7 +- .../AgentPoolWindowsProfile.Serialization.cs | 167 + .../Models/AgentPoolWindowsProfile.cs | 66 + .../Models/ContainerServiceNetworkPolicy.cs | 3 + ...inerServiceNetworkProfile.Serialization.cs | 31 + .../Models/ContainerServiceNetworkProfile.cs | 7 +- .../IstioEgressGateway.Serialization.cs | 66 +- .../Generated/Models/IstioEgressGateway.cs | 8 +- .../Models/KubernetesVersion.Serialization.cs | 39 +- .../src/Generated/Models/KubernetesVersion.cs | 7 +- ...n.cs => MachineIPAddress.Serialization.cs} | 106 +- .../src/Generated/Models/MachineIPAddress.cs | 71 + .../MachineListResult.Serialization.cs} | 110 +- .../src/Generated/Models/MachineListResult.cs | 70 + .../MachineNetworkProperties.Serialization.cs | 185 + .../Models/MachineNetworkProperties.cs} | 28 +- .../Models/MachineProperties.Serialization.cs | 199 + .../Generated/Models/MachineProperties.cs} | 47 +- ...edClusterAgentPoolProfile.Serialization.cs | 81 + .../Models/ManagedClusterAgentPoolProfile.cs | 5 +- ...gentPoolProfileProperties.Serialization.cs | 96 + ...anagedClusterAgentPoolProfileProperties.cs | 29 +- ...dClusterAutoScalerProfile.Serialization.cs | 96 + .../Models/ManagedClusterAutoScalerProfile.cs | 17 +- ...anagedClusterCostAnalysis.Serialization.cs | 167 + .../Models/ManagedClusterCostAnalysis.cs | 66 + ...agedClusterIngressProfile.Serialization.cs | 166 + .../Models/ManagedClusterIngressProfile.cs | 66 + ...gressProfileWebAppRouting.Serialization.cs | 263 + ...nagedClusterIngressProfileWebAppRouting.cs | 78 + ...agedClusterMetricsProfile.Serialization.cs | 169 + .../Models/ManagedClusterMetricsProfile.cs | 77 + .../ManagedClusterNodeOSUpgradeChannel.cs | 3 + ...rNodeResourceGroupProfile.Serialization.cs | 166 + .../ManagedClusterNodeResourceGroupProfile.cs | 66 + .../src/Generated/Models/RestrictionLevel.cs | 51 + .../OSOptionProfileResource.Serialization.cs | 26 - .../AgentPoolsRestOperations.cs | 154 +- .../RestOperations/MachinesRestOperations.cs | 341 + ...MaintenanceConfigurationsRestOperations.cs | 2 +- .../ManagedClustersRestOperations.cs | 160 +- ...rivateEndpointConnectionsRestOperations.cs | 2 +- .../PrivateLinkResourcesRestOperations.cs | 2 +- ...solvePrivateLinkServiceIdRestOperations.cs | 2 +- .../RestOperations/SnapshotsRestOperations.cs | 2 +- ...TrustedAccessRoleBindingsRestOperations.cs | 2 +- .../TrustedAccessRolesRestOperations.cs | 2 +- .../src/autorest.md | 2 +- sdk/containerservice/ci.mgmt.yml | 109 + sdk/cosmosdb/ci.mgmt.yml | 109 + sdk/cosmosdbforpostgresql/ci.mgmt.yml | 109 + sdk/costmanagement/ci.mgmt.yml | 109 + sdk/customer-insights/ci.mgmt.yml | 109 + sdk/databox/ci.mgmt.yml | 109 + sdk/databoxedge/ci.mgmt.yml | 109 + sdk/datadog/ci.mgmt.yml | 109 + sdk/datafactory/ci.mgmt.yml | 109 + sdk/datalake-analytics/ci.mgmt.yml | 109 + sdk/datalake-store/ci.mgmt.yml | 109 + sdk/datamigration/ci.mgmt.yml | 109 + sdk/dataprotection/ci.mgmt.yml | 109 + sdk/datashare/ci.mgmt.yml | 109 + sdk/defendereasm/ci.mgmt.yml | 109 + sdk/desktopvirtualization/ci.mgmt.yml | 109 + sdk/devcenter/ci.mgmt.yml | 109 + sdk/deviceprovisioningservices/ci.mgmt.yml | 109 + sdk/deviceregistry/ci.mgmt.yml | 109 + sdk/deviceupdate/ci.mgmt.yml | 109 + sdk/devopsinfrastructure/ci.mgmt.yml | 109 + sdk/devspaces/ci.mgmt.yml | 109 + sdk/devtestlabs/ci.mgmt.yml | 109 + sdk/digitaltwins/ci.mgmt.yml | 109 + sdk/dns/ci.mgmt.yml | 109 + sdk/dnsresolver/ci.mgmt.yml | 109 + sdk/dynatrace/ci.mgmt.yml | 109 + sdk/edgeorder/ci.mgmt.yml | 109 + sdk/edgezones/ci.mgmt.yml | 109 + sdk/elastic/ci.mgmt.yml | 109 + sdk/elasticsan/ci.mgmt.yml | 109 + ...Messaging.EventGrid.SystemEvents.net8.0.cs | 1074 +- ...g.EventGrid.SystemEvents.netstandard2.0.cs | 1074 +- ...atMessageDeletedEventData.Serialization.cs | 19 +- .../AcsChatMessageDeletedEventData.cs | 10 +- ...eDeletedInThreadEventData.Serialization.cs | 19 +- .../AcsChatMessageDeletedInThreadEventData.cs | 10 +- ...hatMessageEditedEventData.Serialization.cs | 19 +- .../AcsChatMessageEditedEventData.cs | 9 +- ...geEditedInThreadEventData.Serialization.cs | 19 +- .../AcsChatMessageEditedInThreadEventData.cs | 9 +- ...essageEventBaseProperties.Serialization.cs | 13 +- .../AcsChatMessageEventBaseProperties.cs | 8 +- ...entInThreadBaseProperties.Serialization.cs | 13 +- ...sChatMessageEventInThreadBaseProperties.cs | 8 +- ...tMessageReceivedEventData.Serialization.cs | 6 +- .../AcsChatMessageReceivedEventData.cs | 5 +- ...ReceivedInThreadEventData.Serialization.cs | 6 +- ...AcsChatMessageReceivedInThreadEventData.cs | 5 +- ...antAddedToThreadEventData.Serialization.cs | 13 +- ...csChatParticipantAddedToThreadEventData.cs | 8 +- ...ToThreadWithUserEventData.Serialization.cs | 19 +- ...rticipantAddedToThreadWithUserEventData.cs | 9 +- ...emovedFromThreadEventData.Serialization.cs | 13 +- ...atParticipantRemovedFromThreadEventData.cs | 8 +- ...omThreadWithUserEventData.Serialization.cs | 19 +- ...ipantRemovedFromThreadWithUserEventData.cs | 9 +- ...hatThreadCreatedEventData.Serialization.cs | 6 +- .../AcsChatThreadCreatedEventData.cs | 5 +- ...dCreatedWithUserEventData.Serialization.cs | 6 +- .../AcsChatThreadCreatedWithUserEventData.cs | 5 +- ...hatThreadDeletedEventData.Serialization.cs | 19 +- .../AcsChatThreadDeletedEventData.cs | 9 +- ...ThreadEventBaseProperties.Serialization.cs | 13 +- .../AcsChatThreadEventBaseProperties.cs | 9 +- ...entInThreadBaseProperties.Serialization.cs | 13 +- ...csChatThreadEventInThreadBaseProperties.cs | 13 +- ...ropertiesUpdatedEventData.Serialization.cs | 19 +- ...AcsChatThreadPropertiesUpdatedEventData.cs | 9 +- ...esUpdatedPerUserEventData.Serialization.cs | 19 +- ...ThreadPropertiesUpdatedPerUserEventData.cs | 9 +- ...dWithUserDeletedEventData.Serialization.cs | 19 +- .../AcsChatThreadWithUserDeletedEventData.cs | 9 +- ...ryReportReceivedEventData.Serialization.cs | 32 +- ...AcsEmailDeliveryReportReceivedEventData.cs | 12 +- ...ngReportReceivedEventData.Serialization.cs | 32 +- ...gagementTrackingReportReceivedEventData.cs | 17 +- .../AcsIncomingCallEventData.Serialization.cs | 16 + .../src/Generated/AcsIncomingCallEventData.cs | 6 +- ...eryStatusUpdatedEventData.Serialization.cs | 32 +- ...csMessageDeliveryStatusUpdatedEventData.cs | 14 +- .../AcsMessageEventData.Serialization.cs | 13 +- .../src/Generated/AcsMessageEventData.cs | 8 +- ...MessageInteractiveContent.Serialization.cs | 13 +- .../Generated/AcsMessageInteractiveContent.cs | 8 +- ...sMessageReceivedEventData.Serialization.cs | 6 +- .../Generated/AcsMessageReceivedEventData.cs | 5 +- ...ileStatusUpdatedEventData.Serialization.cs | 52 +- .../AcsRecordingFileStatusUpdatedEventData.cs | 20 +- ...outerJobReceivedEventData.Serialization.cs | 26 +- .../AcsRouterJobReceivedEventData.cs | 12 +- ...SchedulingFailedEventData.Serialization.cs | 13 +- .../AcsRouterJobSchedulingFailedEventData.cs | 8 +- ...ingForActivationEventData.Serialization.cs | 13 +- ...sRouterJobWaitingForActivationEventData.cs | 8 +- ...orkerOfferIssuedEventData.Serialization.cs | 26 +- .../AcsRouterWorkerOfferIssuedEventData.cs | 12 +- .../AcsRouterWorkerSelector.Serialization.cs | 39 +- .../src/Generated/AcsRouterWorkerSelector.cs | 16 +- ...DeliveryAttemptProperties.Serialization.cs | 13 +- .../AcsSmsDeliveryAttemptProperties.cs | 13 +- ...ryReportReceivedEventData.Serialization.cs | 13 +- .../AcsSmsDeliveryReportReceivedEventData.cs | 8 +- .../AcsSmsReceivedEventData.Serialization.cs | 13 +- .../src/Generated/AcsSmsReceivedEventData.cs | 13 +- ...iDefinitionAddedEventData.Serialization.cs | 18 +- .../ApiCenterApiDefinitionAddedEventData.cs | 10 +- ...efinitionUpdatedEventData.Serialization.cs | 18 +- .../ApiCenterApiDefinitionUpdatedEventData.cs | 10 +- ...ApiCenterApiSpecification.Serialization.cs | 7 +- .../Generated/ApiCenterApiSpecification.cs | 12 +- .../AppEventTypeDetail.Serialization.cs | 13 +- .../src/Generated/AppEventTypeDetail.cs | 13 +- ...ervicePlanEventTypeDetail.Serialization.cs | 39 +- .../AppServicePlanEventTypeDetail.cs | 21 +- .../Generated/AvsClusterCreatedEventData.cs | 10 +- .../Generated/AvsClusterDeletedEventData.cs | 10 +- .../AvsClusterEventData.Serialization.cs | 7 +- .../src/Generated/AvsClusterEventData.cs | 12 +- .../Generated/AvsClusterFailedEventData.cs | 10 +- .../Generated/AvsClusterUpdatedEventData.cs | 10 +- .../Generated/AvsClusterUpdatingEventData.cs | 10 +- .../AvsPrivateCloudEventData.Serialization.cs | 7 +- .../src/Generated/AvsPrivateCloudEventData.cs | 12 +- .../AvsPrivateCloudFailedEventData.cs | 10 +- .../AvsPrivateCloudUpdatedEventData.cs | 10 +- .../AvsPrivateCloudUpdatingEventData.cs | 10 +- .../AvsScriptExecutionCancelledEventData.cs | 12 +- ...sScriptExecutionEventData.Serialization.cs | 14 +- .../Generated/AvsScriptExecutionEventData.cs | 15 +- .../AvsScriptExecutionFailedEventData.cs | 12 +- .../AvsScriptExecutionFinishedEventData.cs | 8 +- .../AvsScriptExecutionStartedEventData.cs | 12 +- ...municationIdentifierModel.Serialization.cs | 13 +- .../Generated/CommunicationIdentifierModel.cs | 8 +- ...RegistryArtifactEventData.Serialization.cs | 41 +- .../ContainerRegistryArtifactEventData.cs | 22 +- ...gistryArtifactEventTarget.Serialization.cs | 14 +- .../ContainerRegistryArtifactEventTarget.cs | 15 +- ...stryChartDeletedEventData.Serialization.cs | 10 +- .../ContainerRegistryChartDeletedEventData.cs | 15 +- ...istryChartPushedEventData.Serialization.cs | 10 +- .../ContainerRegistryChartPushedEventData.cs | 15 +- ...tryEventConnectedRegistry.Serialization.cs | 7 +- ...ContainerRegistryEventConnectedRegistry.cs | 12 +- ...ontainerRegistryEventData.Serialization.cs | 70 +- .../Generated/ContainerRegistryEventData.cs | 31 +- ...ainerRegistryEventRequest.Serialization.cs | 21 +- .../ContainerRegistryEventRequest.cs | 18 +- ...tainerRegistryEventTarget.Serialization.cs | 14 +- .../Generated/ContainerRegistryEventTarget.cs | 15 +- ...stryImageDeletedEventData.Serialization.cs | 22 +- .../ContainerRegistryImageDeletedEventData.cs | 21 +- ...istryImagePushedEventData.Serialization.cs | 22 +- .../ContainerRegistryImagePushedEventData.cs | 21 +- ...BoxCopyCompletedEventData.Serialization.cs | 29 +- .../DataBoxCopyCompletedEventData.cs | 17 +- ...taBoxCopyStartedEventData.Serialization.cs | 29 +- .../Generated/DataBoxCopyStartedEventData.cs | 17 +- ...oxOrderCompletedEventData.Serialization.cs | 29 +- .../DataBoxOrderCompletedEventData.cs | 17 +- ...eConnectionStateEventInfo.Serialization.cs | 7 +- .../DeviceConnectionStateEventInfo.cs | 12 +- ...ctionStateEventProperties.Serialization.cs | 14 +- .../DeviceConnectionStateEventProperties.cs | 10 +- ...eLifeCycleEventProperties.Serialization.cs | 14 +- .../DeviceLifeCycleEventProperties.cs | 10 +- .../Generated/DeviceTwinInfo.Serialization.cs | 49 +- .../src/Generated/DeviceTwinInfo.cs | 25 +- ...iceTwinInfoX509Thumbprint.Serialization.cs | 14 +- .../Generated/DeviceTwinInfoX509Thumbprint.cs | 15 +- .../DeviceTwinMetadata.Serialization.cs | 7 +- .../src/Generated/DeviceTwinMetadata.cs | 12 +- .../EventGridMQTTClientDeletedEventData.cs | 34 - ...reatedOrUpdatedEventData.Serialization.cs} | 83 +- ...ridMqttClientCreatedOrUpdatedEventData.cs} | 40 +- ...ttClientDeletedEventData.Serialization.cs} | 42 +- .../EventGridMqttClientDeletedEventData.cs | 50 + ...EventGridMqttClientDisconnectionReason.cs} | 44 +- ...tGridMqttClientEventData.Serialization.cs} | 63 +- ...ata.cs => EventGridMqttClientEventData.cs} | 30 +- ...essionConnectedEventData.Serialization.cs} | 49 +- ...ridMqttClientSessionConnectedEventData.cs} | 33 +- ...ionDisconnectedEventData.Serialization.cs} | 64 +- ...MqttClientSessionDisconnectedEventData.cs} | 37 +- ...ntState.cs => EventGridMqttClientState.cs} | 26 +- .../EventGridSystemEventsModelFactory.cs | 757 +- ...ptureFileCreatedEventData.Serialization.cs | 26 +- .../EventHubCaptureFileCreatedEventData.cs | 17 +- ...icomImageCreatedEventData.Serialization.cs | 35 +- .../HealthcareDicomImageCreatedEventData.cs | 24 +- ...icomImageDeletedEventData.Serialization.cs | 35 +- .../HealthcareDicomImageDeletedEventData.cs | 24 +- ...icomImageUpdatedEventData.Serialization.cs | 35 +- .../HealthcareDicomImageUpdatedEventData.cs | 24 +- ...rResourceCreatedEventData.Serialization.cs | 23 +- .../HealthcareFhirResourceCreatedEventData.cs | 16 +- ...rResourceDeletedEventData.Serialization.cs | 23 +- .../HealthcareFhirResourceDeletedEventData.cs | 16 +- ...rResourceUpdatedEventData.Serialization.cs | 23 +- .../HealthcareFhirResourceUpdatedEventData.cs | 16 +- .../IotHubDeviceConnectedEventData.cs | 8 +- .../Generated/IotHubDeviceCreatedEventData.cs | 8 +- .../Generated/IotHubDeviceDeletedEventData.cs | 8 +- .../IotHubDeviceDisconnectedEventData.cs | 8 +- ...essPolicyChangedEventData.Serialization.cs | 35 +- .../KeyVaultAccessPolicyChangedEventData.cs | 24 +- ...rtificateExpiredEventData.Serialization.cs | 35 +- .../KeyVaultCertificateExpiredEventData.cs | 24 +- ...ficateNearExpiryEventData.Serialization.cs | 35 +- .../KeyVaultCertificateNearExpiryEventData.cs | 24 +- ...ewVersionCreatedEventData.Serialization.cs | 35 +- ...ltCertificateNewVersionCreatedEventData.cs | 24 +- ...yVaultKeyExpiredEventData.Serialization.cs | 35 +- .../Generated/KeyVaultKeyExpiredEventData.cs | 24 +- ...ultKeyNearExpiryEventData.Serialization.cs | 35 +- .../KeyVaultKeyNearExpiryEventData.cs | 24 +- ...ewVersionCreatedEventData.Serialization.cs | 35 +- .../KeyVaultKeyNewVersionCreatedEventData.cs | 24 +- ...ultSecretExpiredEventData.Serialization.cs | 35 +- .../KeyVaultSecretExpiredEventData.cs | 24 +- ...SecretNearExpiryEventData.Serialization.cs | 35 +- .../KeyVaultSecretNearExpiryEventData.cs | 24 +- ...ewVersionCreatedEventData.Serialization.cs | 35 +- ...eyVaultSecretNewVersionCreatedEventData.cs | 24 +- ...setDriftDetectedEventData.Serialization.cs | 26 +- ...ngServicesDatasetDriftDetectedEventData.cs | 17 +- .../Generated/MediaJobCanceledEventData.cs | 65 - .../Generated/MediaJobCancelingEventData.cs | 43 - .../src/Generated/MediaJobError.cs | 98 - .../src/Generated/MediaJobErrorCategory.cs | 63 - .../src/Generated/MediaJobErrorCode.cs | 75 - .../src/Generated/MediaJobErroredEventData.cs | 65 - ...MediaJobFinishedEventData.Serialization.cs | 161 - .../Generated/MediaJobFinishedEventData.cs | 65 - .../src/Generated/MediaJobOutput.cs | 99 - .../MediaJobOutputAsset.Serialization.cs | 168 - .../src/Generated/MediaJobOutputAsset.cs | 49 - .../MediaJobOutputCanceledEventData.cs | 52 - .../MediaJobOutputCancelingEventData.cs | 52 - .../MediaJobOutputErroredEventData.cs | 52 - .../MediaJobOutputFinishedEventData.cs | 52 - .../MediaJobOutputProcessingEventData.cs | 52 - .../MediaJobOutputScheduledEventData.cs | 52 - ...utputStateChangeEventData.Serialization.cs | 169 - .../MediaJobOutputStateChangeEventData.cs | 103 - .../Generated/MediaJobProcessingEventData.cs | 43 - .../src/Generated/MediaJobRetry.cs | 51 - .../Generated/MediaJobScheduledEventData.cs | 43 - .../src/Generated/MediaJobState.cs | 66 - .../Generated/MediaJobStateChangeEventData.cs | 90 - ...veEventChannelArchiveHeartbeatEventData.cs | 82 - ...nnectionRejectedEventData.Serialization.cs | 195 - ...diaLiveEventConnectionRejectedEventData.cs | 81 - ...oderDisconnectedEventData.Serialization.cs | 195 - ...iaLiveEventEncoderDisconnectedEventData.cs | 81 - ...DataChunkDroppedEventData.Serialization.cs | 211 - ...eEventIncomingDataChunkDroppedEventData.cs | 85 - ...ngStreamReceivedEventData.Serialization.cs | 247 - ...iveEventIncomingStreamReceivedEventData.cs | 97 - ...StreamsOutOfSyncEventData.Serialization.cs | 207 - ...eEventIncomingStreamsOutOfSyncEventData.cs | 85 - ...StreamsOutOfSyncEventData.Serialization.cs | 195 - ...tIncomingVideoStreamsOutOfSyncEventData.cs | 81 - ...tIngestHeartbeatEventData.Serialization.cs | 355 - .../MediaLiveEventIngestHeartbeatEventData.cs | 125 - ...ntinuityDetectedEventData.Serialization.cs | 223 - ...ventTrackDiscontinuityDetectedEventData.cs | 89 - ...ftTeamsAppIdentifierModel.Serialization.cs | 13 +- .../MicrosoftTeamsAppIdentifierModel.cs | 8 +- ...tTeamsUserIdentifierModel.Serialization.cs | 13 +- .../MicrosoftTeamsUserIdentifierModel.cs | 8 +- ...licyStateChangedEventData.Serialization.cs | 51 +- ...licyInsightsPolicyStateChangedEventData.cs | 28 +- ...licyStateCreatedEventData.Serialization.cs | 51 +- ...licyInsightsPolicyStateCreatedEventData.cs | 28 +- ...licyStateDeletedEventData.Serialization.cs | 51 +- ...licyInsightsPolicyStateDeletedEventData.cs | 28 +- ...ortRdbCompletedEventData.Serialization.cs} | 55 +- ...cs => RedisExportRdbCompletedEventData.cs} | 19 +- ...ortRdbCompletedEventData.Serialization.cs} | 55 +- ...cs => RedisImportRdbCompletedEventData.cs} | 19 +- ...atchingCompletedEventData.Serialization.cs | 13 +- .../RedisPatchingCompletedEventData.cs | 13 +- ...ScalingCompletedEventData.Serialization.cs | 13 +- .../RedisScalingCompletedEventData.cs | 13 +- ...sourcesScheduledEventData.Serialization.cs | 138 + ...ServiceEventResourcesScheduledEventData.cs | 42 + ...ationsHealthResourcesAnnotatedEventData.cs | 6 +- ...urcesAvailabilityStatusChangedEventData.cs | 6 +- ...cationsOperationalDetails.Serialization.cs | 13 +- ...ResourceNotificationsOperationalDetails.cs | 13 +- ...onsResourceDeletedDetails.Serialization.cs | 21 +- ...urceNotificationsResourceDeletedDetails.cs | 18 +- ...urceManagementCreatedOrUpdatedEventData.cs | 6 +- ...onsResourceUpdatedDetails.Serialization.cs | 77 +- ...urceNotificationsResourceUpdatedDetails.cs | 21 +- ...sResourceUpdatedEventData.Serialization.cs | 7 +- ...ceNotificationsResourceUpdatedEventData.cs | 7 +- ...dicNotificationsEventData.Serialization.cs | 54 +- ...AvailablePeriodicNotificationsEventData.cs | 24 +- ...eWithNoListenersEventData.Serialization.cs | 54 +- ...ssagesAvailableWithNoListenersEventData.cs | 24 +- ...dicNotificationsEventData.Serialization.cs | 54 +- ...AvailablePeriodicNotificationsEventData.cs | 24 +- ...eWithNoListenersEventData.Serialization.cs | 54 +- ...ssagesAvailableWithNoListenersEventData.cs | 24 +- ...nectionConnectedEventData.Serialization.cs | 23 +- ...rviceClientConnectionConnectedEventData.cs | 16 +- ...tionDisconnectedEventData.Serialization.cs | 23 +- ...ceClientConnectionDisconnectedEventData.cs | 16 +- .../src/Generated/StorageBlobAccessTier.cs | 60 + ...orageBlobCreatedEventData.Serialization.cs | 9 + .../Generated/StorageBlobCreatedEventData.cs | 10 +- ...yPolicyCompletedEventData.Serialization.cs | 13 +- ...geBlobInventoryPolicyCompletedEventData.cs | 13 +- ...eBlobTierChangedEventData.Serialization.cs | 18 + .../StorageBlobTierChangedEventData.cs | 16 +- .../StorageLifecycleCompletionStatus.cs | 54 + ...ePolicyCompletedEventData.Serialization.cs | 25 +- ...torageLifecyclePolicyCompletedEventData.cs | 20 +- ...ifecyclePolicyRunSummary.Serialization.cs} | 87 +- .../StorageLifecyclePolicyRunSummary.cs | 72 + ...ignmentCompletedEventData.Serialization.cs | 26 +- ...StorageTaskAssignmentCompletedEventData.cs | 12 +- ...AssignmentQueuedEventData.Serialization.cs | 13 +- .../StorageTaskAssignmentQueuedEventData.cs | 13 +- ...ageTaskCompletedEventData.Serialization.cs | 26 +- .../StorageTaskCompletedEventData.cs | 12 +- ...torageTaskQueuedEventData.Serialization.cs | 13 +- .../Generated/StorageTaskQueuedEventData.cs | 13 +- ...scriptionDeletedEventData.Serialization.cs | 7 +- .../Generated/SubscriptionDeletedEventData.cs | 12 +- ...iptionValidationEventData.Serialization.cs | 14 +- .../SubscriptionValidationEventData.cs | 23 +- ...riptionValidationResponse.Serialization.cs | 7 +- .../SubscriptionValidationResponse.cs | 12 +- .../Generated/SystemEventsClientOptions.cs | 8 +- .../UnknownMediaJobOutput.Serialization.cs | 156 - .../src/Generated/UnknownMediaJobOutput.cs | 32 - .../tsp-location.yaml | 5 +- sdk/eventgrid/ci.mgmt.yml | 109 + sdk/eventhub/ci.mgmt.yml | 109 + sdk/extendedlocation/ci.mgmt.yml | 109 + sdk/fabric/ci.mgmt.yml | 109 + sdk/fleet/ci.mgmt.yml | 109 + sdk/fluidrelay/ci.mgmt.yml | 109 + sdk/frontdoor/ci.mgmt.yml | 109 + sdk/grafana/ci.mgmt.yml | 109 + sdk/graphservices/ci.mgmt.yml | 109 + sdk/guestconfiguration/ci.mgmt.yml | 109 + sdk/hardwaresecuritymodules/ci.mgmt.yml | 109 + sdk/hdinsight/ci.mgmt.yml | 109 + sdk/hdinsightcontainers/ci.mgmt.yml | 109 + sdk/healthbot/ci.mgmt.yml | 109 + sdk/healthcareapis/ci.mgmt.yml | 109 + sdk/healthdataaiservices/ci.mgmt.yml | 109 + sdk/hybridaks/ci.mgmt.yml | 109 + sdk/hybridcompute/ci.mgmt.yml | 109 + sdk/hybridconnectivity/ci.mgmt.yml | 109 + sdk/hybridkubernetes/ci.mgmt.yml | 109 + sdk/hybridnetwork/ci.mgmt.yml | 109 + sdk/informaticadatamanagement/ci.mgmt.yml | 109 + sdk/iot/ci.mgmt.yml | 109 + sdk/iotcentral/ci.mgmt.yml | 109 + sdk/iothub/ci.mgmt.yml | 109 + .../Azure.ResourceManager.IoTOperations.sln | 56 + .../CHANGELOG.md | 11 + .../Directory.Build.props | 6 + .../README.md | 80 + .../assets.json | 7 + ...sourceManager.IoTOperations.Samples.csproj | 13 + .../Sample_BrokerAuthenticationResource.cs | 209 + ..._BrokerAuthenticationResourceCollection.cs | 301 + .../Sample_BrokerAuthorizationResource.cs | 266 + ...e_BrokerAuthorizationResourceCollection.cs | 361 + .../Samples/Sample_BrokerListenerResource.cs | 249 + ...Sample_BrokerListenerResourceCollection.cs | 344 + .../Samples/Sample_BrokerResource.cs | 377 + .../Sample_BrokerResourceCollection.cs | 473 + .../Sample_DataflowEndpointResource.cs | 642 + ...mple_DataflowEndpointResourceCollection.cs | 756 + .../Samples/Sample_DataflowProfileResource.cs | 199 + ...ample_DataflowProfileResourceCollection.cs | 292 + .../Samples/Sample_DataflowResource.cs | 476 + .../Sample_DataflowResourceCollection.cs | 580 + .../Samples/Sample_InstanceResource.cs | 114 + .../Sample_InstanceResourceCollection.cs | 205 + .../Sample_SubscriptionResourceExtensions.cs | 50 + ...Azure.ResourceManager.IoTOperations.csproj | 8 + .../Generated/ArmIoTOperationsModelFactory.cs | 299 + ...kerAuthenticationResource.Serialization.cs | 26 + .../Generated/BrokerAuthenticationResource.cs | 348 + .../BrokerAuthenticationResourceCollection.cs | 493 + ...uthenticationResourceData.Serialization.cs | 164 + .../BrokerAuthenticationResourceData.cs | 89 + ...okerAuthorizationResource.Serialization.cs | 26 + .../Generated/BrokerAuthorizationResource.cs | 348 + .../BrokerAuthorizationResourceCollection.cs | 493 + ...AuthorizationResourceData.Serialization.cs | 164 + .../BrokerAuthorizationResourceData.cs | 89 + .../BrokerListenerResource.Serialization.cs | 26 + .../src/Generated/BrokerListenerResource.cs | 348 + .../BrokerListenerResourceCollection.cs | 493 + ...rokerListenerResourceData.Serialization.cs | 164 + .../Generated/BrokerListenerResourceData.cs | 89 + .../Generated/BrokerResource.Serialization.cs | 26 + .../src/Generated/BrokerResource.cs | 554 + .../src/Generated/BrokerResourceCollection.cs | 493 + .../BrokerResourceData.Serialization.cs | 164 + .../src/Generated/BrokerResourceData.cs | 89 + .../DataflowEndpointResource.Serialization.cs | 26 + .../src/Generated/DataflowEndpointResource.cs | 347 + .../DataflowEndpointResourceCollection.cs | 493 + ...aflowEndpointResourceData.Serialization.cs | 164 + .../Generated/DataflowEndpointResourceData.cs | 89 + .../DataflowProfileResource.Serialization.cs | 26 + .../src/Generated/DataflowProfileResource.cs | 416 + .../DataflowProfileResourceCollection.cs | 493 + ...taflowProfileResourceData.Serialization.cs | 164 + .../Generated/DataflowProfileResourceData.cs | 89 + .../DataflowResource.Serialization.cs | 26 + .../src/Generated/DataflowResource.cs} | 160 +- .../Generated/DataflowResourceCollection.cs | 493 + .../DataflowResourceData.Serialization.cs | 164 + .../src/Generated/DataflowResourceData.cs | 89 + .../Extensions/IoTOperationsExtensions.cs | 352 + .../MockableIoTOperationsArmClient.cs | 133 + ...kableIoTOperationsResourceGroupResource.cs | 105 + ...ckableIoTOperationsSubscriptionResource.cs | 102 + .../InstanceResource.Serialization.cs | 26 + .../src/Generated/InstanceResource.cs | 906 + .../Generated/InstanceResourceCollection.cs | 494 + .../InstanceResourceData.Serialization.cs | 205 + .../src/Generated/InstanceResourceData.cs | 96 + .../src/Generated/Internal/Argument.cs | 129 + .../Internal/ChangeTrackingDictionary.cs | 167 + .../Generated/Internal/ChangeTrackingList.cs | 153 + .../Internal/ModelSerializationExtensions.cs | 398 + .../src/Generated/Internal/Optional.cs | 51 + .../Internal/Utf8JsonRequestContent.cs | 55 + ...erAuthenticationResourceOperationSource.cs | 38 + ...kerAuthorizationResourceOperationSource.cs | 38 + .../BrokerListenerResourceOperationSource.cs | 38 + .../BrokerResourceOperationSource.cs | 38 + ...DataflowEndpointResourceOperationSource.cs | 38 + .../DataflowProfileResourceOperationSource.cs | 38 + .../DataflowResourceOperationSource.cs | 38 + .../InstanceResourceOperationSource.cs | 38 + .../IoTOperationsArmOperation.cs | 94 + .../IoTOperationsArmOperationOfT.cs | 100 + .../Models/AdvancedSettings.Serialization.cs | 163 + .../src/Generated/Models/AdvancedSettings.cs | 73 + .../AuthorizationConfig.Serialization.cs | 158 + .../Generated/Models/AuthorizationConfig.cs} | 32 +- .../Models/AuthorizationRule.Serialization.cs | 169 + .../src/Generated/Models/AuthorizationRule.cs | 88 + .../Models/BackendChain.Serialization.cs | 149 + .../src/Generated/Models/BackendChain.cs | 82 + .../BatchingConfiguration.Serialization.cs | 148 + .../Generated/Models/BatchingConfiguration.cs | 69 + .../Models/BrokerAuthenticationMethod.cs | 54 + ...rAuthenticationProperties.Serialization.cs | 151 + .../Models/BrokerAuthenticationProperties.cs | 80 + ...icationResourceListResult.Serialization.cs | 151 + .../BrokerAuthenticationResourceListResult.cs | 80 + ...rAuthenticatorCustomAuth.Serialization.cs} | 50 +- .../Models/BrokerAuthenticatorCustomAuth.cs | 81 + ...AuthenticatorMethodCustom.Serialization.cs | 178 + .../Models/BrokerAuthenticatorMethodCustom.cs | 95 + ...kerAuthenticatorMethodSat.Serialization.cs | 136 + .../Models/BrokerAuthenticatorMethodSat.cs | 76 + ...erAuthenticatorMethodX509.Serialization.cs | 155 + .../Models/BrokerAuthenticatorMethodX509.cs | 70 + ...catorMethodX509Attributes.Serialization.cs | 145 + ...BrokerAuthenticatorMethodX509Attributes.cs | 82 + ...rokerAuthenticatorMethods.Serialization.cs | 171 + .../Models/BrokerAuthenticatorMethods.cs | 91 + ...erAuthorizationProperties.Serialization.cs | 141 + .../Models/BrokerAuthorizationProperties.cs | 79 + ...izationResourceListResult.Serialization.cs | 151 + .../BrokerAuthorizationResourceListResult.cs | 80 + .../Models/BrokerDiagnostics.Serialization.cs | 178 + .../src/Generated/Models/BrokerDiagnostics.cs | 101 + .../BrokerListenerProperties.Serialization.cs | 177 + .../Models/BrokerListenerProperties.cs | 88 + ...istenerResourceListResult.Serialization.cs | 151 + .../BrokerListenerResourceListResult.cs | 80 + .../Generated/Models/BrokerMemoryProfile.cs | 57 + .../Models/BrokerProperties.Serialization.cs | 231 + .../src/Generated/Models/BrokerProperties.cs | 101 + .../Generated/Models/BrokerProtocolType.cs | 51 + .../Models/BrokerResourceDefinitionMethod.cs | 54 + .../BrokerResourceListResult.Serialization.cs | 151 + .../Models/BrokerResourceListResult.cs | 80 + .../BrokerResourceRule.Serialization.cs | 176 + .../Generated/Models/BrokerResourceRule.cs | 82 + .../Models/Cardinality.Serialization.cs | 134 + .../src/Generated/Models/Cardinality.cs} | 49 +- .../CertManagerCertConfig.Serialization.cs | 142 + .../Generated/Models/CertManagerCertConfig.cs | 89 + ...ertManagerCertificateSpec.Serialization.cs | 196 + .../Models/CertManagerCertificateSpec.cs | 95 + .../Generated/Models/CertManagerIssuerKind.cs | 51 + .../CertManagerIssuerRef.Serialization.cs | 142 + .../Generated/Models/CertManagerIssuerRef.cs | 88 + .../CertManagerPrivateKey.Serialization.cs | 134 + .../Generated/Models/CertManagerPrivateKey.cs | 78 + .../Models/ClientConfig.Serialization.cs | 215 + .../src/Generated/Models/ClientConfig.cs | 85 + .../Models/CloudEventAttributeType.cs | 51 + .../Models/DataExplorerAuthMethod.cs | 51 + .../Models/DataLakeStorageAuthMethod.cs | 54 + .../Models/DataflowAction.Serialization.cs | 188 + .../src/Generated/Models/DataflowAction.cs | 88 + ...ltInTransformationDataset.Serialization.cs | 183 + .../DataflowBuiltInTransformationDataset.cs | 95 + ...iltInTransformationFilter.Serialization.cs | 170 + .../DataflowBuiltInTransformationFilter.cs | 91 + ...wBuiltInTransformationMap.Serialization.cs | 187 + .../DataflowBuiltInTransformationMap.cs | 95 + ...tInTransformationSettings.Serialization.cs | 225 + .../DataflowBuiltInTransformationSettings.cs | 84 + ...tinationOperationSettings.Serialization.cs | 134 + .../DataflowDestinationOperationSettings.cs | 82 + ...AuthenticationAccessToken.Serialization.cs | 126 + ...taflowEndpointAuthenticationAccessToken.cs | 75 + ...ndpointAuthenticationSasl.Serialization.cs | 134 + .../DataflowEndpointAuthenticationSasl.cs | 81 + .../DataflowEndpointAuthenticationSaslType.cs | 54 + ...cationServiceAccountToken.Serialization.cs | 126 + ...dpointAuthenticationServiceAccountToken.cs | 75 + ...emAssignedManagedIdentity.Serialization.cs | 129 + ...enticationSystemAssignedManagedIdentity.cs | 65 + ...erAssignedManagedIdentity.Serialization.cs | 145 + ...thenticationUserAssignedManagedIdentity.cs | 86 + ...ndpointAuthenticationX509.Serialization.cs | 126 + .../DataflowEndpointAuthenticationX509.cs | 75 + ...aflowEndpointDataExplorer.Serialization.cs | 157 + .../Models/DataflowEndpointDataExplorer.cs | 93 + ...ataExplorerAuthentication.Serialization.cs | 156 + ...aflowEndpointDataExplorerAuthentication.cs | 92 + ...owEndpointDataLakeStorage.Serialization.cs | 149 + .../Models/DataflowEndpointDataLakeStorage.cs | 86 + ...LakeStorageAuthentication.Serialization.cs | 171 + ...owEndpointDataLakeStorageAuthentication.cs | 103 + ...flowEndpointFabricOneLake.Serialization.cs | 171 + .../Models/DataflowEndpointFabricOneLake.cs | 99 + ...bricOneLakeAuthentication.Serialization.cs | 156 + ...flowEndpointFabricOneLakeAuthentication.cs | 92 + ...ndpointFabricOneLakeNames.Serialization.cs | 134 + .../DataflowEndpointFabricOneLakeNames.cs | 82 + .../Models/DataflowEndpointFabricPathType.cs | 51 + .../DataflowEndpointKafka.Serialization.cs | 261 + .../Generated/Models/DataflowEndpointKafka.cs | 114 + .../Models/DataflowEndpointKafkaAck.cs | 54 + ...dpointKafkaAuthentication.Serialization.cs | 192 + .../DataflowEndpointKafkaAuthentication.cs | 106 + ...flowEndpointKafkaBatching.Serialization.cs | 178 + .../Models/DataflowEndpointKafkaBatching.cs | 77 + .../DataflowEndpointKafkaCompression.cs | 57 + .../DataflowEndpointKafkaPartitionStrategy.cs | 57 + ...aflowEndpointLocalStorage.Serialization.cs | 126 + .../Models/DataflowEndpointLocalStorage.cs | 75 + .../DataflowEndpointMqtt.Serialization.cs | 280 + .../Generated/Models/DataflowEndpointMqtt.cs | 115 + ...ndpointMqttAuthentication.Serialization.cs | 192 + .../DataflowEndpointMqttAuthentication.cs | 113 + ...ataflowEndpointProperties.Serialization.cs | 240 + .../Models/DataflowEndpointProperties.cs | 107 + ...ndpointResourceListResult.Serialization.cs | 151 + .../DataflowEndpointResourceListResult.cs | 80 + .../Generated/Models/DataflowMappingType.cs | 60 + ...DataflowProfileProperties.Serialization.cs | 163 + .../Models/DataflowProfileProperties.cs | 73 + ...ProfileResourceListResult.Serialization.cs | 151 + .../DataflowProfileResourceListResult.cs | 80 + .../DataflowProperties.Serialization.cs | 166 + .../Generated/Models/DataflowProperties.cs | 84 + ...ataflowResourceListResult.Serialization.cs | 151 + .../Models/DataflowResourceListResult.cs | 80 + ...owSourceOperationSettings.Serialization.cs | 187 + .../Models/DataflowSourceOperationSettings.cs | 95 + .../Models/DiagnosticsLogs.Serialization.cs | 129 + .../src/Generated/Models/DiagnosticsLogs.cs} | 33 +- .../DiskBackedMessageBuffer.Serialization.cs | 156 + .../Models/DiskBackedMessageBuffer.cs | 83 + .../src/Generated/Models/EndpointType.cs | 63 + .../Models/ExtendedLocation.Serialization.cs | 134 + .../src/Generated/Models/ExtendedLocation.cs | 81 + .../Generated/Models/ExtendedLocationType.cs | 48 + .../Models/FabricOneLakeAuthMethod.cs | 51 + .../src/Generated/Models/FilterType.cs | 48 + .../Models/Frontend.Serialization.cs | 141 + .../src/Generated/Models/Frontend.cs | 76 + .../GenerateResourceLimits.Serialization.cs | 133 + .../Models/GenerateResourceLimits.cs | 65 + .../InstanceProperties.Serialization.cs | 163 + .../Generated/Models/InstanceProperties.cs | 94 + ...nstanceResourceListResult.Serialization.cs | 151 + .../Models/InstanceResourceListResult.cs | 80 + .../InstanceResourcePatch.Serialization.cs | 162 + .../Generated/Models/InstanceResourcePatch.cs | 71 + .../src/Generated/Models/KafkaAuthMethod.cs | 60 + .../KubernetesReference.Serialization.cs | 156 + .../Generated/Models/KubernetesReference.cs | 90 + .../Models/ListenerPort.Serialization.cs | 200 + .../src/Generated/Models/ListenerPort.cs | 92 + .../LocalKubernetesReference.Serialization.cs | 145 + .../Models/LocalKubernetesReference.cs | 86 + .../Generated/Models/Metrics.Serialization.cs | 133 + .../src/Generated/Models/Metrics.cs} | 30 +- .../src/Generated/Models/MqttAuthMethod.cs | 60 + .../src/Generated/Models/MqttRetainType.cs | 51 + .../src/Generated/Models/OperationType.cs | 54 + .../src/Generated/Models/OperationalMode.cs | 51 + .../src/Generated/Models/OperatorValue.cs | 57 + .../Models/PrincipalConfig.Serialization.cs | 216 + .../src/Generated/Models/PrincipalConfig.cs | 76 + .../Generated/Models/PrivateKeyAlgorithm.cs | 66 + .../Models/PrivateKeyRotationPolicy.cs | 51 + .../ProfileDiagnostics.Serialization.cs | 148 + .../Generated/Models/ProfileDiagnostics.cs | 92 + .../src/Generated/Models/ProvisioningState.cs | 66 + .../Models/SanForCert.Serialization.cs | 154 + .../src/Generated/Models/SanForCert.cs | 83 + .../Models/SchemaRegistryRef.Serialization.cs | 126 + .../Generated/Models/SchemaRegistryRef.cs} | 34 +- .../Models/SelfCheck.Serialization.cs | 163 + .../src/Generated/Models/SelfCheck.cs | 73 + .../Models/SelfTracing.Serialization.cs | 148 + .../src/Generated/Models/SelfTracing.cs | 69 + .../src/Generated/Models/ServiceType.cs | 54 + .../Models/SourceSerializationFormat.cs | 48 + .../StateStoreResourceDefinitionMethod.cs | 54 + .../Models/StateStoreResourceKeyType.cs | 54 + .../StateStoreResourceRule.Serialization.cs | 152 + .../Models/StateStoreResourceRule.cs | 88 + .../Models/SubscriberMessageDropStrategy.cs | 51 + .../SubscriberQueueLimit.Serialization.cs | 148 + .../Generated/Models/SubscriberQueueLimit.cs | 69 + .../Models/TlsCertMethod.Serialization.cs | 156 + .../src/Generated/Models/TlsCertMethod.cs | 86 + .../src/Generated/Models/TlsCertMethodMode.cs | 51 + .../Models/TlsProperties.Serialization.cs | 144 + .../src/Generated/Models/TlsProperties.cs | 69 + .../Generated/Models/Traces.Serialization.cs | 178 + .../src/Generated/Models/Traces.cs | 77 + .../TransformationSerializationFormat.cs | 54 + ...ClaimResourceRequirements.Serialization.cs | 170 + .../Models/VolumeClaimResourceRequirements.cs | 71 + .../Models/VolumeClaimSpec.Serialization.cs | 245 + .../src/Generated/Models/VolumeClaimSpec.cs | 94 + .../VolumeClaimSpecSelector.Serialization.cs | 169 + .../Models/VolumeClaimSpecSelector.cs | 71 + ...cSelectorMatchExpressions.Serialization.cs | 159 + ...VolumeClaimSpecSelectorMatchExpressions.cs | 86 + .../X509ManualCertificate.Serialization.cs | 126 + .../Generated/Models/X509ManualCertificate.cs | 75 + .../src/Generated/ProviderConstants.cs | 16 + .../BrokerAuthenticationRestOperations.cs} | 428 +- .../BrokerAuthorizationRestOperations.cs | 549 + .../BrokerListenerRestOperations.cs | 549 + .../RestOperations/BrokerRestOperations.cs | 513 + .../DataflowEndpointRestOperations.cs | 513 + .../DataflowProfileRestOperations.cs | 513 + .../RestOperations/DataflowRestOperations.cs | 549 + .../RestOperations/InstanceRestOperations.cs | 731 + .../src/Properties/AssemblyInfo.cs | 11 + ...ResourceManager.IoTOperations.Tests.csproj | 8 + .../tests/IoTOperationsManagementTestBase.cs | 45 + .../IoTOperationsManagementTestEnvironment.cs | 11 + .../tsp-location.yaml | 4 + sdk/iotoperations/ci.mgmt.yml | 24 + .../Azure.ResourceManager.KeyVault.net8.0.cs | 3 + ...ResourceManager.KeyVault.netstandard2.0.cs | 3 + .../Sample_DeletedKeyVaultCollection.cs | 6 +- .../Samples/Sample_DeletedKeyVaultResource.cs | 4 +- .../Sample_DeletedManagedHsmCollection.cs | 6 +- .../Sample_DeletedManagedHsmResource.cs | 4 +- .../Samples/Sample_KeyVaultCollection.cs | 12 +- ...aultPrivateEndpointConnectionCollection.cs | 10 +- ...yVaultPrivateEndpointConnectionResource.cs | 6 +- .../Samples/Sample_KeyVaultResource.cs | 10 +- .../Sample_KeyVaultSecretCollection.cs | 10 +- .../Samples/Sample_KeyVaultSecretResource.cs | 4 +- .../Samples/Sample_ManagedHsmCollection.cs | 10 +- ...dHsmPrivateEndpointConnectionCollection.cs | 10 +- ...gedHsmPrivateEndpointConnectionResource.cs | 6 +- .../Samples/Sample_ManagedHsmResource.cs | 10 +- .../Sample_SubscriptionResourceExtensions.cs | 12 +- .../Generated/DeletedKeyVaultCollection.cs | 12 +- .../src/Generated/DeletedKeyVaultResource.cs | 8 +- .../Generated/DeletedManagedHsmCollection.cs | 12 +- .../Generated/DeletedManagedHsmResource.cs | 8 +- .../Extensions/KeyVaultExtensions.cs | 40 +- .../MockableKeyVaultResourceGroupResource.cs | 8 +- .../MockableKeyVaultSubscriptionResource.cs | 32 +- .../src/Generated/KeyVaultCollection.cs | 20 +- ...aultPrivateEndpointConnectionCollection.cs | 20 +- ...yVaultPrivateEndpointConnectionResource.cs | 12 +- .../src/Generated/KeyVaultResource.cs | 40 +- .../src/Generated/KeyVaultSecretCollection.cs | 20 +- .../src/Generated/KeyVaultSecretResource.cs | 8 +- .../src/Generated/ManagedHsmCollection.cs | 20 +- ...dHsmPrivateEndpointConnectionCollection.cs | 20 +- ...gedHsmPrivateEndpointConnectionResource.cs | 24 +- .../src/Generated/ManagedHsmResource.cs | 36 +- .../Generated/Models/ManagedHsmSkuFamily.cs | 3 + .../Models/ManagedHsmSkuName.Serialization.cs | 4 + .../src/Generated/Models/ManagedHsmSkuName.cs | 6 +- .../ManagedHsmsRestOperations.cs | 2 +- ...rivateEndpointConnectionsRestOperations.cs | 2 +- .../MhsmPrivateLinkResourcesRestOperations.cs | 2 +- .../MhsmRegionsRestOperations.cs | 2 +- ...rivateEndpointConnectionsRestOperations.cs | 2 +- .../PrivateLinkResourcesRestOperations.cs | 2 +- .../RestOperations/SecretsRestOperations.cs | 2 +- .../RestOperations/VaultsRestOperations.cs | 2 +- .../src/autorest.md | 2 +- sdk/keyvault/ci.mgmt.yml | 109 + sdk/kubernetesconfiguration/ci.mgmt.yml | 109 + sdk/kusto/ci.mgmt.yml | 109 + sdk/labservices/ci.mgmt.yml | 109 + sdk/loadtestservice/ci.mgmt.yml | 109 + sdk/logic/ci.mgmt.yml | 109 + sdk/machinelearningcompute/ci.mgmt.yml | 109 + sdk/machinelearningservices/ci.mgmt.yml | 109 + sdk/maintenance/ci.mgmt.yml | 109 + sdk/managednetwork/ci.mgmt.yml | 109 + sdk/managednetworkfabric/ci.mgmt.yml | 109 + sdk/managedserviceidentity/ci.mgmt.yml | 109 + sdk/managedservices/ci.mgmt.yml | 109 + sdk/managementpartner/ci.mgmt.yml | 109 + sdk/maps/ci.mgmt.yml | 109 + sdk/marketplace/ci.mgmt.yml | 109 + sdk/marketplaceordering/ci.mgmt.yml | 109 + sdk/mediaservices/ci.mgmt.yml | 109 + sdk/migrationdiscoverysap/ci.mgmt.yml | 109 + sdk/mixedreality/ci.mgmt.yml | 109 + sdk/mobilenetwork/ci.mgmt.yml | 109 + sdk/mongocluster/ci.mgmt.yml | 109 + sdk/monitor/ci.mgmt.yml | 109 + sdk/mysql/ci.mgmt.yml | 109 + sdk/neonpostgres/ci.mgmt.yml | 109 + sdk/netapp/ci.mgmt.yml | 109 + sdk/network/ci.mgmt.yml | 109 + sdk/networkanalytics/ci.mgmt.yml | 109 + sdk/networkcloud/ci.mgmt.yml | 109 + sdk/networkfunction/ci.mgmt.yml | 109 + sdk/newrelicobservability/ci.mgmt.yml | 109 + sdk/nginx/ci.mgmt.yml | 109 + sdk/notificationhubs/ci.mgmt.yml | 109 + .../AIOpenAIClientBuilderExtensions.cs | 52 + .../src/Generated/AIOpenAIModelFactory.cs | 1541 + .../AddUploadPartRequest.Serialization.cs | 174 + .../src/Generated/AddUploadPartRequest.cs | 76 + .../src/Generated/AudioTaskLabel.cs | 51 + .../AudioTranscription.Serialization.cs | 240 + .../src/Generated/AudioTranscription.cs | 103 + .../src/Generated/AudioTranscriptionFormat.cs | 63 + ...AudioTranscriptionOptions.Serialization.cs | 313 + .../Generated/AudioTranscriptionOptions.cs | 146 + ...AudioTranscriptionSegment.Serialization.cs | 235 + .../Generated/AudioTranscriptionSegment.cs | 153 + .../AudioTranscriptionTimestampGranularity.cs | 57 + .../AudioTranscriptionWord.Serialization.cs | 158 + .../src/Generated/AudioTranscriptionWord.cs | 87 + .../AudioTranslation.Serialization.cs | 214 + .../src/Generated/AudioTranslation.cs | 98 + .../src/Generated/AudioTranslationFormat.cs | 63 + .../AudioTranslationOptions.Serialization.cs | 264 + .../src/Generated/AudioTranslationOptions.cs | 119 + .../AudioTranslationSegment.Serialization.cs | 235 + .../src/Generated/AudioTranslationSegment.cs | 153 + ...tEnhancementConfiguration.Serialization.cs | 164 + .../AzureChatEnhancementConfiguration.cs | 69 + .../AzureChatEnhancements.Serialization.cs | 149 + .../src/Generated/AzureChatEnhancements.cs | 68 + ...hatExtensionConfiguration.Serialization.cs | 137 + .../AzureChatExtensionConfiguration.cs | 77 + ...taSourceResponseCitation.Serialization.cs} | 98 +- ...hatExtensionDataSourceResponseCitation.cs} | 48 +- ...rieveDocumentFilterReason.Serialization.cs | 28 + ...atExtensionRetrieveDocumentFilterReason.cs | 18 + ...tensionRetrievedDocument.Serialization.cs} | 128 +- ...=> AzureChatExtensionRetrievedDocument.cs} | 72 +- .../src/Generated/AzureChatExtensionType.cs | 64 + ...tExtensionsMessageContext.Serialization.cs | 195 + .../AzureChatExtensionsMessageContext.cs | 89 + ...gEnhancementConfiguration.Serialization.cs | 142 + ...reChatGroundingEnhancementConfiguration.cs | 72 + ...REnhancementConfiguration.Serialization.cs | 142 + .../AzureChatOCREnhancementConfiguration.cs | 72 + ...hatExtensionConfiguration.Serialization.cs | 134 + ...AzureCosmosDBChatExtensionConfiguration.cs | 50 + ...BChatExtensionParameters.Serialization.cs} | 180 +- .../AzureCosmosDBChatExtensionParameters.cs | 175 + ...smosDBFieldMappingOptions.Serialization.cs | 221 + .../AzureCosmosDBFieldMappingOptions.cs | 99 + ...zureGroundingEnhancement.Serialization.cs} | 101 +- .../Generated/AzureGroundingEnhancement.cs | 76 + ...nhancementCoordinatePoint.Serialization.cs | 150 + ...zureGroundingEnhancementCoordinatePoint.cs | 78 + ...eGroundingEnhancementLine.Serialization.cs | 160 + .../AzureGroundingEnhancementLine.cs | 83 + ...undingEnhancementLineSpan.Serialization.cs | 176 + .../AzureGroundingEnhancementLineSpan.cs | 104 + .../AzureOpenAIChatError.Serialization.cs | 190 - .../src/Generated/AzureOpenAIChatError.cs | 77 - ...reOpenAIChatErrorResponse.Serialization.cs | 140 - .../Generated/AzureOpenAIChatErrorResponse.cs | 61 - .../AzureOpenAIDalleError.Serialization.cs | 190 - .../src/Generated/AzureOpenAIDalleError.cs | 77 - ...eOpenAIDalleErrorResponse.Serialization.cs | 140 - ...AzureSearchChatDataSource.Serialization.cs | 147 - .../Generated/AzureSearchChatDataSource.cs | 14 - ...hatExtensionConfiguration.Serialization.cs | 134 + .../AzureSearchChatExtensionConfiguration.cs | 50 + ...hChatExtensionParameters.Serialization.cs} | 169 +- .../AzureSearchChatExtensionParameters.cs | 167 + ...IndexFieldMappingOptions.Serialization.cs} | 95 +- .../AzureSearchIndexFieldMappingOptions.cs | 92 + .../src/Generated/AzureSearchQueryType.cs | 60 + .../src/Generated/Batch.Serialization.cs | 429 + .../Azure.AI.OpenAI/src/Generated/Batch.cs | 156 + .../BatchCreateRequest.Serialization.cs} | 105 +- .../src/Generated/BatchCreateRequest.cs | 94 + .../BatchErrorDatum.Serialization.cs | 182 + .../src/Generated/BatchErrorDatum.cs | 77 + .../BatchErrorList.Serialization.cs} | 81 +- .../src/Generated/BatchErrorList.cs | 71 + .../src/Generated/BatchErrorListObject.cs | 48 + .../src/Generated/BatchObject.cs | 48 + .../BatchRequestCounts.Serialization.cs | 179 + .../src/Generated/BatchRequestCounts.cs | 73 + .../src/Generated/BatchStatus.cs | 69 + .../src/Generated/ChatChoice.Serialization.cs | 250 + .../src/Generated/ChatChoice.cs | 120 + ...tChoiceLogProbabilityInfo.Serialization.cs | 194 + .../Generated/ChatChoiceLogProbabilityInfo.cs | 79 + ...atCompletionStreamOptions.Serialization.cs | 149 + .../Generated/ChatCompletionStreamOptions.cs | 65 + .../ChatCompletions.Serialization.cs | 231 + .../src/Generated/ChatCompletions.cs | 146 + ...pletionsFunctionToolCall.Serialization.cs} | 69 +- .../ChatCompletionsFunctionToolCall.cs | 50 + ...onsFunctionToolDefinition.Serialization.cs | 134 + .../ChatCompletionsFunctionToolDefinition.cs | 44 + ...ionToolDefinitionFunction.Serialization.cs | 198 + ...mpletionsFunctionToolDefinitionFunction.cs | 116 + ...ionsFunctionToolSelection.Serialization.cs | 142 + .../ChatCompletionsFunctionToolSelection.cs | 75 + ...letionsJsonResponseFormat.Serialization.cs | 126 + .../ChatCompletionsJsonResponseFormat.cs | 29 + ...sJsonSchemaResponseFormat.Serialization.cs | 134 + ...ChatCompletionsJsonSchemaResponseFormat.cs | 47 + ...aResponseFormatJsonSchema.Serialization.cs | 198 + ...tionsJsonSchemaResponseFormatJsonSchema.cs | 116 + ...amedFunctionToolSelection.Serialization.cs | 134 + ...atCompletionsNamedFunctionToolSelection.cs | 44 + ...letionsNamedToolSelection.Serialization.cs | 133 + .../ChatCompletionsNamedToolSelection.cs | 69 + .../ChatCompletionsOptions.Serialization.cs | 619 + .../src/Generated/ChatCompletionsOptions.cs | 414 + ...CompletionsResponseFormat.Serialization.cs | 135 + ...ce.cs => ChatCompletionsResponseFormat.cs} | 34 +- ...letionsTextResponseFormat.Serialization.cs | 126 + .../ChatCompletionsTextResponseFormat.cs | 32 + .../ChatCompletionsToolCall.Serialization.cs} | 67 +- .../src/Generated/ChatCompletionsToolCall.cs | 84 + ...CompletionsToolDefinition.Serialization.cs | 133 + .../ChatCompletionsToolDefinition.cs | 69 + .../ChatCompletionsToolSelectionPreset.cs | 60 + .../Generated/ChatDataSource.Serialization.cs | 130 - .../src/Generated/ChatDocumentFilterReason.cs | 48 - .../ChatMessageContentItem.Serialization.cs | 135 + .../src/Generated/ChatMessageContentItem.cs | 69 + .../ChatMessageContext.Serialization.cs | 176 - .../src/Generated/ChatMessageContext.cs | 71 - ...tMessageImageContentItem.Serialization.cs} | 69 +- .../Generated/ChatMessageImageContentItem.cs | 44 + .../Generated/ChatMessageImageDetailLevel.cs | 60 + .../ChatMessageImageUrl.Serialization.cs} | 73 +- .../src/Generated/ChatMessageImageUrl.cs | 85 + ...MessageRefusalContentItem.Serialization.cs | 134 + .../ChatMessageRefusalContentItem.cs | 44 + ...atMessageTextContentItem.Serialization.cs} | 69 +- .../Generated/ChatMessageTextContentItem.cs | 44 + ...atRequestAssistantMessage.Serialization.cs | 234 + .../Generated/ChatRequestAssistantMessage.cs | 117 + ...atRequestFunctionMessage.Serialization.cs} | 83 +- .../Generated/ChatRequestFunctionMessage.cs | 50 + .../ChatRequestMessage.Serialization.cs | 137 + .../src/Generated/ChatRequestMessage.cs | 69 + ...ChatRequestSystemMessage.Serialization.cs} | 95 +- .../src/Generated/ChatRequestSystemMessage.cs | 91 + .../ChatRequestToolMessage.Serialization.cs} | 90 +- .../src/Generated/ChatRequestToolMessage.cs | 90 + .../ChatRequestUserMessage.Serialization.cs | 152 + .../src/Generated/ChatRequestUserMessage.cs | 91 + .../ChatResponseMessage.Serialization.cs | 244 + .../src/Generated/ChatResponseMessage.cs | 119 + .../Azure.AI.OpenAI/src/Generated/ChatRole.cs | 60 + ...atTokenLogProbabilityInfo.Serialization.cs | 180 + .../Generated/ChatTokenLogProbabilityInfo.cs | 88 + ...TokenLogProbabilityResult.Serialization.cs | 210 + .../ChatTokenLogProbabilityResult.cs | 94 + .../src/Generated/Choice.Serialization.cs | 211 + .../Azure.AI.OpenAI/src/Generated/Choice.cs | 109 + .../CompleteUploadRequest.Serialization.cs | 163 + .../src/Generated/CompleteUploadRequest.cs | 80 + .../Generated/Completions.Serialization.cs | 219 + .../src/Generated/Completions.cs | 144 + .../src/Generated/CompletionsFinishReason.cs | 63 + ...etionsLogProbabilityModel.Serialization.cs | 253 + .../CompletionsLogProbabilityModel.cs | 97 + .../CompletionsOptions.Serialization.cs | 443 + .../src/Generated/CompletionsOptions.cs | 266 + .../CompletionsUsage.Serialization.cs | 194 + .../src/Generated/CompletionsUsage.cs | 96 + ...eCompletionTokensDetails.Serialization.cs} | 93 +- ...ompletionsUsageCompletionTokensDetails.cs} | 30 +- ...sUsagePromptTokensDetails.Serialization.cs | 149 + .../CompletionsUsagePromptTokensDetails.cs | 65 + ...tFilterBlocklistIdResult.Serialization.cs} | 91 +- ...l.cs => ContentFilterBlocklistIdResult.cs} | 34 +- ...tentFilterBlocklistResult.Serialization.cs | 161 - ...ilterCitedDetectionResult.Serialization.cs | 176 + .../ContentFilterCitedDetectionResult.cs | 86 + ...tFilterCompletionTextSpan.Serialization.cs | 150 + .../ContentFilterCompletionTextSpan.cs | 90 + ...rCompletionTextSpanResult.Serialization.cs | 168 + .../ContentFilterCompletionTextSpanResult.cs | 88 + ...entFilterDetailedResults.Serialization.cs} | 85 +- ...ult.cs => ContentFilterDetailedResults.cs} | 43 +- ...tentFilterDetectionResult.Serialization.cs | 55 +- .../Generated/ContentFilterDetectionResult.cs | 25 +- ...tedMaterialCitationResult.Serialization.cs | 151 - ...erProtectedMaterialResult.Serialization.cs | 162 - .../ContentFilterProtectedMaterialResult.cs | 78 - .../ContentFilterResult.Serialization.cs | 150 + ...verityResult.cs => ContentFilterResult.cs} | 39 +- ...erResultDetailsForPrompt.Serialization.cs} | 143 +- .../ContentFilterResultDetailsForPrompt.cs | 137 + ...ntFilterResultsForChoice.Serialization.cs} | 155 +- .../ContentFilterResultsForChoice.cs | 141 + ...entFilterResultsForPrompt.Serialization.cs | 150 + .../ContentFilterResultsForPrompt.cs | 81 + .../src/Generated/ContentFilterSeverity.cs | 32 +- ...ntentFilterSeverityResult.Serialization.cs | 147 - .../CosmosChatDataSource.Serialization.cs | 147 - .../src/Generated/CosmosChatDataSource.cs | 14 - .../CreateUploadRequest.Serialization.cs | 166 + .../src/Generated/CreateUploadRequest.cs | 118 + .../Generated/CreateUploadRequestPurpose.cs | 57 + .../DataSourceAuthentication.Serialization.cs | 133 - .../src/Generated/DataSourceQueryType.cs | 57 - .../DataSourceVectorizer.Serialization.cs | 129 - .../src/Generated/DataSourceVectorizer.cs | 64 - ...asticsearchChatDataSource.Serialization.cs | 147 - .../Generated/ElasticsearchChatDataSource.cs | 14 - ...hatExtensionConfiguration.Serialization.cs | 134 + ...ElasticsearchChatExtensionConfiguration.cs | 50 + ...hChatExtensionParameters.Serialization.cs} | 165 +- .../ElasticsearchChatExtensionParameters.cs | 159 + ...hIndexFieldMappingOptions.Serialization.cs | 235 + ... ElasticsearchIndexFieldMappingOptions.cs} | 43 +- .../src/Generated/ElasticsearchQueryType.cs | 51 + .../src/Generated/EmbeddingEncodingFormat.cs | 51 + .../Generated/EmbeddingItem.Serialization.cs} | 111 +- .../src/Generated/EmbeddingItem.cs | 95 + .../src/Generated/EmbeddingItemObject.cs | 48 + .../src/Generated/Embeddings.Serialization.cs | 160 + .../src/Generated/Embeddings.cs} | 53 +- .../EmbeddingsOptions.Serialization.cs | 222 + .../src/Generated/EmbeddingsOptions.cs | 132 + .../EmbeddingsUsage.Serialization.cs | 150 + .../src/Generated/EmbeddingsUsage.cs | 78 + .../FileDeletionStatus.Serialization.cs | 158 + .../src/Generated/FileDeletionStatus.cs | 85 + .../src/Generated/FileDeletionStatusObject.cs | 48 + .../FileListResponse.Serialization.cs | 160 + .../src/Generated/FileListResponse.cs | 81 + .../src/Generated/FileListResponseObject.cs | 48 + .../src/Generated/FilePurpose.cs | 66 + .../src/Generated/FileState.cs | 75 + .../Generated/FunctionCall.Serialization.cs | 150 + .../src/Generated/FunctionCall.cs | 97 + .../src/Generated/FunctionCallPreset.cs | 60 + .../FunctionDefinition.Serialization.cs | 175 + .../src/Generated/FunctionDefinition.cs | 118 + .../Generated/FunctionName.Serialization.cs | 142 + .../src/Generated/FunctionName.cs | 78 + ...ationContentFilterResults.Serialization.cs | 194 + .../ImageGenerationContentFilterResults.cs | 111 + .../ImageGenerationData.Serialization.cs | 207 + .../src/Generated/ImageGenerationData.cs | 104 + .../ImageGenerationOptions.Serialization.cs | 248 + .../src/Generated/ImageGenerationOptions.cs | 137 + ...ationPromptFilterResults.Serialization.cs} | 161 +- .../ImageGenerationPromptFilterResults.cs | 123 + .../src/Generated/ImageGenerationQuality.cs | 54 + .../ImageGenerationResponseFormat.cs | 51 + .../src/Generated/ImageGenerationStyle.cs | 57 + .../ImageGenerations.Serialization.cs | 160 + .../src/Generated/ImageGenerations.cs | 91 + .../src/Generated/ImageSize.cs | 75 + .../src/Generated/Internal/Argument.cs | 3 + .../Generated/Internal/BinaryContentHelper.cs | 133 - .../Internal/ChangeTrackingDictionary.cs | 3 + .../Generated/Internal/ChangeTrackingList.cs | 3 + .../Internal/ClientPipelineExtensions.cs | 41 - .../Generated/Internal/ClientUriBuilder.cs | 190 - .../src/Generated/Internal/ErrorResult.cs | 23 - .../Internal/ModelSerializationExtensions.cs | 17 +- ....cs => MultipartFormDataRequestContent.cs} | 18 +- .../src/Generated/Internal/Optional.cs | 3 + ...ryContent.cs => Utf8JsonRequestContent.cs} | 11 +- ...okenAuthenticationOptions.Serialization.cs | 147 - ...aSourceAccessTokenAuthenticationOptions.cs | 41 - ...iKeyAuthenticationOptions.Serialization.cs | 147 - ...atDataSourceApiKeyAuthenticationOptions.cs | 41 - ...ringAuthenticationOptions.Serialization.cs | 147 - ...ceConnectionStringAuthenticationOptions.cs | 41 - ...ntNameVectorizationSource.Serialization.cs | 162 - ...SourceDeploymentNameVectorizationSource.cs | 64 - ...iKeyAuthenticationOptions.Serialization.cs | 147 - ...ourceEncodedApiKeyAuthenticationOptions.cs | 41 - ...dpointVectorizationSource.Serialization.cs | 173 - ...atDataSourceEndpointVectorizationSource.cs | 79 - ...gratedVectorizationSource.Serialization.cs | 136 - ...DataSourceIntegratedVectorizationSource.cs | 26 - ...eyIdAuthenticationOptions.Serialization.cs | 158 - ...aSourceKeyAndKeyIdAuthenticationOptions.cs | 48 - ...odelIdVectorizationSource.Serialization.cs | 147 - ...hatDataSourceModelIdVectorizationSource.cs | 44 - ...tityAuthenticationOptions.Serialization.cs | 136 - ...nedManagedIdentityAuthenticationOptions.cs | 26 - ...tityAuthenticationOptions.Serialization.cs | 147 - ...nedManagedIdentityAuthenticationOptions.cs | 41 - ...wordAuthenticationOptions.Serialization.cs | 158 - ...sernameAndPasswordAuthenticationOptions.cs | 48 - ...ntFilterBlocklistIdResult.Serialization.cs | 147 - ...rnalAzureContentFilterBlocklistIdResult.cs | 80 - ...lterBlocklistResultDetail.Serialization.cs | 147 - ...lterResultForPromptContentFilterResults.cs | 168 - ...ContentFilterResultsError.Serialization.cs | 147 - ...esultForPromptContentFilterResultsError.cs | 77 - ...alAzureCosmosDBChatDataSourceParameters.cs | 152 - ...OpenAIChatErrorInnerError.Serialization.cs | 166 - .../InternalAzureOpenAIChatErrorInnerError.cs | 69 - ...ernalAzureOpenAIChatErrorInnerErrorCode.cs | 45 - ...penAIDalleErrorInnerError.Serialization.cs | 166 - ...InternalAzureOpenAIDalleErrorInnerError.cs | 69 - ...rnalAzureOpenAIDalleErrorInnerErrorCode.cs | 45 - ...rnalAzureSearchChatDataSourceParameters.cs | 151 - ...hChatDataSourceParametersIncludeContext.cs | 51 - ...alElasticsearchChatDataSourceParameters.cs | 139 - ...InternalMongoDBChatDataSourceParameters.cs | 180 - ...nternalPineconeChatDataSourceParameters.cs | 159 - ...nknownAzureChatDataSource.Serialization.cs | 136 - .../InternalUnknownAzureChatDataSource.cs | 25 - ...urceAuthenticationOptions.Serialization.cs | 136 - ...zureChatDataSourceAuthenticationOptions.cs | 25 - ...SourceVectorizationSource.Serialization.cs | 136 - ...nAzureChatDataSourceVectorizationSource.cs | 25 - .../MongoDBChatDataSource.Serialization.cs | 147 - .../src/Generated/MongoDBChatDataSource.cs | 14 - ...atExtensionConfiguration.Serialization.cs} | 69 +- .../MongoDBChatExtensionConfiguration.cs | 47 + ...BChatExtensionParameters.Serialization.cs} | 205 +- .../MongoDBChatExtensionParameters.cs | 219 + ...onParametersFieldsMapping.Serialization.cs | 221 + ...oDBChatExtensionParametersFieldsMapping.cs | 99 + ...okenAuthenticationOptions.Serialization.cs | 134 + ...ourDataAccessTokenAuthenticationOptions.cs | 44 + ...iKeyAuthenticationOptions.Serialization.cs | 134 + .../OnYourDataApiKeyAuthenticationOptions.cs | 44 + ...DataAuthenticationOptions.Serialization.cs | 140 + .../OnYourDataAuthenticationOptions.cs | 69 + .../Generated/OnYourDataAuthenticationType.cs | 69 + ...ringAuthenticationOptions.Serialization.cs | 134 + ...taConnectionStringAuthenticationOptions.cs | 44 + .../Generated/OnYourDataContextProperty.cs | 54 + ...ntNameVectorizationSource.Serialization.cs | 149 + ...urDataDeploymentNameVectorizationSource.cs | 51 + ...iKeyAuthenticationOptions.Serialization.cs | 134 + ...rDataEncodedApiKeyAuthenticationOptions.cs | 44 + ...dpointVectorizationSource.Serialization.cs | 142 + .../OnYourDataEndpointVectorizationSource.cs | 66 + ...gratedVectorizationSource.Serialization.cs | 126 + ...OnYourDataIntegratedVectorizationSource.cs | 29 + ...eyIdAuthenticationOptions.Serialization.cs | 142 + ...ourDataKeyAndKeyIdAuthenticationOptions.cs | 51 + ...odelIdVectorizationSource.Serialization.cs | 134 + .../OnYourDataModelIdVectorizationSource.cs | 47 + ...tityAuthenticationOptions.Serialization.cs | 126 + ...nedManagedIdentityAuthenticationOptions.cs | 29 + ...tityAuthenticationOptions.Serialization.cs | 134 + ...nedManagedIdentityAuthenticationOptions.cs | 44 + ...wordAuthenticationOptions.Serialization.cs | 142 + ...sernameAndPasswordAuthenticationOptions.cs | 51 + ...okenAuthenticationOptions.Serialization.cs | 134 + ...rSearchAccessTokenAuthenticationOptions.cs | 44 + ...iKeyAuthenticationOptions.Serialization.cs | 134 + ...VectorSearchApiKeyAuthenticationOptions.cs | 44 + ...archAuthenticationOptions.Serialization.cs | 134 + ...urDataVectorSearchAuthenticationOptions.cs | 69 + ...nYourDataVectorSearchAuthenticationType.cs | 51 + ...urDataVectorizationSource.Serialization.cs | 136 + .../OnYourDataVectorizationSource.cs | 69 + .../OnYourDataVectorizationSourceType.cs | 67 + .../src/Generated/OpenAIClient.cs | 2867 ++ .../src/Generated/OpenAIClientOptions.cs | 76 + .../src/Generated/OpenAIFile.Serialization.cs | 217 + .../src/Generated/OpenAIFile.cs | 113 + .../src/Generated/OpenAIFileObject.cs | 48 + ...OpenAIPageableListOfBatch.Serialization.cs | 210 + .../Generated/OpenAIPageableListOfBatch.cs | 83 + .../OpenAIPageableListOfBatchObject.cs | 48 + .../PineconeChatDataSource.Serialization.cs | 147 - .../src/Generated/PineconeChatDataSource.cs | 14 - ...hatExtensionConfiguration.Serialization.cs | 134 + .../PineconeChatExtensionConfiguration.cs | 50 + ...eChatExtensionParameters.Serialization.cs} | 169 +- .../PineconeChatExtensionParameters.cs | 165 + ...neconeFieldMappingOptions.Serialization.cs | 202 + .../Generated/PineconeFieldMappingOptions.cs | 92 + ...equestContentFilterResult.Serialization.cs | 155 - .../Generated/RequestContentFilterResult.cs | 60 - .../RequestImageContentFilterResult.cs | 85 - .../Generated/ResponseContentFilterResult.cs | 129 - ...eImageContentFilterResult.Serialization.cs | 185 - .../ResponseImageContentFilterResult.cs | 105 - .../SpeechGenerationOptions.Serialization.cs | 197 + .../src/Generated/SpeechGenerationOptions.cs | 93 + .../SpeechGenerationResponseFormat.cs | 63 + .../src/Generated/SpeechVoice.cs | 63 + ...atExtensionConfiguration.Serialization.cs} | 69 +- .../UnknownAzureChatExtensionConfiguration.cs | 31 + ...letionsNamedToolSelection.Serialization.cs | 126 + ...nknownChatCompletionsNamedToolSelection.cs | 28 + ...CompletionsResponseFormat.Serialization.cs | 126 + .../UnknownChatCompletionsResponseFormat.cs | 28 + ...wnChatCompletionsToolCall.Serialization.cs | 132 + .../UnknownChatCompletionsToolCall.cs | 29 + ...CompletionsToolDefinition.Serialization.cs | 126 + .../UnknownChatCompletionsToolDefinition.cs | 28 + ...ownChatMessageContentItem.Serialization.cs | 126 + .../UnknownChatMessageContentItem.cs | 28 + ...UnknownChatRequestMessage.Serialization.cs | 126 + .../Generated/UnknownChatRequestMessage.cs | 28 + ...DataAuthenticationOptions.Serialization.cs | 126 + .../UnknownOnYourDataAuthenticationOptions.cs | 28 + ...archAuthenticationOptions.Serialization.cs | 126 + ...urDataVectorSearchAuthenticationOptions.cs | 28 + ...urDataVectorizationSource.Serialization.cs | 126 + .../UnknownOnYourDataVectorizationSource.cs | 28 + .../src/Generated/Upload.Serialization.cs | 238 + .../Azure.AI.OpenAI/src/Generated/Upload.cs | 120 + .../UploadFileRequest.Serialization.cs | 198 + .../src/Generated/UploadFileRequest.cs | 86 + .../src/Generated/UploadObject.cs | 48 + .../src/Generated/UploadPart.Serialization.cs | 183 + .../src/Generated/UploadPart.cs | 97 + .../src/Generated/UploadPartObject.cs | 48 + .../src/Generated/UploadPurpose.cs | 66 + .../src/Generated/UploadStatus.cs | 57 + sdk/openai/Azure.AI.OpenAI/tsp-location.yaml | 4 + sdk/openenergyplatform/ci.mgmt.yml | 109 + sdk/operationalinsights/ci.mgmt.yml | 109 + sdk/oracle/ci.mgmt.yml | 109 + sdk/orbital/ci.mgmt.yml | 109 + sdk/paloaltonetworks.ngfw/ci.mgmt.yml | 109 + sdk/peering/ci.mgmt.yml | 109 + ...e.Developer.MicrosoftPlaywrightTesting.sln | 56 + .../CHANGELOG.md | 11 + .../Directory.Build.props | 6 + .../README.md | 107 + ...eveloper.MicrosoftPlaywrightTesting.csproj | 19 + .../Generated/AccessToken.Serialization.cs | 201 + .../src/Generated/AccessToken.cs | 97 + .../src/Generated/AccessTokenState.cs | 51 + .../src/Generated/AccessTokens.cs | 562 + .../src/Generated/Account.Serialization.cs | 295 + .../src/Generated/Account.cs | 109 + .../src/Generated/AccountState.cs | 51 + .../src/Generated/Accounts.cs | 340 + .../src/Generated/AuthManagerClient.cs | 85 + .../src/Generated/AuthManagerClientOptions.cs | 37 + ...laywrightTestingClientBuilderExtensions.cs | 38 + ...rMicrosoftPlaywrightTestingModelFactory.cs | 69 + .../src/Generated/Docs/AccessTokens.xml | 225 + .../src/Generated/Docs/Accounts.xml | 117 + .../src/Generated/EnablementStatus.cs | 51 + .../src/Generated/Internal/Argument.cs | 129 + .../Internal/ChangeTrackingDictionary.cs | 167 + .../Generated/Internal/ChangeTrackingList.cs | 153 + .../Internal/ModelSerializationExtensions.cs | 398 + .../src/Generated/Internal/Optional.cs | 51 + .../Internal/Utf8JsonRequestContent.cs | 55 + .../src/Generated/OS.cs | 51 + .../src/Generated/SubscriptionState.cs | 60 + .../src/Properties/AssemblyInfo.cs | 11 + ...er.MicrosoftPlaywrightTesting.Tests.csproj | 20 + .../Generated/Samples/Samples_AccessTokens.cs | 239 + .../Generated/Samples/Samples_Accounts.cs | 131 + .../tsp-location.yaml | 5 + .../Configuration.json | 12 + .../tsp-location.yaml | 5 +- .../tspCodeModel.json | 7107 +++++ sdk/playwrighttesting/ci.mgmt.yml | 109 + sdk/policyinsights/ci.mgmt.yml | 109 + sdk/postgresql/ci.mgmt.yml | 109 + sdk/powerbidedicated/ci.mgmt.yml | 109 + sdk/privatedns/ci.mgmt.yml | 109 + sdk/providerhub/ci.mgmt.yml | 109 + sdk/purview/ci.mgmt.yml | 109 + sdk/quantum/ci.mgmt.yml | 109 + sdk/qumulo/ci.mgmt.yml | 109 + sdk/quota/ci.mgmt.yml | 109 + sdk/recoveryservices-backup/ci.mgmt.yml | 109 + .../ci.mgmt.yml | 109 + sdk/recoveryservices-siterecovery/ci.mgmt.yml | 109 + ...ResourceManager.RecoveryServices.net8.0.cs | 90 +- ...Manager.RecoveryServices.netstandard2.0.cs | 90 +- ...ple_RecoveryServicesPrivateLinkResource.cs | 2 +- ...ryServicesPrivateLinkResourceCollection.cs | 8 +- .../Sample_RecoveryServicesVaultCollection.cs | 136 +- ...coveryServicesVaultExtendedInfoResource.cs | 6 +- .../Sample_RecoveryServicesVaultResource.cs | 79 +- .../Sample_ResourceGroupResourceExtensions.cs | 4 +- .../Sample_SubscriptionResourceExtensions.cs | 4 +- .../ArmRecoveryServicesModelFactory.cs | 40 +- ...leRecoveryServicesResourceGroupResource.cs | 8 +- ...bleRecoveryServicesSubscriptionResource.cs | 8 +- .../Extensions/RecoveryServicesExtensions.cs | 16 +- ...AzureMonitorAlertSettings.Serialization.cs | 34 +- .../Models/AzureMonitorAlertSettings.cs | 12 +- .../src/Generated/Models/BcdrSecurityLevel.cs | 57 + .../ClassicAlertSettings.Serialization.cs | 19 +- .../Generated/Models/ClassicAlertSettings.cs | 8 +- .../Generated/Models/EnhancedSecurityState.cs | 57 + ...ervicesSoftDeleteSettings.Serialization.cs | 17 +- .../RecoveryServicesSoftDeleteSettings.cs | 6 +- ...ryServicesVaultProperties.Serialization.cs | 42 + .../Models/RecoveryServicesVaultProperties.cs | 11 +- .../Models/StandardTierStorageRedundancy.cs | 3 + .../Models/VaultMonitoringSettings.cs | 27 +- ...pertiesRedundancySettings.Serialization.cs | 4 +- .../VaultPropertiesRedundancySettings.cs | 4 +- .../RecoveryServicesPrivateLinkResource.cs | 4 +- ...ryServicesPrivateLinkResourceCollection.cs | 16 +- .../RecoveryServicesVaultCollection.cs | 34 +- ...coveryServicesVaultExtendedInfoResource.cs | 12 +- .../RecoveryServicesVaultResource.cs | 66 +- .../PrivateLinkResourcesRestOperations.cs | 2 +- .../RecoveryServicesRestOperations.cs | 2 +- .../RegisteredIdentitiesRestOperations.cs | 2 +- .../ReplicationUsagesRestOperations.cs | 2 +- .../RestOperations/UsagesRestOperations.cs | 2 +- .../VaultCertificatesRestOperations.cs | 2 +- .../VaultExtendedInfoRestOperations.cs | 2 +- .../RestOperations/VaultsRestOperations.cs | 44 +- .../src/autorest.md | 2 +- sdk/recoveryservices/ci.mgmt.yml | 109 + sdk/redis/ci.mgmt.yml | 109 + ....ResourceManager.RedisEnterprise.net8.0.cs | 217 +- ...eManager.RedisEnterprise.netstandard2.0.cs | 217 +- ...Sample_RedisEnterpriseClusterCollection.cs | 20 +- .../Sample_RedisEnterpriseClusterResource.cs | 16 +- ...ample_RedisEnterpriseDatabaseCollection.cs | 31 +- .../Sample_RedisEnterpriseDatabaseResource.cs | 80 +- ...risePrivateEndpointConnectionCollection.cs | 20 +- ...rprisePrivateEndpointConnectionResource.cs | 12 +- .../Sample_SubscriptionResourceExtensions.cs | 8 +- .../AccessPolicyAssignmentCollection.cs | 493 - ...ccessPolicyAssignmentData.Serialization.cs | 330 - .../Generated/AccessPolicyAssignmentData.cs | 97 - ...sPolicyAssignmentResource.Serialization.cs | 26 - .../ArmRedisEnterpriseModelFactory.cs | 143 +- .../MockableRedisEnterpriseArmClient.cs | 12 - ...bleRedisEnterpriseResourceGroupResource.cs | 12 +- ...ableRedisEnterpriseSubscriptionResource.cs | 12 +- .../Extensions/RedisEnterpriseExtensions.cs | 43 +- .../AccessPolicyAssignmentOperationSource.cs | 38 - .../Models/AccessKeysAuthentication.cs | 51 - .../Generated/Models/DeferUpgradeSetting.cs | 51 - .../Models/ForceLinkContent.Serialization.cs | 30 +- .../src/Generated/Models/ForceLinkContent.cs | 31 +- ...kParametersGeoReplication.Serialization.cs | 154 + .../ForceLinkParametersGeoReplication.cs | 72 + ...rceUnlinkRedisEnterpriseDatabaseContent.cs | 2 +- .../Models/PersistenceSettingAofFrequency.cs | 2 +- ...disEnterpriseClusterPatch.Serialization.cs | 32 - .../Models/RedisEnterpriseClusterPatch.cs | 22 +- .../Models/RedisEnterpriseClusteringPolicy.cs | 6 +- ...isEnterpriseDatabasePatch.Serialization.cs | 44 - .../Models/RedisEnterpriseDatabasePatch.cs | 23 +- .../Models/RedisEnterpriseHighAvailability.cs | 51 - .../Models/RedisEnterpriseRedundancyMode.cs | 54 - .../Generated/Models/RedisEnterpriseSku.cs | 12 +- .../Models/RedisEnterpriseSkuName.cs | 134 +- .../Models/RedisEnterpriseTlsVersion.cs | 2 +- .../Models/RedisPersistenceSettings.cs | 14 +- .../RedisEnterpriseClusterCollection.cs | 48 +- ...edisEnterpriseClusterData.Serialization.cs | 62 - .../Generated/RedisEnterpriseClusterData.cs | 22 +- .../RedisEnterpriseClusterResource.cs | 64 +- .../RedisEnterpriseDatabaseCollection.cs | 28 +- ...disEnterpriseDatabaseData.Serialization.cs | 97 - .../Generated/RedisEnterpriseDatabaseData.cs | 23 +- .../RedisEnterpriseDatabaseResource.cs | 205 +- ...risePrivateEndpointConnectionCollection.cs | 32 +- ...rprisePrivateEndpointConnectionResource.cs | 24 +- .../RestOperations/DatabasesRestOperations.cs | 166 +- .../OperationsStatusRestOperations.cs | 2 +- ...rivateEndpointConnectionsRestOperations.cs | 34 +- .../PrivateLinkResourcesRestOperations.cs | 10 +- .../RedisEnterpriseRestOperations.cs | 54 +- .../src/autorest.md | 2 +- sdk/redisenterprise/ci.mgmt.yml | 109 + sdk/relay/ci.mgmt.yml | 109 + sdk/reservations/ci.mgmt.yml | 109 + sdk/resourceconnector/ci.mgmt.yml | 109 + sdk/resourcegraph/ci.mgmt.yml | 109 + sdk/resourcehealth/ci.mgmt.yml | 109 + sdk/resourcemanager/ci.mgmt.yml | 2 + sdk/resourcemover/ci.mgmt.yml | 109 + sdk/resources/ci.mgmt.yml | 109 + .../Models/AIStudioModelCatalogName.cs | 2 +- .../Models/AzureMachineLearningParameters.cs | 4 +- .../Models/AzureMachineLearningVectorizer.cs | 2 +- .../Models/DebugInfo.Serialization.cs | 44 - .../src/Generated/Models/DebugInfo.cs | 2 +- .../QueryRewritesDebugInfo.Serialization.cs | 60 - .../Models/QueryRewritesDebugInfo.cs | 2 +- ...ryRewritesValuesDebugInfo.Serialization.cs | 56 - .../Models/QueryRewritesValuesDebugInfo.cs | 2 +- .../SearchDocumentsResult.Serialization.cs | 14 +- .../Generated/Models/SearchDocumentsResult.cs | 6 +- .../src/Generated/Models/TokenFilterName.cs | 2 +- .../Models/VectorSearchVectorizerKind.cs | 2 +- .../src/Generated/SearchModelFactory.cs | 288 +- .../Azure.Search.Documents/src/autorest.md | 6 +- sdk/search/ci.mgmt.yml | 109 + sdk/securitycenter/ci.mgmt.yml | 109 + sdk/securitydevops/ci.mgmt.yml | 109 + .../src/autorest.md | 2 +- sdk/securityinsights/ci.mgmt.yml | 109 + sdk/selfhelp/ci.mgmt.yml | 109 + sdk/servicebus/ci.mgmt.yml | 109 + sdk/servicefabric/ci.mgmt.yml | 109 + sdk/servicefabricmanagedclusters/ci.mgmt.yml | 109 + sdk/servicelinker/ci.mgmt.yml | 109 + sdk/servicenetworking/ci.mgmt.yml | 109 + sdk/signalr/ci.mgmt.yml | 109 + sdk/sphere/ci.mgmt.yml | 109 + sdk/springappdiscovery/ci.mgmt.yml | 109 + sdk/sqlmanagement/ci.mgmt.yml | 109 + sdk/sqlvirtualmachine/ci.mgmt.yml | 109 + .../Configuration.json | 12 + .../tsp-location.yaml | 7 +- .../tspCodeModel.json | 13011 +++++++++ sdk/standbypool/ci.mgmt.yml | 109 + sdk/storage/ci.mgmt.yml | 109 + sdk/storageactions/ci.mgmt.yml | 109 + sdk/storagecache/ci.mgmt.yml | 109 + sdk/storagemover/ci.mgmt.yml | 109 + sdk/storagepool/ci.mgmt.yml | 109 + sdk/storagesync/ci.mgmt.yml | 109 + sdk/streamanalytics/ci.mgmt.yml | 109 + sdk/subscription/ci.mgmt.yml | 109 + sdk/support/ci.mgmt.yml | 109 + ...Sample_SynapseBigDataPoolInfoCollection.cs | 2 +- .../Samples/Sample_SynapseSqlPoolResource.cs | 28 - .../src/Generated/ArmSynapseModelFactory.cs | 44 +- .../BigDataPoolLibraryInfo.Serialization.cs | 2 +- .../Models/BigDataPoolLibraryInfo.cs | 2 +- ...opyComputeScaleProperties.Serialization.cs | 148 + .../Models/CopyComputeScaleProperties.cs | 69 + ...nalComputeScaleProperties.Serialization.cs | 163 + .../PipelineExternalComputeScaleProperties.cs | 73 + ...InteractiveAuthoringState.Serialization.cs | 28 + .../SelfContainedInteractiveAuthoringState.cs | 18 + ...nRuntimeComputeProperties.Serialization.cs | 32 + ...apseIntegrationRuntimeComputeProperties.cs | 10 +- ...fHostedIntegrationRuntime.Serialization.cs | 17 +- .../SynapseSelfHostedIntegrationRuntime.cs | 6 +- ...dIntegrationRuntimeStatus.Serialization.cs | 50 +- ...napseSelfHostedIntegrationRuntimeStatus.cs | 14 +- ...SynapseWorkspaceRepositoryConfiguration.cs | 4 +- .../RestOperations/SqlPoolsRestOperations.cs | 99 - .../SynapseLibraryData.Serialization.cs | 2 +- .../src/Generated/SynapseLibraryData.cs | 2 +- .../SynapsePrivateLinkHubResource.cs | 4 +- .../src/Generated/SynapseSqlPoolResource.cs | 84 - .../SynapseWorkspaceData.Serialization.cs | 45 +- .../src/Generated/SynapseWorkspaceData.cs | 9 +- .../src/autorest.md | 34 +- sdk/synapse/ci.mgmt.yml | 109 + sdk/terraform/ci.mgmt.yml | 109 + sdk/trafficmanager/ci.mgmt.yml | 109 + sdk/trustedsigning/ci.mgmt.yml | 109 + sdk/voiceservices/ci.mgmt.yml | 109 + sdk/webpubsub/ci.mgmt.yml | 109 + sdk/websites/ci.mgmt.yml | 109 + sdk/workloadmonitor/ci.mgmt.yml | 109 + sdk/workloads/ci.mgmt.yml | 109 + 1669 files changed, 170920 insertions(+), 26052 deletions(-) create mode 100644 sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeDeallocateContent.Serialization.cs create mode 100644 sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeDeallocateContent.cs create mode 100644 sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeDeallocateOption.cs create mode 100644 sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeReimageContent.Serialization.cs create mode 100644 sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeReimageContent.cs create mode 100644 sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeReimageOption.cs create mode 100644 sdk/batch/Azure.Compute.Batch/src/Generated/ContainerHostBatchBindMountEntry.Serialization.cs create mode 100644 sdk/batch/Azure.Compute.Batch/src/Generated/ContainerHostBatchBindMountEntry.cs create mode 100644 sdk/batch/Azure.Compute.Batch/src/Generated/ContainerHostDataPath.cs create mode 100644 sdk/batch/Azure.Compute.Batch/src/Generated/SecurityEncryptionTypes.cs create mode 100644 sdk/batch/Azure.Compute.Batch/src/Generated/VMDiskSecurityProfile.Serialization.cs create mode 100644 sdk/batch/Azure.Compute.Batch/src/Generated/VMDiskSecurityProfile.cs create mode 100644 sdk/chaos/Azure.ResourceManager.Chaos/Configuration.json delete mode 100644 sdk/chaos/Azure.ResourceManager.Chaos/src/autorest.md create mode 100644 sdk/chaos/Azure.ResourceManager.Chaos/tsp-location.yaml create mode 100644 sdk/chaos/Azure.ResourceManager.Chaos/tspCodeModel.json create mode 100644 sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Models/ApplicationType.cs create mode 100644 sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Models/EnclavePlatform.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MachineCollection.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MachineResource.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineCollection.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/{OSOptionProfileData.Serialization.cs => MachineData.Serialization.cs} (64%) rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/{OSOptionProfileData.cs => MachineData.cs} (57%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineResource.Serialization.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/{OSOptionProfileResource.cs => MachineResource.cs} (51%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworking.Serialization.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworking.cs rename sdk/{redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/AccessPolicyAssignmentPropertiesUser.Serialization.cs => containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworkingObservability.Serialization.cs} (59%) rename sdk/{redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/AccessPolicyAssignmentPropertiesUser.cs => containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworkingObservability.cs} (69%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworkingSecurity.Serialization.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworkingSecurity.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolDeleteMachinesParameter.Serialization.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolDeleteMachinesParameter.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSecurityProfile.Serialization.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSecurityProfile.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolWindowsProfile.Serialization.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolWindowsProfile.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/{ContainerServiceOSOptionProperty.Serialization.cs => MachineIPAddress.Serialization.cs} (57%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineIPAddress.cs rename sdk/{redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/AccessPolicyAssignmentList.Serialization.cs => containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineListResult.Serialization.cs} (68%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineListResult.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineNetworkProperties.Serialization.cs rename sdk/{eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErrorDetail.cs => containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineNetworkProperties.cs} (70%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineProperties.Serialization.cs rename sdk/{eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventEncoderConnectedEventData.cs => containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineProperties.cs} (56%) create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCostAnalysis.Serialization.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCostAnalysis.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfile.Serialization.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfile.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfileWebAppRouting.Serialization.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfileWebAppRouting.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMetricsProfile.Serialization.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMetricsProfile.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeResourceGroupProfile.Serialization.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeResourceGroupProfile.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/RestrictionLevel.cs delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileResource.Serialization.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/MachinesRestOperations.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientDeletedEventData.cs rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientCreatedOrUpdatedEventData.Serialization.cs => EventGridMqttClientCreatedOrUpdatedEventData.Serialization.cs} (70%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientCreatedOrUpdatedEventData.cs => EventGridMqttClientCreatedOrUpdatedEventData.cs} (61%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientDeletedEventData.Serialization.cs => EventGridMqttClientDeletedEventData.Serialization.cs} (75%) create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDeletedEventData.cs rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientDisconnectionReason.cs => EventGridMqttClientDisconnectionReason.cs} (64%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientEventData.Serialization.cs => EventGridMqttClientEventData.Serialization.cs} (71%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientEventData.cs => EventGridMqttClientEventData.cs} (68%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientSessionConnectedEventData.Serialization.cs => EventGridMqttClientSessionConnectedEventData.Serialization.cs} (77%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientSessionConnectedEventData.cs => EventGridMqttClientSessionConnectedEventData.cs} (55%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientSessionDisconnectedEventData.Serialization.cs => EventGridMqttClientSessionDisconnectedEventData.Serialization.cs} (74%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientSessionDisconnectedEventData.cs => EventGridMqttClientSessionDisconnectedEventData.cs} (58%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientState.cs => EventGridMqttClientState.cs} (58%) delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCanceledEventData.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCancelingEventData.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobError.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErrorCategory.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErrorCode.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErroredEventData.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobFinishedEventData.Serialization.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobFinishedEventData.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutput.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputAsset.Serialization.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputAsset.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCanceledEventData.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCancelingEventData.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputErroredEventData.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputFinishedEventData.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProcessingEventData.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputScheduledEventData.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputStateChangeEventData.Serialization.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputStateChangeEventData.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobProcessingEventData.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobRetry.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobScheduledEventData.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobState.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobStateChangeEventData.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventChannelArchiveHeartbeatEventData.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventConnectionRejectedEventData.Serialization.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventConnectionRejectedEventData.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventEncoderDisconnectedEventData.Serialization.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventEncoderDisconnectedEventData.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingDataChunkDroppedEventData.Serialization.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingDataChunkDroppedEventData.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingStreamReceivedEventData.Serialization.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingStreamReceivedEventData.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingStreamsOutOfSyncEventData.Serialization.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingStreamsOutOfSyncEventData.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingVideoStreamsOutOfSyncEventData.Serialization.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingVideoStreamsOutOfSyncEventData.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIngestHeartbeatEventData.Serialization.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIngestHeartbeatEventData.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventTrackDiscontinuityDetectedEventData.Serialization.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventTrackDiscontinuityDetectedEventData.cs rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{RedisExportRDBCompletedEventData.Serialization.cs => RedisExportRdbCompletedEventData.Serialization.cs} (73%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{RedisExportRDBCompletedEventData.cs => RedisExportRdbCompletedEventData.cs} (78%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{RedisImportRDBCompletedEventData.Serialization.cs => RedisImportRdbCompletedEventData.Serialization.cs} (73%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{RedisImportRDBCompletedEventData.cs => RedisImportRdbCompletedEventData.cs} (78%) create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsContainerServiceEventResourcesScheduledEventData.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsContainerServiceEventResourcesScheduledEventData.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobAccessTier.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecycleCompletionStatus.cs rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{MediaJobOutputScheduledEventData.Serialization.cs => StorageLifecyclePolicyRunSummary.Serialization.cs} (53%) create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyRunSummary.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/UnknownMediaJobOutput.Serialization.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/UnknownMediaJobOutput.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/Azure.ResourceManager.IoTOperations.sln create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/CHANGELOG.md create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/Directory.Build.props create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/README.md create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/assets.json create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Azure.ResourceManager.IoTOperations.Samples.csproj create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerAuthenticationResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerAuthenticationResourceCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerAuthorizationResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerAuthorizationResourceCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerListenerResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerListenerResourceCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerResourceCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_DataflowEndpointResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_DataflowEndpointResourceCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_DataflowProfileResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_DataflowProfileResourceCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_DataflowResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_DataflowResourceCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_InstanceResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_InstanceResourceCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Azure.ResourceManager.IoTOperations.csproj create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/ArmIoTOperationsModelFactory.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResource.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResourceCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResourceData.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResourceData.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResource.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResourceCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResourceData.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResourceData.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResource.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResourceCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResourceData.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResourceData.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResource.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResourceCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResourceData.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResourceData.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResource.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResourceCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResourceData.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResourceData.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowProfileResource.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowProfileResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowProfileResourceCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowProfileResourceData.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowProfileResourceData.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowResource.Serialization.cs rename sdk/{redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/AccessPolicyAssignmentResource.cs => iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowResource.cs} (53%) create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowResourceCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowResourceData.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowResourceData.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Extensions/IoTOperationsExtensions.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Extensions/MockableIoTOperationsArmClient.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Extensions/MockableIoTOperationsResourceGroupResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Extensions/MockableIoTOperationsSubscriptionResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/InstanceResource.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/InstanceResource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/InstanceResourceCollection.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/InstanceResourceData.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/InstanceResourceData.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Internal/Argument.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Internal/Optional.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/BrokerAuthenticationResourceOperationSource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/BrokerAuthorizationResourceOperationSource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/BrokerListenerResourceOperationSource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/BrokerResourceOperationSource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/DataflowEndpointResourceOperationSource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/DataflowProfileResourceOperationSource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/DataflowResourceOperationSource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/InstanceResourceOperationSource.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/IoTOperationsArmOperation.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/IoTOperationsArmOperationOfT.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/AdvancedSettings.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/AdvancedSettings.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/AuthorizationConfig.Serialization.cs rename sdk/{redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/AccessPolicyAssignmentList.cs => iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/AuthorizationConfig.cs} (65%) create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/AuthorizationRule.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/AuthorizationRule.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BackendChain.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BackendChain.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BatchingConfiguration.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BatchingConfiguration.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticationMethod.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticationProperties.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticationProperties.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticationResourceListResult.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticationResourceListResult.cs rename sdk/{synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseResourceMoveDefinition.Serialization.cs => iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorCustomAuth.Serialization.cs} (63%) create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorCustomAuth.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodCustom.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodCustom.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodSat.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodSat.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodX509.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodX509.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodX509Attributes.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodX509Attributes.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethods.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethods.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthorizationProperties.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthorizationProperties.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthorizationResourceListResult.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthorizationResourceListResult.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerDiagnostics.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerDiagnostics.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerListenerProperties.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerListenerProperties.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerListenerResourceListResult.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerListenerResourceListResult.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerMemoryProfile.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerProperties.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerProperties.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerProtocolType.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerResourceDefinitionMethod.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerResourceListResult.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerResourceListResult.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerResourceRule.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerResourceRule.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Cardinality.Serialization.cs rename sdk/{containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSOptionProperty.cs => iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Cardinality.cs} (59%) create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerCertConfig.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerCertConfig.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerCertificateSpec.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerCertificateSpec.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerIssuerKind.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerIssuerRef.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerIssuerRef.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerPrivateKey.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerPrivateKey.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ClientConfig.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ClientConfig.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CloudEventAttributeType.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataExplorerAuthMethod.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataLakeStorageAuthMethod.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowAction.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowAction.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationDataset.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationDataset.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationFilter.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationFilter.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationMap.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationMap.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationSettings.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationSettings.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowDestinationOperationSettings.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowDestinationOperationSettings.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationAccessToken.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationAccessToken.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationSasl.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationSasl.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationSaslType.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationServiceAccountToken.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationServiceAccountToken.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationSystemAssignedManagedIdentity.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationSystemAssignedManagedIdentity.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationUserAssignedManagedIdentity.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationUserAssignedManagedIdentity.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationX509.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationX509.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataExplorer.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataExplorer.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataExplorerAuthentication.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataExplorerAuthentication.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataLakeStorage.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataLakeStorage.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataLakeStorageAuthentication.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataLakeStorageAuthentication.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointFabricOneLake.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointFabricOneLake.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointFabricOneLakeAuthentication.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointFabricOneLakeAuthentication.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointFabricOneLakeNames.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointFabricOneLakeNames.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointFabricPathType.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafka.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafka.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafkaAck.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafkaAuthentication.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafkaAuthentication.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafkaBatching.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafkaBatching.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafkaCompression.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafkaPartitionStrategy.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointLocalStorage.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointLocalStorage.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointMqtt.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointMqtt.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointMqttAuthentication.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointMqttAuthentication.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointProperties.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointProperties.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointResourceListResult.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointResourceListResult.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowMappingType.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowProfileProperties.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowProfileProperties.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowProfileResourceListResult.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowProfileResourceListResult.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowProperties.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowProperties.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowResourceListResult.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowResourceListResult.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowSourceOperationSettings.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowSourceOperationSettings.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DiagnosticsLogs.Serialization.cs rename sdk/{openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.cs => iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DiagnosticsLogs.cs} (62%) create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DiskBackedMessageBuffer.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DiskBackedMessageBuffer.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/EndpointType.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ExtendedLocation.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ExtendedLocation.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ExtendedLocationType.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/FabricOneLakeAuthMethod.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/FilterType.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Frontend.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Frontend.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/GenerateResourceLimits.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/GenerateResourceLimits.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/InstanceProperties.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/InstanceProperties.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/InstanceResourceListResult.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/InstanceResourceListResult.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/InstanceResourcePatch.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/InstanceResourcePatch.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/KafkaAuthMethod.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/KubernetesReference.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/KubernetesReference.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ListenerPort.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ListenerPort.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/LocalKubernetesReference.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/LocalKubernetesReference.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Metrics.Serialization.cs rename sdk/{openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.cs => iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Metrics.cs} (61%) create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/MqttAuthMethod.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/MqttRetainType.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/OperationType.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/OperationalMode.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/OperatorValue.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/PrincipalConfig.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/PrincipalConfig.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/PrivateKeyAlgorithm.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/PrivateKeyRotationPolicy.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ProfileDiagnostics.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ProfileDiagnostics.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ProvisioningState.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SanForCert.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SanForCert.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SchemaRegistryRef.Serialization.cs rename sdk/{synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseResourceMoveDefinition.cs => iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SchemaRegistryRef.cs} (67%) create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SelfCheck.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SelfCheck.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SelfTracing.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SelfTracing.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ServiceType.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SourceSerializationFormat.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/StateStoreResourceDefinitionMethod.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/StateStoreResourceKeyType.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/StateStoreResourceRule.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/StateStoreResourceRule.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SubscriberMessageDropStrategy.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SubscriberQueueLimit.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SubscriberQueueLimit.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/TlsCertMethod.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/TlsCertMethod.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/TlsCertMethodMode.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/TlsProperties.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/TlsProperties.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Traces.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Traces.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/TransformationSerializationFormat.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimResourceRequirements.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimResourceRequirements.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimSpec.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimSpec.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimSpecSelector.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimSpecSelector.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimSpecSelectorMatchExpressions.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimSpecSelectorMatchExpressions.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/X509ManualCertificate.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/X509ManualCertificate.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/ProviderConstants.cs rename sdk/{redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RestOperations/AccessPolicyAssignmentRestOperations.cs => iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/BrokerAuthenticationRestOperations.cs} (51%) create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/BrokerAuthorizationRestOperations.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/BrokerListenerRestOperations.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/BrokerRestOperations.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/DataflowEndpointRestOperations.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/DataflowProfileRestOperations.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/DataflowRestOperations.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/InstanceRestOperations.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Properties/AssemblyInfo.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/tests/Azure.ResourceManager.IoTOperations.Tests.csproj create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/tests/IoTOperationsManagementTestBase.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/tests/IoTOperationsManagementTestEnvironment.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IoTOperations/tsp-location.yaml create mode 100644 sdk/iotoperations/ci.mgmt.yml create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AIOpenAIClientBuilderExtensions.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AIOpenAIModelFactory.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AddUploadPartRequest.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AddUploadPartRequest.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTaskLabel.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscription.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscription.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionFormat.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionOptions.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionOptions.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionSegment.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionSegment.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionTimestampGranularity.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionWord.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionWord.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranslation.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranslation.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranslationFormat.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranslationOptions.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranslationOptions.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranslationSegment.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranslationSegment.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatEnhancementConfiguration.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatEnhancementConfiguration.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatEnhancements.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatEnhancements.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionConfiguration.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionConfiguration.cs rename sdk/openai/Azure.AI.OpenAI/src/Generated/{ChatCitation.Serialization.cs => AzureChatExtensionDataSourceResponseCitation.Serialization.cs} (56%) rename sdk/openai/Azure.AI.OpenAI/src/Generated/{ChatCitation.cs => AzureChatExtensionDataSourceResponseCitation.cs} (53%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionRetrieveDocumentFilterReason.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionRetrieveDocumentFilterReason.cs rename sdk/openai/Azure.AI.OpenAI/src/Generated/{ChatRetrievedDocument.Serialization.cs => AzureChatExtensionRetrievedDocument.Serialization.cs} (59%) rename sdk/openai/Azure.AI.OpenAI/src/Generated/{ChatRetrievedDocument.cs => AzureChatExtensionRetrievedDocument.cs} (52%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionType.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionsMessageContext.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionsMessageContext.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatGroundingEnhancementConfiguration.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatGroundingEnhancementConfiguration.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatOCREnhancementConfiguration.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatOCREnhancementConfiguration.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatExtensionConfiguration.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatExtensionConfiguration.cs rename sdk/openai/Azure.AI.OpenAI/src/Generated/{InternalAzureCosmosDBChatDataSourceParameters.Serialization.cs => AzureCosmosDBChatExtensionParameters.Serialization.cs} (54%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatExtensionParameters.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBFieldMappingOptions.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBFieldMappingOptions.cs rename sdk/{eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCanceledEventData.Serialization.cs => openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancement.Serialization.cs} (52%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancement.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancementCoordinatePoint.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancementCoordinatePoint.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancementLine.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancementLine.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancementLineSpan.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancementLineSpan.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatExtensionConfiguration.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatExtensionConfiguration.cs rename sdk/openai/Azure.AI.OpenAI/src/Generated/{InternalAzureSearchChatDataSourceParameters.Serialization.cs => AzureSearchChatExtensionParameters.Serialization.cs} (58%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatExtensionParameters.cs rename sdk/openai/Azure.AI.OpenAI/src/Generated/{DataSourceFieldMappings.Serialization.cs => AzureSearchIndexFieldMappingOptions.Serialization.cs} (65%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchIndexFieldMappingOptions.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchQueryType.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/Batch.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/Batch.cs rename sdk/{eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProgressEventData.Serialization.cs => openai/Azure.AI.OpenAI/src/Generated/BatchCreateRequest.Serialization.cs} (54%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/BatchCreateRequest.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/BatchErrorDatum.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/BatchErrorDatum.cs rename sdk/{eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventChannelArchiveHeartbeatEventData.Serialization.cs => openai/Azure.AI.OpenAI/src/Generated/BatchErrorList.Serialization.cs} (55%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/BatchErrorList.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/BatchErrorListObject.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/BatchObject.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/BatchRequestCounts.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/BatchRequestCounts.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/BatchStatus.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatChoice.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatChoice.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatChoiceLogProbabilityInfo.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatChoiceLogProbabilityInfo.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionStreamOptions.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionStreamOptions.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletions.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletions.cs rename sdk/{eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCanceledEventData.Serialization.cs => openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolCall.Serialization.cs} (58%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolCall.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolDefinition.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolDefinition.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolDefinitionFunction.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolDefinitionFunction.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolSelection.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolSelection.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsJsonResponseFormat.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsJsonResponseFormat.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsJsonSchemaResponseFormat.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsJsonSchemaResponseFormat.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsJsonSchemaResponseFormatJsonSchema.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsJsonSchemaResponseFormatJsonSchema.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsNamedFunctionToolSelection.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsNamedFunctionToolSelection.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsNamedToolSelection.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsNamedToolSelection.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsOptions.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsOptions.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsResponseFormat.Serialization.cs rename sdk/openai/Azure.AI.OpenAI/src/Generated/{ChatDataSource.cs => ChatCompletionsResponseFormat.cs} (55%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsTextResponseFormat.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsTextResponseFormat.cs rename sdk/{eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutput.Serialization.cs => openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsToolCall.Serialization.cs} (53%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsToolCall.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsToolDefinition.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsToolDefinition.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsToolSelectionPreset.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatDataSource.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatDocumentFilterReason.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageContentItem.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageContentItem.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageContext.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageContext.cs rename sdk/{eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobProcessingEventData.Serialization.cs => openai/Azure.AI.OpenAI/src/Generated/ChatMessageImageContentItem.Serialization.cs} (57%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageImageContentItem.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageImageDetailLevel.cs rename sdk/{eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErrorDetail.Serialization.cs => openai/Azure.AI.OpenAI/src/Generated/ChatMessageImageUrl.Serialization.cs} (64%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageImageUrl.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageRefusalContentItem.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageRefusalContentItem.cs rename sdk/{eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCancelingEventData.Serialization.cs => openai/Azure.AI.OpenAI/src/Generated/ChatMessageTextContentItem.Serialization.cs} (57%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageTextContentItem.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestAssistantMessage.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestAssistantMessage.cs rename sdk/{eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobScheduledEventData.Serialization.cs => openai/Azure.AI.OpenAI/src/Generated/ChatRequestFunctionMessage.Serialization.cs} (58%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestFunctionMessage.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestMessage.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestMessage.cs rename sdk/{eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErroredEventData.Serialization.cs => openai/Azure.AI.OpenAI/src/Generated/ChatRequestSystemMessage.Serialization.cs} (52%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestSystemMessage.cs rename sdk/{eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCancelingEventData.Serialization.cs => openai/Azure.AI.OpenAI/src/Generated/ChatRequestToolMessage.Serialization.cs} (50%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestToolMessage.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestUserMessage.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestUserMessage.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatResponseMessage.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatResponseMessage.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRole.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatTokenLogProbabilityInfo.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatTokenLogProbabilityInfo.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatTokenLogProbabilityResult.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ChatTokenLogProbabilityResult.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/Choice.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/Choice.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/CompleteUploadRequest.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/CompleteUploadRequest.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/Completions.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/Completions.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsFinishReason.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsLogProbabilityModel.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsLogProbabilityModel.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsOptions.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsOptions.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsUsage.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsUsage.cs rename sdk/{eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventEncoderConnectedEventData.Serialization.cs => openai/Azure.AI.OpenAI/src/Generated/CompletionsUsageCompletionTokensDetails.Serialization.cs} (54%) rename sdk/openai/Azure.AI.OpenAI/src/Generated/{ContentFilterProtectedMaterialCitationResult.cs => CompletionsUsageCompletionTokensDetails.cs} (62%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsUsagePromptTokensDetails.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsUsagePromptTokensDetails.cs rename sdk/{eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputErroredEventData.Serialization.cs => openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistIdResult.Serialization.cs} (54%) rename sdk/openai/Azure.AI.OpenAI/src/Generated/{InternalAzureContentFilterBlocklistResultDetail.cs => ContentFilterBlocklistIdResult.cs} (59%) delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterCitedDetectionResult.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterCitedDetectionResult.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterCompletionTextSpan.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterCompletionTextSpan.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterCompletionTextSpanResult.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterCompletionTextSpanResult.cs rename sdk/{eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobStateChangeEventData.Serialization.cs => openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetailedResults.Serialization.cs} (56%) rename sdk/openai/Azure.AI.OpenAI/src/Generated/{ContentFilterBlocklistResult.cs => ContentFilterDetailedResults.cs} (50%) delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitationResult.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResult.Serialization.cs rename sdk/openai/Azure.AI.OpenAI/src/Generated/{ContentFilterSeverityResult.cs => ContentFilterResult.cs} (57%) rename sdk/openai/Azure.AI.OpenAI/src/Generated/{InternalAzureContentFilterResultForPromptContentFilterResults.Serialization.cs => ContentFilterResultDetailsForPrompt.Serialization.cs} (55%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultDetailsForPrompt.cs rename sdk/openai/Azure.AI.OpenAI/src/Generated/{ResponseContentFilterResult.Serialization.cs => ContentFilterResultsForChoice.Serialization.cs} (55%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultsForChoice.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultsForPrompt.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultsForPrompt.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/CosmosChatDataSource.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/CosmosChatDataSource.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/CreateUploadRequest.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/CreateUploadRequest.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/CreateUploadRequestPurpose.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceQueryType.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatExtensionConfiguration.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatExtensionConfiguration.cs rename sdk/openai/Azure.AI.OpenAI/src/Generated/{InternalElasticsearchChatDataSourceParameters.Serialization.cs => ElasticsearchChatExtensionParameters.Serialization.cs} (56%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatExtensionParameters.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchIndexFieldMappingOptions.Serialization.cs rename sdk/openai/Azure.AI.OpenAI/src/Generated/{DataSourceFieldMappings.cs => ElasticsearchIndexFieldMappingOptions.cs} (52%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchQueryType.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/EmbeddingEncodingFormat.cs rename sdk/{eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobError.Serialization.cs => openai/Azure.AI.OpenAI/src/Generated/EmbeddingItem.Serialization.cs} (56%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/EmbeddingItem.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/EmbeddingItemObject.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/Embeddings.Serialization.cs rename sdk/{eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProgressEventData.cs => openai/Azure.AI.OpenAI/src/Generated/Embeddings.cs} (50%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/EmbeddingsOptions.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/EmbeddingsOptions.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/EmbeddingsUsage.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/EmbeddingsUsage.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/FileDeletionStatus.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/FileDeletionStatus.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/FileDeletionStatusObject.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/FileListResponse.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/FileListResponse.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/FileListResponseObject.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/FilePurpose.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/FileState.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/FunctionCall.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/FunctionCall.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/FunctionCallPreset.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/FunctionDefinition.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/FunctionDefinition.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/FunctionName.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/FunctionName.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationContentFilterResults.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationContentFilterResults.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationData.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationData.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationOptions.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationOptions.cs rename sdk/openai/Azure.AI.OpenAI/src/Generated/{RequestImageContentFilterResult.Serialization.cs => ImageGenerationPromptFilterResults.Serialization.cs} (56%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationPromptFilterResults.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationQuality.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationResponseFormat.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationStyle.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerations.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerations.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ImageSize.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/BinaryContentHelper.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ClientPipelineExtensions.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ClientUriBuilder.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ErrorResult.cs rename sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/{MultipartFormDataBinaryContent.cs => MultipartFormDataRequestContent.cs} (92%) rename sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/{Utf8JsonBinaryContent.cs => Utf8JsonRequestContent.cs} (82%) delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceIntegratedVectorizationSource.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceIntegratedVectorizationSource.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerErrorCode.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerErrorCode.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParametersIncludeContext.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalMongoDBChatDataSourceParameters.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatDataSource.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatDataSource.cs rename sdk/{eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProcessingEventData.Serialization.cs => openai/Azure.AI.OpenAI/src/Generated/MongoDBChatExtensionConfiguration.Serialization.cs} (56%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatExtensionConfiguration.cs rename sdk/openai/Azure.AI.OpenAI/src/Generated/{InternalMongoDBChatDataSourceParameters.Serialization.cs => MongoDBChatExtensionParameters.Serialization.cs} (54%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatExtensionParameters.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatExtensionParametersFieldsMapping.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatExtensionParametersFieldsMapping.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataAccessTokenAuthenticationOptions.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataAccessTokenAuthenticationOptions.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataApiKeyAuthenticationOptions.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataApiKeyAuthenticationOptions.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataAuthenticationOptions.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataAuthenticationOptions.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataAuthenticationType.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataConnectionStringAuthenticationOptions.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataConnectionStringAuthenticationOptions.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataContextProperty.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataDeploymentNameVectorizationSource.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataDeploymentNameVectorizationSource.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataEncodedApiKeyAuthenticationOptions.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataEncodedApiKeyAuthenticationOptions.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataEndpointVectorizationSource.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataEndpointVectorizationSource.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataIntegratedVectorizationSource.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataIntegratedVectorizationSource.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataKeyAndKeyIdAuthenticationOptions.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataKeyAndKeyIdAuthenticationOptions.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataModelIdVectorizationSource.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataModelIdVectorizationSource.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataSystemAssignedManagedIdentityAuthenticationOptions.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataUserAssignedManagedIdentityAuthenticationOptions.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataUsernameAndPasswordAuthenticationOptions.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataUsernameAndPasswordAuthenticationOptions.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorSearchAccessTokenAuthenticationOptions.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorSearchAccessTokenAuthenticationOptions.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorSearchApiKeyAuthenticationOptions.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorSearchApiKeyAuthenticationOptions.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorSearchAuthenticationOptions.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorSearchAuthenticationOptions.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorSearchAuthenticationType.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorizationSource.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorizationSource.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorizationSourceType.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIClient.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIClientOptions.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIFile.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIFile.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIFileObject.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIPageableListOfBatch.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIPageableListOfBatch.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIPageableListOfBatchObject.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatExtensionConfiguration.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatExtensionConfiguration.cs rename sdk/openai/Azure.AI.OpenAI/src/Generated/{InternalPineconeChatDataSourceParameters.Serialization.cs => PineconeChatExtensionParameters.Serialization.cs} (54%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatExtensionParameters.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeFieldMappingOptions.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeFieldMappingOptions.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/RequestContentFilterResult.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/RequestContentFilterResult.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/RequestImageContentFilterResult.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseContentFilterResult.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseImageContentFilterResult.Serialization.cs delete mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseImageContentFilterResult.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/SpeechGenerationOptions.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/SpeechGenerationOptions.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/SpeechGenerationResponseFormat.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/SpeechVoice.cs rename sdk/{eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputFinishedEventData.Serialization.cs => openai/Azure.AI.OpenAI/src/Generated/UnknownAzureChatExtensionConfiguration.Serialization.cs} (53%) create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownAzureChatExtensionConfiguration.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsNamedToolSelection.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsNamedToolSelection.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsResponseFormat.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsResponseFormat.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsToolCall.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsToolCall.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsToolDefinition.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsToolDefinition.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatMessageContentItem.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatMessageContentItem.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatRequestMessage.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatRequestMessage.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownOnYourDataAuthenticationOptions.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownOnYourDataAuthenticationOptions.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownOnYourDataVectorSearchAuthenticationOptions.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownOnYourDataVectorSearchAuthenticationOptions.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownOnYourDataVectorizationSource.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownOnYourDataVectorizationSource.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/Upload.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/Upload.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UploadFileRequest.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UploadFileRequest.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UploadObject.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UploadPart.Serialization.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UploadPart.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UploadPartObject.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UploadPurpose.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/src/Generated/UploadStatus.cs create mode 100644 sdk/openai/Azure.AI.OpenAI/tsp-location.yaml create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/Azure.Developer.MicrosoftPlaywrightTesting.sln create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/CHANGELOG.md create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/Directory.Build.props create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/README.md create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Azure.Developer.MicrosoftPlaywrightTesting.csproj create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccessToken.Serialization.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccessToken.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccessTokenState.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccessTokens.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Account.Serialization.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Account.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccountState.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Accounts.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AuthManagerClient.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AuthManagerClientOptions.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/DeveloperMicrosoftPlaywrightTestingClientBuilderExtensions.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/DeveloperMicrosoftPlaywrightTestingModelFactory.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Docs/AccessTokens.xml create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Docs/Accounts.xml create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/EnablementStatus.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/Argument.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/Optional.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/OS.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/SubscriptionState.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Properties/AssemblyInfo.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tests/Azure.Developer.MicrosoftPlaywrightTesting.Tests.csproj create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tests/Generated/Samples/Samples_AccessTokens.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tests/Generated/Samples/Samples_Accounts.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tsp-location.yaml create mode 100644 sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/Configuration.json create mode 100644 sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/tspCodeModel.json create mode 100644 sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/BcdrSecurityLevel.cs create mode 100644 sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/EnhancedSecurityState.cs delete mode 100644 sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/AccessPolicyAssignmentCollection.cs delete mode 100644 sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/AccessPolicyAssignmentData.Serialization.cs delete mode 100644 sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/AccessPolicyAssignmentData.cs delete mode 100644 sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/AccessPolicyAssignmentResource.Serialization.cs delete mode 100644 sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/LongRunningOperation/AccessPolicyAssignmentOperationSource.cs delete mode 100644 sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/AccessKeysAuthentication.cs delete mode 100644 sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/DeferUpgradeSetting.cs create mode 100644 sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/ForceLinkParametersGeoReplication.Serialization.cs create mode 100644 sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/ForceLinkParametersGeoReplication.cs delete mode 100644 sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseHighAvailability.cs delete mode 100644 sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseRedundancyMode.cs delete mode 100644 sdk/search/Azure.Search.Documents/src/Generated/Models/DebugInfo.Serialization.cs delete mode 100644 sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesDebugInfo.Serialization.cs delete mode 100644 sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesValuesDebugInfo.Serialization.cs create mode 100644 sdk/standbypool/Azure.ResourceManager.StandbyPool/Configuration.json create mode 100644 sdk/standbypool/Azure.ResourceManager.StandbyPool/tspCodeModel.json create mode 100644 sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/CopyComputeScaleProperties.Serialization.cs create mode 100644 sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/CopyComputeScaleProperties.cs create mode 100644 sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/PipelineExternalComputeScaleProperties.Serialization.cs create mode 100644 sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/PipelineExternalComputeScaleProperties.cs create mode 100644 sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SelfContainedInteractiveAuthoringState.Serialization.cs create mode 100644 sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SelfContainedInteractiveAuthoringState.cs diff --git a/sdk/advisor/ci.mgmt.yml b/sdk/advisor/ci.mgmt.yml index 6b9f8d6952e6..f2b5efa6956a 100644 --- a/sdk/advisor/ci.mgmt.yml +++ b/sdk/advisor/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/advisor/ci.mgmt.yml - sdk/advisor/Azure.ResourceManager.Advisor/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/advisor/ci.mgmt.yml + - sdk/advisor/Azure.ResourceManager.Advisor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/advisor/ci.mgmt.yml + - sdk/advisor/Azure.ResourceManager.Advisor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/advisor/ci.mgmt.yml + - sdk/advisor/Azure.ResourceManager.Advisor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/advisor/ci.mgmt.yml + - sdk/advisor/Azure.ResourceManager.Advisor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/advisor/ci.mgmt.yml + - sdk/advisor/Azure.ResourceManager.Advisor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/advisor/ci.mgmt.yml + - sdk/advisor/Azure.ResourceManager.Advisor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/advisor/ci.mgmt.yml + - sdk/advisor/Azure.ResourceManager.Advisor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/advisor/ci.mgmt.yml + - sdk/advisor/Azure.ResourceManager.Advisor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/advisor/ci.mgmt.yml + - sdk/advisor/Azure.ResourceManager.Advisor/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/agrifood/ci.mgmt.yml b/sdk/agrifood/ci.mgmt.yml index ee27d71f9495..006c95f068e1 100644 --- a/sdk/agrifood/ci.mgmt.yml +++ b/sdk/agrifood/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/agrifood/ci.mgmt.yml - sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/agrifood/ci.mgmt.yml + - sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/agrifood/ci.mgmt.yml + - sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/agrifood/ci.mgmt.yml + - sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/agrifood/ci.mgmt.yml + - sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/agrifood/ci.mgmt.yml + - sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/agrifood/ci.mgmt.yml + - sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/agrifood/ci.mgmt.yml + - sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/agrifood/ci.mgmt.yml + - sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/agrifood/ci.mgmt.yml + - sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/alertsmanagement/ci.mgmt.yml b/sdk/alertsmanagement/ci.mgmt.yml index f33a90fffe5c..cdc6fd2d44f6 100644 --- a/sdk/alertsmanagement/ci.mgmt.yml +++ b/sdk/alertsmanagement/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/alertsmanagement/ci.mgmt.yml - sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/alertsmanagement/ci.mgmt.yml + - sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/alertsmanagement/ci.mgmt.yml + - sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/alertsmanagement/ci.mgmt.yml + - sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/alertsmanagement/ci.mgmt.yml + - sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/alertsmanagement/ci.mgmt.yml + - sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/alertsmanagement/ci.mgmt.yml + - sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/alertsmanagement/ci.mgmt.yml + - sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/alertsmanagement/ci.mgmt.yml + - sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/alertsmanagement/ci.mgmt.yml + - sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/analysisservices/ci.mgmt.yml b/sdk/analysisservices/ci.mgmt.yml index 33729b962d88..a7259ef8af2c 100644 --- a/sdk/analysisservices/ci.mgmt.yml +++ b/sdk/analysisservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/analysisservices/ci.mgmt.yml - sdk/analysisservices/Azure.ResourceManager.Analysis/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/analysisservices/ci.mgmt.yml + - sdk/analysisservices/Azure.ResourceManager.Analysis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/analysisservices/ci.mgmt.yml + - sdk/analysisservices/Azure.ResourceManager.Analysis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/analysisservices/ci.mgmt.yml + - sdk/analysisservices/Azure.ResourceManager.Analysis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/analysisservices/ci.mgmt.yml + - sdk/analysisservices/Azure.ResourceManager.Analysis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/analysisservices/ci.mgmt.yml + - sdk/analysisservices/Azure.ResourceManager.Analysis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/analysisservices/ci.mgmt.yml + - sdk/analysisservices/Azure.ResourceManager.Analysis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/analysisservices/ci.mgmt.yml + - sdk/analysisservices/Azure.ResourceManager.Analysis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/analysisservices/ci.mgmt.yml + - sdk/analysisservices/Azure.ResourceManager.Analysis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/analysisservices/ci.mgmt.yml + - sdk/analysisservices/Azure.ResourceManager.Analysis/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/apicenter/ci.mgmt.yml b/sdk/apicenter/ci.mgmt.yml index 41c037327e33..766b96956f0c 100644 --- a/sdk/apicenter/ci.mgmt.yml +++ b/sdk/apicenter/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/apicenter/ci.mgmt.yml - sdk/apicenter/Azure.ResourceManager.ApiCenter/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/apicenter/ci.mgmt.yml + - sdk/apicenter/Azure.ResourceManager.ApiCenter/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/apicenter/ci.mgmt.yml + - sdk/apicenter/Azure.ResourceManager.ApiCenter/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/apicenter/ci.mgmt.yml + - sdk/apicenter/Azure.ResourceManager.ApiCenter/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/apicenter/ci.mgmt.yml + - sdk/apicenter/Azure.ResourceManager.ApiCenter/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/apicenter/ci.mgmt.yml + - sdk/apicenter/Azure.ResourceManager.ApiCenter/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/apicenter/ci.mgmt.yml + - sdk/apicenter/Azure.ResourceManager.ApiCenter/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/apicenter/ci.mgmt.yml + - sdk/apicenter/Azure.ResourceManager.ApiCenter/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/apicenter/ci.mgmt.yml + - sdk/apicenter/Azure.ResourceManager.ApiCenter/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/apicenter/ci.mgmt.yml + - sdk/apicenter/Azure.ResourceManager.ApiCenter/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/apimanagement/ci.mgmt.yml b/sdk/apimanagement/ci.mgmt.yml index b72c80a2e0e6..4dc5c3048c5e 100644 --- a/sdk/apimanagement/ci.mgmt.yml +++ b/sdk/apimanagement/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/apimanagement/ci.mgmt.yml - sdk/apimanagement/Azure.ResourceManager.ApiManagement/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/apimanagement/ci.mgmt.yml + - sdk/apimanagement/Azure.ResourceManager.ApiManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/apimanagement/ci.mgmt.yml + - sdk/apimanagement/Azure.ResourceManager.ApiManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/apimanagement/ci.mgmt.yml + - sdk/apimanagement/Azure.ResourceManager.ApiManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/apimanagement/ci.mgmt.yml + - sdk/apimanagement/Azure.ResourceManager.ApiManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/apimanagement/ci.mgmt.yml + - sdk/apimanagement/Azure.ResourceManager.ApiManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/apimanagement/ci.mgmt.yml + - sdk/apimanagement/Azure.ResourceManager.ApiManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/apimanagement/ci.mgmt.yml + - sdk/apimanagement/Azure.ResourceManager.ApiManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/apimanagement/ci.mgmt.yml + - sdk/apimanagement/Azure.ResourceManager.ApiManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/apimanagement/ci.mgmt.yml + - sdk/apimanagement/Azure.ResourceManager.ApiManagement/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/appcomplianceautomation/ci.mgmt.yml b/sdk/appcomplianceautomation/ci.mgmt.yml index d8a31e0139a8..064f13ef6fe0 100644 --- a/sdk/appcomplianceautomation/ci.mgmt.yml +++ b/sdk/appcomplianceautomation/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/appcomplianceautomation/ci.mgmt.yml - sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appcomplianceautomation/ci.mgmt.yml + - sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appcomplianceautomation/ci.mgmt.yml + - sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appcomplianceautomation/ci.mgmt.yml + - sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appcomplianceautomation/ci.mgmt.yml + - sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appcomplianceautomation/ci.mgmt.yml + - sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appcomplianceautomation/ci.mgmt.yml + - sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appcomplianceautomation/ci.mgmt.yml + - sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appcomplianceautomation/ci.mgmt.yml + - sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appcomplianceautomation/ci.mgmt.yml + - sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/appconfiguration/ci.mgmt.yml b/sdk/appconfiguration/ci.mgmt.yml index a883eaefcd59..1f55b85f6380 100644 --- a/sdk/appconfiguration/ci.mgmt.yml +++ b/sdk/appconfiguration/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/appconfiguration/ci.mgmt.yml - sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appconfiguration/ci.mgmt.yml + - sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appconfiguration/ci.mgmt.yml + - sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appconfiguration/ci.mgmt.yml + - sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appconfiguration/ci.mgmt.yml + - sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appconfiguration/ci.mgmt.yml + - sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appconfiguration/ci.mgmt.yml + - sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appconfiguration/ci.mgmt.yml + - sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appconfiguration/ci.mgmt.yml + - sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appconfiguration/ci.mgmt.yml + - sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/ + # These comments should stay. extends: diff --git a/sdk/applicationinsights/ci.mgmt.yml b/sdk/applicationinsights/ci.mgmt.yml index af82b66e6952..1d9a37a8c370 100644 --- a/sdk/applicationinsights/ci.mgmt.yml +++ b/sdk/applicationinsights/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/applicationinsights/ci.mgmt.yml - sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/applicationinsights/ci.mgmt.yml + - sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/applicationinsights/ci.mgmt.yml + - sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/applicationinsights/ci.mgmt.yml + - sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/applicationinsights/ci.mgmt.yml + - sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/applicationinsights/ci.mgmt.yml + - sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/applicationinsights/ci.mgmt.yml + - sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/applicationinsights/ci.mgmt.yml + - sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/applicationinsights/ci.mgmt.yml + - sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/applicationinsights/ci.mgmt.yml + - sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/appplatform/ci.mgmt.yml b/sdk/appplatform/ci.mgmt.yml index 1d28b9352b6c..af65df2395a6 100644 --- a/sdk/appplatform/ci.mgmt.yml +++ b/sdk/appplatform/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/appplatform/ci.mgmt.yml - sdk/appplatform/Azure.ResourceManager.AppPlatform/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appplatform/ci.mgmt.yml + - sdk/appplatform/Azure.ResourceManager.AppPlatform/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appplatform/ci.mgmt.yml + - sdk/appplatform/Azure.ResourceManager.AppPlatform/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appplatform/ci.mgmt.yml + - sdk/appplatform/Azure.ResourceManager.AppPlatform/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appplatform/ci.mgmt.yml + - sdk/appplatform/Azure.ResourceManager.AppPlatform/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appplatform/ci.mgmt.yml + - sdk/appplatform/Azure.ResourceManager.AppPlatform/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appplatform/ci.mgmt.yml + - sdk/appplatform/Azure.ResourceManager.AppPlatform/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appplatform/ci.mgmt.yml + - sdk/appplatform/Azure.ResourceManager.AppPlatform/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appplatform/ci.mgmt.yml + - sdk/appplatform/Azure.ResourceManager.AppPlatform/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appplatform/ci.mgmt.yml + - sdk/appplatform/Azure.ResourceManager.AppPlatform/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/arc-scvmm/ci.mgmt.yml b/sdk/arc-scvmm/ci.mgmt.yml index bbc2db0c9f63..02bf369c8f67 100644 --- a/sdk/arc-scvmm/ci.mgmt.yml +++ b/sdk/arc-scvmm/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/arc-scvmm/ci.mgmt.yml - sdk/arc-scvmm/Azure.ResourceManager.ScVmm/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/arc-scvmm/ci.mgmt.yml + - sdk/arc-scvmm/Azure.ResourceManager.ScVmm/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/arc-scvmm/ci.mgmt.yml + - sdk/arc-scvmm/Azure.ResourceManager.ScVmm/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/arc-scvmm/ci.mgmt.yml + - sdk/arc-scvmm/Azure.ResourceManager.ScVmm/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/arc-scvmm/ci.mgmt.yml + - sdk/arc-scvmm/Azure.ResourceManager.ScVmm/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/arc-scvmm/ci.mgmt.yml + - sdk/arc-scvmm/Azure.ResourceManager.ScVmm/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/arc-scvmm/ci.mgmt.yml + - sdk/arc-scvmm/Azure.ResourceManager.ScVmm/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/arc-scvmm/ci.mgmt.yml + - sdk/arc-scvmm/Azure.ResourceManager.ScVmm/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/arc-scvmm/ci.mgmt.yml + - sdk/arc-scvmm/Azure.ResourceManager.ScVmm/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/arc-scvmm/ci.mgmt.yml + - sdk/arc-scvmm/Azure.ResourceManager.ScVmm/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/astronomer/ci.mgmt.yml b/sdk/astronomer/ci.mgmt.yml index f6099036651c..2ec84f0a86ca 100644 --- a/sdk/astronomer/ci.mgmt.yml +++ b/sdk/astronomer/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/astronomer/ci.mgmt.yml - sdk/astronomer/Azure.ResourceManager.Astro/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/astronomer/ci.mgmt.yml + - sdk/astronomer/Azure.ResourceManager.Astro/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/astronomer/ci.mgmt.yml + - sdk/astronomer/Azure.ResourceManager.Astro/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/astronomer/ci.mgmt.yml + - sdk/astronomer/Azure.ResourceManager.Astro/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/astronomer/ci.mgmt.yml + - sdk/astronomer/Azure.ResourceManager.Astro/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/astronomer/ci.mgmt.yml + - sdk/astronomer/Azure.ResourceManager.Astro/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/astronomer/ci.mgmt.yml + - sdk/astronomer/Azure.ResourceManager.Astro/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/astronomer/ci.mgmt.yml + - sdk/astronomer/Azure.ResourceManager.Astro/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/astronomer/ci.mgmt.yml + - sdk/astronomer/Azure.ResourceManager.Astro/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/astronomer/ci.mgmt.yml + - sdk/astronomer/Azure.ResourceManager.Astro/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/attestation/ci.mgmt.yml b/sdk/attestation/ci.mgmt.yml index 51d1ac0c8240..53d13cf72c24 100644 --- a/sdk/attestation/ci.mgmt.yml +++ b/sdk/attestation/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/attestation/ci.mgmt.yml - sdk/attestation/Azure.ResourceManager.Attestation/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/attestation/ci.mgmt.yml + - sdk/attestation/Azure.ResourceManager.Attestation/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/attestation/ci.mgmt.yml + - sdk/attestation/Azure.ResourceManager.Attestation/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/attestation/ci.mgmt.yml + - sdk/attestation/Azure.ResourceManager.Attestation/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/attestation/ci.mgmt.yml + - sdk/attestation/Azure.ResourceManager.Attestation/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/attestation/ci.mgmt.yml + - sdk/attestation/Azure.ResourceManager.Attestation/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/attestation/ci.mgmt.yml + - sdk/attestation/Azure.ResourceManager.Attestation/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/attestation/ci.mgmt.yml + - sdk/attestation/Azure.ResourceManager.Attestation/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/attestation/ci.mgmt.yml + - sdk/attestation/Azure.ResourceManager.Attestation/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/attestation/ci.mgmt.yml + - sdk/attestation/Azure.ResourceManager.Attestation/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/authorization/ci.mgmt.yml b/sdk/authorization/ci.mgmt.yml index 7ac32fcc5543..3b7bd7d1a987 100644 --- a/sdk/authorization/ci.mgmt.yml +++ b/sdk/authorization/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/authorization/ci.mgmt.yml - sdk/authorization/Azure.ResourceManager.Authorization/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/authorization/ci.mgmt.yml + - sdk/authorization/Azure.ResourceManager.Authorization/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/authorization/ci.mgmt.yml + - sdk/authorization/Azure.ResourceManager.Authorization/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/authorization/ci.mgmt.yml + - sdk/authorization/Azure.ResourceManager.Authorization/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/authorization/ci.mgmt.yml + - sdk/authorization/Azure.ResourceManager.Authorization/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/authorization/ci.mgmt.yml + - sdk/authorization/Azure.ResourceManager.Authorization/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/authorization/ci.mgmt.yml + - sdk/authorization/Azure.ResourceManager.Authorization/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/authorization/ci.mgmt.yml + - sdk/authorization/Azure.ResourceManager.Authorization/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/authorization/ci.mgmt.yml + - sdk/authorization/Azure.ResourceManager.Authorization/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/authorization/ci.mgmt.yml + - sdk/authorization/Azure.ResourceManager.Authorization/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/automanage/ci.mgmt.yml b/sdk/automanage/ci.mgmt.yml index 5a2467820b85..8791a59830f2 100644 --- a/sdk/automanage/ci.mgmt.yml +++ b/sdk/automanage/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/automanage/ci.mgmt.yml - sdk/automanage/Azure.ResourceManager.Automanage/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/automanage/ci.mgmt.yml + - sdk/automanage/Azure.ResourceManager.Automanage/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/automanage/ci.mgmt.yml + - sdk/automanage/Azure.ResourceManager.Automanage/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/automanage/ci.mgmt.yml + - sdk/automanage/Azure.ResourceManager.Automanage/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/automanage/ci.mgmt.yml + - sdk/automanage/Azure.ResourceManager.Automanage/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/automanage/ci.mgmt.yml + - sdk/automanage/Azure.ResourceManager.Automanage/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/automanage/ci.mgmt.yml + - sdk/automanage/Azure.ResourceManager.Automanage/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/automanage/ci.mgmt.yml + - sdk/automanage/Azure.ResourceManager.Automanage/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/automanage/ci.mgmt.yml + - sdk/automanage/Azure.ResourceManager.Automanage/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/automanage/ci.mgmt.yml + - sdk/automanage/Azure.ResourceManager.Automanage/ + extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/automation/ci.mgmt.yml b/sdk/automation/ci.mgmt.yml index 45bec5d1c196..550a799e4711 100644 --- a/sdk/automation/ci.mgmt.yml +++ b/sdk/automation/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/automation/ci.mgmt.yml - sdk/automation/Azure.ResourceManager.Automation/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/automation/ci.mgmt.yml + - sdk/automation/Azure.ResourceManager.Automation/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/automation/ci.mgmt.yml + - sdk/automation/Azure.ResourceManager.Automation/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/automation/ci.mgmt.yml + - sdk/automation/Azure.ResourceManager.Automation/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/automation/ci.mgmt.yml + - sdk/automation/Azure.ResourceManager.Automation/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/automation/ci.mgmt.yml + - sdk/automation/Azure.ResourceManager.Automation/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/automation/ci.mgmt.yml + - sdk/automation/Azure.ResourceManager.Automation/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/automation/ci.mgmt.yml + - sdk/automation/Azure.ResourceManager.Automation/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/automation/ci.mgmt.yml + - sdk/automation/Azure.ResourceManager.Automation/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/automation/ci.mgmt.yml + - sdk/automation/Azure.ResourceManager.Automation/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/avs/ci.mgmt.yml b/sdk/avs/ci.mgmt.yml index 6404a2ba34ce..89c0e9181ec7 100644 --- a/sdk/avs/ci.mgmt.yml +++ b/sdk/avs/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/avs/ci.mgmt.yml - sdk/avs/Azure.ResourceManager.Avs/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/avs/ci.mgmt.yml + - sdk/avs/Azure.ResourceManager.Avs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/avs/ci.mgmt.yml + - sdk/avs/Azure.ResourceManager.Avs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/avs/ci.mgmt.yml + - sdk/avs/Azure.ResourceManager.Avs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/avs/ci.mgmt.yml + - sdk/avs/Azure.ResourceManager.Avs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/avs/ci.mgmt.yml + - sdk/avs/Azure.ResourceManager.Avs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/avs/ci.mgmt.yml + - sdk/avs/Azure.ResourceManager.Avs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/avs/ci.mgmt.yml + - sdk/avs/Azure.ResourceManager.Avs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/avs/ci.mgmt.yml + - sdk/avs/Azure.ResourceManager.Avs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/avs/ci.mgmt.yml + - sdk/avs/Azure.ResourceManager.Avs/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/azurelargeinstance/ci.mgmt.yml b/sdk/azurelargeinstance/ci.mgmt.yml index fbe98927ef15..e51a670c376c 100644 --- a/sdk/azurelargeinstance/ci.mgmt.yml +++ b/sdk/azurelargeinstance/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/azurelargeinstance/ci.mgmt.yml - sdk/azurelargeinstance/Azure.ResourceManager.LargeInstance/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/azurelargeinstance/ci.mgmt.yml + - sdk/azurelargeinstance/Azure.ResourceManager.LargeInstance/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/azurelargeinstance/ci.mgmt.yml + - sdk/azurelargeinstance/Azure.ResourceManager.LargeInstance/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/azurelargeinstance/ci.mgmt.yml + - sdk/azurelargeinstance/Azure.ResourceManager.LargeInstance/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/azurelargeinstance/ci.mgmt.yml + - sdk/azurelargeinstance/Azure.ResourceManager.LargeInstance/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/azurelargeinstance/ci.mgmt.yml + - sdk/azurelargeinstance/Azure.ResourceManager.LargeInstance/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/azurelargeinstance/ci.mgmt.yml + - sdk/azurelargeinstance/Azure.ResourceManager.LargeInstance/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/azurelargeinstance/ci.mgmt.yml + - sdk/azurelargeinstance/Azure.ResourceManager.LargeInstance/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/azurelargeinstance/ci.mgmt.yml + - sdk/azurelargeinstance/Azure.ResourceManager.LargeInstance/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/azurelargeinstance/ci.mgmt.yml + - sdk/azurelargeinstance/Azure.ResourceManager.LargeInstance/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/azurestackhci/ci.mgmt.yml b/sdk/azurestackhci/ci.mgmt.yml index 89c22080e00c..6af4ef1c9445 100644 --- a/sdk/azurestackhci/ci.mgmt.yml +++ b/sdk/azurestackhci/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/azurestackhci/ci.mgmt.yml - sdk/azurestackhci/Azure.ResourceManager.Hci/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/azurestackhci/ci.mgmt.yml + - sdk/azurestackhci/Azure.ResourceManager.Hci/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/azurestackhci/ci.mgmt.yml + - sdk/azurestackhci/Azure.ResourceManager.Hci/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/azurestackhci/ci.mgmt.yml + - sdk/azurestackhci/Azure.ResourceManager.Hci/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/azurestackhci/ci.mgmt.yml + - sdk/azurestackhci/Azure.ResourceManager.Hci/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/azurestackhci/ci.mgmt.yml + - sdk/azurestackhci/Azure.ResourceManager.Hci/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/azurestackhci/ci.mgmt.yml + - sdk/azurestackhci/Azure.ResourceManager.Hci/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/azurestackhci/ci.mgmt.yml + - sdk/azurestackhci/Azure.ResourceManager.Hci/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/azurestackhci/ci.mgmt.yml + - sdk/azurestackhci/Azure.ResourceManager.Hci/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/azurestackhci/ci.mgmt.yml + - sdk/azurestackhci/Azure.ResourceManager.Hci/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/batch/Azure.Compute.Batch/api/Azure.Compute.Batch.net8.0.cs b/sdk/batch/Azure.Compute.Batch/api/Azure.Compute.Batch.net8.0.cs index 94a098ec1bb7..f2e7a58ec245 100644 --- a/sdk/batch/Azure.Compute.Batch/api/Azure.Compute.Batch.net8.0.cs +++ b/sdk/batch/Azure.Compute.Batch/api/Azure.Compute.Batch.net8.0.cs @@ -231,10 +231,14 @@ public BatchClient(System.Uri endpoint, Azure.Core.TokenCredential credential, A public virtual Azure.Response CreateTaskCollection(string jobId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task> CreateTaskCollectionAsync(string jobId, Azure.Compute.Batch.BatchTaskGroup taskCollection, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task CreateTaskCollectionAsync(string jobId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response DeleteJob(string jobId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task DeleteJobAsync(string jobId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response DeleteJobSchedule(string jobScheduleId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task DeleteJobScheduleAsync(string jobScheduleId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response DeallocateNode(string poolId, string nodeId, Azure.Compute.Batch.BatchNodeDeallocateContent parameters = null, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response DeallocateNode(string poolId, string nodeId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeallocateNodeAsync(string poolId, string nodeId, Azure.Compute.Batch.BatchNodeDeallocateContent parameters = null, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeallocateNodeAsync(string poolId, string nodeId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response DeleteJob(string jobId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), bool? force = default(bool?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteJobAsync(string jobId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), bool? force = default(bool?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response DeleteJobSchedule(string jobScheduleId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), bool? force = default(bool?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteJobScheduleAsync(string jobScheduleId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), bool? force = default(bool?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response DeleteNodeFile(string poolId, string nodeId, string filePath, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), bool? recursive = default(bool?), Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task DeleteNodeFileAsync(string poolId, string nodeId, string filePath, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), bool? recursive = default(bool?), Azure.RequestContext context = null) { throw null; } public virtual Azure.Response DeleteNodeUser(string poolId, string nodeId, string userName, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestContext context = null) { throw null; } @@ -389,6 +393,10 @@ public BatchClient(System.Uri endpoint, Azure.Core.TokenCredential credential, A public virtual Azure.Response RebootNode(string poolId, string nodeId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task RebootNodeAsync(string poolId, string nodeId, Azure.Compute.Batch.BatchNodeRebootContent parameters = null, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task RebootNodeAsync(string poolId, string nodeId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response ReimageNode(string poolId, string nodeId, Azure.Compute.Batch.BatchNodeReimageContent parameters = null, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response ReimageNode(string poolId, string nodeId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task ReimageNodeAsync(string poolId, string nodeId, Azure.Compute.Batch.BatchNodeReimageContent parameters = null, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task ReimageNodeAsync(string poolId, string nodeId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestContext context = null) { throw null; } public virtual Azure.Response RemoveNodes(string poolId, Azure.Compute.Batch.BatchNodeRemoveContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response RemoveNodes(string poolId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task RemoveNodesAsync(string poolId, Azure.Compute.Batch.BatchNodeRemoveContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -417,14 +425,16 @@ public BatchClient(System.Uri endpoint, Azure.Core.TokenCredential credential, A public virtual Azure.Response ResizePool(string poolId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task ResizePoolAsync(string poolId, Azure.Compute.Batch.BatchPoolResizeContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task ResizePoolAsync(string poolId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response StartNode(string poolId, string nodeId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task StartNodeAsync(string poolId, string nodeId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestContext context = null) { throw null; } public virtual Azure.Response StopPoolResize(string poolId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task StopPoolResizeAsync(string poolId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response TerminateJob(string jobId, Azure.Compute.Batch.BatchJobTerminateContent parameters = null, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response TerminateJob(string jobId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task TerminateJobAsync(string jobId, Azure.Compute.Batch.BatchJobTerminateContent parameters = null, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task TerminateJobAsync(string jobId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response TerminateJobSchedule(string jobScheduleId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task TerminateJobScheduleAsync(string jobScheduleId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response TerminateJob(string jobId, Azure.Compute.Batch.BatchJobTerminateContent parameters = null, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), bool? force = default(bool?), Azure.RequestConditions requestConditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response TerminateJob(string jobId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), bool? force = default(bool?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task TerminateJobAsync(string jobId, Azure.Compute.Batch.BatchJobTerminateContent parameters = null, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), bool? force = default(bool?), Azure.RequestConditions requestConditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task TerminateJobAsync(string jobId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), bool? force = default(bool?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response TerminateJobSchedule(string jobScheduleId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), bool? force = default(bool?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task TerminateJobScheduleAsync(string jobScheduleId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), bool? force = default(bool?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response TerminateTask(string jobId, string taskId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task TerminateTaskAsync(string jobId, string taskId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response UpdateJob(string jobId, Azure.Compute.Batch.BatchJobUpdateContent job, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -446,10 +456,10 @@ public BatchClient(System.Uri endpoint, Azure.Core.TokenCredential credential, A } public partial class BatchClientOptions : Azure.Core.ClientOptions { - public BatchClientOptions(Azure.Compute.Batch.BatchClientOptions.ServiceVersion version = Azure.Compute.Batch.BatchClientOptions.ServiceVersion.V2024_02_01_19_0) { } + public BatchClientOptions(Azure.Compute.Batch.BatchClientOptions.ServiceVersion version = Azure.Compute.Batch.BatchClientOptions.ServiceVersion.V2024_07_01_20_0) { } public enum ServiceVersion { - V2024_02_01_19_0 = 1, + V2024_07_01_20_0 = 1, } } public partial class BatchError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel @@ -643,7 +653,8 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer } public partial class BatchJobNetworkConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public BatchJobNetworkConfiguration(string subnetId) { } + public BatchJobNetworkConfiguration(string subnetId, bool skipWithdrawFromVNet) { } + public bool SkipWithdrawFromVNet { get { throw null; } set { } } public string SubnetId { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Compute.Batch.BatchJobNetworkConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1009,6 +1020,7 @@ public BatchJobUpdateContent() { } public Azure.Compute.Batch.BatchJobConstraints Constraints { get { throw null; } set { } } public int? MaxParallelTasks { get { throw null; } set { } } public System.Collections.Generic.IList Metadata { get { throw null; } } + public Azure.Compute.Batch.BatchJobNetworkConfiguration NetworkConfiguration { get { throw null; } set { } } public Azure.Compute.Batch.OnAllBatchTasksComplete? OnAllTasksComplete { get { throw null; } set { } } public Azure.Compute.Batch.BatchPoolInfo PoolInfo { get { throw null; } set { } } public int? Priority { get { throw null; } set { } } @@ -1086,6 +1098,8 @@ public partial class BatchNodeCounts : System.ClientModel.Primitives.IJsonModel< { internal BatchNodeCounts() { } public int Creating { get { throw null; } } + public int Deallocated { get { throw null; } } + public int Deallocating { get { throw null; } } public int Idle { get { throw null; } } public int LeavingPool { get { throw null; } } public int Offline { get { throw null; } } @@ -1107,6 +1121,37 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class BatchNodeDeallocateContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BatchNodeDeallocateContent() { } + public Azure.Compute.Batch.BatchNodeDeallocateOption? NodeDeallocateOption { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Compute.Batch.BatchNodeDeallocateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Compute.Batch.BatchNodeDeallocateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct BatchNodeDeallocateOption : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public BatchNodeDeallocateOption(string value) { throw null; } + public static Azure.Compute.Batch.BatchNodeDeallocateOption Requeue { get { throw null; } } + public static Azure.Compute.Batch.BatchNodeDeallocateOption RetainedData { get { throw null; } } + public static Azure.Compute.Batch.BatchNodeDeallocateOption TaskCompletion { get { throw null; } } + public static Azure.Compute.Batch.BatchNodeDeallocateOption Terminate { get { throw null; } } + public bool Equals(Azure.Compute.Batch.BatchNodeDeallocateOption other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Compute.Batch.BatchNodeDeallocateOption left, Azure.Compute.Batch.BatchNodeDeallocateOption right) { throw null; } + public static implicit operator Azure.Compute.Batch.BatchNodeDeallocateOption (string value) { throw null; } + public static bool operator !=(Azure.Compute.Batch.BatchNodeDeallocateOption left, Azure.Compute.Batch.BatchNodeDeallocateOption right) { throw null; } + public override string ToString() { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct BatchNodeDeallocationOption : System.IEquatable { @@ -1300,6 +1345,37 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.Compute.Batch.BatchNodeRebootOption left, Azure.Compute.Batch.BatchNodeRebootOption right) { throw null; } public override string ToString() { throw null; } } + public partial class BatchNodeReimageContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BatchNodeReimageContent() { } + public Azure.Compute.Batch.BatchNodeReimageOption? NodeReimageOption { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Compute.Batch.BatchNodeReimageContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Compute.Batch.BatchNodeReimageContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct BatchNodeReimageOption : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public BatchNodeReimageOption(string value) { throw null; } + public static Azure.Compute.Batch.BatchNodeReimageOption Requeue { get { throw null; } } + public static Azure.Compute.Batch.BatchNodeReimageOption RetainedData { get { throw null; } } + public static Azure.Compute.Batch.BatchNodeReimageOption TaskCompletion { get { throw null; } } + public static Azure.Compute.Batch.BatchNodeReimageOption Terminate { get { throw null; } } + public bool Equals(Azure.Compute.Batch.BatchNodeReimageOption other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Compute.Batch.BatchNodeReimageOption left, Azure.Compute.Batch.BatchNodeReimageOption right) { throw null; } + public static implicit operator Azure.Compute.Batch.BatchNodeReimageOption (string value) { throw null; } + public static bool operator !=(Azure.Compute.Batch.BatchNodeReimageOption left, Azure.Compute.Batch.BatchNodeReimageOption right) { throw null; } + public override string ToString() { throw null; } + } public partial class BatchNodeRemoteLoginSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal BatchNodeRemoteLoginSettings() { } @@ -1332,6 +1408,8 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly int _dummyPrimitive; public BatchNodeState(string value) { throw null; } public static Azure.Compute.Batch.BatchNodeState Creating { get { throw null; } } + public static Azure.Compute.Batch.BatchNodeState Deallocated { get { throw null; } } + public static Azure.Compute.Batch.BatchNodeState Deallocating { get { throw null; } } public static Azure.Compute.Batch.BatchNodeState Idle { get { throw null; } } public static Azure.Compute.Batch.BatchNodeState LeavingPool { get { throw null; } } public static Azure.Compute.Batch.BatchNodeState Offline { get { throw null; } } @@ -1701,9 +1779,20 @@ public partial class BatchPoolUpdateContent : System.ClientModel.Primitives.IJso { public BatchPoolUpdateContent() { } public System.Collections.Generic.IList ApplicationPackageReferences { get { throw null; } } + public string DisplayName { get { throw null; } set { } } + public bool? EnableInterNodeCommunication { get { throw null; } set { } } public System.Collections.Generic.IList Metadata { get { throw null; } } + public System.Collections.Generic.IList MountConfiguration { get { throw null; } } + public Azure.Compute.Batch.NetworkConfiguration NetworkConfiguration { get { throw null; } set { } } + public System.Collections.Generic.IDictionary ResourceTags { get { throw null; } } public Azure.Compute.Batch.BatchStartTask StartTask { get { throw null; } set { } } public Azure.Compute.Batch.BatchNodeCommunicationMode? TargetNodeCommunicationMode { get { throw null; } set { } } + public Azure.Compute.Batch.BatchTaskSchedulingPolicy TaskSchedulingPolicy { get { throw null; } set { } } + public int? TaskSlotsPerNode { get { throw null; } set { } } + public Azure.Compute.Batch.UpgradePolicy UpgradePolicy { get { throw null; } set { } } + public System.Collections.Generic.IList UserAccounts { get { throw null; } } + public Azure.Compute.Batch.VirtualMachineConfiguration VirtualMachineConfiguration { get { throw null; } set { } } + public string VmSize { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Compute.Batch.BatchPoolUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1962,6 +2051,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class BatchTaskContainerSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public BatchTaskContainerSettings(string imageName) { } + public System.Collections.Generic.IList ContainerHostBatchBindMounts { get { throw null; } } public string ContainerRunOptions { get { throw null; } set { } } public string ImageName { get { throw null; } set { } } public Azure.Compute.Batch.ContainerRegistryReference Registry { get { throw null; } set { } } @@ -2252,7 +2342,7 @@ public static partial class ComputeBatchModelFactory public static Azure.Compute.Batch.BatchJobStatistics BatchJobStatistics(string url = null, System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdateTime = default(System.DateTimeOffset), System.TimeSpan userCpuTime = default(System.TimeSpan), System.TimeSpan kernelCpuTime = default(System.TimeSpan), System.TimeSpan wallClockTime = default(System.TimeSpan), long readIOps = (long)0, long writeIOps = (long)0, float readIOGiB = 0f, float writeIOGiB = 0f, long numSucceededTasks = (long)0, long numFailedTasks = (long)0, long numTaskRetries = (long)0, System.TimeSpan waitTime = default(System.TimeSpan)) { throw null; } public static Azure.Compute.Batch.BatchNode BatchNode(string id = null, string url = null, Azure.Compute.Batch.BatchNodeState? state = default(Azure.Compute.Batch.BatchNodeState?), Azure.Compute.Batch.SchedulingState? schedulingState = default(Azure.Compute.Batch.SchedulingState?), System.DateTimeOffset? stateTransitionTime = default(System.DateTimeOffset?), System.DateTimeOffset? lastBootTime = default(System.DateTimeOffset?), System.DateTimeOffset? allocationTime = default(System.DateTimeOffset?), string ipAddress = null, string affinityId = null, string vmSize = null, int? totalTasksRun = default(int?), int? runningTasksCount = default(int?), int? runningTaskSlotsCount = default(int?), int? totalTasksSucceeded = default(int?), System.Collections.Generic.IEnumerable recentTasks = null, Azure.Compute.Batch.BatchStartTask startTask = null, Azure.Compute.Batch.BatchStartTaskInfo startTaskInfo = null, System.Collections.Generic.IEnumerable errors = null, bool? isDedicated = default(bool?), Azure.Compute.Batch.BatchNodeEndpointConfiguration endpointConfiguration = null, Azure.Compute.Batch.BatchNodeAgentInfo nodeAgentInfo = null, Azure.Compute.Batch.VirtualMachineInfo virtualMachineInfo = null) { throw null; } public static Azure.Compute.Batch.BatchNodeAgentInfo BatchNodeAgentInfo(string version = null, System.DateTimeOffset lastUpdateTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Compute.Batch.BatchNodeCounts BatchNodeCounts(int creating = 0, int idle = 0, int offline = 0, int preempted = 0, int rebooting = 0, int reimaging = 0, int running = 0, int starting = 0, int startTaskFailed = 0, int leavingPool = 0, int unknown = 0, int unusable = 0, int waitingForStartTask = 0, int total = 0, int upgradingOs = 0) { throw null; } + public static Azure.Compute.Batch.BatchNodeCounts BatchNodeCounts(int creating = 0, int idle = 0, int offline = 0, int preempted = 0, int rebooting = 0, int reimaging = 0, int running = 0, int starting = 0, int startTaskFailed = 0, int leavingPool = 0, int unknown = 0, int unusable = 0, int waitingForStartTask = 0, int deallocated = 0, int deallocating = 0, int total = 0, int upgradingOs = 0) { throw null; } public static Azure.Compute.Batch.BatchNodeEndpointConfiguration BatchNodeEndpointConfiguration(System.Collections.Generic.IEnumerable inboundEndpoints = null) { throw null; } public static Azure.Compute.Batch.BatchNodeError BatchNodeError(string code = null, string message = null, System.Collections.Generic.IEnumerable errorDetails = null) { throw null; } public static Azure.Compute.Batch.BatchNodeFile BatchNodeFile(string name = null, string url = null, bool? isDirectory = default(bool?), Azure.Compute.Batch.FileProperties properties = null) { throw null; } @@ -2283,8 +2373,8 @@ public static partial class ComputeBatchModelFactory public static Azure.Compute.Batch.BatchTaskInfo BatchTaskInfo(string taskUrl = null, string jobId = null, string taskId = null, int? subtaskId = default(int?), Azure.Compute.Batch.BatchTaskState taskState = default(Azure.Compute.Batch.BatchTaskState), Azure.Compute.Batch.BatchTaskExecutionInfo executionInfo = null) { throw null; } public static Azure.Compute.Batch.BatchTaskSlotCounts BatchTaskSlotCounts(int active = 0, int running = 0, int completed = 0, int succeeded = 0, int failed = 0) { throw null; } public static Azure.Compute.Batch.BatchTaskStatistics BatchTaskStatistics(string url = null, System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdateTime = default(System.DateTimeOffset), System.TimeSpan userCpuTime = default(System.TimeSpan), System.TimeSpan kernelCpuTime = default(System.TimeSpan), System.TimeSpan wallClockTime = default(System.TimeSpan), long readIOps = (long)0, long writeIOps = (long)0, float readIOGiB = 0f, float writeIOGiB = 0f, System.TimeSpan waitTime = default(System.TimeSpan)) { throw null; } - public static Azure.Compute.Batch.FileProperties FileProperties(System.DateTimeOffset? creationTime = default(System.DateTimeOffset?), System.DateTimeOffset lastModified = default(System.DateTimeOffset), long contentLength = (long)0, string contentType = null, string fileMode = null) { throw null; } - public static Azure.Compute.Batch.ImageReference ImageReference(string publisher = null, string offer = null, string sku = null, string version = null, string virtualMachineImageId = null, string exactVersion = null) { throw null; } + public static Azure.Compute.Batch.FileProperties FileProperties(System.DateTimeOffset? creationTime = default(System.DateTimeOffset?), System.DateTimeOffset lastModified = default(System.DateTimeOffset), string contentLength = null, string contentType = null, string fileMode = null) { throw null; } + public static Azure.Compute.Batch.ImageReference ImageReference(string publisher = null, string offer = null, string sku = null, string version = null, string virtualMachineImageId = null, string exactVersion = null, string sharedGalleryImageId = null, string communityGalleryImageId = null) { throw null; } public static Azure.Compute.Batch.InboundEndpoint InboundEndpoint(string name = null, Azure.Compute.Batch.InboundEndpointProtocol protocol = default(Azure.Compute.Batch.InboundEndpointProtocol), string publicIpAddress = null, string publicFQDN = null, int frontendPort = 0, int backendPort = 0) { throw null; } public static Azure.Compute.Batch.InstanceViewStatus InstanceViewStatus(string code = null, string displayStatus = null, Azure.Compute.Batch.StatusLevelTypes? level = default(Azure.Compute.Batch.StatusLevelTypes?), string message = null, System.DateTimeOffset? time = default(System.DateTimeOffset?)) { throw null; } public static Azure.Compute.Batch.NameValuePair NameValuePair(string name = null, string value = null) { throw null; } @@ -2309,6 +2399,40 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerHostBatchBindMountEntry : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerHostBatchBindMountEntry() { } + public bool? IsReadOnly { get { throw null; } set { } } + public Azure.Compute.Batch.ContainerHostDataPath? Source { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Compute.Batch.ContainerHostBatchBindMountEntry System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Compute.Batch.ContainerHostBatchBindMountEntry System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerHostDataPath : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerHostDataPath(string value) { throw null; } + public static Azure.Compute.Batch.ContainerHostDataPath Applications { get { throw null; } } + public static Azure.Compute.Batch.ContainerHostDataPath JobPrep { get { throw null; } } + public static Azure.Compute.Batch.ContainerHostDataPath Shared { get { throw null; } } + public static Azure.Compute.Batch.ContainerHostDataPath Startup { get { throw null; } } + public static Azure.Compute.Batch.ContainerHostDataPath Task { get { throw null; } } + public static Azure.Compute.Batch.ContainerHostDataPath VfsMounts { get { throw null; } } + public bool Equals(Azure.Compute.Batch.ContainerHostDataPath other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Compute.Batch.ContainerHostDataPath left, Azure.Compute.Batch.ContainerHostDataPath right) { throw null; } + public static implicit operator Azure.Compute.Batch.ContainerHostDataPath (string value) { throw null; } + public static bool operator !=(Azure.Compute.Batch.ContainerHostDataPath left, Azure.Compute.Batch.ContainerHostDataPath right) { throw null; } + public override string ToString() { throw null; } + } public partial class ContainerRegistryReference : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistryReference() { } @@ -2588,7 +2712,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class FileProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal FileProperties() { } - public long ContentLength { get { throw null; } } + public string ContentLength { get { throw null; } } public string ContentType { get { throw null; } } public System.DateTimeOffset? CreationTime { get { throw null; } } public string FileMode { get { throw null; } } @@ -2615,9 +2739,11 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ImageReference : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ImageReference() { } + public string CommunityGalleryImageId { get { throw null; } set { } } public string ExactVersion { get { throw null; } } public string Offer { get { throw null; } set { } } public string Publisher { get { throw null; } set { } } + public string SharedGalleryImageId { get { throw null; } set { } } public string Sku { get { throw null; } set { } } public string Version { get { throw null; } set { } } public string VirtualMachineImageId { get { throw null; } set { } } @@ -2763,8 +2889,9 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer } public partial class ManagedDisk : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ManagedDisk(Azure.Compute.Batch.StorageAccountType storageAccountType) { } - public Azure.Compute.Batch.StorageAccountType StorageAccountType { get { throw null; } set { } } + public ManagedDisk() { } + public Azure.Compute.Batch.VMDiskSecurityProfile SecurityProfile { get { throw null; } set { } } + public Azure.Compute.Batch.StorageAccountType? StorageAccountType { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Compute.Batch.ManagedDisk System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -3109,6 +3236,24 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.Compute.Batch.SchedulingState left, Azure.Compute.Batch.SchedulingState right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SecurityEncryptionTypes : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SecurityEncryptionTypes(string value) { throw null; } + public static Azure.Compute.Batch.SecurityEncryptionTypes NonPersistedTPM { get { throw null; } } + public static Azure.Compute.Batch.SecurityEncryptionTypes VMGuestStateOnly { get { throw null; } } + public bool Equals(Azure.Compute.Batch.SecurityEncryptionTypes other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Compute.Batch.SecurityEncryptionTypes left, Azure.Compute.Batch.SecurityEncryptionTypes right) { throw null; } + public static implicit operator Azure.Compute.Batch.SecurityEncryptionTypes (string value) { throw null; } + public static bool operator !=(Azure.Compute.Batch.SecurityEncryptionTypes left, Azure.Compute.Batch.SecurityEncryptionTypes right) { throw null; } + public override string ToString() { throw null; } + } public partial class SecurityProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public SecurityProfile(bool encryptionAtHost, Azure.Compute.Batch.SecurityTypes securityType, Azure.Compute.Batch.UefiSettings uefiSettings) { } @@ -3128,6 +3273,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly object _dummy; private readonly int _dummyPrimitive; public SecurityTypes(string value) { throw null; } + public static Azure.Compute.Batch.SecurityTypes ConfidentialVM { get { throw null; } } public static Azure.Compute.Batch.SecurityTypes TrustedLaunch { get { throw null; } } public bool Equals(Azure.Compute.Batch.SecurityTypes other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -3332,6 +3478,17 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class VMDiskSecurityProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMDiskSecurityProfile() { } + public Azure.Compute.Batch.SecurityEncryptionTypes? SecurityEncryptionType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Compute.Batch.VMDiskSecurityProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Compute.Batch.VMDiskSecurityProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class VMExtension : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public VMExtension(string name, string publisher, string type) { } diff --git a/sdk/batch/Azure.Compute.Batch/api/Azure.Compute.Batch.netstandard2.0.cs b/sdk/batch/Azure.Compute.Batch/api/Azure.Compute.Batch.netstandard2.0.cs index 94a098ec1bb7..f2e7a58ec245 100644 --- a/sdk/batch/Azure.Compute.Batch/api/Azure.Compute.Batch.netstandard2.0.cs +++ b/sdk/batch/Azure.Compute.Batch/api/Azure.Compute.Batch.netstandard2.0.cs @@ -231,10 +231,14 @@ public BatchClient(System.Uri endpoint, Azure.Core.TokenCredential credential, A public virtual Azure.Response CreateTaskCollection(string jobId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task> CreateTaskCollectionAsync(string jobId, Azure.Compute.Batch.BatchTaskGroup taskCollection, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task CreateTaskCollectionAsync(string jobId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response DeleteJob(string jobId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task DeleteJobAsync(string jobId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response DeleteJobSchedule(string jobScheduleId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task DeleteJobScheduleAsync(string jobScheduleId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response DeallocateNode(string poolId, string nodeId, Azure.Compute.Batch.BatchNodeDeallocateContent parameters = null, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response DeallocateNode(string poolId, string nodeId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeallocateNodeAsync(string poolId, string nodeId, Azure.Compute.Batch.BatchNodeDeallocateContent parameters = null, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeallocateNodeAsync(string poolId, string nodeId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response DeleteJob(string jobId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), bool? force = default(bool?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteJobAsync(string jobId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), bool? force = default(bool?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response DeleteJobSchedule(string jobScheduleId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), bool? force = default(bool?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteJobScheduleAsync(string jobScheduleId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), bool? force = default(bool?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response DeleteNodeFile(string poolId, string nodeId, string filePath, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), bool? recursive = default(bool?), Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task DeleteNodeFileAsync(string poolId, string nodeId, string filePath, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), bool? recursive = default(bool?), Azure.RequestContext context = null) { throw null; } public virtual Azure.Response DeleteNodeUser(string poolId, string nodeId, string userName, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestContext context = null) { throw null; } @@ -389,6 +393,10 @@ public BatchClient(System.Uri endpoint, Azure.Core.TokenCredential credential, A public virtual Azure.Response RebootNode(string poolId, string nodeId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task RebootNodeAsync(string poolId, string nodeId, Azure.Compute.Batch.BatchNodeRebootContent parameters = null, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task RebootNodeAsync(string poolId, string nodeId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response ReimageNode(string poolId, string nodeId, Azure.Compute.Batch.BatchNodeReimageContent parameters = null, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response ReimageNode(string poolId, string nodeId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task ReimageNodeAsync(string poolId, string nodeId, Azure.Compute.Batch.BatchNodeReimageContent parameters = null, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task ReimageNodeAsync(string poolId, string nodeId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestContext context = null) { throw null; } public virtual Azure.Response RemoveNodes(string poolId, Azure.Compute.Batch.BatchNodeRemoveContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response RemoveNodes(string poolId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task RemoveNodesAsync(string poolId, Azure.Compute.Batch.BatchNodeRemoveContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -417,14 +425,16 @@ public BatchClient(System.Uri endpoint, Azure.Core.TokenCredential credential, A public virtual Azure.Response ResizePool(string poolId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task ResizePoolAsync(string poolId, Azure.Compute.Batch.BatchPoolResizeContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task ResizePoolAsync(string poolId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response StartNode(string poolId, string nodeId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task StartNodeAsync(string poolId, string nodeId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestContext context = null) { throw null; } public virtual Azure.Response StopPoolResize(string poolId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task StopPoolResizeAsync(string poolId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response TerminateJob(string jobId, Azure.Compute.Batch.BatchJobTerminateContent parameters = null, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response TerminateJob(string jobId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task TerminateJobAsync(string jobId, Azure.Compute.Batch.BatchJobTerminateContent parameters = null, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task TerminateJobAsync(string jobId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response TerminateJobSchedule(string jobScheduleId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task TerminateJobScheduleAsync(string jobScheduleId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response TerminateJob(string jobId, Azure.Compute.Batch.BatchJobTerminateContent parameters = null, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), bool? force = default(bool?), Azure.RequestConditions requestConditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response TerminateJob(string jobId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), bool? force = default(bool?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task TerminateJobAsync(string jobId, Azure.Compute.Batch.BatchJobTerminateContent parameters = null, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), bool? force = default(bool?), Azure.RequestConditions requestConditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task TerminateJobAsync(string jobId, Azure.Core.RequestContent content, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), bool? force = default(bool?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response TerminateJobSchedule(string jobScheduleId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), bool? force = default(bool?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task TerminateJobScheduleAsync(string jobScheduleId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), bool? force = default(bool?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response TerminateTask(string jobId, string taskId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task TerminateTaskAsync(string jobId, string taskId, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response UpdateJob(string jobId, Azure.Compute.Batch.BatchJobUpdateContent job, int? timeOutInSeconds = default(int?), System.DateTimeOffset? ocpdate = default(System.DateTimeOffset?), Azure.RequestConditions requestConditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -446,10 +456,10 @@ public BatchClient(System.Uri endpoint, Azure.Core.TokenCredential credential, A } public partial class BatchClientOptions : Azure.Core.ClientOptions { - public BatchClientOptions(Azure.Compute.Batch.BatchClientOptions.ServiceVersion version = Azure.Compute.Batch.BatchClientOptions.ServiceVersion.V2024_02_01_19_0) { } + public BatchClientOptions(Azure.Compute.Batch.BatchClientOptions.ServiceVersion version = Azure.Compute.Batch.BatchClientOptions.ServiceVersion.V2024_07_01_20_0) { } public enum ServiceVersion { - V2024_02_01_19_0 = 1, + V2024_07_01_20_0 = 1, } } public partial class BatchError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel @@ -643,7 +653,8 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer } public partial class BatchJobNetworkConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public BatchJobNetworkConfiguration(string subnetId) { } + public BatchJobNetworkConfiguration(string subnetId, bool skipWithdrawFromVNet) { } + public bool SkipWithdrawFromVNet { get { throw null; } set { } } public string SubnetId { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Compute.Batch.BatchJobNetworkConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1009,6 +1020,7 @@ public BatchJobUpdateContent() { } public Azure.Compute.Batch.BatchJobConstraints Constraints { get { throw null; } set { } } public int? MaxParallelTasks { get { throw null; } set { } } public System.Collections.Generic.IList Metadata { get { throw null; } } + public Azure.Compute.Batch.BatchJobNetworkConfiguration NetworkConfiguration { get { throw null; } set { } } public Azure.Compute.Batch.OnAllBatchTasksComplete? OnAllTasksComplete { get { throw null; } set { } } public Azure.Compute.Batch.BatchPoolInfo PoolInfo { get { throw null; } set { } } public int? Priority { get { throw null; } set { } } @@ -1086,6 +1098,8 @@ public partial class BatchNodeCounts : System.ClientModel.Primitives.IJsonModel< { internal BatchNodeCounts() { } public int Creating { get { throw null; } } + public int Deallocated { get { throw null; } } + public int Deallocating { get { throw null; } } public int Idle { get { throw null; } } public int LeavingPool { get { throw null; } } public int Offline { get { throw null; } } @@ -1107,6 +1121,37 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class BatchNodeDeallocateContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BatchNodeDeallocateContent() { } + public Azure.Compute.Batch.BatchNodeDeallocateOption? NodeDeallocateOption { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Compute.Batch.BatchNodeDeallocateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Compute.Batch.BatchNodeDeallocateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct BatchNodeDeallocateOption : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public BatchNodeDeallocateOption(string value) { throw null; } + public static Azure.Compute.Batch.BatchNodeDeallocateOption Requeue { get { throw null; } } + public static Azure.Compute.Batch.BatchNodeDeallocateOption RetainedData { get { throw null; } } + public static Azure.Compute.Batch.BatchNodeDeallocateOption TaskCompletion { get { throw null; } } + public static Azure.Compute.Batch.BatchNodeDeallocateOption Terminate { get { throw null; } } + public bool Equals(Azure.Compute.Batch.BatchNodeDeallocateOption other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Compute.Batch.BatchNodeDeallocateOption left, Azure.Compute.Batch.BatchNodeDeallocateOption right) { throw null; } + public static implicit operator Azure.Compute.Batch.BatchNodeDeallocateOption (string value) { throw null; } + public static bool operator !=(Azure.Compute.Batch.BatchNodeDeallocateOption left, Azure.Compute.Batch.BatchNodeDeallocateOption right) { throw null; } + public override string ToString() { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct BatchNodeDeallocationOption : System.IEquatable { @@ -1300,6 +1345,37 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.Compute.Batch.BatchNodeRebootOption left, Azure.Compute.Batch.BatchNodeRebootOption right) { throw null; } public override string ToString() { throw null; } } + public partial class BatchNodeReimageContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BatchNodeReimageContent() { } + public Azure.Compute.Batch.BatchNodeReimageOption? NodeReimageOption { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Compute.Batch.BatchNodeReimageContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Compute.Batch.BatchNodeReimageContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct BatchNodeReimageOption : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public BatchNodeReimageOption(string value) { throw null; } + public static Azure.Compute.Batch.BatchNodeReimageOption Requeue { get { throw null; } } + public static Azure.Compute.Batch.BatchNodeReimageOption RetainedData { get { throw null; } } + public static Azure.Compute.Batch.BatchNodeReimageOption TaskCompletion { get { throw null; } } + public static Azure.Compute.Batch.BatchNodeReimageOption Terminate { get { throw null; } } + public bool Equals(Azure.Compute.Batch.BatchNodeReimageOption other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Compute.Batch.BatchNodeReimageOption left, Azure.Compute.Batch.BatchNodeReimageOption right) { throw null; } + public static implicit operator Azure.Compute.Batch.BatchNodeReimageOption (string value) { throw null; } + public static bool operator !=(Azure.Compute.Batch.BatchNodeReimageOption left, Azure.Compute.Batch.BatchNodeReimageOption right) { throw null; } + public override string ToString() { throw null; } + } public partial class BatchNodeRemoteLoginSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal BatchNodeRemoteLoginSettings() { } @@ -1332,6 +1408,8 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly int _dummyPrimitive; public BatchNodeState(string value) { throw null; } public static Azure.Compute.Batch.BatchNodeState Creating { get { throw null; } } + public static Azure.Compute.Batch.BatchNodeState Deallocated { get { throw null; } } + public static Azure.Compute.Batch.BatchNodeState Deallocating { get { throw null; } } public static Azure.Compute.Batch.BatchNodeState Idle { get { throw null; } } public static Azure.Compute.Batch.BatchNodeState LeavingPool { get { throw null; } } public static Azure.Compute.Batch.BatchNodeState Offline { get { throw null; } } @@ -1701,9 +1779,20 @@ public partial class BatchPoolUpdateContent : System.ClientModel.Primitives.IJso { public BatchPoolUpdateContent() { } public System.Collections.Generic.IList ApplicationPackageReferences { get { throw null; } } + public string DisplayName { get { throw null; } set { } } + public bool? EnableInterNodeCommunication { get { throw null; } set { } } public System.Collections.Generic.IList Metadata { get { throw null; } } + public System.Collections.Generic.IList MountConfiguration { get { throw null; } } + public Azure.Compute.Batch.NetworkConfiguration NetworkConfiguration { get { throw null; } set { } } + public System.Collections.Generic.IDictionary ResourceTags { get { throw null; } } public Azure.Compute.Batch.BatchStartTask StartTask { get { throw null; } set { } } public Azure.Compute.Batch.BatchNodeCommunicationMode? TargetNodeCommunicationMode { get { throw null; } set { } } + public Azure.Compute.Batch.BatchTaskSchedulingPolicy TaskSchedulingPolicy { get { throw null; } set { } } + public int? TaskSlotsPerNode { get { throw null; } set { } } + public Azure.Compute.Batch.UpgradePolicy UpgradePolicy { get { throw null; } set { } } + public System.Collections.Generic.IList UserAccounts { get { throw null; } } + public Azure.Compute.Batch.VirtualMachineConfiguration VirtualMachineConfiguration { get { throw null; } set { } } + public string VmSize { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Compute.Batch.BatchPoolUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1962,6 +2051,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class BatchTaskContainerSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public BatchTaskContainerSettings(string imageName) { } + public System.Collections.Generic.IList ContainerHostBatchBindMounts { get { throw null; } } public string ContainerRunOptions { get { throw null; } set { } } public string ImageName { get { throw null; } set { } } public Azure.Compute.Batch.ContainerRegistryReference Registry { get { throw null; } set { } } @@ -2252,7 +2342,7 @@ public static partial class ComputeBatchModelFactory public static Azure.Compute.Batch.BatchJobStatistics BatchJobStatistics(string url = null, System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdateTime = default(System.DateTimeOffset), System.TimeSpan userCpuTime = default(System.TimeSpan), System.TimeSpan kernelCpuTime = default(System.TimeSpan), System.TimeSpan wallClockTime = default(System.TimeSpan), long readIOps = (long)0, long writeIOps = (long)0, float readIOGiB = 0f, float writeIOGiB = 0f, long numSucceededTasks = (long)0, long numFailedTasks = (long)0, long numTaskRetries = (long)0, System.TimeSpan waitTime = default(System.TimeSpan)) { throw null; } public static Azure.Compute.Batch.BatchNode BatchNode(string id = null, string url = null, Azure.Compute.Batch.BatchNodeState? state = default(Azure.Compute.Batch.BatchNodeState?), Azure.Compute.Batch.SchedulingState? schedulingState = default(Azure.Compute.Batch.SchedulingState?), System.DateTimeOffset? stateTransitionTime = default(System.DateTimeOffset?), System.DateTimeOffset? lastBootTime = default(System.DateTimeOffset?), System.DateTimeOffset? allocationTime = default(System.DateTimeOffset?), string ipAddress = null, string affinityId = null, string vmSize = null, int? totalTasksRun = default(int?), int? runningTasksCount = default(int?), int? runningTaskSlotsCount = default(int?), int? totalTasksSucceeded = default(int?), System.Collections.Generic.IEnumerable recentTasks = null, Azure.Compute.Batch.BatchStartTask startTask = null, Azure.Compute.Batch.BatchStartTaskInfo startTaskInfo = null, System.Collections.Generic.IEnumerable errors = null, bool? isDedicated = default(bool?), Azure.Compute.Batch.BatchNodeEndpointConfiguration endpointConfiguration = null, Azure.Compute.Batch.BatchNodeAgentInfo nodeAgentInfo = null, Azure.Compute.Batch.VirtualMachineInfo virtualMachineInfo = null) { throw null; } public static Azure.Compute.Batch.BatchNodeAgentInfo BatchNodeAgentInfo(string version = null, System.DateTimeOffset lastUpdateTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Compute.Batch.BatchNodeCounts BatchNodeCounts(int creating = 0, int idle = 0, int offline = 0, int preempted = 0, int rebooting = 0, int reimaging = 0, int running = 0, int starting = 0, int startTaskFailed = 0, int leavingPool = 0, int unknown = 0, int unusable = 0, int waitingForStartTask = 0, int total = 0, int upgradingOs = 0) { throw null; } + public static Azure.Compute.Batch.BatchNodeCounts BatchNodeCounts(int creating = 0, int idle = 0, int offline = 0, int preempted = 0, int rebooting = 0, int reimaging = 0, int running = 0, int starting = 0, int startTaskFailed = 0, int leavingPool = 0, int unknown = 0, int unusable = 0, int waitingForStartTask = 0, int deallocated = 0, int deallocating = 0, int total = 0, int upgradingOs = 0) { throw null; } public static Azure.Compute.Batch.BatchNodeEndpointConfiguration BatchNodeEndpointConfiguration(System.Collections.Generic.IEnumerable inboundEndpoints = null) { throw null; } public static Azure.Compute.Batch.BatchNodeError BatchNodeError(string code = null, string message = null, System.Collections.Generic.IEnumerable errorDetails = null) { throw null; } public static Azure.Compute.Batch.BatchNodeFile BatchNodeFile(string name = null, string url = null, bool? isDirectory = default(bool?), Azure.Compute.Batch.FileProperties properties = null) { throw null; } @@ -2283,8 +2373,8 @@ public static partial class ComputeBatchModelFactory public static Azure.Compute.Batch.BatchTaskInfo BatchTaskInfo(string taskUrl = null, string jobId = null, string taskId = null, int? subtaskId = default(int?), Azure.Compute.Batch.BatchTaskState taskState = default(Azure.Compute.Batch.BatchTaskState), Azure.Compute.Batch.BatchTaskExecutionInfo executionInfo = null) { throw null; } public static Azure.Compute.Batch.BatchTaskSlotCounts BatchTaskSlotCounts(int active = 0, int running = 0, int completed = 0, int succeeded = 0, int failed = 0) { throw null; } public static Azure.Compute.Batch.BatchTaskStatistics BatchTaskStatistics(string url = null, System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdateTime = default(System.DateTimeOffset), System.TimeSpan userCpuTime = default(System.TimeSpan), System.TimeSpan kernelCpuTime = default(System.TimeSpan), System.TimeSpan wallClockTime = default(System.TimeSpan), long readIOps = (long)0, long writeIOps = (long)0, float readIOGiB = 0f, float writeIOGiB = 0f, System.TimeSpan waitTime = default(System.TimeSpan)) { throw null; } - public static Azure.Compute.Batch.FileProperties FileProperties(System.DateTimeOffset? creationTime = default(System.DateTimeOffset?), System.DateTimeOffset lastModified = default(System.DateTimeOffset), long contentLength = (long)0, string contentType = null, string fileMode = null) { throw null; } - public static Azure.Compute.Batch.ImageReference ImageReference(string publisher = null, string offer = null, string sku = null, string version = null, string virtualMachineImageId = null, string exactVersion = null) { throw null; } + public static Azure.Compute.Batch.FileProperties FileProperties(System.DateTimeOffset? creationTime = default(System.DateTimeOffset?), System.DateTimeOffset lastModified = default(System.DateTimeOffset), string contentLength = null, string contentType = null, string fileMode = null) { throw null; } + public static Azure.Compute.Batch.ImageReference ImageReference(string publisher = null, string offer = null, string sku = null, string version = null, string virtualMachineImageId = null, string exactVersion = null, string sharedGalleryImageId = null, string communityGalleryImageId = null) { throw null; } public static Azure.Compute.Batch.InboundEndpoint InboundEndpoint(string name = null, Azure.Compute.Batch.InboundEndpointProtocol protocol = default(Azure.Compute.Batch.InboundEndpointProtocol), string publicIpAddress = null, string publicFQDN = null, int frontendPort = 0, int backendPort = 0) { throw null; } public static Azure.Compute.Batch.InstanceViewStatus InstanceViewStatus(string code = null, string displayStatus = null, Azure.Compute.Batch.StatusLevelTypes? level = default(Azure.Compute.Batch.StatusLevelTypes?), string message = null, System.DateTimeOffset? time = default(System.DateTimeOffset?)) { throw null; } public static Azure.Compute.Batch.NameValuePair NameValuePair(string name = null, string value = null) { throw null; } @@ -2309,6 +2399,40 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerHostBatchBindMountEntry : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerHostBatchBindMountEntry() { } + public bool? IsReadOnly { get { throw null; } set { } } + public Azure.Compute.Batch.ContainerHostDataPath? Source { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Compute.Batch.ContainerHostBatchBindMountEntry System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Compute.Batch.ContainerHostBatchBindMountEntry System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerHostDataPath : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerHostDataPath(string value) { throw null; } + public static Azure.Compute.Batch.ContainerHostDataPath Applications { get { throw null; } } + public static Azure.Compute.Batch.ContainerHostDataPath JobPrep { get { throw null; } } + public static Azure.Compute.Batch.ContainerHostDataPath Shared { get { throw null; } } + public static Azure.Compute.Batch.ContainerHostDataPath Startup { get { throw null; } } + public static Azure.Compute.Batch.ContainerHostDataPath Task { get { throw null; } } + public static Azure.Compute.Batch.ContainerHostDataPath VfsMounts { get { throw null; } } + public bool Equals(Azure.Compute.Batch.ContainerHostDataPath other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Compute.Batch.ContainerHostDataPath left, Azure.Compute.Batch.ContainerHostDataPath right) { throw null; } + public static implicit operator Azure.Compute.Batch.ContainerHostDataPath (string value) { throw null; } + public static bool operator !=(Azure.Compute.Batch.ContainerHostDataPath left, Azure.Compute.Batch.ContainerHostDataPath right) { throw null; } + public override string ToString() { throw null; } + } public partial class ContainerRegistryReference : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerRegistryReference() { } @@ -2588,7 +2712,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class FileProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal FileProperties() { } - public long ContentLength { get { throw null; } } + public string ContentLength { get { throw null; } } public string ContentType { get { throw null; } } public System.DateTimeOffset? CreationTime { get { throw null; } } public string FileMode { get { throw null; } } @@ -2615,9 +2739,11 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ImageReference : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ImageReference() { } + public string CommunityGalleryImageId { get { throw null; } set { } } public string ExactVersion { get { throw null; } } public string Offer { get { throw null; } set { } } public string Publisher { get { throw null; } set { } } + public string SharedGalleryImageId { get { throw null; } set { } } public string Sku { get { throw null; } set { } } public string Version { get { throw null; } set { } } public string VirtualMachineImageId { get { throw null; } set { } } @@ -2763,8 +2889,9 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer } public partial class ManagedDisk : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ManagedDisk(Azure.Compute.Batch.StorageAccountType storageAccountType) { } - public Azure.Compute.Batch.StorageAccountType StorageAccountType { get { throw null; } set { } } + public ManagedDisk() { } + public Azure.Compute.Batch.VMDiskSecurityProfile SecurityProfile { get { throw null; } set { } } + public Azure.Compute.Batch.StorageAccountType? StorageAccountType { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Compute.Batch.ManagedDisk System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -3109,6 +3236,24 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.Compute.Batch.SchedulingState left, Azure.Compute.Batch.SchedulingState right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SecurityEncryptionTypes : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SecurityEncryptionTypes(string value) { throw null; } + public static Azure.Compute.Batch.SecurityEncryptionTypes NonPersistedTPM { get { throw null; } } + public static Azure.Compute.Batch.SecurityEncryptionTypes VMGuestStateOnly { get { throw null; } } + public bool Equals(Azure.Compute.Batch.SecurityEncryptionTypes other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Compute.Batch.SecurityEncryptionTypes left, Azure.Compute.Batch.SecurityEncryptionTypes right) { throw null; } + public static implicit operator Azure.Compute.Batch.SecurityEncryptionTypes (string value) { throw null; } + public static bool operator !=(Azure.Compute.Batch.SecurityEncryptionTypes left, Azure.Compute.Batch.SecurityEncryptionTypes right) { throw null; } + public override string ToString() { throw null; } + } public partial class SecurityProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public SecurityProfile(bool encryptionAtHost, Azure.Compute.Batch.SecurityTypes securityType, Azure.Compute.Batch.UefiSettings uefiSettings) { } @@ -3128,6 +3273,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly object _dummy; private readonly int _dummyPrimitive; public SecurityTypes(string value) { throw null; } + public static Azure.Compute.Batch.SecurityTypes ConfidentialVM { get { throw null; } } public static Azure.Compute.Batch.SecurityTypes TrustedLaunch { get { throw null; } } public bool Equals(Azure.Compute.Batch.SecurityTypes other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -3332,6 +3478,17 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class VMDiskSecurityProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMDiskSecurityProfile() { } + public Azure.Compute.Batch.SecurityEncryptionTypes? SecurityEncryptionType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Compute.Batch.VMDiskSecurityProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Compute.Batch.VMDiskSecurityProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class VMExtension : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public VMExtension(string name, string publisher, string type) { } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/AutomaticOsUpgradePolicy.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/AutomaticOsUpgradePolicy.cs index a55f474ba013..c3b9be08a2f0 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/AutomaticOsUpgradePolicy.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/AutomaticOsUpgradePolicy.cs @@ -52,7 +52,7 @@ public AutomaticOsUpgradePolicy() /// Initializes a new instance of . /// Whether OS image rollback feature should be disabled. - /// Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. <br /><br /> If this is set to true for Windows based pools, [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/en-us/rest/api/batchservice/pool/add?tabs=HTTP#windowsconfiguration) cannot be set to true. + /// Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. <br /><br /> If this is set to true for Windows based pools, [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/rest/api/batchservice/pool/add?tabs=HTTP#windowsconfiguration) cannot be set to true. /// Indicates whether rolling upgrade policy should be used during Auto OS Upgrade. Auto OS Upgrade will fallback to the default policy if no policy is defined on the VMSS. /// Defer OS upgrades on the TVMs if they are running tasks. /// Keeps track of any properties unknown to the library. @@ -67,7 +67,7 @@ internal AutomaticOsUpgradePolicy(bool? disableAutomaticRollback, bool? enableAu /// Whether OS image rollback feature should be disabled. public bool? DisableAutomaticRollback { get; set; } - /// Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. <br /><br /> If this is set to true for Windows based pools, [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/en-us/rest/api/batchservice/pool/add?tabs=HTTP#windowsconfiguration) cannot be set to true. + /// Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. <br /><br /> If this is set to true for Windows based pools, [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/rest/api/batchservice/pool/add?tabs=HTTP#windowsconfiguration) cannot be set to true. public bool? EnableAutomaticOsUpgrade { get; set; } /// Indicates whether rolling upgrade policy should be used during Auto OS Upgrade. Auto OS Upgrade will fallback to the default policy if no policy is defined on the VMSS. public bool? UseRollingUpgradePolicy { get; set; } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchClient.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchClient.cs index 47672eb0c12f..7e5fe5063d76 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchClient.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchClient.cs @@ -1656,14 +1656,15 @@ public virtual Response RemoveNodes(string poolId, RequestContent content, int? /// current system clock time; set it explicitly if you are calling the REST API /// directly. /// + /// If true, the server will delete the Job even if the corresponding nodes have not fully processed the deletion. The default value is false. /// The content to send as the request conditions of the request. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. /// is null. /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual async Task DeleteJobAsync(string jobId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null) + /// + public virtual async Task DeleteJobAsync(string jobId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, bool? force = null, RequestConditions requestConditions = null, RequestContext context = null) { Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); @@ -1671,7 +1672,7 @@ public virtual async Task DeleteJobAsync(string jobId, int? timeOutInS scope.Start(); try { - using HttpMessage message = CreateDeleteJobRequest(jobId, timeOutInSeconds, ocpdate, requestConditions, context); + using HttpMessage message = CreateDeleteJobRequest(jobId, timeOutInSeconds, ocpdate, force, requestConditions, context); return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); } catch (Exception e) @@ -1699,14 +1700,15 @@ public virtual async Task DeleteJobAsync(string jobId, int? timeOutInS /// current system clock time; set it explicitly if you are calling the REST API /// directly. /// + /// If true, the server will delete the Job even if the corresponding nodes have not fully processed the deletion. The default value is false. /// The content to send as the request conditions of the request. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. /// is null. /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual Response DeleteJob(string jobId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null) + /// + public virtual Response DeleteJob(string jobId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, bool? force = null, RequestConditions requestConditions = null, RequestContext context = null) { Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); @@ -1714,7 +1716,7 @@ public virtual Response DeleteJob(string jobId, int? timeOutInSeconds = null, Da scope.Start(); try { - using HttpMessage message = CreateDeleteJobRequest(jobId, timeOutInSeconds, ocpdate, requestConditions, context); + using HttpMessage message = CreateDeleteJobRequest(jobId, timeOutInSeconds, ocpdate, force, requestConditions, context); return _pipeline.ProcessMessage(message, context); } catch (Exception e) @@ -2379,6 +2381,7 @@ public virtual Response EnableJob(string jobId, int? timeOutInSeconds = null, Da /// current system clock time; set it explicitly if you are calling the REST API /// directly. /// + /// If true, the server will terminate the Job even if the corresponding nodes have not fully processed the termination. The default value is false. /// The content to send as the request conditions of the request. /// The cancellation token to use. /// is null. @@ -2391,14 +2394,14 @@ public virtual Response EnableJob(string jobId, int? timeOutInSeconds = null, Da /// state, they will remain in the active state. Once a Job is terminated, new /// Tasks cannot be added and any remaining active Tasks will not be scheduled. /// - /// - public virtual async Task TerminateJobAsync(string jobId, BatchJobTerminateContent parameters = null, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, CancellationToken cancellationToken = default) + /// + public virtual async Task TerminateJobAsync(string jobId, BatchJobTerminateContent parameters = null, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, bool? force = null, RequestConditions requestConditions = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); using RequestContent content = parameters?.ToRequestContent(); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await TerminateJobAsync(jobId, content, timeOutInSeconds, ocpdate, requestConditions, context).ConfigureAwait(false); + Response response = await TerminateJobAsync(jobId, content, timeOutInSeconds, ocpdate, force, requestConditions, context).ConfigureAwait(false); return response; } @@ -2411,6 +2414,7 @@ public virtual async Task TerminateJobAsync(string jobId, BatchJobTerm /// current system clock time; set it explicitly if you are calling the REST API /// directly. /// + /// If true, the server will terminate the Job even if the corresponding nodes have not fully processed the termination. The default value is false. /// The content to send as the request conditions of the request. /// The cancellation token to use. /// is null. @@ -2423,14 +2427,14 @@ public virtual async Task TerminateJobAsync(string jobId, BatchJobTerm /// state, they will remain in the active state. Once a Job is terminated, new /// Tasks cannot be added and any remaining active Tasks will not be scheduled. /// - /// - public virtual Response TerminateJob(string jobId, BatchJobTerminateContent parameters = null, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, CancellationToken cancellationToken = default) + /// + public virtual Response TerminateJob(string jobId, BatchJobTerminateContent parameters = null, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, bool? force = null, RequestConditions requestConditions = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); using RequestContent content = parameters?.ToRequestContent(); RequestContext context = FromCancellationToken(cancellationToken); - Response response = TerminateJob(jobId, content, timeOutInSeconds, ocpdate, requestConditions, context); + Response response = TerminateJob(jobId, content, timeOutInSeconds, ocpdate, force, requestConditions, context); return response; } @@ -2444,7 +2448,7 @@ public virtual Response TerminateJob(string jobId, BatchJobTerminateContent para /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -2457,14 +2461,15 @@ public virtual Response TerminateJob(string jobId, BatchJobTerminateContent para /// current system clock time; set it explicitly if you are calling the REST API /// directly. /// + /// If true, the server will terminate the Job even if the corresponding nodes have not fully processed the termination. The default value is false. /// The content to send as the request conditions of the request. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. /// is null. /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual async Task TerminateJobAsync(string jobId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null) + /// + public virtual async Task TerminateJobAsync(string jobId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, bool? force = null, RequestConditions requestConditions = null, RequestContext context = null) { Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); @@ -2472,7 +2477,7 @@ public virtual async Task TerminateJobAsync(string jobId, RequestConte scope.Start(); try { - using HttpMessage message = CreateTerminateJobRequest(jobId, content, timeOutInSeconds, ocpdate, requestConditions, context); + using HttpMessage message = CreateTerminateJobRequest(jobId, content, timeOutInSeconds, ocpdate, force, requestConditions, context); return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); } catch (Exception e) @@ -2492,7 +2497,7 @@ public virtual async Task TerminateJobAsync(string jobId, RequestConte /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -2505,14 +2510,15 @@ public virtual async Task TerminateJobAsync(string jobId, RequestConte /// current system clock time; set it explicitly if you are calling the REST API /// directly. /// + /// If true, the server will terminate the Job even if the corresponding nodes have not fully processed the termination. The default value is false. /// The content to send as the request conditions of the request. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. /// is null. /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual Response TerminateJob(string jobId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null) + /// + public virtual Response TerminateJob(string jobId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, bool? force = null, RequestConditions requestConditions = null, RequestContext context = null) { Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); @@ -2520,7 +2526,7 @@ public virtual Response TerminateJob(string jobId, RequestContent content, int? scope.Start(); try { - using HttpMessage message = CreateTerminateJobRequest(jobId, content, timeOutInSeconds, ocpdate, requestConditions, context); + using HttpMessage message = CreateTerminateJobRequest(jobId, content, timeOutInSeconds, ocpdate, force, requestConditions, context); return _pipeline.ProcessMessage(message, context); } catch (Exception e) @@ -2848,14 +2854,15 @@ public virtual Response GetJobTaskCounts(string jobId, int? timeOutInSeconds, Da /// current system clock time; set it explicitly if you are calling the REST API /// directly. /// + /// If true, the server will delete the JobSchedule even if the corresponding nodes have not fully processed the deletion. The default value is false. /// The content to send as the request conditions of the request. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. /// is null. /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual async Task DeleteJobScheduleAsync(string jobScheduleId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null) + /// + public virtual async Task DeleteJobScheduleAsync(string jobScheduleId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, bool? force = null, RequestConditions requestConditions = null, RequestContext context = null) { Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId)); @@ -2863,7 +2870,7 @@ public virtual async Task DeleteJobScheduleAsync(string jobScheduleId, scope.Start(); try { - using HttpMessage message = CreateDeleteJobScheduleRequest(jobScheduleId, timeOutInSeconds, ocpdate, requestConditions, context); + using HttpMessage message = CreateDeleteJobScheduleRequest(jobScheduleId, timeOutInSeconds, ocpdate, force, requestConditions, context); return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); } catch (Exception e) @@ -2891,14 +2898,15 @@ public virtual async Task DeleteJobScheduleAsync(string jobScheduleId, /// current system clock time; set it explicitly if you are calling the REST API /// directly. /// + /// If true, the server will delete the JobSchedule even if the corresponding nodes have not fully processed the deletion. The default value is false. /// The content to send as the request conditions of the request. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. /// is null. /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual Response DeleteJobSchedule(string jobScheduleId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null) + /// + public virtual Response DeleteJobSchedule(string jobScheduleId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, bool? force = null, RequestConditions requestConditions = null, RequestContext context = null) { Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId)); @@ -2906,7 +2914,7 @@ public virtual Response DeleteJobSchedule(string jobScheduleId, int? timeOutInSe scope.Start(); try { - using HttpMessage message = CreateDeleteJobScheduleRequest(jobScheduleId, timeOutInSeconds, ocpdate, requestConditions, context); + using HttpMessage message = CreateDeleteJobScheduleRequest(jobScheduleId, timeOutInSeconds, ocpdate, force, requestConditions, context); return _pipeline.ProcessMessage(message, context); } catch (Exception e) @@ -3502,14 +3510,15 @@ public virtual Response EnableJobSchedule(string jobScheduleId, int? timeOutInSe /// current system clock time; set it explicitly if you are calling the REST API /// directly. /// + /// If true, the server will terminate the JobSchedule even if the corresponding nodes have not fully processed the termination. The default value is false. /// The content to send as the request conditions of the request. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. /// is null. /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual async Task TerminateJobScheduleAsync(string jobScheduleId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null) + /// + public virtual async Task TerminateJobScheduleAsync(string jobScheduleId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, bool? force = null, RequestConditions requestConditions = null, RequestContext context = null) { Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId)); @@ -3517,7 +3526,7 @@ public virtual async Task TerminateJobScheduleAsync(string jobSchedule scope.Start(); try { - using HttpMessage message = CreateTerminateJobScheduleRequest(jobScheduleId, timeOutInSeconds, ocpdate, requestConditions, context); + using HttpMessage message = CreateTerminateJobScheduleRequest(jobScheduleId, timeOutInSeconds, ocpdate, force, requestConditions, context); return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); } catch (Exception e) @@ -3545,14 +3554,15 @@ public virtual async Task TerminateJobScheduleAsync(string jobSchedule /// current system clock time; set it explicitly if you are calling the REST API /// directly. /// + /// If true, the server will terminate the JobSchedule even if the corresponding nodes have not fully processed the termination. The default value is false. /// The content to send as the request conditions of the request. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. /// is null. /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual Response TerminateJobSchedule(string jobScheduleId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null) + /// + public virtual Response TerminateJobSchedule(string jobScheduleId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, bool? force = null, RequestConditions requestConditions = null, RequestContext context = null) { Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId)); @@ -3560,7 +3570,7 @@ public virtual Response TerminateJobSchedule(string jobScheduleId, int? timeOutI scope.Start(); try { - using HttpMessage message = CreateTerminateJobScheduleRequest(jobScheduleId, timeOutInSeconds, ocpdate, requestConditions, context); + using HttpMessage message = CreateTerminateJobScheduleRequest(jobScheduleId, timeOutInSeconds, ocpdate, force, requestConditions, context); return _pipeline.ProcessMessage(message, context); } catch (Exception e) @@ -5746,6 +5756,402 @@ public virtual Response RebootNode(string poolId, string nodeId, RequestContent } } + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Starts the specified Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node that you want to restart. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + /// + /// The time the request was issued. Client libraries typically set this to the + /// current system clock time; set it explicitly if you are calling the REST API + /// directly. + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task StartNodeAsync(string poolId, string nodeId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + + using var scope = ClientDiagnostics.CreateScope("BatchClient.StartNode"); + scope.Start(); + try + { + using HttpMessage message = CreateStartNodeRequest(poolId, nodeId, timeOutInSeconds, ocpdate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Starts the specified Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node that you want to restart. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + /// + /// The time the request was issued. Client libraries typically set this to the + /// current system clock time; set it explicitly if you are calling the REST API + /// directly. + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response StartNode(string poolId, string nodeId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + + using var scope = ClientDiagnostics.CreateScope("BatchClient.StartNode"); + scope.Start(); + try + { + using HttpMessage message = CreateStartNodeRequest(poolId, nodeId, timeOutInSeconds, ocpdate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Reinstalls the operating system on the specified Compute Node. + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node that you want to restart. + /// The options to use for reimaging the Compute Node. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + /// + /// The time the request was issued. Client libraries typically set this to the + /// current system clock time; set it explicitly if you are calling the REST API + /// directly. + /// + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + /// You can reinstall the operating system on a Compute Node only if it is in an + /// idle or running state. This API can be invoked only on Pools created with the + /// cloud service configuration property. + /// + /// + public virtual async Task ReimageNodeAsync(string poolId, string nodeId, BatchNodeReimageContent parameters = null, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + + using RequestContent content = parameters?.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await ReimageNodeAsync(poolId, nodeId, content, timeOutInSeconds, ocpdate, context).ConfigureAwait(false); + return response; + } + + /// Reinstalls the operating system on the specified Compute Node. + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node that you want to restart. + /// The options to use for reimaging the Compute Node. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + /// + /// The time the request was issued. Client libraries typically set this to the + /// current system clock time; set it explicitly if you are calling the REST API + /// directly. + /// + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + /// You can reinstall the operating system on a Compute Node only if it is in an + /// idle or running state. This API can be invoked only on Pools created with the + /// cloud service configuration property. + /// + /// + public virtual Response ReimageNode(string poolId, string nodeId, BatchNodeReimageContent parameters = null, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + + using RequestContent content = parameters?.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = ReimageNode(poolId, nodeId, content, timeOutInSeconds, ocpdate, context); + return response; + } + + /// + /// [Protocol Method] Reinstalls the operating system on the specified Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node that you want to restart. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + /// + /// The time the request was issued. Client libraries typically set this to the + /// current system clock time; set it explicitly if you are calling the REST API + /// directly. + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task ReimageNodeAsync(string poolId, string nodeId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + + using var scope = ClientDiagnostics.CreateScope("BatchClient.ReimageNode"); + scope.Start(); + try + { + using HttpMessage message = CreateReimageNodeRequest(poolId, nodeId, content, timeOutInSeconds, ocpdate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Reinstalls the operating system on the specified Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node that you want to restart. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + /// + /// The time the request was issued. Client libraries typically set this to the + /// current system clock time; set it explicitly if you are calling the REST API + /// directly. + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response ReimageNode(string poolId, string nodeId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + + using var scope = ClientDiagnostics.CreateScope("BatchClient.ReimageNode"); + scope.Start(); + try + { + using HttpMessage message = CreateReimageNodeRequest(poolId, nodeId, content, timeOutInSeconds, ocpdate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Deallocates the specified Compute Node. + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node that you want to restart. + /// The options to use for deallocating the Compute Node. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + /// + /// The time the request was issued. Client libraries typically set this to the + /// current system clock time; set it explicitly if you are calling the REST API + /// directly. + /// + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// You can deallocate a Compute Node only if it is in an idle or running state. + /// + public virtual async Task DeallocateNodeAsync(string poolId, string nodeId, BatchNodeDeallocateContent parameters = null, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + + using RequestContent content = parameters?.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await DeallocateNodeAsync(poolId, nodeId, content, timeOutInSeconds, ocpdate, context).ConfigureAwait(false); + return response; + } + + /// Deallocates the specified Compute Node. + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node that you want to restart. + /// The options to use for deallocating the Compute Node. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + /// + /// The time the request was issued. Client libraries typically set this to the + /// current system clock time; set it explicitly if you are calling the REST API + /// directly. + /// + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// You can deallocate a Compute Node only if it is in an idle or running state. + /// + public virtual Response DeallocateNode(string poolId, string nodeId, BatchNodeDeallocateContent parameters = null, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + + using RequestContent content = parameters?.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = DeallocateNode(poolId, nodeId, content, timeOutInSeconds, ocpdate, context); + return response; + } + + /// + /// [Protocol Method] Deallocates the specified Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node that you want to restart. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + /// + /// The time the request was issued. Client libraries typically set this to the + /// current system clock time; set it explicitly if you are calling the REST API + /// directly. + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DeallocateNodeAsync(string poolId, string nodeId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + + using var scope = ClientDiagnostics.CreateScope("BatchClient.DeallocateNode"); + scope.Start(); + try + { + using HttpMessage message = CreateDeallocateNodeRequest(poolId, nodeId, content, timeOutInSeconds, ocpdate, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Deallocates the specified Compute Node. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The ID of the Pool that contains the Compute Node. + /// The ID of the Compute Node that you want to restart. + /// The content to send as the body of the request. + /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". + /// + /// The time the request was issued. Client libraries typically set this to the + /// current system clock time; set it explicitly if you are calling the REST API + /// directly. + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response DeallocateNode(string poolId, string nodeId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(poolId, nameof(poolId)); + Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId)); + + using var scope = ClientDiagnostics.CreateScope("BatchClient.DeallocateNode"); + scope.Start(); + try + { + using HttpMessage message = CreateDeallocateNodeRequest(poolId, nodeId, content, timeOutInSeconds, ocpdate, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// Disables Task scheduling on the specified Compute Node. /// The ID of the Pool that contains the Compute Node. /// The ID of the Compute Node on which you want to disable Task scheduling. @@ -6003,9 +6409,8 @@ public virtual Response EnableNodeScheduling(string poolId, string nodeId, int? /// or is null. /// or is an empty string, and was expected to be non-empty. /// - /// Before you can remotely login to a Compute Node using the remote login - /// settings, you must create a user Account on the Compute Node. This API can be - /// invoked only on Pools created with the virtual machine configuration property. + /// Before you can remotely login to a Compute Node using the remote login settings, + /// you must create a user Account on the Compute Node. /// /// public virtual async Task> GetNodeRemoteLoginSettingsAsync(string poolId, string nodeId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default) @@ -6031,9 +6436,8 @@ public virtual async Task> GetNodeRemoteL /// or is null. /// or is an empty string, and was expected to be non-empty. /// - /// Before you can remotely login to a Compute Node using the remote login - /// settings, you must create a user Account on the Compute Node. This API can be - /// invoked only on Pools created with the virtual machine configuration property. + /// Before you can remotely login to a Compute Node using the remote login settings, + /// you must create a user Account on the Compute Node. /// /// public virtual Response GetNodeRemoteLoginSettings(string poolId, string nodeId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default) @@ -7036,7 +7440,7 @@ public virtual Pageable GetApplications(int? timeOutInSeconds, DateT /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-account-usage-metrics. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-account-usage-metrics. /// /// The cancellation token to use. /// @@ -7082,7 +7486,7 @@ public virtual AsyncPageable GetPoolUsageMetricsAsync(int /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-account-usage-metrics. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-account-usage-metrics. /// /// The cancellation token to use. /// @@ -7140,7 +7544,7 @@ public virtual Pageable GetPoolUsageMetrics(int? timeOutI /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-account-usage-metrics. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-account-usage-metrics. /// /// The request context, which can override default behaviors of the client pipeline on a per-call basis. /// Service returned a non-success status code. @@ -7191,7 +7595,7 @@ public virtual AsyncPageable GetPoolUsageMetricsAsync(int? timeOutIn /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-account-usage-metrics. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-account-usage-metrics. /// /// The request context, which can override default behaviors of the client pipeline on a per-call basis. /// Service returned a non-success status code. @@ -7204,7 +7608,7 @@ public virtual Pageable GetPoolUsageMetrics(int? timeOutInSeconds, D return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "BatchClient.GetPoolUsageMetrics", "value", "odata.nextLink", context); } - /// Lists all of the Pools in the specified Account. + /// Lists all of the Pools which be mounted. /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". /// /// The time the request was issued. Client libraries typically set this to the @@ -7217,7 +7621,7 @@ public virtual Pageable GetPoolUsageMetrics(int? timeOutInSeconds, D /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-pools. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-pools. /// /// An OData $select clause. /// An OData $expand clause. @@ -7231,7 +7635,7 @@ public virtual AsyncPageable GetPoolsAsync(int? timeOutInSeconds = nu return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BatchPool.DeserializeBatchPool(e), ClientDiagnostics, _pipeline, "BatchClient.GetPools", "value", "odata.nextLink", context); } - /// Lists all of the Pools in the specified Account. + /// Lists all of the Pools which be mounted. /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". /// /// The time the request was issued. Client libraries typically set this to the @@ -7244,7 +7648,7 @@ public virtual AsyncPageable GetPoolsAsync(int? timeOutInSeconds = nu /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-pools. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-pools. /// /// An OData $select clause. /// An OData $expand clause. @@ -7259,7 +7663,7 @@ public virtual Pageable GetPools(int? timeOutInSeconds = null, DateTi } /// - /// [Protocol Method] Lists all of the Pools in the specified Account. + /// [Protocol Method] Lists all of the Pools which be mounted. /// /// /// @@ -7285,7 +7689,7 @@ public virtual Pageable GetPools(int? timeOutInSeconds = null, DateTi /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-pools. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-pools. /// /// An OData $select clause. /// An OData $expand clause. @@ -7301,7 +7705,7 @@ public virtual AsyncPageable GetPoolsAsync(int? timeOutInSeconds, Da } /// - /// [Protocol Method] Lists all of the Pools in the specified Account. + /// [Protocol Method] Lists all of the Pools which be mounted. /// /// /// @@ -7327,7 +7731,7 @@ public virtual AsyncPageable GetPoolsAsync(int? timeOutInSeconds, Da /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-pools. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-pools. /// /// An OData $select clause. /// An OData $expand clause. @@ -7355,7 +7759,7 @@ public virtual Pageable GetPools(int? timeOutInSeconds, DateTimeOffs /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-support-images. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-support-images. /// /// The cancellation token to use. /// @@ -7380,7 +7784,7 @@ public virtual AsyncPageable GetSupportedImagesAsync(int? t /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-support-images. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-support-images. /// /// The cancellation token to use. /// @@ -7419,7 +7823,7 @@ public virtual Pageable GetSupportedImages(int? timeOutInSe /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-support-images. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-support-images. /// /// The request context, which can override default behaviors of the client pipeline on a per-call basis. /// Service returned a non-success status code. @@ -7459,7 +7863,7 @@ public virtual AsyncPageable GetSupportedImagesAsync(int? timeOutInS /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-support-images. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-support-images. /// /// The request context, which can override default behaviors of the client pipeline on a per-call basis. /// Service returned a non-success status code. @@ -7489,7 +7893,7 @@ public virtual Pageable GetSupportedImages(int? timeOutInSeconds, Da /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-support-images. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-support-images. /// /// The cancellation token to use. /// @@ -7518,7 +7922,7 @@ public virtual AsyncPageable GetPoolNodeCountsAsync(int? ti /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-support-images. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-support-images. /// /// The cancellation token to use. /// @@ -7559,7 +7963,7 @@ public virtual Pageable GetPoolNodeCounts(int? timeOutInSec /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-support-images. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-support-images. /// /// The request context, which can override default behaviors of the client pipeline on a per-call basis. /// Service returned a non-success status code. @@ -7601,7 +8005,7 @@ public virtual AsyncPageable GetPoolNodeCountsAsync(int? timeOutInSe /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-support-images. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-support-images. /// /// The request context, which can override default behaviors of the client pipeline on a per-call basis. /// Service returned a non-success status code. @@ -7627,7 +8031,7 @@ public virtual Pageable GetPoolNodeCounts(int? timeOutInSeconds, Dat /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-jobs. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-jobs. /// /// An OData $select clause. /// An OData $expand clause. @@ -7654,7 +8058,7 @@ public virtual AsyncPageable GetJobsAsync(int? timeOutInSeconds = null /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-jobs. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-jobs. /// /// An OData $select clause. /// An OData $expand clause. @@ -7695,7 +8099,7 @@ public virtual Pageable GetJobs(int? timeOutInSeconds = null, DateTime /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-jobs. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-jobs. /// /// An OData $select clause. /// An OData $expand clause. @@ -7737,7 +8141,7 @@ public virtual AsyncPageable GetJobsAsync(int? timeOutInSeconds, Dat /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-jobs. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-jobs. /// /// An OData $select clause. /// An OData $expand clause. @@ -7766,7 +8170,7 @@ public virtual Pageable GetJobs(int? timeOutInSeconds, DateTimeOffse /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-jobs-in-a-job-schedule. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-jobs-in-a-job-schedule. /// /// An OData $select clause. /// An OData $expand clause. @@ -7798,7 +8202,7 @@ public virtual AsyncPageable GetJobsFromSchedulesAsync(string jobSched /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-jobs-in-a-job-schedule. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-jobs-in-a-job-schedule. /// /// An OData $select clause. /// An OData $expand clause. @@ -7844,7 +8248,7 @@ public virtual Pageable GetJobsFromSchedules(string jobScheduleId, int /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-jobs-in-a-job-schedule. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-jobs-in-a-job-schedule. /// /// An OData $select clause. /// An OData $expand clause. @@ -7891,7 +8295,7 @@ public virtual AsyncPageable GetJobsFromSchedulesAsync(string jobSch /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-jobs-in-a-job-schedule. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-jobs-in-a-job-schedule. /// /// An OData $select clause. /// An OData $expand clause. @@ -7927,7 +8331,7 @@ public virtual Pageable GetJobsFromSchedules(string jobScheduleId, i /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-job-preparation-and-release-status. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-job-preparation-and-release-status. /// /// An OData $select clause. /// The cancellation token to use. @@ -7969,7 +8373,7 @@ public virtual AsyncPageable GetJobPrep /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-job-preparation-and-release-status. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-job-preparation-and-release-status. /// /// An OData $select clause. /// The cancellation token to use. @@ -8023,7 +8427,7 @@ public virtual Pageable GetJobPreparati /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-job-preparation-and-release-status. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-job-preparation-and-release-status. /// /// An OData $select clause. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. @@ -8070,7 +8474,7 @@ public virtual AsyncPageable GetJobPreparationAndReleaseTaskStatuses /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-job-preparation-and-release-status. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-job-preparation-and-release-status. /// /// An OData $select clause. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. @@ -8101,7 +8505,7 @@ public virtual Pageable GetJobPreparationAndReleaseTaskStatuses(stri /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-job-schedules. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-job-schedules. /// /// An OData $select clause. /// An OData $expand clause. @@ -8128,7 +8532,7 @@ public virtual AsyncPageable GetJobSchedulesAsync(int? timeOut /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-job-schedules. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-job-schedules. /// /// An OData $select clause. /// An OData $expand clause. @@ -8169,7 +8573,7 @@ public virtual Pageable GetJobSchedules(int? timeOutInSeconds /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-job-schedules. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-job-schedules. /// /// An OData $select clause. /// An OData $expand clause. @@ -8211,7 +8615,7 @@ public virtual AsyncPageable GetJobSchedulesAsync(int? timeOutInSeco /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-job-schedules. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-job-schedules. /// /// An OData $select clause. /// An OData $expand clause. @@ -8240,7 +8644,7 @@ public virtual Pageable GetJobSchedules(int? timeOutInSeconds, DateT /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-tasks. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-tasks. /// /// An OData $select clause. /// An OData $expand clause. @@ -8277,7 +8681,7 @@ public virtual AsyncPageable GetTasksAsync(string jobId, int? timeOut /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-tasks. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-tasks. /// /// An OData $select clause. /// An OData $expand clause. @@ -8328,7 +8732,7 @@ public virtual Pageable GetTasks(string jobId, int? timeOutInSeconds /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-tasks. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-tasks. /// /// An OData $select clause. /// An OData $expand clause. @@ -8375,7 +8779,7 @@ public virtual AsyncPageable GetTasksAsync(string jobId, int? timeOu /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-tasks. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-tasks. /// /// An OData $select clause. /// An OData $expand clause. @@ -8549,7 +8953,7 @@ public virtual Pageable GetSubTasks(string jobId, string taskId, int /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-task-files. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-task-files. /// /// /// Whether to list children of the Task directory. This parameter can be used in @@ -8585,7 +8989,7 @@ public virtual AsyncPageable GetTaskFilesAsync(string jobId, stri /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-task-files. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-task-files. /// /// /// Whether to list children of the Task directory. This parameter can be used in @@ -8635,7 +9039,7 @@ public virtual Pageable GetTaskFiles(string jobId, string taskId, /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-task-files. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-task-files. /// /// /// Whether to list children of the Task directory. This parameter can be used in @@ -8686,7 +9090,7 @@ public virtual AsyncPageable GetTaskFilesAsync(string jobId, string /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-task-files. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-task-files. /// /// /// Whether to list children of the Task directory. This parameter can be used in @@ -8722,7 +9126,7 @@ public virtual Pageable GetTaskFiles(string jobId, string taskId, in /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-nodes-in-a-pool. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-nodes-in-a-pool. /// /// An OData $select clause. /// The cancellation token to use. @@ -8753,7 +9157,7 @@ public virtual AsyncPageable GetNodesAsync(string poolId, int? timeOu /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-nodes-in-a-pool. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-nodes-in-a-pool. /// /// An OData $select clause. /// The cancellation token to use. @@ -8798,7 +9202,7 @@ public virtual Pageable GetNodes(string poolId, int? timeOutInSeconds /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-nodes-in-a-pool. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-nodes-in-a-pool. /// /// An OData $select clause. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. @@ -8844,7 +9248,7 @@ public virtual AsyncPageable GetNodesAsync(string poolId, int? timeO /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-nodes-in-a-pool. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-nodes-in-a-pool. /// /// An OData $select clause. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. @@ -9023,7 +9427,7 @@ public virtual Pageable GetNodeExtensions(string poolId, string node /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-compute-node-files. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-compute-node-files. /// /// Whether to list children of a directory. /// The cancellation token to use. @@ -9056,7 +9460,7 @@ public virtual AsyncPageable GetNodeFilesAsync(string poolId, str /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-compute-node-files. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-compute-node-files. /// /// Whether to list children of a directory. /// The cancellation token to use. @@ -9103,7 +9507,7 @@ public virtual Pageable GetNodeFiles(string poolId, string nodeId /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-compute-node-files. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-compute-node-files. /// /// Whether to list children of a directory. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. @@ -9151,7 +9555,7 @@ public virtual AsyncPageable GetNodeFilesAsync(string poolId, string /// /// /// An OData $filter clause. For more information on constructing this filter, see - /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-compute-node-files. + /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-compute-node-files. /// /// Whether to list children of a directory. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. @@ -9727,7 +10131,7 @@ internal HttpMessage CreateGetPoolNodeCountsRequest(int? timeOutInSeconds, DateT return message; } - internal HttpMessage CreateDeleteJobRequest(string jobId, int? timeOutInSeconds, DateTimeOffset? ocpdate, RequestConditions requestConditions, RequestContext context) + internal HttpMessage CreateDeleteJobRequest(string jobId, int? timeOutInSeconds, DateTimeOffset? ocpdate, bool? force, RequestConditions requestConditions, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier202); var request = message.Request; @@ -9741,6 +10145,10 @@ internal HttpMessage CreateDeleteJobRequest(string jobId, int? timeOutInSeconds, { uri.AppendQuery("timeOut", timeOutInSeconds.Value, true); } + if (force != null) + { + uri.AppendQuery("force", force.Value, true); + } request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("client-request-id", message.Request.ClientRequestId); @@ -9917,7 +10325,7 @@ internal HttpMessage CreateEnableJobRequest(string jobId, int? timeOutInSeconds, return message; } - internal HttpMessage CreateTerminateJobRequest(string jobId, RequestContent content, int? timeOutInSeconds, DateTimeOffset? ocpdate, RequestConditions requestConditions, RequestContext context) + internal HttpMessage CreateTerminateJobRequest(string jobId, RequestContent content, int? timeOutInSeconds, DateTimeOffset? ocpdate, bool? force, RequestConditions requestConditions, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier202); var request = message.Request; @@ -9932,6 +10340,10 @@ internal HttpMessage CreateTerminateJobRequest(string jobId, RequestContent cont { uri.AppendQuery("timeOut", timeOutInSeconds.Value, true); } + if (force != null) + { + uri.AppendQuery("force", force.Value, true); + } request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("client-request-id", message.Request.ClientRequestId); @@ -10150,7 +10562,7 @@ internal HttpMessage CreateJobScheduleExistsRequest(string jobScheduleId, int? t return message; } - internal HttpMessage CreateDeleteJobScheduleRequest(string jobScheduleId, int? timeOutInSeconds, DateTimeOffset? ocpdate, RequestConditions requestConditions, RequestContext context) + internal HttpMessage CreateDeleteJobScheduleRequest(string jobScheduleId, int? timeOutInSeconds, DateTimeOffset? ocpdate, bool? force, RequestConditions requestConditions, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier202); var request = message.Request; @@ -10164,6 +10576,10 @@ internal HttpMessage CreateDeleteJobScheduleRequest(string jobScheduleId, int? t { uri.AppendQuery("timeOut", timeOutInSeconds.Value, true); } + if (force != null) + { + uri.AppendQuery("force", force.Value, true); + } request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("client-request-id", message.Request.ClientRequestId); @@ -10338,7 +10754,7 @@ internal HttpMessage CreateEnableJobScheduleRequest(string jobScheduleId, int? t return message; } - internal HttpMessage CreateTerminateJobScheduleRequest(string jobScheduleId, int? timeOutInSeconds, DateTimeOffset? ocpdate, RequestConditions requestConditions, RequestContext context) + internal HttpMessage CreateTerminateJobScheduleRequest(string jobScheduleId, int? timeOutInSeconds, DateTimeOffset? ocpdate, bool? force, RequestConditions requestConditions, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier202); var request = message.Request; @@ -10353,6 +10769,10 @@ internal HttpMessage CreateTerminateJobScheduleRequest(string jobScheduleId, int { uri.AppendQuery("timeOut", timeOutInSeconds.Value, true); } + if (force != null) + { + uri.AppendQuery("force", force.Value, true); + } request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("client-request-id", message.Request.ClientRequestId); @@ -11025,6 +11445,94 @@ internal HttpMessage CreateRebootNodeRequest(string poolId, string nodeId, Reque return message; } + internal HttpMessage CreateStartNodeRequest(string poolId, string nodeId, int? timeOutInSeconds, DateTimeOffset? ocpdate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + uri.AppendPath("/nodes/", false); + uri.AppendPath(nodeId, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (timeOutInSeconds != null) + { + uri.AppendQuery("timeOut", timeOutInSeconds.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpdate != null) + { + request.Headers.Add("ocp-date", ocpdate.Value, "R"); + } + return message; + } + + internal HttpMessage CreateReimageNodeRequest(string poolId, string nodeId, RequestContent content, int? timeOutInSeconds, DateTimeOffset? ocpdate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + uri.AppendPath("/nodes/", false); + uri.AppendPath(nodeId, true); + uri.AppendPath("/reimage", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (timeOutInSeconds != null) + { + uri.AppendQuery("timeOut", timeOutInSeconds.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpdate != null) + { + request.Headers.Add("ocp-date", ocpdate.Value, "R"); + } + request.Headers.Add("Content-Type", "application/json; odata=minimalmetadata"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeallocateNodeRequest(string poolId, string nodeId, RequestContent content, int? timeOutInSeconds, DateTimeOffset? ocpdate, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/pools/", false); + uri.AppendPath(poolId, true); + uri.AppendPath("/nodes/", false); + uri.AppendPath(nodeId, true); + uri.AppendPath("/deallocate", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (timeOutInSeconds != null) + { + uri.AppendQuery("timeOut", timeOutInSeconds.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("client-request-id", message.Request.ClientRequestId); + request.Headers.Add("return-client-request-id", "true"); + if (ocpdate != null) + { + request.Headers.Add("ocp-date", ocpdate.Value, "R"); + } + request.Headers.Add("Content-Type", "application/json; odata=minimalmetadata"); + request.Content = content; + return message; + } + internal HttpMessage CreateDisableNodeSchedulingRequest(string poolId, string nodeId, RequestContent content, int? timeOutInSeconds, DateTimeOffset? ocpdate, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchClientOptions.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchClientOptions.cs index eab2e5942414..c4f6c163cc57 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchClientOptions.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchClientOptions.cs @@ -13,13 +13,13 @@ namespace Azure.Compute.Batch /// Client options for BatchClient. public partial class BatchClientOptions : ClientOptions { - private const ServiceVersion LatestVersion = ServiceVersion.V2024_02_01_19_0; + private const ServiceVersion LatestVersion = ServiceVersion.V2024_07_01_20_0; /// The version of the service to use. public enum ServiceVersion { - /// Service version "2024-02-01.19.0". - V2024_02_01_19_0 = 1, + /// Service version "2024-07-01.20.0". + V2024_07_01_20_0 = 1, } internal string Version { get; } @@ -29,7 +29,7 @@ public BatchClientOptions(ServiceVersion version = LatestVersion) { Version = version switch { - ServiceVersion.V2024_02_01_19_0 => "2024-02-01.19.0", + ServiceVersion.V2024_07_01_20_0 => "2024-07-01.20.0", _ => throw new NotSupportedException() }; } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJob.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJob.cs index b516fefc1292..3084acc36928 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJob.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJob.cs @@ -83,7 +83,7 @@ public BatchJob(BatchPoolInfo poolInfo) /// The network configuration for the Job. /// A list of name-value pairs associated with the Job as metadata. The Batch service does not assign any meaning to metadata; it is solely for the use of user code. /// The execution information for the Job. - /// Resource usage statistics for the entire lifetime of the Job. This property is populated only if the CloudJob was retrieved with an expand clause including the 'stats' attribute; otherwise it is null. The statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30 minutes. + /// Resource usage statistics for the entire lifetime of the Job. This property is populated only if the BatchJob was retrieved with an expand clause including the 'stats' attribute; otherwise it is null. The statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30 minutes. /// Keeps track of any properties unknown to the library. internal BatchJob(string id, string displayName, bool? usesTaskDependencies, string url, string eTag, DateTimeOffset? lastModified, DateTimeOffset? creationTime, BatchJobState? state, DateTimeOffset? stateTransitionTime, BatchJobState? previousState, DateTimeOffset? previousStateTransitionTime, int? priority, bool? allowTaskPreemption, int? maxParallelTasks, BatchJobConstraints constraints, BatchJobManagerTask jobManagerTask, BatchJobPreparationTask jobPreparationTask, BatchJobReleaseTask jobReleaseTask, IReadOnlyList commonEnvironmentSettings, BatchPoolInfo poolInfo, OnAllBatchTasksComplete? onAllTasksComplete, OnBatchTaskFailure? onTaskFailure, BatchJobNetworkConfiguration networkConfiguration, IList metadata, BatchJobExecutionInfo executionInfo, BatchJobStatistics stats, IDictionary serializedAdditionalRawData) { @@ -171,7 +171,7 @@ internal BatchJob() public IList Metadata { get; } /// The execution information for the Job. public BatchJobExecutionInfo ExecutionInfo { get; } - /// Resource usage statistics for the entire lifetime of the Job. This property is populated only if the CloudJob was retrieved with an expand clause including the 'stats' attribute; otherwise it is null. The statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30 minutes. + /// Resource usage statistics for the entire lifetime of the Job. This property is populated only if the BatchJob was retrieved with an expand clause including the 'stats' attribute; otherwise it is null. The statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30 minutes. public BatchJobStatistics Stats { get; } } } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJobManagerTask.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJobManagerTask.cs index 7f679bb2fb59..9ebea8b406d9 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJobManagerTask.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJobManagerTask.cs @@ -71,7 +71,7 @@ public partial class BatchJobManagerTask /// Initializes a new instance of . /// A string that uniquely identifies the Job Manager Task within the Job. The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. - /// The command line of the Job Manager Task. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// The command line of the Job Manager Task. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables). /// or is null. public BatchJobManagerTask(string id, string commandLine) { @@ -89,7 +89,7 @@ public BatchJobManagerTask(string id, string commandLine) /// Initializes a new instance of . /// A string that uniquely identifies the Job Manager Task within the Job. The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. /// The display name of the Job Manager Task. It need not be unique and can contain any Unicode characters up to a maximum length of 1024. - /// The command line of the Job Manager Task. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// The command line of the Job Manager Task. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables). /// The settings for the container under which the Job Manager Task runs. If the Pool that will run this Task has containerConfiguration set, this must be set as well. If the Pool that will run this Task doesn't have containerConfiguration set, this must not be set. When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. /// A list of files that the Batch service will download to the Compute Node before running the command line. Files listed under this element are located in the Task's working directory. There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. /// A list of files that the Batch service will upload from the Compute Node after running the command line. For multi-instance Tasks, the files will only be uploaded from the Compute Node on which the primary Task is executed. @@ -141,7 +141,7 @@ internal BatchJobManagerTask() public string Id { get; set; } /// The display name of the Job Manager Task. It need not be unique and can contain any Unicode characters up to a maximum length of 1024. public string DisplayName { get; set; } - /// The command line of the Job Manager Task. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// The command line of the Job Manager Task. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables). public string CommandLine { get; set; } /// The settings for the container under which the Job Manager Task runs. If the Pool that will run this Task has containerConfiguration set, this must be set as well. If the Pool that will run this Task doesn't have containerConfiguration set, this must not be set. When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. public BatchTaskContainerSettings ContainerSettings { get; set; } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJobNetworkConfiguration.Serialization.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJobNetworkConfiguration.Serialization.cs index b77d46998063..793ede70b803 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJobNetworkConfiguration.Serialization.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJobNetworkConfiguration.Serialization.cs @@ -36,6 +36,8 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("subnetId"u8); writer.WriteStringValue(SubnetId); + writer.WritePropertyName("skipWithdrawFromVNet"u8); + writer.WriteBooleanValue(SkipWithdrawFromVNet); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -74,6 +76,7 @@ internal static BatchJobNetworkConfiguration DeserializeBatchJobNetworkConfigura return null; } string subnetId = default; + bool skipWithdrawFromVNet = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -83,13 +86,18 @@ internal static BatchJobNetworkConfiguration DeserializeBatchJobNetworkConfigura subnetId = property.Value.GetString(); continue; } + if (property.NameEquals("skipWithdrawFromVNet"u8)) + { + skipWithdrawFromVNet = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new BatchJobNetworkConfiguration(subnetId, serializedAdditionalRawData); + return new BatchJobNetworkConfiguration(subnetId, skipWithdrawFromVNet, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJobNetworkConfiguration.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJobNetworkConfiguration.cs index d6697158bf5e..931e05614029 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJobNetworkConfiguration.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJobNetworkConfiguration.cs @@ -46,21 +46,25 @@ public partial class BatchJobNetworkConfiguration private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The ARM resource identifier of the virtual network subnet which Compute Nodes running Tasks from the Job will join for the duration of the Task. This will only work with a VirtualMachineConfiguration Pool. The virtual network must be in the same region and subscription as the Azure Batch Account. The specified subnet should have enough free IP addresses to accommodate the number of Compute Nodes which will run Tasks from the Job. This can be up to the number of Compute Nodes in the Pool. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet so that Azure Batch service can schedule Tasks on the Nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the Nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the Compute Nodes to unusable. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication from the Azure Batch service. For Pools created with a Virtual Machine configuration, enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. Port 443 is also required to be open for outbound connections for communications to Azure Storage. For more details see: https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. + /// The ARM resource identifier of the virtual network subnet which Compute Nodes running Tasks from the Job will join for the duration of the Task. The virtual network must be in the same region and subscription as the Azure Batch Account. The specified subnet should have enough free IP addresses to accommodate the number of Compute Nodes which will run Tasks from the Job. This can be up to the number of Compute Nodes in the Pool. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet so that Azure Batch service can schedule Tasks on the Nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the Nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the Compute Nodes to unusable. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication from the Azure Batch service. For Pools created with a Virtual Machine configuration, enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. Port 443 is also required to be open for outbound connections for communications to Azure Storage. For more details see: https://learn.microsoft.com/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. + /// Whether to withdraw Compute Nodes from the virtual network to DNC when the job is terminated or deleted. If true, nodes will remain joined to the virtual network to DNC. If false, nodes will automatically withdraw when the job ends. Defaults to false. /// is null. - public BatchJobNetworkConfiguration(string subnetId) + public BatchJobNetworkConfiguration(string subnetId, bool skipWithdrawFromVNet) { Argument.AssertNotNull(subnetId, nameof(subnetId)); SubnetId = subnetId; + SkipWithdrawFromVNet = skipWithdrawFromVNet; } /// Initializes a new instance of . - /// The ARM resource identifier of the virtual network subnet which Compute Nodes running Tasks from the Job will join for the duration of the Task. This will only work with a VirtualMachineConfiguration Pool. The virtual network must be in the same region and subscription as the Azure Batch Account. The specified subnet should have enough free IP addresses to accommodate the number of Compute Nodes which will run Tasks from the Job. This can be up to the number of Compute Nodes in the Pool. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet so that Azure Batch service can schedule Tasks on the Nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the Nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the Compute Nodes to unusable. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication from the Azure Batch service. For Pools created with a Virtual Machine configuration, enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. Port 443 is also required to be open for outbound connections for communications to Azure Storage. For more details see: https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. + /// The ARM resource identifier of the virtual network subnet which Compute Nodes running Tasks from the Job will join for the duration of the Task. The virtual network must be in the same region and subscription as the Azure Batch Account. The specified subnet should have enough free IP addresses to accommodate the number of Compute Nodes which will run Tasks from the Job. This can be up to the number of Compute Nodes in the Pool. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet so that Azure Batch service can schedule Tasks on the Nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the Nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the Compute Nodes to unusable. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication from the Azure Batch service. For Pools created with a Virtual Machine configuration, enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. Port 443 is also required to be open for outbound connections for communications to Azure Storage. For more details see: https://learn.microsoft.com/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. + /// Whether to withdraw Compute Nodes from the virtual network to DNC when the job is terminated or deleted. If true, nodes will remain joined to the virtual network to DNC. If false, nodes will automatically withdraw when the job ends. Defaults to false. /// Keeps track of any properties unknown to the library. - internal BatchJobNetworkConfiguration(string subnetId, IDictionary serializedAdditionalRawData) + internal BatchJobNetworkConfiguration(string subnetId, bool skipWithdrawFromVNet, IDictionary serializedAdditionalRawData) { SubnetId = subnetId; + SkipWithdrawFromVNet = skipWithdrawFromVNet; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -69,7 +73,9 @@ internal BatchJobNetworkConfiguration() { } - /// The ARM resource identifier of the virtual network subnet which Compute Nodes running Tasks from the Job will join for the duration of the Task. This will only work with a VirtualMachineConfiguration Pool. The virtual network must be in the same region and subscription as the Azure Batch Account. The specified subnet should have enough free IP addresses to accommodate the number of Compute Nodes which will run Tasks from the Job. This can be up to the number of Compute Nodes in the Pool. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet so that Azure Batch service can schedule Tasks on the Nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the Nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the Compute Nodes to unusable. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication from the Azure Batch service. For Pools created with a Virtual Machine configuration, enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. Port 443 is also required to be open for outbound connections for communications to Azure Storage. For more details see: https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. + /// The ARM resource identifier of the virtual network subnet which Compute Nodes running Tasks from the Job will join for the duration of the Task. The virtual network must be in the same region and subscription as the Azure Batch Account. The specified subnet should have enough free IP addresses to accommodate the number of Compute Nodes which will run Tasks from the Job. This can be up to the number of Compute Nodes in the Pool. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet so that Azure Batch service can schedule Tasks on the Nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the Nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the Compute Nodes to unusable. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication from the Azure Batch service. For Pools created with a Virtual Machine configuration, enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. Port 443 is also required to be open for outbound connections for communications to Azure Storage. For more details see: https://learn.microsoft.com/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. public string SubnetId { get; set; } + /// Whether to withdraw Compute Nodes from the virtual network to DNC when the job is terminated or deleted. If true, nodes will remain joined to the virtual network to DNC. If false, nodes will automatically withdraw when the job ends. Defaults to false. + public bool SkipWithdrawFromVNet { get; set; } } } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJobPreparationTask.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJobPreparationTask.cs index ce02002b17a0..cef539ebd5a2 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJobPreparationTask.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJobPreparationTask.cs @@ -73,7 +73,7 @@ public partial class BatchJobPreparationTask private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The command line of the Job Preparation Task. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// The command line of the Job Preparation Task. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables). /// is null. public BatchJobPreparationTask(string commandLine) { @@ -86,7 +86,7 @@ public BatchJobPreparationTask(string commandLine) /// Initializes a new instance of . /// A string that uniquely identifies the Job Preparation Task within the Job. The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobpreparation'. No other Task in the Job can have the same ID as the Job Preparation Task. If you try to submit a Task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobPreparationTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict). - /// The command line of the Job Preparation Task. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// The command line of the Job Preparation Task. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables). /// The settings for the container under which the Job Preparation Task runs. When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. /// A list of files that the Batch service will download to the Compute Node before running the command line. Files listed under this element are located in the Task's working directory. There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. /// A list of environment variable settings for the Job Preparation Task. @@ -116,7 +116,7 @@ internal BatchJobPreparationTask() /// A string that uniquely identifies the Job Preparation Task within the Job. The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobpreparation'. No other Task in the Job can have the same ID as the Job Preparation Task. If you try to submit a Task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobPreparationTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict). public string Id { get; set; } - /// The command line of the Job Preparation Task. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// The command line of the Job Preparation Task. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables). public string CommandLine { get; set; } /// The settings for the container under which the Job Preparation Task runs. When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. public BatchTaskContainerSettings ContainerSettings { get; set; } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJobReleaseTask.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJobReleaseTask.cs index acbf28a11f7d..c9a63263aaf7 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJobReleaseTask.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJobReleaseTask.cs @@ -63,7 +63,7 @@ public partial class BatchJobReleaseTask private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The command line of the Job Release Task. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// The command line of the Job Release Task. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables). /// is null. public BatchJobReleaseTask(string commandLine) { @@ -76,7 +76,7 @@ public BatchJobReleaseTask(string commandLine) /// Initializes a new instance of . /// A string that uniquely identifies the Job Release Task within the Job. The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobrelease'. No other Task in the Job can have the same ID as the Job Release Task. If you try to submit a Task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobReleaseTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict). - /// The command line of the Job Release Task. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// The command line of the Job Release Task. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables). /// The settings for the container under which the Job Release Task runs. When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. /// A list of files that the Batch service will download to the Compute Node before running the command line. There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. Files listed under this element are located in the Task's working directory. /// A list of environment variable settings for the Job Release Task. @@ -104,7 +104,7 @@ internal BatchJobReleaseTask() /// A string that uniquely identifies the Job Release Task within the Job. The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobrelease'. No other Task in the Job can have the same ID as the Job Release Task. If you try to submit a Task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobReleaseTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict). public string Id { get; set; } - /// The command line of the Job Release Task. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// The command line of the Job Release Task. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables). public string CommandLine { get; set; } /// The settings for the container under which the Job Release Task runs. When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. public BatchTaskContainerSettings ContainerSettings { get; set; } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJobUpdateContent.Serialization.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJobUpdateContent.Serialization.cs index f5789261d03b..c865fc428c1a 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJobUpdateContent.Serialization.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJobUpdateContent.Serialization.cs @@ -74,6 +74,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndArray(); } + if (Optional.IsDefined(NetworkConfiguration)) + { + writer.WritePropertyName("networkConfiguration"u8); + writer.WriteObjectValue(NetworkConfiguration, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -118,6 +123,7 @@ internal static BatchJobUpdateContent DeserializeBatchJobUpdateContent(JsonEleme BatchPoolInfo poolInfo = default; OnAllBatchTasksComplete? onAllTasksComplete = default; IList metadata = default; + BatchJobNetworkConfiguration networkConfiguration = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -190,6 +196,15 @@ internal static BatchJobUpdateContent DeserializeBatchJobUpdateContent(JsonEleme metadata = array; continue; } + if (property.NameEquals("networkConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkConfiguration = BatchJobNetworkConfiguration.DeserializeBatchJobNetworkConfiguration(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -204,6 +219,7 @@ internal static BatchJobUpdateContent DeserializeBatchJobUpdateContent(JsonEleme poolInfo, onAllTasksComplete, metadata ?? new ChangeTrackingList(), + networkConfiguration, serializedAdditionalRawData); } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJobUpdateContent.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJobUpdateContent.cs index 5776641d88ea..0cbcd028e9a1 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJobUpdateContent.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchJobUpdateContent.cs @@ -59,8 +59,9 @@ public BatchJobUpdateContent() /// The Pool on which the Batch service runs the Job's Tasks. You may change the Pool for a Job only when the Job is disabled. The Patch Job call will fail if you include the poolInfo element and the Job is not disabled. If you specify an autoPoolSpecification in the poolInfo, only the keepAlive property of the autoPoolSpecification can be updated, and then only if the autoPoolSpecification has a poolLifetimeOption of Job (other job properties can be updated as normal). If omitted, the Job continues to run on its current Pool. /// The action the Batch service should take when all Tasks in the Job are in the completed state. If omitted, the completion behavior is left unchanged. You may not change the value from terminatejob to noaction - that is, once you have engaged automatic Job termination, you cannot turn it off again. If you try to do this, the request fails with an 'invalid property value' error response; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). /// A list of name-value pairs associated with the Job as metadata. If omitted, the existing Job metadata is left unchanged. + /// The network configuration for the Job. /// Keeps track of any properties unknown to the library. - internal BatchJobUpdateContent(int? priority, bool? allowTaskPreemption, int? maxParallelTasks, BatchJobConstraints constraints, BatchPoolInfo poolInfo, OnAllBatchTasksComplete? onAllTasksComplete, IList metadata, IDictionary serializedAdditionalRawData) + internal BatchJobUpdateContent(int? priority, bool? allowTaskPreemption, int? maxParallelTasks, BatchJobConstraints constraints, BatchPoolInfo poolInfo, OnAllBatchTasksComplete? onAllTasksComplete, IList metadata, BatchJobNetworkConfiguration networkConfiguration, IDictionary serializedAdditionalRawData) { Priority = priority; AllowTaskPreemption = allowTaskPreemption; @@ -69,6 +70,7 @@ internal BatchJobUpdateContent(int? priority, bool? allowTaskPreemption, int? ma PoolInfo = poolInfo; OnAllTasksComplete = onAllTasksComplete; Metadata = metadata; + NetworkConfiguration = networkConfiguration; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -86,5 +88,7 @@ internal BatchJobUpdateContent(int? priority, bool? allowTaskPreemption, int? ma public OnAllBatchTasksComplete? OnAllTasksComplete { get; set; } /// A list of name-value pairs associated with the Job as metadata. If omitted, the existing Job metadata is left unchanged. public IList Metadata { get; } + /// The network configuration for the Job. + public BatchJobNetworkConfiguration NetworkConfiguration { get; set; } } } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNode.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNode.cs index a1e4ac04664e..eaf494b708ff 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNode.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNode.cs @@ -62,7 +62,7 @@ internal BatchNode() /// The time at which this Compute Node was allocated to the Pool. This is the time when the Compute Node was initially allocated and doesn't change once set. It is not updated when the Compute Node is service healed or preempted. /// The IP address that other Nodes can use to communicate with this Compute Node. Every Compute Node that is added to a Pool is assigned a unique IP address. Whenever a Compute Node is removed from a Pool, all of its local files are deleted, and the IP address is reclaimed and could be reused for new Compute Nodes. /// An identifier which can be passed when adding a Task to request that the Task be scheduled on this Compute Node. Note that this is just a soft affinity. If the target Compute Node is busy or unavailable at the time the Task is scheduled, then the Task will be scheduled elsewhere. - /// The size of the virtual machine hosting the Compute Node. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes). + /// The size of the virtual machine hosting the Compute Node. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://learn.microsoft.com/azure/batch/batch-pool-vm-sizes). /// The total number of Job Tasks completed on the Compute Node. This includes Job Manager Tasks and normal Tasks, but not Job Preparation, Job Release or Start Tasks. /// The total number of currently running Job Tasks on the Compute Node. This includes Job Manager Tasks and normal Tasks, but not Job Preparation, Job Release or Start Tasks. /// The total number of scheduling slots used by currently running Job Tasks on the Compute Node. This includes Job Manager Tasks and normal Tasks, but not Job Preparation, Job Release or Start Tasks. @@ -121,7 +121,7 @@ internal BatchNode(string id, string url, BatchNodeState? state, SchedulingState public string IpAddress { get; } /// An identifier which can be passed when adding a Task to request that the Task be scheduled on this Compute Node. Note that this is just a soft affinity. If the target Compute Node is busy or unavailable at the time the Task is scheduled, then the Task will be scheduled elsewhere. public string AffinityId { get; } - /// The size of the virtual machine hosting the Compute Node. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes). + /// The size of the virtual machine hosting the Compute Node. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://learn.microsoft.com/azure/batch/batch-pool-vm-sizes). public string VmSize { get; } /// The total number of Job Tasks completed on the Compute Node. This includes Job Manager Tasks and normal Tasks, but not Job Preparation, Job Release or Start Tasks. public int? TotalTasksRun { get; } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeCounts.Serialization.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeCounts.Serialization.cs index 3be7e8a1103a..10b647dc8baf 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeCounts.Serialization.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeCounts.Serialization.cs @@ -60,6 +60,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteNumberValue(Unusable); writer.WritePropertyName("waitingForStartTask"u8); writer.WriteNumberValue(WaitingForStartTask); + writer.WritePropertyName("deallocated"u8); + writer.WriteNumberValue(Deallocated); + writer.WritePropertyName("deallocating"u8); + writer.WriteNumberValue(Deallocating); writer.WritePropertyName("total"u8); writer.WriteNumberValue(Total); writer.WritePropertyName("upgradingOS"u8); @@ -114,6 +118,8 @@ internal static BatchNodeCounts DeserializeBatchNodeCounts(JsonElement element, int unknown = default; int unusable = default; int waitingForStartTask = default; + int deallocated = default; + int deallocating = default; int total = default; int upgradingOS = default; IDictionary serializedAdditionalRawData = default; @@ -185,6 +191,16 @@ internal static BatchNodeCounts DeserializeBatchNodeCounts(JsonElement element, waitingForStartTask = property.Value.GetInt32(); continue; } + if (property.NameEquals("deallocated"u8)) + { + deallocated = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("deallocating"u8)) + { + deallocating = property.Value.GetInt32(); + continue; + } if (property.NameEquals("total"u8)) { total = property.Value.GetInt32(); @@ -215,6 +231,8 @@ internal static BatchNodeCounts DeserializeBatchNodeCounts(JsonElement element, unknown, unusable, waitingForStartTask, + deallocated, + deallocating, total, upgradingOS, serializedAdditionalRawData); diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeCounts.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeCounts.cs index 56ccd9fa2373..04e5b38c071d 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeCounts.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeCounts.cs @@ -59,9 +59,11 @@ public partial class BatchNodeCounts /// The number of Compute Nodes in the unknown state. /// The number of Compute Nodes in the unusable state. /// The number of Compute Nodes in the waitingForStartTask state. + /// The number of Compute Nodes in the deallocated state. + /// The number of Compute Nodes in the deallocating state. /// The total number of Compute Nodes. /// The number of Compute Nodes in the upgradingOS state. - internal BatchNodeCounts(int creating, int idle, int offline, int preempted, int rebooting, int reimaging, int running, int starting, int startTaskFailed, int leavingPool, int unknown, int unusable, int waitingForStartTask, int total, int upgradingOs) + internal BatchNodeCounts(int creating, int idle, int offline, int preempted, int rebooting, int reimaging, int running, int starting, int startTaskFailed, int leavingPool, int unknown, int unusable, int waitingForStartTask, int deallocated, int deallocating, int total, int upgradingOs) { Creating = creating; Idle = idle; @@ -76,6 +78,8 @@ internal BatchNodeCounts(int creating, int idle, int offline, int preempted, int Unknown = unknown; Unusable = unusable; WaitingForStartTask = waitingForStartTask; + Deallocated = deallocated; + Deallocating = deallocating; Total = total; UpgradingOs = upgradingOs; } @@ -94,10 +98,12 @@ internal BatchNodeCounts(int creating, int idle, int offline, int preempted, int /// The number of Compute Nodes in the unknown state. /// The number of Compute Nodes in the unusable state. /// The number of Compute Nodes in the waitingForStartTask state. + /// The number of Compute Nodes in the deallocated state. + /// The number of Compute Nodes in the deallocating state. /// The total number of Compute Nodes. /// The number of Compute Nodes in the upgradingOS state. /// Keeps track of any properties unknown to the library. - internal BatchNodeCounts(int creating, int idle, int offline, int preempted, int rebooting, int reimaging, int running, int starting, int startTaskFailed, int leavingPool, int unknown, int unusable, int waitingForStartTask, int total, int upgradingOs, IDictionary serializedAdditionalRawData) + internal BatchNodeCounts(int creating, int idle, int offline, int preempted, int rebooting, int reimaging, int running, int starting, int startTaskFailed, int leavingPool, int unknown, int unusable, int waitingForStartTask, int deallocated, int deallocating, int total, int upgradingOs, IDictionary serializedAdditionalRawData) { Creating = creating; Idle = idle; @@ -112,6 +118,8 @@ internal BatchNodeCounts(int creating, int idle, int offline, int preempted, int Unknown = unknown; Unusable = unusable; WaitingForStartTask = waitingForStartTask; + Deallocated = deallocated; + Deallocating = deallocating; Total = total; UpgradingOs = upgradingOs; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -148,6 +156,10 @@ internal BatchNodeCounts() public int Unusable { get; } /// The number of Compute Nodes in the waitingForStartTask state. public int WaitingForStartTask { get; } + /// The number of Compute Nodes in the deallocated state. + public int Deallocated { get; } + /// The number of Compute Nodes in the deallocating state. + public int Deallocating { get; } /// The total number of Compute Nodes. public int Total { get; } /// The number of Compute Nodes in the upgradingOS state. diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeDeallocateContent.Serialization.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeDeallocateContent.Serialization.cs new file mode 100644 index 000000000000..aedc552556b7 --- /dev/null +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeDeallocateContent.Serialization.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Compute.Batch +{ + public partial class BatchNodeDeallocateContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(BatchNodeDeallocateContent)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(NodeDeallocateOption)) + { + writer.WritePropertyName("nodeDeallocateOption"u8); + writer.WriteStringValue(NodeDeallocateOption.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BatchNodeDeallocateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BatchNodeDeallocateContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBatchNodeDeallocateContent(document.RootElement, options); + } + + internal static BatchNodeDeallocateContent DeserializeBatchNodeDeallocateContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BatchNodeDeallocateOption? nodeDeallocateOption = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nodeDeallocateOption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nodeDeallocateOption = new BatchNodeDeallocateOption(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BatchNodeDeallocateContent(nodeDeallocateOption, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BatchNodeDeallocateContent)} does not support writing '{options.Format}' format."); + } + } + + BatchNodeDeallocateContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBatchNodeDeallocateContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BatchNodeDeallocateContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static BatchNodeDeallocateContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeBatchNodeDeallocateContent(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/batch/Azure.Compute.Batch/src/Generated/BatchNodeDeallocateContent.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeDeallocateContent.cs new file mode 100644 index 000000000000..c14a7b03f81e --- /dev/null +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeDeallocateContent.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Compute.Batch +{ + /// Options for deallocating a Compute Node. + public partial class BatchNodeDeallocateContent + { + /// + /// 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; + + /// Initializes a new instance of . + public BatchNodeDeallocateContent() + { + } + + /// Initializes a new instance of . + /// When to deallocate the Compute Node and what to do with currently running Tasks. The default value is requeue. + /// Keeps track of any properties unknown to the library. + internal BatchNodeDeallocateContent(BatchNodeDeallocateOption? nodeDeallocateOption, IDictionary serializedAdditionalRawData) + { + NodeDeallocateOption = nodeDeallocateOption; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// When to deallocate the Compute Node and what to do with currently running Tasks. The default value is requeue. + public BatchNodeDeallocateOption? NodeDeallocateOption { get; set; } + } +} diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeDeallocateOption.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeDeallocateOption.cs new file mode 100644 index 000000000000..b4c883a187e5 --- /dev/null +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeDeallocateOption.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Compute.Batch +{ + /// BatchNodeDeallocateOption enums. + public readonly partial struct BatchNodeDeallocateOption : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BatchNodeDeallocateOption(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RequeueValue = "requeue"; + private const string TerminateValue = "terminate"; + private const string TaskCompletionValue = "taskcompletion"; + private const string RetainedDataValue = "retaineddata"; + + /// Terminate running Task processes and requeue the Tasks. The Tasks will run again when a Compute Node is available. Deallocate the Compute Node as soon as Tasks have been terminated. + public static BatchNodeDeallocateOption Requeue { get; } = new BatchNodeDeallocateOption(RequeueValue); + /// Terminate running Tasks. The Tasks will be completed with failureInfo indicating that they were terminated, and will not run again. Deallocate the Compute Node as soon as Tasks have been terminated. + public static BatchNodeDeallocateOption Terminate { get; } = new BatchNodeDeallocateOption(TerminateValue); + /// Allow currently running Tasks to complete. Schedule no new Tasks while waiting. Deallocate the Compute Node when all Tasks have completed. + public static BatchNodeDeallocateOption TaskCompletion { get; } = new BatchNodeDeallocateOption(TaskCompletionValue); + /// Allow currently running Tasks to complete, then wait for all Task data retention periods to expire. Schedule no new Tasks while waiting. Deallocate the Compute Node when all Task retention periods have expired. + public static BatchNodeDeallocateOption RetainedData { get; } = new BatchNodeDeallocateOption(RetainedDataValue); + /// Determines if two values are the same. + public static bool operator ==(BatchNodeDeallocateOption left, BatchNodeDeallocateOption right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BatchNodeDeallocateOption left, BatchNodeDeallocateOption right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BatchNodeDeallocateOption(string value) => new BatchNodeDeallocateOption(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BatchNodeDeallocateOption other && Equals(other); + /// + public bool Equals(BatchNodeDeallocateOption 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/batch/Azure.Compute.Batch/src/Generated/BatchNodeReimageContent.Serialization.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeReimageContent.Serialization.cs new file mode 100644 index 000000000000..66a50d339e1d --- /dev/null +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeReimageContent.Serialization.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Compute.Batch +{ + public partial class BatchNodeReimageContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(BatchNodeReimageContent)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(NodeReimageOption)) + { + writer.WritePropertyName("nodeReimageOption"u8); + writer.WriteStringValue(NodeReimageOption.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BatchNodeReimageContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BatchNodeReimageContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBatchNodeReimageContent(document.RootElement, options); + } + + internal static BatchNodeReimageContent DeserializeBatchNodeReimageContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BatchNodeReimageOption? nodeReimageOption = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nodeReimageOption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nodeReimageOption = new BatchNodeReimageOption(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BatchNodeReimageContent(nodeReimageOption, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BatchNodeReimageContent)} does not support writing '{options.Format}' format."); + } + } + + BatchNodeReimageContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBatchNodeReimageContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BatchNodeReimageContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static BatchNodeReimageContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeBatchNodeReimageContent(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/batch/Azure.Compute.Batch/src/Generated/BatchNodeReimageContent.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeReimageContent.cs new file mode 100644 index 000000000000..8222990b7344 --- /dev/null +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeReimageContent.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Compute.Batch +{ + /// Parameters for reimaging an Azure Batch Compute Node. + public partial class BatchNodeReimageContent + { + /// + /// 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; + + /// Initializes a new instance of . + public BatchNodeReimageContent() + { + } + + /// Initializes a new instance of . + /// When to reimage the Compute Node and what to do with currently running Tasks. The default value is requeue. + /// Keeps track of any properties unknown to the library. + internal BatchNodeReimageContent(BatchNodeReimageOption? nodeReimageOption, IDictionary serializedAdditionalRawData) + { + NodeReimageOption = nodeReimageOption; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// When to reimage the Compute Node and what to do with currently running Tasks. The default value is requeue. + public BatchNodeReimageOption? NodeReimageOption { get; set; } + } +} diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeReimageOption.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeReimageOption.cs new file mode 100644 index 000000000000..1ceebbf46262 --- /dev/null +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeReimageOption.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Compute.Batch +{ + /// BatchNodeReimageOption enums. + public readonly partial struct BatchNodeReimageOption : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BatchNodeReimageOption(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RequeueValue = "requeue"; + private const string TerminateValue = "terminate"; + private const string TaskCompletionValue = "taskcompletion"; + private const string RetainedDataValue = "retaineddata"; + + /// Terminate running Task processes and requeue the Tasks. The Tasks will run again when a Compute Node is available. Reimage the Compute Node as soon as Tasks have been terminated. + public static BatchNodeReimageOption Requeue { get; } = new BatchNodeReimageOption(RequeueValue); + /// Terminate running Tasks. The Tasks will be completed with failureInfo indicating that they were terminated, and will not run again. Reimage the Compute Node as soon as Tasks have been terminated. + public static BatchNodeReimageOption Terminate { get; } = new BatchNodeReimageOption(TerminateValue); + /// Allow currently running Tasks to complete. Schedule no new Tasks while waiting. Reimage the Compute Node when all Tasks have completed. + public static BatchNodeReimageOption TaskCompletion { get; } = new BatchNodeReimageOption(TaskCompletionValue); + /// Allow currently running Tasks to complete, then wait for all Task data retention periods to expire. Schedule no new Tasks while waiting. Reimage the Compute Node when all Task retention periods have expired. + public static BatchNodeReimageOption RetainedData { get; } = new BatchNodeReimageOption(RetainedDataValue); + /// Determines if two values are the same. + public static bool operator ==(BatchNodeReimageOption left, BatchNodeReimageOption right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BatchNodeReimageOption left, BatchNodeReimageOption right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BatchNodeReimageOption(string value) => new BatchNodeReimageOption(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BatchNodeReimageOption other && Equals(other); + /// + public bool Equals(BatchNodeReimageOption 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/batch/Azure.Compute.Batch/src/Generated/BatchNodeState.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeState.cs index b986f5ec1350..71bfaaba250f 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeState.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeState.cs @@ -36,6 +36,8 @@ public BatchNodeState(string value) private const string OfflineValue = "offline"; private const string PreemptedValue = "preempted"; private const string UpgradingOSValue = "upgradingos"; + private const string DeallocatedValue = "deallocated"; + private const string DeallocatingValue = "deallocating"; /// The Compute Node is not currently running a Task. public static BatchNodeState Idle { get; } = new BatchNodeState(IdleValue); @@ -65,6 +67,10 @@ public BatchNodeState(string value) public static BatchNodeState Preempted { get; } = new BatchNodeState(PreemptedValue); /// The Compute Node is undergoing an OS upgrade operation. public static BatchNodeState UpgradingOS { get; } = new BatchNodeState(UpgradingOSValue); + /// The Compute Node is deallocated. + public static BatchNodeState Deallocated { get; } = new BatchNodeState(DeallocatedValue); + /// The Compute Node is deallocating. + public static BatchNodeState Deallocating { get; } = new BatchNodeState(DeallocatingValue); /// Determines if two values are the same. public static bool operator ==(BatchNodeState left, BatchNodeState right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeUserCreateContent.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeUserCreateContent.cs index 0f9fbcc2b158..e3d6007ed5fd 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeUserCreateContent.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeUserCreateContent.cs @@ -59,7 +59,7 @@ public BatchNodeUserCreateContent(string name) /// The user name of the Account. /// Whether the Account should be an administrator on the Compute Node. The default value is false. /// The time at which the Account should expire. If omitted, the default is 1 day from the current time. For Linux Compute Nodes, the expiryTime has a precision up to a day. - /// The password of the Account. The password is required for Windows Compute Nodes (those created with 'virtualMachineConfiguration' using a Windows Image reference). For Linux Compute Nodes, the password can optionally be specified along with the sshPublicKey property. + /// The password of the Account. The password is required for Windows Compute Nodes. For Linux Compute Nodes, the password can optionally be specified along with the sshPublicKey property. /// The SSH public key that can be used for remote login to the Compute Node. The public key should be compatible with OpenSSH encoding and should be base 64 encoded. This property can be specified only for Linux Compute Nodes. If this is specified for a Windows Compute Node, then the Batch service rejects the request; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). /// Keeps track of any properties unknown to the library. internal BatchNodeUserCreateContent(string name, bool? isAdmin, DateTimeOffset? expiryTime, string password, string sshPublicKey, IDictionary serializedAdditionalRawData) @@ -83,7 +83,7 @@ internal BatchNodeUserCreateContent() public bool? IsAdmin { get; set; } /// The time at which the Account should expire. If omitted, the default is 1 day from the current time. For Linux Compute Nodes, the expiryTime has a precision up to a day. public DateTimeOffset? ExpiryTime { get; set; } - /// The password of the Account. The password is required for Windows Compute Nodes (those created with 'virtualMachineConfiguration' using a Windows Image reference). For Linux Compute Nodes, the password can optionally be specified along with the sshPublicKey property. + /// The password of the Account. The password is required for Windows Compute Nodes. For Linux Compute Nodes, the password can optionally be specified along with the sshPublicKey property. public string Password { get; set; } /// The SSH public key that can be used for remote login to the Compute Node. The public key should be compatible with OpenSSH encoding and should be base 64 encoded. This property can be specified only for Linux Compute Nodes. If this is specified for a Windows Compute Node, then the Batch service rejects the request; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). public string SshPublicKey { get; set; } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeUserUpdateContent.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeUserUpdateContent.cs index 8ebac642c3d5..9741f08b6208 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeUserUpdateContent.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchNodeUserUpdateContent.cs @@ -51,7 +51,7 @@ public BatchNodeUserUpdateContent() } /// Initializes a new instance of . - /// The password of the Account. The password is required for Windows Compute Nodes (those created with 'virtualMachineConfiguration' using a Windows Image reference). For Linux Compute Nodes, the password can optionally be specified along with the sshPublicKey property. If omitted, any existing password is removed. + /// The password of the Account. The password is required for Windows Compute Nodes. For Linux Compute Nodes, the password can optionally be specified along with the sshPublicKey property. If omitted, any existing password is removed. /// The time at which the Account should expire. If omitted, the default is 1 day from the current time. For Linux Compute Nodes, the expiryTime has a precision up to a day. /// The SSH public key that can be used for remote login to the Compute Node. The public key should be compatible with OpenSSH encoding and should be base 64 encoded. This property can be specified only for Linux Compute Nodes. If this is specified for a Windows Compute Node, then the Batch service rejects the request; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If omitted, any existing SSH public key is removed. /// Keeps track of any properties unknown to the library. @@ -63,7 +63,7 @@ internal BatchNodeUserUpdateContent(string password, DateTimeOffset? expiryTime, _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The password of the Account. The password is required for Windows Compute Nodes (those created with 'virtualMachineConfiguration' using a Windows Image reference). For Linux Compute Nodes, the password can optionally be specified along with the sshPublicKey property. If omitted, any existing password is removed. + /// The password of the Account. The password is required for Windows Compute Nodes. For Linux Compute Nodes, the password can optionally be specified along with the sshPublicKey property. If omitted, any existing password is removed. public string Password { get; set; } /// The time at which the Account should expire. If omitted, the default is 1 day from the current time. For Linux Compute Nodes, the expiryTime has a precision up to a day. public DateTimeOffset? ExpiryTime { get; set; } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPool.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPool.cs index 4cbd3bee1478..a398ae3c7a09 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPool.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPool.cs @@ -67,7 +67,7 @@ internal BatchPool() /// The time at which the Pool entered its current state. /// Whether the Pool is resizing. /// The time at which the Pool entered its current allocation state. - /// The size of virtual machines in the Pool. All virtual machines in a Pool are the same size. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes). + /// The size of virtual machines in the Pool. All virtual machines in a Pool are the same size. For information about available VM sizes, see Sizes for Virtual Machines in Azure (https://learn.microsoft.com/azure/virtual-machines/sizes/overview). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). /// The virtual machine configuration for the Pool. This property must be specified. /// The timeout for allocation of Compute Nodes to the Pool. This is the timeout for the most recent resize operation. (The initial sizing when the Pool is created counts as a resize.) The default value is 15 minutes. /// A list of errors encountered while performing the last resize on the Pool. This property is set only if one or more errors occurred during the last Pool resize, and only when the Pool allocationState is Steady. @@ -88,7 +88,7 @@ internal BatchPool() /// How Tasks are distributed across Compute Nodes in a Pool. If not specified, the default is spread. /// The list of user Accounts to be created on each Compute Node in the Pool. /// A list of name-value pairs associated with the Pool as metadata. - /// Utilization and resource usage statistics for the entire lifetime of the Pool. This property is populated only if the CloudPool was retrieved with an expand clause including the 'stats' attribute; otherwise it is null. The statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30 minutes. + /// Utilization and resource usage statistics for the entire lifetime of the Pool. This property is populated only if the BatchPool was retrieved with an expand clause including the 'stats' attribute; otherwise it is null. The statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30 minutes. /// A list of file systems to mount on each node in the pool. This supports Azure Files, NFS, CIFS/SMB, and Blobfuse. /// The identity of the Batch pool, if configured. The list of user identities associated with the Batch pool. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. /// The desired node communication mode for the pool. If omitted, the default value is Default. @@ -157,7 +157,7 @@ internal BatchPool(string id, string displayName, string url, string eTag, DateT public AllocationState? AllocationState { get; } /// The time at which the Pool entered its current allocation state. public DateTimeOffset? AllocationStateTransitionTime { get; } - /// The size of virtual machines in the Pool. All virtual machines in a Pool are the same size. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes). + /// The size of virtual machines in the Pool. All virtual machines in a Pool are the same size. For information about available VM sizes, see Sizes for Virtual Machines in Azure (https://learn.microsoft.com/azure/virtual-machines/sizes/overview). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). public string VmSize { get; } /// The virtual machine configuration for the Pool. This property must be specified. public VirtualMachineConfiguration VirtualMachineConfiguration { get; } @@ -199,7 +199,7 @@ internal BatchPool(string id, string displayName, string url, string eTag, DateT public IReadOnlyList UserAccounts { get; } /// A list of name-value pairs associated with the Pool as metadata. public IReadOnlyList Metadata { get; } - /// Utilization and resource usage statistics for the entire lifetime of the Pool. This property is populated only if the CloudPool was retrieved with an expand clause including the 'stats' attribute; otherwise it is null. The statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30 minutes. + /// Utilization and resource usage statistics for the entire lifetime of the Pool. This property is populated only if the BatchPool was retrieved with an expand clause including the 'stats' attribute; otherwise it is null. The statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30 minutes. public BatchPoolStatistics Stats { get; } /// A list of file systems to mount on each node in the pool. This supports Azure Files, NFS, CIFS/SMB, and Blobfuse. public IReadOnlyList MountConfiguration { get; } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPoolCreateContent.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPoolCreateContent.cs index 78653a2849d3..19a0f7de26e8 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPoolCreateContent.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPoolCreateContent.cs @@ -47,7 +47,7 @@ public partial class BatchPoolCreateContent /// Initializes a new instance of . /// A string that uniquely identifies the Pool within the Account. The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two Pool IDs within an Account that differ only by case). - /// The size of virtual machines in the Pool. All virtual machines in a Pool are the same size. For information about available VM sizes for Pools using Images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration), see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). + /// The size of virtual machines in the Pool. All virtual machines in a Pool are the same size. For information about available VM sizes for Pools using Images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration), see Sizes for Virtual Machines in Azure (https://learn.microsoft.com/azure/virtual-machines/sizes/overview). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). /// or is null. public BatchPoolCreateContent(string id, string vmSize) { @@ -66,14 +66,14 @@ public BatchPoolCreateContent(string id, string vmSize) /// Initializes a new instance of . /// A string that uniquely identifies the Pool within the Account. The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two Pool IDs within an Account that differ only by case). /// The display name for the Pool. The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - /// The size of virtual machines in the Pool. All virtual machines in a Pool are the same size. For information about available VM sizes for Pools using Images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration), see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). + /// The size of virtual machines in the Pool. All virtual machines in a Pool are the same size. For information about available VM sizes for Pools using Images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration), see Sizes for Virtual Machines in Azure (https://learn.microsoft.com/azure/virtual-machines/sizes/overview). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). /// The virtual machine configuration for the Pool. This property must be specified. /// The timeout for allocation of Compute Nodes to the Pool. This timeout applies only to manual scaling; it has no effect when enableAutoScale is set to true. The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). /// The user-specified tags associated with the pool. The user-defined tags to be associated with the Azure Batch Pool. When specified, these tags are propagated to the backing Azure resources associated with the pool. This property can only be specified when the Batch account was created with the poolAllocationMode property set to 'UserSubscription'. /// The desired number of dedicated Compute Nodes in the Pool. This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both. /// The desired number of Spot/Low-priority Compute Nodes in the Pool. This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both. /// Whether the Pool size should automatically adjust over time. If false, at least one of targetDedicatedNodes and targetLowPriorityNodes must be specified. If true, the autoScaleFormula property is required and the Pool automatically resizes according to the formula. The default value is false. - /// A formula for the desired number of Compute Nodes in the Pool. This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the Pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see 'Automatically scale Compute Nodes in an Azure Batch Pool' (https://azure.microsoft.com/documentation/articles/batch-automatic-scaling/). + /// A formula for the desired number of Compute Nodes in the Pool. This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the Pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see 'Automatically scale Compute Nodes in an Azure Batch Pool' (https://learn.microsoft.com/azure/batch/batch-automatic-scaling). /// The time interval at which to automatically adjust the Pool size according to the autoscale formula. The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). /// Whether the Pool permits direct communication between Compute Nodes. Enabling inter-node communication limits the maximum size of the Pool due to deployment restrictions on the Compute Nodes of the Pool. This may result in the Pool not reaching its desired size. The default value is false. /// The network configuration for the Pool. @@ -123,7 +123,7 @@ internal BatchPoolCreateContent() public string Id { get; } /// The display name for the Pool. The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. public string DisplayName { get; set; } - /// The size of virtual machines in the Pool. All virtual machines in a Pool are the same size. For information about available VM sizes for Pools using Images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration), see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). + /// The size of virtual machines in the Pool. All virtual machines in a Pool are the same size. For information about available VM sizes for Pools using Images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration), see Sizes for Virtual Machines in Azure (https://learn.microsoft.com/azure/virtual-machines/sizes/overview). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). public string VmSize { get; } /// The virtual machine configuration for the Pool. This property must be specified. public VirtualMachineConfiguration VirtualMachineConfiguration { get; set; } @@ -137,7 +137,7 @@ internal BatchPoolCreateContent() public int? TargetLowPriorityNodes { get; set; } /// Whether the Pool size should automatically adjust over time. If false, at least one of targetDedicatedNodes and targetLowPriorityNodes must be specified. If true, the autoScaleFormula property is required and the Pool automatically resizes according to the formula. The default value is false. public bool? EnableAutoScale { get; set; } - /// A formula for the desired number of Compute Nodes in the Pool. This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the Pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see 'Automatically scale Compute Nodes in an Azure Batch Pool' (https://azure.microsoft.com/documentation/articles/batch-automatic-scaling/). + /// A formula for the desired number of Compute Nodes in the Pool. This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the Pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see 'Automatically scale Compute Nodes in an Azure Batch Pool' (https://learn.microsoft.com/azure/batch/batch-automatic-scaling). public string AutoScaleFormula { get; set; } /// The time interval at which to automatically adjust the Pool size according to the autoscale formula. The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). public TimeSpan? AutoScaleEvaluationInterval { get; set; } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPoolEnableAutoScaleContent.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPoolEnableAutoScaleContent.cs index 13446bd47d3c..b3b15b6404d6 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPoolEnableAutoScaleContent.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPoolEnableAutoScaleContent.cs @@ -51,7 +51,7 @@ public BatchPoolEnableAutoScaleContent() } /// Initializes a new instance of . - /// The formula for the desired number of Compute Nodes in the Pool. The formula is checked for validity before it is applied to the Pool. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see Automatically scale Compute Nodes in an Azure Batch Pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling). + /// The formula for the desired number of Compute Nodes in the Pool. The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If you specify a new interval, then the existing autoscale evaluation schedule will be stopped and a new autoscale evaluation schedule will be started, with its starting time being the time when this request was issued. /// The time interval at which to automatically adjust the Pool size according to the autoscale formula. The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If you specify a new interval, then the existing autoscale evaluation schedule will be stopped and a new autoscale evaluation schedule will be started, with its starting time being the time when this request was issued. /// Keeps track of any properties unknown to the library. internal BatchPoolEnableAutoScaleContent(string autoScaleFormula, TimeSpan? autoScaleEvaluationInterval, IDictionary serializedAdditionalRawData) @@ -61,7 +61,7 @@ internal BatchPoolEnableAutoScaleContent(string autoScaleFormula, TimeSpan? auto _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The formula for the desired number of Compute Nodes in the Pool. The formula is checked for validity before it is applied to the Pool. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see Automatically scale Compute Nodes in an Azure Batch Pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling). + /// The formula for the desired number of Compute Nodes in the Pool. The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If you specify a new interval, then the existing autoscale evaluation schedule will be stopped and a new autoscale evaluation schedule will be started, with its starting time being the time when this request was issued. public string AutoScaleFormula { get; set; } /// The time interval at which to automatically adjust the Pool size according to the autoscale formula. The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If you specify a new interval, then the existing autoscale evaluation schedule will be stopped and a new autoscale evaluation schedule will be started, with its starting time being the time when this request was issued. public TimeSpan? AutoScaleEvaluationInterval { get; set; } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPoolEvaluateAutoScaleContent.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPoolEvaluateAutoScaleContent.cs index b89f8e7df1cd..50097db45eac 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPoolEvaluateAutoScaleContent.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPoolEvaluateAutoScaleContent.cs @@ -46,7 +46,7 @@ public partial class BatchPoolEvaluateAutoScaleContent private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The formula for the desired number of Compute Nodes in the Pool. The formula is validated and its results calculated, but it is not applied to the Pool. To apply the formula to the Pool, 'Enable automatic scaling on a Pool'. For more information about specifying this formula, see Automatically scale Compute Nodes in an Azure Batch Pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling). + /// The formula for the desired number of Compute Nodes in the Pool. The formula is validated and its results calculated, but it is not applied to the Pool. To apply the formula to the Pool, 'Enable automatic scaling on a Pool'. For more information about specifying this formula, see Automatically scale Compute Nodes in an Azure Batch Pool (https://learn.microsoft.com/azure/batch/batch-automatic-scaling). /// is null. public BatchPoolEvaluateAutoScaleContent(string autoScaleFormula) { @@ -56,7 +56,7 @@ public BatchPoolEvaluateAutoScaleContent(string autoScaleFormula) } /// Initializes a new instance of . - /// The formula for the desired number of Compute Nodes in the Pool. The formula is validated and its results calculated, but it is not applied to the Pool. To apply the formula to the Pool, 'Enable automatic scaling on a Pool'. For more information about specifying this formula, see Automatically scale Compute Nodes in an Azure Batch Pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling). + /// The formula for the desired number of Compute Nodes in the Pool. The formula is validated and its results calculated, but it is not applied to the Pool. To apply the formula to the Pool, 'Enable automatic scaling on a Pool'. For more information about specifying this formula, see Automatically scale Compute Nodes in an Azure Batch Pool (https://learn.microsoft.com/azure/batch/batch-automatic-scaling). /// Keeps track of any properties unknown to the library. internal BatchPoolEvaluateAutoScaleContent(string autoScaleFormula, IDictionary serializedAdditionalRawData) { @@ -69,7 +69,7 @@ internal BatchPoolEvaluateAutoScaleContent() { } - /// The formula for the desired number of Compute Nodes in the Pool. The formula is validated and its results calculated, but it is not applied to the Pool. To apply the formula to the Pool, 'Enable automatic scaling on a Pool'. For more information about specifying this formula, see Automatically scale Compute Nodes in an Azure Batch Pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling). + /// The formula for the desired number of Compute Nodes in the Pool. The formula is validated and its results calculated, but it is not applied to the Pool. To apply the formula to the Pool, 'Enable automatic scaling on a Pool'. For more information about specifying this formula, see Automatically scale Compute Nodes in an Azure Batch Pool (https://learn.microsoft.com/azure/batch/batch-automatic-scaling). public string AutoScaleFormula { get; } } } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPoolSpecification.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPoolSpecification.cs index 758fe6016c02..26540e39b9fc 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPoolSpecification.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPoolSpecification.cs @@ -46,7 +46,7 @@ public partial class BatchPoolSpecification private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The size of the virtual machines in the Pool. All virtual machines in a Pool are the same size. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes). + /// The size of the virtual machines in the Pool. All virtual machines in a Pool are the same size. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://learn.microsoft.com/azure/batch/batch-pool-vm-sizes). /// is null. public BatchPoolSpecification(string vmSize) { @@ -61,8 +61,8 @@ public BatchPoolSpecification(string vmSize) /// Initializes a new instance of . /// The display name for the Pool. The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - /// The size of the virtual machines in the Pool. All virtual machines in a Pool are the same size. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes). - /// The virtual machine configuration for the Pool. This property must be specified if the Pool needs to be created with Azure IaaS VMs. If it is not specified then the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + /// The size of the virtual machines in the Pool. All virtual machines in a Pool are the same size. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://learn.microsoft.com/azure/batch/batch-pool-vm-sizes). + /// The virtual machine configuration for the Pool. This property must be specified. /// The number of task slots that can be used to run concurrent tasks on a single compute node in the pool. The default value is 1. The maximum value is the smaller of 4 times the number of cores of the vmSize of the pool or 256. /// How Tasks are distributed across Compute Nodes in a Pool. If not specified, the default is spread. /// The timeout for allocation of Compute Nodes to the Pool. This timeout applies only to manual scaling; it has no effect when enableAutoScale is set to true. The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service rejects the request with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). @@ -115,9 +115,9 @@ internal BatchPoolSpecification() /// The display name for the Pool. The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. public string DisplayName { get; set; } - /// The size of the virtual machines in the Pool. All virtual machines in a Pool are the same size. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes). + /// The size of the virtual machines in the Pool. All virtual machines in a Pool are the same size. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://learn.microsoft.com/azure/batch/batch-pool-vm-sizes). public string VmSize { get; set; } - /// The virtual machine configuration for the Pool. This property must be specified if the Pool needs to be created with Azure IaaS VMs. If it is not specified then the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + /// The virtual machine configuration for the Pool. This property must be specified. public VirtualMachineConfiguration VirtualMachineConfiguration { get; set; } /// The number of task slots that can be used to run concurrent tasks on a single compute node in the pool. The default value is 1. The maximum value is the smaller of 4 times the number of cores of the vmSize of the pool or 256. public int? TaskSlotsPerNode { get; set; } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPoolUpdateContent.Serialization.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPoolUpdateContent.Serialization.cs index ec85cc71f76f..566169b705d0 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPoolUpdateContent.Serialization.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPoolUpdateContent.Serialization.cs @@ -34,6 +34,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(BatchPoolUpdateContent)} does not support writing '{format}' format."); } + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (Optional.IsDefined(VmSize)) + { + writer.WritePropertyName("vmSize"u8); + writer.WriteStringValue(VmSize); + } + if (Optional.IsDefined(EnableInterNodeCommunication)) + { + writer.WritePropertyName("enableInterNodeCommunication"u8); + writer.WriteBooleanValue(EnableInterNodeCommunication.Value); + } if (Optional.IsDefined(StartTask)) { writer.WritePropertyName("startTask"u8); @@ -59,11 +74,67 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndArray(); } + if (Optional.IsDefined(VirtualMachineConfiguration)) + { + writer.WritePropertyName("virtualMachineConfiguration"u8); + writer.WriteObjectValue(VirtualMachineConfiguration, options); + } if (Optional.IsDefined(TargetNodeCommunicationMode)) { writer.WritePropertyName("targetNodeCommunicationMode"u8); writer.WriteStringValue(TargetNodeCommunicationMode.Value.ToString()); } + if (Optional.IsDefined(TaskSlotsPerNode)) + { + writer.WritePropertyName("taskSlotsPerNode"u8); + writer.WriteNumberValue(TaskSlotsPerNode.Value); + } + if (Optional.IsDefined(TaskSchedulingPolicy)) + { + writer.WritePropertyName("taskSchedulingPolicy"u8); + writer.WriteObjectValue(TaskSchedulingPolicy, options); + } + if (Optional.IsDefined(NetworkConfiguration)) + { + writer.WritePropertyName("networkConfiguration"u8); + writer.WriteObjectValue(NetworkConfiguration, options); + } + if (Optional.IsCollectionDefined(ResourceTags)) + { + writer.WritePropertyName("resourceTags"u8); + writer.WriteStartObject(); + foreach (var item in ResourceTags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsCollectionDefined(UserAccounts)) + { + writer.WritePropertyName("userAccounts"u8); + writer.WriteStartArray(); + foreach (var item in UserAccounts) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(MountConfiguration)) + { + writer.WritePropertyName("mountConfiguration"u8); + writer.WriteStartArray(); + foreach (var item in MountConfiguration) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(UpgradePolicy)) + { + writer.WritePropertyName("upgradePolicy"u8); + writer.WriteObjectValue(UpgradePolicy, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -101,14 +172,44 @@ internal static BatchPoolUpdateContent DeserializeBatchPoolUpdateContent(JsonEle { return null; } + string displayName = default; + string vmSize = default; + bool? enableInterNodeCommunication = default; BatchStartTask startTask = default; IList applicationPackageReferences = default; IList metadata = default; + VirtualMachineConfiguration virtualMachineConfiguration = default; BatchNodeCommunicationMode? targetNodeCommunicationMode = default; + int? taskSlotsPerNode = default; + BatchTaskSchedulingPolicy taskSchedulingPolicy = default; + NetworkConfiguration networkConfiguration = default; + IDictionary resourceTags = default; + IList userAccounts = default; + IList mountConfiguration = default; + UpgradePolicy upgradePolicy = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("vmSize"u8)) + { + vmSize = property.Value.GetString(); + continue; + } + if (property.NameEquals("enableInterNodeCommunication"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableInterNodeCommunication = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("startTask"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -146,6 +247,15 @@ internal static BatchPoolUpdateContent DeserializeBatchPoolUpdateContent(JsonEle metadata = array; continue; } + if (property.NameEquals("virtualMachineConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + virtualMachineConfiguration = VirtualMachineConfiguration.DeserializeVirtualMachineConfiguration(property.Value, options); + continue; + } if (property.NameEquals("targetNodeCommunicationMode"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -155,13 +265,107 @@ internal static BatchPoolUpdateContent DeserializeBatchPoolUpdateContent(JsonEle targetNodeCommunicationMode = new BatchNodeCommunicationMode(property.Value.GetString()); continue; } + if (property.NameEquals("taskSlotsPerNode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + taskSlotsPerNode = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("taskSchedulingPolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + taskSchedulingPolicy = BatchTaskSchedulingPolicy.DeserializeBatchTaskSchedulingPolicy(property.Value, options); + continue; + } + if (property.NameEquals("networkConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkConfiguration = NetworkConfiguration.DeserializeNetworkConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("resourceTags"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()); + } + resourceTags = dictionary; + continue; + } + if (property.NameEquals("userAccounts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UserAccount.DeserializeUserAccount(item, options)); + } + userAccounts = array; + continue; + } + if (property.NameEquals("mountConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Batch.MountConfiguration.DeserializeMountConfiguration(item, options)); + } + mountConfiguration = array; + continue; + } + if (property.NameEquals("upgradePolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + upgradePolicy = UpgradePolicy.DeserializeUpgradePolicy(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new BatchPoolUpdateContent(startTask, applicationPackageReferences ?? new ChangeTrackingList(), metadata ?? new ChangeTrackingList(), targetNodeCommunicationMode, serializedAdditionalRawData); + return new BatchPoolUpdateContent( + displayName, + vmSize, + enableInterNodeCommunication, + startTask, + applicationPackageReferences ?? new ChangeTrackingList(), + metadata ?? new ChangeTrackingList(), + virtualMachineConfiguration, + targetNodeCommunicationMode, + taskSlotsPerNode, + taskSchedulingPolicy, + networkConfiguration, + resourceTags ?? new ChangeTrackingDictionary(), + userAccounts ?? new ChangeTrackingList(), + mountConfiguration ?? new ChangeTrackingList(), + upgradePolicy, + serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPoolUpdateContent.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPoolUpdateContent.cs index 1300eb052c5c..9e84325fdb5d 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPoolUpdateContent.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPoolUpdateContent.cs @@ -50,30 +50,77 @@ public BatchPoolUpdateContent() { ApplicationPackageReferences = new ChangeTrackingList(); Metadata = new ChangeTrackingList(); + ResourceTags = new ChangeTrackingDictionary(); + UserAccounts = new ChangeTrackingList(); + MountConfiguration = new ChangeTrackingList(); } /// Initializes a new instance of . + /// The display name for the Pool. The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. This field can be updated only when the pool is empty. + /// The size of virtual machines in the Pool. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://learn.microsoft.com/azure/batch/batch-pool-vm-sizes).<br /><br />This field can be updated only when the pool is empty. + /// Whether the Pool permits direct communication between Compute Nodes. Enabling inter-node communication limits the maximum size of the Pool due to deployment restrictions on the Compute Nodes of the Pool. This may result in the Pool not reaching its desired size. The default value is false.<br /><br />This field can be updated only when the pool is empty. /// A Task to run on each Compute Node as it joins the Pool. The Task runs when the Compute Node is added to the Pool or when the Compute Node is restarted. If this element is present, it overwrites any existing StartTask. If omitted, any existing StartTask is left unchanged. /// A list of Packages to be installed on each Compute Node in the Pool. Changes to Package references affect all new Nodes joining the Pool, but do not affect Compute Nodes that are already in the Pool until they are rebooted or reimaged. If this element is present, it replaces any existing Package references. If you specify an empty collection, then all Package references are removed from the Pool. If omitted, any existing Package references are left unchanged. /// A list of name-value pairs associated with the Pool as metadata. If this element is present, it replaces any existing metadata configured on the Pool. If you specify an empty collection, any metadata is removed from the Pool. If omitted, any existing metadata is left unchanged. + /// The virtual machine configuration for the Pool. This property must be specified.<br /><br />This field can be updated only when the pool is empty. /// The desired node communication mode for the pool. If this element is present, it replaces the existing targetNodeCommunicationMode configured on the Pool. If omitted, any existing metadata is left unchanged. + /// The number of task slots that can be used to run concurrent tasks on a single compute node in the pool. The default value is 1. The maximum value is the smaller of 4 times the number of cores of the vmSize of the pool or 256.<br /><br />This field can be updated only when the pool is empty. + /// How Tasks are distributed across Compute Nodes in a Pool. If not specified, the default is spread.<br /><br />This field can be updated only when the pool is empty. + /// The network configuration for the Pool. This field can be updated only when the pool is empty. + /// The user-specified tags associated with the pool. The user-defined tags to be associated with the Azure Batch Pool. When specified, these tags are propagated to the backing Azure resources associated with the pool. This property can only be specified when the Batch account was created with the poolAllocationMode property set to 'UserSubscription'.<br /><br />This field can be updated only when the pool is empty. + /// The list of user Accounts to be created on each Compute Node in the Pool. This field can be updated only when the pool is empty. + /// Mount storage using specified file system for the entire lifetime of the pool. Mount the storage using Azure fileshare, NFS, CIFS or Blobfuse based file system.<br /><br />This field can be updated only when the pool is empty. + /// The upgrade policy for the Pool. Describes an upgrade policy - automatic, manual, or rolling.<br /><br />This field can be updated only when the pool is empty. /// Keeps track of any properties unknown to the library. - internal BatchPoolUpdateContent(BatchStartTask startTask, IList applicationPackageReferences, IList metadata, BatchNodeCommunicationMode? targetNodeCommunicationMode, IDictionary serializedAdditionalRawData) + internal BatchPoolUpdateContent(string displayName, string vmSize, bool? enableInterNodeCommunication, BatchStartTask startTask, IList applicationPackageReferences, IList metadata, VirtualMachineConfiguration virtualMachineConfiguration, BatchNodeCommunicationMode? targetNodeCommunicationMode, int? taskSlotsPerNode, BatchTaskSchedulingPolicy taskSchedulingPolicy, NetworkConfiguration networkConfiguration, IDictionary resourceTags, IList userAccounts, IList mountConfiguration, UpgradePolicy upgradePolicy, IDictionary serializedAdditionalRawData) { + DisplayName = displayName; + VmSize = vmSize; + EnableInterNodeCommunication = enableInterNodeCommunication; StartTask = startTask; ApplicationPackageReferences = applicationPackageReferences; Metadata = metadata; + VirtualMachineConfiguration = virtualMachineConfiguration; TargetNodeCommunicationMode = targetNodeCommunicationMode; + TaskSlotsPerNode = taskSlotsPerNode; + TaskSchedulingPolicy = taskSchedulingPolicy; + NetworkConfiguration = networkConfiguration; + ResourceTags = resourceTags; + UserAccounts = userAccounts; + MountConfiguration = mountConfiguration; + UpgradePolicy = upgradePolicy; _serializedAdditionalRawData = serializedAdditionalRawData; } + /// The display name for the Pool. The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. This field can be updated only when the pool is empty. + public string DisplayName { get; set; } + /// The size of virtual machines in the Pool. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://learn.microsoft.com/azure/batch/batch-pool-vm-sizes).<br /><br />This field can be updated only when the pool is empty. + public string VmSize { get; set; } + /// Whether the Pool permits direct communication between Compute Nodes. Enabling inter-node communication limits the maximum size of the Pool due to deployment restrictions on the Compute Nodes of the Pool. This may result in the Pool not reaching its desired size. The default value is false.<br /><br />This field can be updated only when the pool is empty. + public bool? EnableInterNodeCommunication { get; set; } /// A Task to run on each Compute Node as it joins the Pool. The Task runs when the Compute Node is added to the Pool or when the Compute Node is restarted. If this element is present, it overwrites any existing StartTask. If omitted, any existing StartTask is left unchanged. public BatchStartTask StartTask { get; set; } /// A list of Packages to be installed on each Compute Node in the Pool. Changes to Package references affect all new Nodes joining the Pool, but do not affect Compute Nodes that are already in the Pool until they are rebooted or reimaged. If this element is present, it replaces any existing Package references. If you specify an empty collection, then all Package references are removed from the Pool. If omitted, any existing Package references are left unchanged. public IList ApplicationPackageReferences { get; } /// A list of name-value pairs associated with the Pool as metadata. If this element is present, it replaces any existing metadata configured on the Pool. If you specify an empty collection, any metadata is removed from the Pool. If omitted, any existing metadata is left unchanged. public IList Metadata { get; } + /// The virtual machine configuration for the Pool. This property must be specified.<br /><br />This field can be updated only when the pool is empty. + public VirtualMachineConfiguration VirtualMachineConfiguration { get; set; } /// The desired node communication mode for the pool. If this element is present, it replaces the existing targetNodeCommunicationMode configured on the Pool. If omitted, any existing metadata is left unchanged. public BatchNodeCommunicationMode? TargetNodeCommunicationMode { get; set; } + /// The number of task slots that can be used to run concurrent tasks on a single compute node in the pool. The default value is 1. The maximum value is the smaller of 4 times the number of cores of the vmSize of the pool or 256.<br /><br />This field can be updated only when the pool is empty. + public int? TaskSlotsPerNode { get; set; } + /// How Tasks are distributed across Compute Nodes in a Pool. If not specified, the default is spread.<br /><br />This field can be updated only when the pool is empty. + public BatchTaskSchedulingPolicy TaskSchedulingPolicy { get; set; } + /// The network configuration for the Pool. This field can be updated only when the pool is empty. + public NetworkConfiguration NetworkConfiguration { get; set; } + /// The user-specified tags associated with the pool. The user-defined tags to be associated with the Azure Batch Pool. When specified, these tags are propagated to the backing Azure resources associated with the pool. This property can only be specified when the Batch account was created with the poolAllocationMode property set to 'UserSubscription'.<br /><br />This field can be updated only when the pool is empty. + public IDictionary ResourceTags { get; } + /// The list of user Accounts to be created on each Compute Node in the Pool. This field can be updated only when the pool is empty. + public IList UserAccounts { get; } + /// Mount storage using specified file system for the entire lifetime of the pool. Mount the storage using Azure fileshare, NFS, CIFS or Blobfuse based file system.<br /><br />This field can be updated only when the pool is empty. + public IList MountConfiguration { get; } + /// The upgrade policy for the Pool. Describes an upgrade policy - automatic, manual, or rolling.<br /><br />This field can be updated only when the pool is empty. + public UpgradePolicy UpgradePolicy { get; set; } } } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPoolUsageMetrics.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPoolUsageMetrics.cs index c28463c07907..66fee7143432 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPoolUsageMetrics.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchPoolUsageMetrics.cs @@ -49,7 +49,7 @@ public partial class BatchPoolUsageMetrics /// The ID of the Pool whose metrics are aggregated in this entry. /// The start time of the aggregation interval covered by this entry. /// The end time of the aggregation interval covered by this entry. - /// The size of virtual machines in the Pool. All VMs in a Pool are the same size. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes). + /// The size of virtual machines in the Pool. All VMs in a Pool are the same size. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://learn.microsoft.com/azure/batch/batch-pool-vm-sizes). /// The total core hours used in the Pool during this aggregation interval. /// or is null. internal BatchPoolUsageMetrics(string poolId, DateTimeOffset startTime, DateTimeOffset endTime, string vmSize, float totalCoreHours) @@ -68,7 +68,7 @@ internal BatchPoolUsageMetrics(string poolId, DateTimeOffset startTime, DateTime /// The ID of the Pool whose metrics are aggregated in this entry. /// The start time of the aggregation interval covered by this entry. /// The end time of the aggregation interval covered by this entry. - /// The size of virtual machines in the Pool. All VMs in a Pool are the same size. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes). + /// The size of virtual machines in the Pool. All VMs in a Pool are the same size. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://learn.microsoft.com/azure/batch/batch-pool-vm-sizes). /// The total core hours used in the Pool during this aggregation interval. /// Keeps track of any properties unknown to the library. internal BatchPoolUsageMetrics(string poolId, DateTimeOffset startTime, DateTimeOffset endTime, string vmSize, float totalCoreHours, IDictionary serializedAdditionalRawData) @@ -92,7 +92,7 @@ internal BatchPoolUsageMetrics() public DateTimeOffset StartTime { get; } /// The end time of the aggregation interval covered by this entry. public DateTimeOffset EndTime { get; } - /// The size of virtual machines in the Pool. All VMs in a Pool are the same size. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes). + /// The size of virtual machines in the Pool. All VMs in a Pool are the same size. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://learn.microsoft.com/azure/batch/batch-pool-vm-sizes). public string VmSize { get; } /// The total core hours used in the Pool during this aggregation interval. public float TotalCoreHours { get; } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchStartTask.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchStartTask.cs index d83549ff0698..4adb269470aa 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchStartTask.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchStartTask.cs @@ -60,7 +60,7 @@ public partial class BatchStartTask private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The command line of the StartTask. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// The command line of the StartTask. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables). /// is null. public BatchStartTask(string commandLine) { @@ -72,7 +72,7 @@ public BatchStartTask(string commandLine) } /// Initializes a new instance of . - /// The command line of the StartTask. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// The command line of the StartTask. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables). /// The settings for the container under which the StartTask runs. When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. /// A list of files that the Batch service will download to the Compute Node before running the command line. There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. Files listed under this element are located in the Task's working directory. /// A list of environment variable settings for the StartTask. @@ -97,7 +97,7 @@ internal BatchStartTask() { } - /// The command line of the StartTask. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// The command line of the StartTask. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables). public string CommandLine { get; set; } /// The settings for the container under which the StartTask runs. When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. public BatchTaskContainerSettings ContainerSettings { get; set; } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchTask.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchTask.cs index 3f38ef61f36d..db112fb7f7ae 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchTask.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchTask.cs @@ -76,7 +76,7 @@ public BatchTask() /// The time at which the Task entered its current state. /// The previous state of the Task. This property is not set if the Task is in its initial Active state. /// The time at which the Task entered its previous state. This property is not set if the Task is in its initial Active state. - /// The command line of the Task. For multi-instance Tasks, the command line is executed as the primary Task, after the primary Task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// The command line of the Task. For multi-instance Tasks, the command line is executed as the primary Task, after the primary Task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables). /// The settings for the container under which the Task runs. If the Pool that will run this Task has containerConfiguration set, this must be set as well. If the Pool that will run this Task doesn't have containerConfiguration set, this must not be set. When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. /// A list of files that the Batch service will download to the Compute Node before running the command line. For multi-instance Tasks, the resource files will only be downloaded to the Compute Node on which the primary Task is executed. There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. /// A list of files that the Batch service will upload from the Compute Node after running the command line. For multi-instance Tasks, the files will only be uploaded from the Compute Node on which the primary Task is executed. @@ -147,7 +147,7 @@ internal BatchTask(string id, string displayName, string url, string eTag, DateT public BatchTaskState? PreviousState { get; } /// The time at which the Task entered its previous state. This property is not set if the Task is in its initial Active state. public DateTimeOffset? PreviousStateTransitionTime { get; } - /// The command line of the Task. For multi-instance Tasks, the command line is executed as the primary Task, after the primary Task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// The command line of the Task. For multi-instance Tasks, the command line is executed as the primary Task, after the primary Task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables). public string CommandLine { get; } /// The settings for the container under which the Task runs. If the Pool that will run this Task has containerConfiguration set, this must be set as well. If the Pool that will run this Task doesn't have containerConfiguration set, this must not be set. When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. public BatchTaskContainerSettings ContainerSettings { get; } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchTaskContainerSettings.Serialization.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchTaskContainerSettings.Serialization.cs index 19f0339c4bc8..b7d45b7c030a 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchTaskContainerSettings.Serialization.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchTaskContainerSettings.Serialization.cs @@ -51,6 +51,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("workingDirectory"u8); writer.WriteStringValue(WorkingDirectory.Value.ToString()); } + if (Optional.IsCollectionDefined(ContainerHostBatchBindMounts)) + { + writer.WritePropertyName("containerHostBatchBindMounts"u8); + writer.WriteStartArray(); + foreach (var item in ContainerHostBatchBindMounts) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -92,6 +102,7 @@ internal static BatchTaskContainerSettings DeserializeBatchTaskContainerSettings string imageName = default; ContainerRegistryReference registry = default; ContainerWorkingDirectory? workingDirectory = default; + IList containerHostBatchBindMounts = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -124,13 +135,33 @@ internal static BatchTaskContainerSettings DeserializeBatchTaskContainerSettings workingDirectory = new ContainerWorkingDirectory(property.Value.GetString()); continue; } + if (property.NameEquals("containerHostBatchBindMounts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContainerHostBatchBindMountEntry.DeserializeContainerHostBatchBindMountEntry(item, options)); + } + containerHostBatchBindMounts = array; + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new BatchTaskContainerSettings(containerRunOptions, imageName, registry, workingDirectory, serializedAdditionalRawData); + return new BatchTaskContainerSettings( + containerRunOptions, + imageName, + registry, + workingDirectory, + containerHostBatchBindMounts ?? new ChangeTrackingList(), + serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchTaskContainerSettings.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchTaskContainerSettings.cs index 9ecfdf09e22b..f528edcc8753 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchTaskContainerSettings.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchTaskContainerSettings.cs @@ -53,6 +53,7 @@ public BatchTaskContainerSettings(string imageName) Argument.AssertNotNull(imageName, nameof(imageName)); ImageName = imageName; + ContainerHostBatchBindMounts = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -60,13 +61,15 @@ public BatchTaskContainerSettings(string imageName) /// The Image to use to create the container in which the Task will run. This is the full Image reference, as would be specified to "docker pull". If no tag is provided as part of the Image name, the tag ":latest" is used as a default. /// The private registry which contains the container Image. This setting can be omitted if was already provided at Pool creation. /// The location of the container Task working directory. The default is 'taskWorkingDirectory'. + /// The paths you want to mounted to container task. If this array is null or be not present, container task will mount entire temporary disk drive in windows (or AZ_BATCH_NODE_ROOT_DIR in Linux). It won't' mount any data paths into container if this array is set as empty. /// Keeps track of any properties unknown to the library. - internal BatchTaskContainerSettings(string containerRunOptions, string imageName, ContainerRegistryReference registry, ContainerWorkingDirectory? workingDirectory, IDictionary serializedAdditionalRawData) + internal BatchTaskContainerSettings(string containerRunOptions, string imageName, ContainerRegistryReference registry, ContainerWorkingDirectory? workingDirectory, IList containerHostBatchBindMounts, IDictionary serializedAdditionalRawData) { ContainerRunOptions = containerRunOptions; ImageName = imageName; Registry = registry; WorkingDirectory = workingDirectory; + ContainerHostBatchBindMounts = containerHostBatchBindMounts; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -83,5 +86,7 @@ internal BatchTaskContainerSettings() public ContainerRegistryReference Registry { get; set; } /// The location of the container Task working directory. The default is 'taskWorkingDirectory'. public ContainerWorkingDirectory? WorkingDirectory { get; set; } + /// The paths you want to mounted to container task. If this array is null or be not present, container task will mount entire temporary disk drive in windows (or AZ_BATCH_NODE_ROOT_DIR in Linux). It won't' mount any data paths into container if this array is set as empty. + public IList ContainerHostBatchBindMounts { get; } } } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchTaskCreateContent.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchTaskCreateContent.cs index 88818560e6b8..2f6b5bda02f0 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchTaskCreateContent.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchTaskCreateContent.cs @@ -47,7 +47,7 @@ public partial class BatchTaskCreateContent /// Initializes a new instance of . /// A string that uniquely identifies the Task within the Job. The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within a Job that differ only by case). - /// The command line of the Task. For multi-instance Tasks, the command line is executed as the primary Task, after the primary Task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// The command line of the Task. For multi-instance Tasks, the command line is executed as the primary Task, after the primary Task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables). /// or is null. public BatchTaskCreateContent(string id, string commandLine) { @@ -66,7 +66,7 @@ public BatchTaskCreateContent(string id, string commandLine) /// A string that uniquely identifies the Task within the Job. The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within a Job that differ only by case). /// A display name for the Task. The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. /// How the Batch service should respond when the Task completes. - /// The command line of the Task. For multi-instance Tasks, the command line is executed as the primary Task, after the primary Task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// The command line of the Task. For multi-instance Tasks, the command line is executed as the primary Task, after the primary Task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables). /// The settings for the container under which the Task runs. If the Pool that will run this Task has containerConfiguration set, this must be set as well. If the Pool that will run this Task doesn't have containerConfiguration set, this must not be set. When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. /// A list of files that the Batch service will download to the Compute Node before running the command line. For multi-instance Tasks, the resource files will only be downloaded to the Compute Node on which the primary Task is executed. There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. /// A list of files that the Batch service will upload from the Compute Node after running the command line. For multi-instance Tasks, the files will only be uploaded from the Compute Node on which the primary Task is executed. @@ -112,7 +112,7 @@ internal BatchTaskCreateContent() public string DisplayName { get; set; } /// How the Batch service should respond when the Task completes. public ExitConditions ExitConditions { get; set; } - /// The command line of the Task. For multi-instance Tasks, the command line is executed as the primary Task, after the primary Task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// The command line of the Task. For multi-instance Tasks, the command line is executed as the primary Task, after the primary Task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables). public string CommandLine { get; } /// The settings for the container under which the Task runs. If the Pool that will run this Task has containerConfiguration set, this must be set as well. If the Pool that will run this Task doesn't have containerConfiguration set, this must not be set. When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. public BatchTaskContainerSettings ContainerSettings { get; set; } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/ComputeBatchModelFactory.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/ComputeBatchModelFactory.cs index 51e40bc9f43a..84854cd82e05 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/ComputeBatchModelFactory.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/ComputeBatchModelFactory.cs @@ -60,7 +60,7 @@ public static BatchErrorDetail BatchErrorDetail(string key = null, string value /// The ID of the Pool whose metrics are aggregated in this entry. /// The start time of the aggregation interval covered by this entry. /// The end time of the aggregation interval covered by this entry. - /// The size of virtual machines in the Pool. All VMs in a Pool are the same size. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes). + /// The size of virtual machines in the Pool. All VMs in a Pool are the same size. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://learn.microsoft.com/azure/batch/batch-pool-vm-sizes). /// The total core hours used in the Pool during this aggregation interval. /// A new instance for mocking. public static BatchPoolUsageMetrics BatchPoolUsageMetrics(string poolId = null, DateTimeOffset startTime = default, DateTimeOffset endTime = default, string vmSize = null, float totalCoreHours = default) @@ -77,14 +77,14 @@ public static BatchPoolUsageMetrics BatchPoolUsageMetrics(string poolId = null, /// Initializes a new instance of . /// A string that uniquely identifies the Pool within the Account. The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two Pool IDs within an Account that differ only by case). /// The display name for the Pool. The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. - /// The size of virtual machines in the Pool. All virtual machines in a Pool are the same size. For information about available VM sizes for Pools using Images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration), see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). + /// The size of virtual machines in the Pool. All virtual machines in a Pool are the same size. For information about available VM sizes for Pools using Images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration), see Sizes for Virtual Machines in Azure (https://learn.microsoft.com/azure/virtual-machines/sizes/overview). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). /// The virtual machine configuration for the Pool. This property must be specified. /// The timeout for allocation of Compute Nodes to the Pool. This timeout applies only to manual scaling; it has no effect when enableAutoScale is set to true. The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). /// The user-specified tags associated with the pool. The user-defined tags to be associated with the Azure Batch Pool. When specified, these tags are propagated to the backing Azure resources associated with the pool. This property can only be specified when the Batch account was created with the poolAllocationMode property set to 'UserSubscription'. /// The desired number of dedicated Compute Nodes in the Pool. This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both. /// The desired number of Spot/Low-priority Compute Nodes in the Pool. This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both. /// Whether the Pool size should automatically adjust over time. If false, at least one of targetDedicatedNodes and targetLowPriorityNodes must be specified. If true, the autoScaleFormula property is required and the Pool automatically resizes according to the formula. The default value is false. - /// A formula for the desired number of Compute Nodes in the Pool. This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the Pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see 'Automatically scale Compute Nodes in an Azure Batch Pool' (https://azure.microsoft.com/documentation/articles/batch-automatic-scaling/). + /// A formula for the desired number of Compute Nodes in the Pool. This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the Pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see 'Automatically scale Compute Nodes in an Azure Batch Pool' (https://learn.microsoft.com/azure/batch/batch-automatic-scaling). /// The time interval at which to automatically adjust the Pool size according to the autoscale formula. The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). /// Whether the Pool permits direct communication between Compute Nodes. Enabling inter-node communication limits the maximum size of the Pool due to deployment restrictions on the Compute Nodes of the Pool. This may result in the Pool not reaching its desired size. The default value is false. /// The network configuration for the Pool. @@ -137,10 +137,12 @@ public static BatchPoolCreateContent BatchPoolCreateContent(string id = null, st /// The offer type of the Azure Virtual Machines Marketplace Image. For example, UbuntuServer or WindowsServer. /// The SKU of the Azure Virtual Machines Marketplace Image. For example, 18.04-LTS or 2019-Datacenter. /// The version of the Azure Virtual Machines Marketplace Image. A value of 'latest' can be specified to select the latest version of an Image. If omitted, the default is 'latest'. - /// The ARM resource identifier of the Azure Compute Gallery Image. Compute Nodes in the Pool will be created using this Image Id. This is of the form /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{VersionId} or /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName} for always defaulting to the latest image version. This property is mutually exclusive with other ImageReference properties. The Azure Compute Gallery Image must have replicas in the same region and must be in the same subscription as the Azure Batch account. If the image version is not specified in the imageId, the latest version will be used. For information about the firewall settings for the Batch Compute Node agent to communicate with the Batch service see https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. + /// The ARM resource identifier of the Azure Compute Gallery Image. Compute Nodes in the Pool will be created using this Image Id. This is of the form /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{VersionId} or /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName} for always defaulting to the latest image version. This property is mutually exclusive with other ImageReference properties. The Azure Compute Gallery Image must have replicas in the same region and must be in the same subscription as the Azure Batch account. If the image version is not specified in the imageId, the latest version will be used. For information about the firewall settings for the Batch Compute Node agent to communicate with the Batch service see https://learn.microsoft.com/azure/batch/nodes-and-pools#virtual-network-vnet-and-firewall-configuration. /// The specific version of the platform image or marketplace image used to create the node. This read-only field differs from 'version' only if the value specified for 'version' when the pool was created was 'latest'. + /// The shared gallery image unique identifier. This property is mutually exclusive with other properties and can be fetched from shared gallery image GET call. + /// The community gallery image unique identifier. This property is mutually exclusive with other properties and can be fetched from community gallery image GET call. /// A new instance for mocking. - public static ImageReference ImageReference(string publisher = null, string offer = null, string sku = null, string version = null, string virtualMachineImageId = null, string exactVersion = null) + public static ImageReference ImageReference(string publisher = null, string offer = null, string sku = null, string version = null, string virtualMachineImageId = null, string exactVersion = null, string sharedGalleryImageId = null, string communityGalleryImageId = null) { return new ImageReference( publisher, @@ -149,6 +151,8 @@ public static ImageReference ImageReference(string publisher = null, string offe version, virtualMachineImageId, exactVersion, + sharedGalleryImageId, + communityGalleryImageId, serializedAdditionalRawData: null); } @@ -163,7 +167,7 @@ public static ImageReference ImageReference(string publisher = null, string offe /// The time at which the Pool entered its current state. /// Whether the Pool is resizing. /// The time at which the Pool entered its current allocation state. - /// The size of virtual machines in the Pool. All virtual machines in a Pool are the same size. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes). + /// The size of virtual machines in the Pool. All virtual machines in a Pool are the same size. For information about available VM sizes, see Sizes for Virtual Machines in Azure (https://learn.microsoft.com/azure/virtual-machines/sizes/overview). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). /// The virtual machine configuration for the Pool. This property must be specified. /// The timeout for allocation of Compute Nodes to the Pool. This is the timeout for the most recent resize operation. (The initial sizing when the Pool is created counts as a resize.) The default value is 15 minutes. /// A list of errors encountered while performing the last resize on the Pool. This property is set only if one or more errors occurred during the last Pool resize, and only when the Pool allocationState is Steady. @@ -184,7 +188,7 @@ public static ImageReference ImageReference(string publisher = null, string offe /// How Tasks are distributed across Compute Nodes in a Pool. If not specified, the default is spread. /// The list of user Accounts to be created on each Compute Node in the Pool. /// A list of name-value pairs associated with the Pool as metadata. - /// Utilization and resource usage statistics for the entire lifetime of the Pool. This property is populated only if the CloudPool was retrieved with an expand clause including the 'stats' attribute; otherwise it is null. The statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30 minutes. + /// Utilization and resource usage statistics for the entire lifetime of the Pool. This property is populated only if the BatchPool was retrieved with an expand clause including the 'stats' attribute; otherwise it is null. The statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30 minutes. /// A list of file systems to mount on each node in the pool. This supports Azure Files, NFS, CIFS/SMB, and Blobfuse. /// The identity of the Batch pool, if configured. The list of user identities associated with the Batch pool. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. /// The desired node communication mode for the pool. If omitted, the default value is Default. @@ -413,10 +417,12 @@ public static BatchPoolNodeCounts BatchPoolNodeCounts(string poolId = null, Batc /// The number of Compute Nodes in the unknown state. /// The number of Compute Nodes in the unusable state. /// The number of Compute Nodes in the waitingForStartTask state. + /// The number of Compute Nodes in the deallocated state. + /// The number of Compute Nodes in the deallocating state. /// The total number of Compute Nodes. /// The number of Compute Nodes in the upgradingOS state. /// A new instance for mocking. - public static BatchNodeCounts BatchNodeCounts(int creating = default, int idle = default, int offline = default, int preempted = default, int rebooting = default, int reimaging = default, int running = default, int starting = default, int startTaskFailed = default, int leavingPool = default, int unknown = default, int unusable = default, int waitingForStartTask = default, int total = default, int upgradingOs = default) + public static BatchNodeCounts BatchNodeCounts(int creating = default, int idle = default, int offline = default, int preempted = default, int rebooting = default, int reimaging = default, int running = default, int starting = default, int startTaskFailed = default, int leavingPool = default, int unknown = default, int unusable = default, int waitingForStartTask = default, int deallocated = default, int deallocating = default, int total = default, int upgradingOs = default) { return new BatchNodeCounts( creating, @@ -432,6 +438,8 @@ public static BatchNodeCounts BatchNodeCounts(int creating = default, int idle = unknown, unusable, waitingForStartTask, + deallocated, + deallocating, total, upgradingOs, serializedAdditionalRawData: null); @@ -463,7 +471,7 @@ public static BatchNodeCounts BatchNodeCounts(int creating = default, int idle = /// The network configuration for the Job. /// A list of name-value pairs associated with the Job as metadata. The Batch service does not assign any meaning to metadata; it is solely for the use of user code. /// The execution information for the Job. - /// Resource usage statistics for the entire lifetime of the Job. This property is populated only if the CloudJob was retrieved with an expand clause including the 'stats' attribute; otherwise it is null. The statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30 minutes. + /// Resource usage statistics for the entire lifetime of the Job. This property is populated only if the BatchJob was retrieved with an expand clause including the 'stats' attribute; otherwise it is null. The statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30 minutes. /// A new instance for mocking. public static BatchJob BatchJob(string id = null, string displayName = null, bool? usesTaskDependencies = null, string url = null, string eTag = null, DateTimeOffset? lastModified = null, DateTimeOffset? creationTime = null, BatchJobState? state = null, DateTimeOffset? stateTransitionTime = null, BatchJobState? previousState = null, DateTimeOffset? previousStateTransitionTime = null, int? priority = null, bool? allowTaskPreemption = null, int? maxParallelTasks = null, BatchJobConstraints constraints = null, BatchJobManagerTask jobManagerTask = null, BatchJobPreparationTask jobPreparationTask = null, BatchJobReleaseTask jobReleaseTask = null, IEnumerable commonEnvironmentSettings = null, BatchPoolInfo poolInfo = null, OnAllBatchTasksComplete? onAllTasksComplete = null, OnBatchTaskFailure? onTaskFailure = null, BatchJobNetworkConfiguration networkConfiguration = null, IEnumerable metadata = null, BatchJobExecutionInfo executionInfo = null, BatchJobStatistics stats = null) { @@ -871,7 +879,7 @@ public static BatchJobScheduleCreateContent BatchJobScheduleCreateContent(string /// A string that uniquely identifies the Task within the Job. The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within a Job that differ only by case). /// A display name for the Task. The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. /// How the Batch service should respond when the Task completes. - /// The command line of the Task. For multi-instance Tasks, the command line is executed as the primary Task, after the primary Task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// The command line of the Task. For multi-instance Tasks, the command line is executed as the primary Task, after the primary Task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables). /// The settings for the container under which the Task runs. If the Pool that will run this Task has containerConfiguration set, this must be set as well. If the Pool that will run this Task doesn't have containerConfiguration set, this must not be set. When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. /// A list of files that the Batch service will download to the Compute Node before running the command line. For multi-instance Tasks, the resource files will only be downloaded to the Compute Node on which the primary Task is executed. There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. /// A list of files that the Batch service will upload from the Compute Node after running the command line. For multi-instance Tasks, the files will only be uploaded from the Compute Node on which the primary Task is executed. @@ -924,7 +932,7 @@ public static BatchTaskCreateContent BatchTaskCreateContent(string id = null, st /// The time at which the Task entered its current state. /// The previous state of the Task. This property is not set if the Task is in its initial Active state. /// The time at which the Task entered its previous state. This property is not set if the Task is in its initial Active state. - /// The command line of the Task. For multi-instance Tasks, the command line is executed as the primary Task, after the primary Task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). + /// The command line of the Task. For multi-instance Tasks, the command line is executed as the primary Task, after the primary Task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables). /// The settings for the container under which the Task runs. If the Pool that will run this Task has containerConfiguration set, this must be set as well. If the Pool that will run this Task doesn't have containerConfiguration set, this must not be set. When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. /// A list of files that the Batch service will download to the Compute Node before running the command line. For multi-instance Tasks, the resource files will only be downloaded to the Compute Node on which the primary Task is executed. There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. /// A list of files that the Batch service will upload from the Compute Node after running the command line. For multi-instance Tasks, the files will only be uploaded from the Compute Node on which the primary Task is executed. @@ -1137,7 +1145,7 @@ public static BatchNodeFile BatchNodeFile(string name = null, string url = null, /// The content type of the file. /// The file mode attribute in octal format. The file mode is returned only for files on Linux Compute Nodes. /// A new instance for mocking. - public static FileProperties FileProperties(DateTimeOffset? creationTime = null, DateTimeOffset lastModified = default, long contentLength = default, string contentType = null, string fileMode = null) + public static FileProperties FileProperties(DateTimeOffset? creationTime = null, DateTimeOffset lastModified = default, string contentLength = null, string contentType = null, string fileMode = null) { return new FileProperties( creationTime, @@ -1152,7 +1160,7 @@ public static FileProperties FileProperties(DateTimeOffset? creationTime = null, /// The user name of the Account. /// Whether the Account should be an administrator on the Compute Node. The default value is false. /// The time at which the Account should expire. If omitted, the default is 1 day from the current time. For Linux Compute Nodes, the expiryTime has a precision up to a day. - /// The password of the Account. The password is required for Windows Compute Nodes (those created with 'virtualMachineConfiguration' using a Windows Image reference). For Linux Compute Nodes, the password can optionally be specified along with the sshPublicKey property. + /// The password of the Account. The password is required for Windows Compute Nodes. For Linux Compute Nodes, the password can optionally be specified along with the sshPublicKey property. /// The SSH public key that can be used for remote login to the Compute Node. The public key should be compatible with OpenSSH encoding and should be base 64 encoded. This property can be specified only for Linux Compute Nodes. If this is specified for a Windows Compute Node, then the Batch service rejects the request; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). /// A new instance for mocking. public static BatchNodeUserCreateContent BatchNodeUserCreateContent(string name = null, bool? isAdmin = null, DateTimeOffset? expiryTime = null, string password = null, string sshPublicKey = null) @@ -1176,7 +1184,7 @@ public static BatchNodeUserCreateContent BatchNodeUserCreateContent(string name /// The time at which this Compute Node was allocated to the Pool. This is the time when the Compute Node was initially allocated and doesn't change once set. It is not updated when the Compute Node is service healed or preempted. /// The IP address that other Nodes can use to communicate with this Compute Node. Every Compute Node that is added to a Pool is assigned a unique IP address. Whenever a Compute Node is removed from a Pool, all of its local files are deleted, and the IP address is reclaimed and could be reused for new Compute Nodes. /// An identifier which can be passed when adding a Task to request that the Task be scheduled on this Compute Node. Note that this is just a soft affinity. If the target Compute Node is busy or unavailable at the time the Task is scheduled, then the Task will be scheduled elsewhere. - /// The size of the virtual machine hosting the Compute Node. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes). + /// The size of the virtual machine hosting the Compute Node. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://learn.microsoft.com/azure/batch/batch-pool-vm-sizes). /// The total number of Job Tasks completed on the Compute Node. This includes Job Manager Tasks and normal Tasks, but not Job Preparation, Job Release or Start Tasks. /// The total number of currently running Job Tasks on the Compute Node. This includes Job Manager Tasks and normal Tasks, but not Job Preparation, Job Release or Start Tasks. /// The total number of scheduling slots used by currently running Job Tasks on the Compute Node. This includes Job Manager Tasks and normal Tasks, but not Job Preparation, Job Release or Start Tasks. diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/ContainerHostBatchBindMountEntry.Serialization.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/ContainerHostBatchBindMountEntry.Serialization.cs new file mode 100644 index 000000000000..7136f9b4e1ff --- /dev/null +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/ContainerHostBatchBindMountEntry.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Compute.Batch +{ + public partial class ContainerHostBatchBindMountEntry : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerHostBatchBindMountEntry)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source.Value.ToString()); + } + if (Optional.IsDefined(IsReadOnly)) + { + writer.WritePropertyName("isReadOnly"u8); + writer.WriteBooleanValue(IsReadOnly.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerHostBatchBindMountEntry IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerHostBatchBindMountEntry)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerHostBatchBindMountEntry(document.RootElement, options); + } + + internal static ContainerHostBatchBindMountEntry DeserializeContainerHostBatchBindMountEntry(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ContainerHostDataPath? source = default; + bool? isReadOnly = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("source"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + source = new ContainerHostDataPath(property.Value.GetString()); + continue; + } + if (property.NameEquals("isReadOnly"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isReadOnly = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerHostBatchBindMountEntry(source, isReadOnly, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ContainerHostBatchBindMountEntry)} does not support writing '{options.Format}' format."); + } + } + + ContainerHostBatchBindMountEntry IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContainerHostBatchBindMountEntry(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerHostBatchBindMountEntry)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ContainerHostBatchBindMountEntry FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeContainerHostBatchBindMountEntry(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/batch/Azure.Compute.Batch/src/Generated/ContainerHostBatchBindMountEntry.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/ContainerHostBatchBindMountEntry.cs new file mode 100644 index 000000000000..129e36e79f3d --- /dev/null +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/ContainerHostBatchBindMountEntry.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Compute.Batch +{ + /// The entry of path and mount mode you want to mount into task container. + public partial class ContainerHostBatchBindMountEntry + { + /// + /// 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; + + /// Initializes a new instance of . + public ContainerHostBatchBindMountEntry() + { + } + + /// Initializes a new instance of . + /// The path which be mounted to container customer can select. + /// Mount this source path as read-only mode or not. Default value is false (read/write mode). For Linux, if you mount this path as a read/write mode, this does not mean that all users in container have the read/write access for the path, it depends on the access in host VM. If this path is mounted read-only, all users within the container will not be able to modify the path. + /// Keeps track of any properties unknown to the library. + internal ContainerHostBatchBindMountEntry(ContainerHostDataPath? source, bool? isReadOnly, IDictionary serializedAdditionalRawData) + { + Source = source; + IsReadOnly = isReadOnly; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The path which be mounted to container customer can select. + public ContainerHostDataPath? Source { get; set; } + /// Mount this source path as read-only mode or not. Default value is false (read/write mode). For Linux, if you mount this path as a read/write mode, this does not mean that all users in container have the read/write access for the path, it depends on the access in host VM. If this path is mounted read-only, all users within the container will not be able to modify the path. + public bool? IsReadOnly { get; set; } + } +} diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/ContainerHostDataPath.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/ContainerHostDataPath.cs new file mode 100644 index 000000000000..db0708edc775 --- /dev/null +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/ContainerHostDataPath.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Compute.Batch +{ + /// The paths which will be mounted to container task's container. + public readonly partial struct ContainerHostDataPath : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContainerHostDataPath(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SharedValue = "Shared"; + private const string StartupValue = "Startup"; + private const string VfsMountsValue = "VfsMounts"; + private const string TaskValue = "Task"; + private const string JobPrepValue = "JobPrep"; + private const string ApplicationsValue = "Applications"; + + /// The path for multi-instances task to shared their files. + public static ContainerHostDataPath Shared { get; } = new ContainerHostDataPath(SharedValue); + /// The path for start task. + public static ContainerHostDataPath Startup { get; } = new ContainerHostDataPath(StartupValue); + /// The path contains all virtual file systems are mounted on this node. + public static ContainerHostDataPath VfsMounts { get; } = new ContainerHostDataPath(VfsMountsValue); + /// The task path. + public static ContainerHostDataPath Task { get; } = new ContainerHostDataPath(TaskValue); + /// The job-prep task path. + public static ContainerHostDataPath JobPrep { get; } = new ContainerHostDataPath(JobPrepValue); + /// The applications path. + public static ContainerHostDataPath Applications { get; } = new ContainerHostDataPath(ApplicationsValue); + /// Determines if two values are the same. + public static bool operator ==(ContainerHostDataPath left, ContainerHostDataPath right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContainerHostDataPath left, ContainerHostDataPath right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ContainerHostDataPath(string value) => new ContainerHostDataPath(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContainerHostDataPath other && Equals(other); + /// + public bool Equals(ContainerHostDataPath 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/batch/Azure.Compute.Batch/src/Generated/DiffDiskPlacement.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/DiffDiskPlacement.cs index 4a31115ce568..0729c6609146 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/DiffDiskPlacement.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/DiffDiskPlacement.cs @@ -10,7 +10,7 @@ namespace Azure.Compute.Batch { - /// AccessDiffDiskPlacementScope enums. + /// Specifies the ephemeral disk placement for operating system disk for all compute nodes (VMs) in the pool. This property can be used by user in the request to choose which location the operating system should be in. e.g., cache disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk size requirements for Windows VMs at https://learn.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at https://learn.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. public readonly partial struct DiffDiskPlacement : IEquatable { private readonly string _value; diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/DiffDiskSettings.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/DiffDiskSettings.cs index 03ec91b162ed..0ae2222fd149 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/DiffDiskSettings.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/DiffDiskSettings.cs @@ -54,7 +54,7 @@ public DiffDiskSettings() } /// Initializes a new instance of . - /// Specifies the ephemeral disk placement for operating system disk for all VMs in the pool. This property can be used by user in the request to choose the location e.g., cache disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk size requirements for Windows VMs at https://docs.microsoft.com/en-us/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. + /// Specifies the ephemeral disk placement for operating system disk for all VMs in the pool. This property can be used by user in the request to choose the location e.g., cache disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk size requirements for Windows VMs at https://learn.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at https://learn.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. /// Keeps track of any properties unknown to the library. internal DiffDiskSettings(DiffDiskPlacement? placement, IDictionary serializedAdditionalRawData) { @@ -62,7 +62,7 @@ internal DiffDiskSettings(DiffDiskPlacement? placement, IDictionary Specifies the ephemeral disk placement for operating system disk for all VMs in the pool. This property can be used by user in the request to choose the location e.g., cache disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk size requirements for Windows VMs at https://docs.microsoft.com/en-us/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. + /// Specifies the ephemeral disk placement for operating system disk for all VMs in the pool. This property can be used by user in the request to choose the location e.g., cache disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk size requirements for Windows VMs at https://learn.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at https://learn.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. public DiffDiskPlacement? Placement { get; set; } } } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/DiskEncryptionConfiguration.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/DiskEncryptionConfiguration.cs index 1a8f6a27f6ca..2ad49f0b0d74 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/DiskEncryptionConfiguration.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/DiskEncryptionConfiguration.cs @@ -56,7 +56,7 @@ public DiskEncryptionConfiguration() } /// Initializes a new instance of . - /// The list of disk targets Batch Service will encrypt on the compute node. If omitted, no disks on the compute nodes in the pool will be encrypted. On Linux pool, only "TemporaryDisk" is supported; on Windows pool, "OsDisk" and "TemporaryDisk" must be specified. + /// The list of disk targets Batch Service will encrypt on the compute node. The list of disk targets Batch Service will encrypt on the compute node. /// Keeps track of any properties unknown to the library. internal DiskEncryptionConfiguration(IList targets, IDictionary serializedAdditionalRawData) { @@ -64,7 +64,7 @@ internal DiskEncryptionConfiguration(IList targets, IDicti _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The list of disk targets Batch Service will encrypt on the compute node. If omitted, no disks on the compute nodes in the pool will be encrypted. On Linux pool, only "TemporaryDisk" is supported; on Windows pool, "OsDisk" and "TemporaryDisk" must be specified. + /// The list of disk targets Batch Service will encrypt on the compute node. The list of disk targets Batch Service will encrypt on the compute node. public IList Targets { get; } } } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/Docs/BatchClient.xml b/sdk/batch/Azure.Compute.Batch/src/Generated/Docs/BatchClient.xml index 105b11993153..2cc4a0efd024 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/Docs/BatchClient.xml +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/Docs/BatchClient.xml @@ -151,7 +151,10 @@ BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool001", "standard_ }, Caching = CachingType.ReadWrite, DiskSizeGB = 100, - ManagedDisk = new ManagedDisk(StorageAccountType.StandardSSDLRS), + ManagedDisk = new ManagedDisk + { + StorageAccountType = StorageAccountType.StandardSSDLRS, + }, }, }, ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), @@ -427,7 +430,10 @@ BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool001", "standard_ }, Caching = CachingType.ReadWrite, DiskSizeGB = 100, - ManagedDisk = new ManagedDisk(StorageAccountType.StandardSSDLRS), + ManagedDisk = new ManagedDisk + { + StorageAccountType = StorageAccountType.StandardSSDLRS, + }, }, }, ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), @@ -2109,7 +2115,7 @@ Response response = client.RemoveNodes("poolId", content); Console.WriteLine(response.Status); ]]> - + This sample shows how to call DeleteJobAsync. - + This sample shows how to call DeleteJob. - + This sample shows how to call TerminateJobAsync. - + This sample shows how to call TerminateJob. - + This sample shows how to call TerminateJobAsync. - + This sample shows how to call TerminateJob. - + This sample shows how to call DeleteJobScheduleAsync. - + This sample shows how to call DeleteJobSchedule. - + This sample shows how to call TerminateJobScheduleAsync. - + This sample shows how to call TerminateJobSchedule. "); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); +BatchTaskCreateContent task = new BatchTaskCreateContent("taskId", "bash -c 'echo hello'") +{ + ContainerSettings = new BatchTaskContainerSettings("ubuntu") + { + ContainerHostBatchBindMounts = {new ContainerHostBatchBindMountEntry + { + Source = ContainerHostDataPath.Task, + IsReadOnly = true, + }}, + }, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.NonAdmin, + }, + }, +}; +Response response = await client.CreateTaskAsync("jobId", task); +]]> +This sample shows how to call CreateTaskAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +BatchClient client = new BatchClient(endpoint, credential); + +BatchTaskCreateContent task = new BatchTaskCreateContent("taskId", "bash -c 'echo hello'") +{ + ContainerSettings = new BatchTaskContainerSettings("ubuntu") + { + ContainerHostBatchBindMounts = {new ContainerHostBatchBindMountEntry + { + Source = ContainerHostDataPath.Task, + IsReadOnly = true, + }, new ContainerHostBatchBindMountEntry + { + Source = ContainerHostDataPath.Task, + IsReadOnly = true, + }}, + }, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.NonAdmin, + }, + }, +}; +Response response = await client.CreateTaskAsync("jobId", task); +]]> +This sample shows how to call CreateTaskAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +BatchClient client = new BatchClient(endpoint, credential); + BatchTaskCreateContent task = new BatchTaskCreateContent("taskId", "cmd /c exit 3") { ExitConditions = new ExitConditions @@ -4172,6 +4308,64 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); +BatchTaskCreateContent task = new BatchTaskCreateContent("taskId", "bash -c 'echo hello'") +{ + ContainerSettings = new BatchTaskContainerSettings("ubuntu") + { + ContainerHostBatchBindMounts = {new ContainerHostBatchBindMountEntry + { + Source = ContainerHostDataPath.Task, + IsReadOnly = true, + }}, + }, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.NonAdmin, + }, + }, +}; +Response response = client.CreateTask("jobId", task); +]]> +This sample shows how to call CreateTask. +"); +TokenCredential credential = new DefaultAzureCredential(); +BatchClient client = new BatchClient(endpoint, credential); + +BatchTaskCreateContent task = new BatchTaskCreateContent("taskId", "bash -c 'echo hello'") +{ + ContainerSettings = new BatchTaskContainerSettings("ubuntu") + { + ContainerHostBatchBindMounts = {new ContainerHostBatchBindMountEntry + { + Source = ContainerHostDataPath.Task, + IsReadOnly = true, + }, new ContainerHostBatchBindMountEntry + { + Source = ContainerHostDataPath.Task, + IsReadOnly = true, + }}, + }, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.NonAdmin, + }, + }, +}; +Response response = client.CreateTask("jobId", task); +]]> +This sample shows how to call CreateTask. +"); +TokenCredential credential = new DefaultAzureCredential(); +BatchClient client = new BatchClient(endpoint, credential); + BatchTaskCreateContent task = new BatchTaskCreateContent("taskId", "cmd /c exit 3") { ExitConditions = new ExitConditions @@ -4256,6 +4450,81 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); +using RequestContent content = RequestContent.Create(new +{ + id = "taskId", + commandLine = "bash -c 'echo hello'", + containerSettings = new + { + imageName = "ubuntu", + containerHostBatchBindMounts = new object[] + { + new + { + source = "Task", + isReadOnly = true, + } + }, + }, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, +}); +Response response = await client.CreateTaskAsync("jobId", content); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call CreateTaskAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +BatchClient client = new BatchClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + id = "taskId", + commandLine = "bash -c 'echo hello'", + containerSettings = new + { + imageName = "ubuntu", + containerHostBatchBindMounts = new object[] + { + new + { + source = "Task", + isReadOnly = true, + }, + new + { + source = "Task", + isReadOnly = true, + } + }, + }, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, +}); +Response response = await client.CreateTaskAsync("jobId", content); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call CreateTaskAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +BatchClient client = new BatchClient(endpoint, credential); + using RequestContent content = RequestContent.Create(new { id = "taskId", @@ -4356,6 +4625,81 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); +using RequestContent content = RequestContent.Create(new +{ + id = "taskId", + commandLine = "bash -c 'echo hello'", + containerSettings = new + { + imageName = "ubuntu", + containerHostBatchBindMounts = new object[] + { + new + { + source = "Task", + isReadOnly = true, + } + }, + }, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, +}); +Response response = client.CreateTask("jobId", content); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call CreateTask. +"); +TokenCredential credential = new DefaultAzureCredential(); +BatchClient client = new BatchClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + id = "taskId", + commandLine = "bash -c 'echo hello'", + containerSettings = new + { + imageName = "ubuntu", + containerHostBatchBindMounts = new object[] + { + new + { + source = "Task", + isReadOnly = true, + }, + new + { + source = "Task", + isReadOnly = true, + } + }, + }, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, +}); +Response response = client.CreateTask("jobId", content); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call CreateTask. +"); +TokenCredential credential = new DefaultAzureCredential(); +BatchClient client = new BatchClient(endpoint, credential); + using RequestContent content = RequestContent.Create(new { id = "taskId", @@ -5282,6 +5626,132 @@ BatchClient client = new BatchClient(endpoint, credential); using RequestContent content = null; Response response = client.RebootNode("poolId", "tvm-1695681911_1-20161122t193202z", content); +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call StartNodeAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +BatchClient client = new BatchClient(endpoint, credential); + +Response response = await client.StartNodeAsync("poolId", "tvm-1695681911_1-20161122t193202z"); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call StartNode. +"); +TokenCredential credential = new DefaultAzureCredential(); +BatchClient client = new BatchClient(endpoint, credential); + +Response response = client.StartNode("poolId", "tvm-1695681911_1-20161122t193202z"); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call ReimageNodeAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +BatchClient client = new BatchClient(endpoint, credential); + +Response response = await client.ReimageNodeAsync("poolId", "tvm-1695681911_1-20161122t193202z"); +]]> + + + +This sample shows how to call ReimageNode. +"); +TokenCredential credential = new DefaultAzureCredential(); +BatchClient client = new BatchClient(endpoint, credential); + +Response response = client.ReimageNode("poolId", "tvm-1695681911_1-20161122t193202z"); +]]> + + + +This sample shows how to call ReimageNodeAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +BatchClient client = new BatchClient(endpoint, credential); + +using RequestContent content = null; +Response response = await client.ReimageNodeAsync("poolId", "tvm-1695681911_1-20161122t193202z", content); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call ReimageNode. +"); +TokenCredential credential = new DefaultAzureCredential(); +BatchClient client = new BatchClient(endpoint, credential); + +using RequestContent content = null; +Response response = client.ReimageNode("poolId", "tvm-1695681911_1-20161122t193202z", content); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call DeallocateNodeAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +BatchClient client = new BatchClient(endpoint, credential); + +Response response = await client.DeallocateNodeAsync("poolId", "tvm-1695681911_1-20161122t193202z"); +]]> + + + +This sample shows how to call DeallocateNode. +"); +TokenCredential credential = new DefaultAzureCredential(); +BatchClient client = new BatchClient(endpoint, credential); + +Response response = client.DeallocateNode("poolId", "tvm-1695681911_1-20161122t193202z"); +]]> + + + +This sample shows how to call DeallocateNodeAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +BatchClient client = new BatchClient(endpoint, credential); + +using RequestContent content = null; +Response response = await client.DeallocateNodeAsync("poolId", "tvm-1695681911_1-20161122t193202z", content); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call DeallocateNode. +"); +TokenCredential credential = new DefaultAzureCredential(); +BatchClient client = new BatchClient(endpoint, credential); + +using RequestContent content = null; +Response response = client.DeallocateNode("poolId", "tvm-1695681911_1-20161122t193202z", content); + Console.WriteLine(response.Status); ]]> diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/FileProperties.Serialization.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/FileProperties.Serialization.cs index e51c04c24a8e..e55837402cca 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/FileProperties.Serialization.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/FileProperties.Serialization.cs @@ -42,7 +42,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("lastModified"u8); writer.WriteStringValue(LastModified, "O"); writer.WritePropertyName("contentLength"u8); - writer.WriteNumberValue(ContentLength); + writer.WriteStringValue(ContentLength); if (Optional.IsDefined(ContentType)) { writer.WritePropertyName("contentType"u8); @@ -92,7 +92,7 @@ internal static FileProperties DeserializeFileProperties(JsonElement element, Mo } DateTimeOffset? creationTime = default; DateTimeOffset lastModified = default; - long contentLength = default; + string contentLength = default; string contentType = default; string fileMode = default; IDictionary serializedAdditionalRawData = default; @@ -115,7 +115,7 @@ internal static FileProperties DeserializeFileProperties(JsonElement element, Mo } if (property.NameEquals("contentLength"u8)) { - contentLength = property.Value.GetInt64(); + contentLength = property.Value.GetString(); continue; } if (property.NameEquals("contentType"u8)) diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/FileProperties.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/FileProperties.cs index 62a026bccce2..112b2425a776 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/FileProperties.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/FileProperties.cs @@ -48,8 +48,11 @@ public partial class FileProperties /// Initializes a new instance of . /// The time at which the file was last modified. /// The length of the file. - internal FileProperties(DateTimeOffset lastModified, long contentLength) + /// is null. + internal FileProperties(DateTimeOffset lastModified, string contentLength) { + Argument.AssertNotNull(contentLength, nameof(contentLength)); + LastModified = lastModified; ContentLength = contentLength; } @@ -61,7 +64,7 @@ internal FileProperties(DateTimeOffset lastModified, long contentLength) /// The content type of the file. /// The file mode attribute in octal format. The file mode is returned only for files on Linux Compute Nodes. /// Keeps track of any properties unknown to the library. - internal FileProperties(DateTimeOffset? creationTime, DateTimeOffset lastModified, long contentLength, string contentType, string fileMode, IDictionary serializedAdditionalRawData) + internal FileProperties(DateTimeOffset? creationTime, DateTimeOffset lastModified, string contentLength, string contentType, string fileMode, IDictionary serializedAdditionalRawData) { CreationTime = creationTime; LastModified = lastModified; @@ -81,7 +84,7 @@ internal FileProperties() /// The time at which the file was last modified. public DateTimeOffset LastModified { get; } /// The length of the file. - public long ContentLength { get; } + public string ContentLength { get; } /// The content type of the file. public string ContentType { get; } /// The file mode attribute in octal format. The file mode is returned only for files on Linux Compute Nodes. diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/ImageReference.Serialization.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/ImageReference.Serialization.cs index 236229f5bd9a..ba2303bceac3 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/ImageReference.Serialization.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/ImageReference.Serialization.cs @@ -64,6 +64,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("exactVersion"u8); writer.WriteStringValue(ExactVersion); } + if (Optional.IsDefined(SharedGalleryImageId)) + { + writer.WritePropertyName("sharedGalleryImageId"u8); + writer.WriteStringValue(SharedGalleryImageId); + } + if (Optional.IsDefined(CommunityGalleryImageId)) + { + writer.WritePropertyName("communityGalleryImageId"u8); + writer.WriteStringValue(CommunityGalleryImageId); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -107,6 +117,8 @@ internal static ImageReference DeserializeImageReference(JsonElement element, Mo string version = default; string virtualMachineImageId = default; string exactVersion = default; + string sharedGalleryImageId = default; + string communityGalleryImageId = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -141,6 +153,16 @@ internal static ImageReference DeserializeImageReference(JsonElement element, Mo exactVersion = property.Value.GetString(); continue; } + if (property.NameEquals("sharedGalleryImageId"u8)) + { + sharedGalleryImageId = property.Value.GetString(); + continue; + } + if (property.NameEquals("communityGalleryImageId"u8)) + { + communityGalleryImageId = property.Value.GetString(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -154,6 +176,8 @@ internal static ImageReference DeserializeImageReference(JsonElement element, Mo version, virtualMachineImageId, exactVersion, + sharedGalleryImageId, + communityGalleryImageId, serializedAdditionalRawData); } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/ImageReference.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/ImageReference.cs index 6c5cb5fc883f..67fa3216c0de 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/ImageReference.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/ImageReference.cs @@ -59,10 +59,12 @@ public ImageReference() /// The offer type of the Azure Virtual Machines Marketplace Image. For example, UbuntuServer or WindowsServer. /// The SKU of the Azure Virtual Machines Marketplace Image. For example, 18.04-LTS or 2019-Datacenter. /// The version of the Azure Virtual Machines Marketplace Image. A value of 'latest' can be specified to select the latest version of an Image. If omitted, the default is 'latest'. - /// The ARM resource identifier of the Azure Compute Gallery Image. Compute Nodes in the Pool will be created using this Image Id. This is of the form /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{VersionId} or /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName} for always defaulting to the latest image version. This property is mutually exclusive with other ImageReference properties. The Azure Compute Gallery Image must have replicas in the same region and must be in the same subscription as the Azure Batch account. If the image version is not specified in the imageId, the latest version will be used. For information about the firewall settings for the Batch Compute Node agent to communicate with the Batch service see https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. + /// The ARM resource identifier of the Azure Compute Gallery Image. Compute Nodes in the Pool will be created using this Image Id. This is of the form /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{VersionId} or /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName} for always defaulting to the latest image version. This property is mutually exclusive with other ImageReference properties. The Azure Compute Gallery Image must have replicas in the same region and must be in the same subscription as the Azure Batch account. If the image version is not specified in the imageId, the latest version will be used. For information about the firewall settings for the Batch Compute Node agent to communicate with the Batch service see https://learn.microsoft.com/azure/batch/nodes-and-pools#virtual-network-vnet-and-firewall-configuration. /// The specific version of the platform image or marketplace image used to create the node. This read-only field differs from 'version' only if the value specified for 'version' when the pool was created was 'latest'. + /// The shared gallery image unique identifier. This property is mutually exclusive with other properties and can be fetched from shared gallery image GET call. + /// The community gallery image unique identifier. This property is mutually exclusive with other properties and can be fetched from community gallery image GET call. /// Keeps track of any properties unknown to the library. - internal ImageReference(string publisher, string offer, string sku, string version, string virtualMachineImageId, string exactVersion, IDictionary serializedAdditionalRawData) + internal ImageReference(string publisher, string offer, string sku, string version, string virtualMachineImageId, string exactVersion, string sharedGalleryImageId, string communityGalleryImageId, IDictionary serializedAdditionalRawData) { Publisher = publisher; Offer = offer; @@ -70,6 +72,8 @@ internal ImageReference(string publisher, string offer, string sku, string versi Version = version; VirtualMachineImageId = virtualMachineImageId; ExactVersion = exactVersion; + SharedGalleryImageId = sharedGalleryImageId; + CommunityGalleryImageId = communityGalleryImageId; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -81,9 +85,13 @@ internal ImageReference(string publisher, string offer, string sku, string versi public string Sku { get; set; } /// The version of the Azure Virtual Machines Marketplace Image. A value of 'latest' can be specified to select the latest version of an Image. If omitted, the default is 'latest'. public string Version { get; set; } - /// The ARM resource identifier of the Azure Compute Gallery Image. Compute Nodes in the Pool will be created using this Image Id. This is of the form /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{VersionId} or /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName} for always defaulting to the latest image version. This property is mutually exclusive with other ImageReference properties. The Azure Compute Gallery Image must have replicas in the same region and must be in the same subscription as the Azure Batch account. If the image version is not specified in the imageId, the latest version will be used. For information about the firewall settings for the Batch Compute Node agent to communicate with the Batch service see https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. + /// The ARM resource identifier of the Azure Compute Gallery Image. Compute Nodes in the Pool will be created using this Image Id. This is of the form /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{VersionId} or /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName} for always defaulting to the latest image version. This property is mutually exclusive with other ImageReference properties. The Azure Compute Gallery Image must have replicas in the same region and must be in the same subscription as the Azure Batch account. If the image version is not specified in the imageId, the latest version will be used. For information about the firewall settings for the Batch Compute Node agent to communicate with the Batch service see https://learn.microsoft.com/azure/batch/nodes-and-pools#virtual-network-vnet-and-firewall-configuration. public string VirtualMachineImageId { get; set; } /// The specific version of the platform image or marketplace image used to create the node. This read-only field differs from 'version' only if the value specified for 'version' when the pool was created was 'latest'. public string ExactVersion { get; } + /// The shared gallery image unique identifier. This property is mutually exclusive with other properties and can be fetched from shared gallery image GET call. + public string SharedGalleryImageId { get; set; } + /// The community gallery image unique identifier. This property is mutually exclusive with other properties and can be fetched from community gallery image GET call. + public string CommunityGalleryImageId { get; set; } } } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/InboundNatPool.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/InboundNatPool.cs index 7dabe3fd9da0..ec5da9c432cd 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/InboundNatPool.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/InboundNatPool.cs @@ -51,7 +51,7 @@ public partial class InboundNatPool /// Initializes a new instance of . /// The name of the endpoint. The name must be unique within a Batch Pool, can contain letters, numbers, underscores, periods, and hyphens. Names must start with a letter or number, must end with a letter, number, or underscore, and cannot exceed 77 characters. If any invalid values are provided the request fails with HTTP status code 400. /// The protocol of the endpoint. - /// The port number on the Compute Node. This must be unique within a Batch Pool. Acceptable values are between 1 and 65535 except for 22, 3389, 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. + /// The port number on the Compute Node. This must be unique within a Batch Pool. Acceptable values are between 1 and 65535 except for 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. /// The first port number in the range of external ports that will be used to provide inbound access to the backendPort on individual Compute Nodes. Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved. All ranges within a Pool must be distinct and cannot overlap. Each range must contain at least 40 ports. If any reserved or overlapping values are provided the request fails with HTTP status code 400. /// The last port number in the range of external ports that will be used to provide inbound access to the backendPort on individual Compute Nodes. Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved by the Batch service. All ranges within a Pool must be distinct and cannot overlap. Each range must contain at least 40 ports. If any reserved or overlapping values are provided the request fails with HTTP status code 400. /// is null. @@ -70,7 +70,7 @@ public InboundNatPool(string name, InboundEndpointProtocol protocol, int backend /// Initializes a new instance of . /// The name of the endpoint. The name must be unique within a Batch Pool, can contain letters, numbers, underscores, periods, and hyphens. Names must start with a letter or number, must end with a letter, number, or underscore, and cannot exceed 77 characters. If any invalid values are provided the request fails with HTTP status code 400. /// The protocol of the endpoint. - /// The port number on the Compute Node. This must be unique within a Batch Pool. Acceptable values are between 1 and 65535 except for 22, 3389, 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. + /// The port number on the Compute Node. This must be unique within a Batch Pool. Acceptable values are between 1 and 65535 except for 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. /// The first port number in the range of external ports that will be used to provide inbound access to the backendPort on individual Compute Nodes. Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved. All ranges within a Pool must be distinct and cannot overlap. Each range must contain at least 40 ports. If any reserved or overlapping values are provided the request fails with HTTP status code 400. /// The last port number in the range of external ports that will be used to provide inbound access to the backendPort on individual Compute Nodes. Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved by the Batch service. All ranges within a Pool must be distinct and cannot overlap. Each range must contain at least 40 ports. If any reserved or overlapping values are provided the request fails with HTTP status code 400. /// A list of network security group rules that will be applied to the endpoint. The maximum number of rules that can be specified across all the endpoints on a Batch Pool is 25. If no network security group rules are specified, a default rule will be created to allow inbound access to the specified backendPort. If the maximum number of network security group rules is exceeded the request fails with HTTP status code 400. @@ -95,7 +95,7 @@ internal InboundNatPool() public string Name { get; set; } /// The protocol of the endpoint. public InboundEndpointProtocol Protocol { get; set; } - /// The port number on the Compute Node. This must be unique within a Batch Pool. Acceptable values are between 1 and 65535 except for 22, 3389, 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. + /// The port number on the Compute Node. This must be unique within a Batch Pool. Acceptable values are between 1 and 65535 except for 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. public int BackendPort { get; set; } /// The first port number in the range of external ports that will be used to provide inbound access to the backendPort on individual Compute Nodes. Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved. All ranges within a Pool must be distinct and cannot overlap. Each range must contain at least 40 ports. If any reserved or overlapping values are provided the request fails with HTTP status code 400. public int FrontendPortRangeStart { get; set; } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/ManagedDisk.Serialization.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/ManagedDisk.Serialization.cs index de2b43ad3a72..f94ca4219790 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/ManagedDisk.Serialization.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/ManagedDisk.Serialization.cs @@ -34,8 +34,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ManagedDisk)} does not support writing '{format}' format."); } - writer.WritePropertyName("storageAccountType"u8); - writer.WriteStringValue(StorageAccountType.ToString()); + if (Optional.IsDefined(StorageAccountType)) + { + writer.WritePropertyName("storageAccountType"u8); + writer.WriteStringValue(StorageAccountType.Value.ToString()); + } + if (Optional.IsDefined(SecurityProfile)) + { + writer.WritePropertyName("securityProfile"u8); + writer.WriteObjectValue(SecurityProfile, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -73,23 +81,37 @@ internal static ManagedDisk DeserializeManagedDisk(JsonElement element, ModelRea { return null; } - StorageAccountType storageAccountType = default; + StorageAccountType? storageAccountType = default; + VMDiskSecurityProfile securityProfile = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("storageAccountType"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } storageAccountType = new StorageAccountType(property.Value.GetString()); continue; } + if (property.NameEquals("securityProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securityProfile = VMDiskSecurityProfile.DeserializeVMDiskSecurityProfile(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new ManagedDisk(storageAccountType, serializedAdditionalRawData); + return new ManagedDisk(storageAccountType, securityProfile, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/ManagedDisk.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/ManagedDisk.cs index f8ada07e8f72..32a2f0e6cc65 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/ManagedDisk.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/ManagedDisk.cs @@ -46,27 +46,24 @@ public partial class ManagedDisk private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The storage account type for managed disk. - public ManagedDisk(StorageAccountType storageAccountType) + public ManagedDisk() { - StorageAccountType = storageAccountType; } /// Initializes a new instance of . /// The storage account type for managed disk. + /// Specifies the security profile settings for the managed disk. /// Keeps track of any properties unknown to the library. - internal ManagedDisk(StorageAccountType storageAccountType, IDictionary serializedAdditionalRawData) + internal ManagedDisk(StorageAccountType? storageAccountType, VMDiskSecurityProfile securityProfile, IDictionary serializedAdditionalRawData) { StorageAccountType = storageAccountType; + SecurityProfile = securityProfile; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ManagedDisk() - { - } - /// The storage account type for managed disk. - public StorageAccountType StorageAccountType { get; set; } + public StorageAccountType? StorageAccountType { get; set; } + /// Specifies the security profile settings for the managed disk. + public VMDiskSecurityProfile SecurityProfile { get; set; } } } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/NetworkConfiguration.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/NetworkConfiguration.cs index e69a292a3501..90847b622aee 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/NetworkConfiguration.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/NetworkConfiguration.cs @@ -51,10 +51,10 @@ public NetworkConfiguration() } /// Initializes a new instance of . - /// The ARM resource identifier of the virtual network subnet which the Compute Nodes of the Pool will join. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}. The virtual network must be in the same region and subscription as the Azure Batch Account. The specified subnet should have enough free IP addresses to accommodate the number of Compute Nodes in the Pool. If the subnet doesn't have enough free IP addresses, the Pool will partially allocate Nodes and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule Tasks on the Nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the Nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the Compute Nodes to unusable. For Pools created with virtualMachineConfiguration only ARM virtual networks ('Microsoft.Network/virtualNetworks') are supported. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication. For Pools created with a virtual machine configuration, enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. Also enable outbound connections to Azure Storage on port 443. For more details see: https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. + /// The ARM resource identifier of the virtual network subnet which the Compute Nodes of the Pool will join. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}. The virtual network must be in the same region and subscription as the Azure Batch Account. The specified subnet should have enough free IP addresses to accommodate the number of Compute Nodes in the Pool. If the subnet doesn't have enough free IP addresses, the Pool will partially allocate Nodes and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule Tasks on the Nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the Nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the Compute Nodes to unusable. Only ARM virtual networks ('Microsoft.Network/virtualNetworks') are supported. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication, including ports 29876 and 29877. Also enable outbound connections to Azure Storage on port 443. For more details see: https://learn.microsoft.com/azure/batch/nodes-and-pools#virtual-network-vnet-and-firewall-configuration. /// The scope of dynamic vnet assignment. - /// The configuration for endpoints on Compute Nodes in the Batch Pool. Pool endpoint configuration is only supported on Pools with the virtualMachineConfiguration property. - /// The Public IPAddress configuration for Compute Nodes in the Batch Pool. Public IP configuration property is only supported on Pools with the virtualMachineConfiguration property. + /// The configuration for endpoints on Compute Nodes in the Batch Pool. + /// The Public IPAddress configuration for Compute Nodes in the Batch Pool. /// Whether this pool should enable accelerated networking. Accelerated networking enables single root I/O virtualization (SR-IOV) to a VM, which may lead to improved networking performance. For more details, see: https://learn.microsoft.com/azure/virtual-network/accelerated-networking-overview. /// Keeps track of any properties unknown to the library. internal NetworkConfiguration(string subnetId, DynamicVNetAssignmentScope? dynamicVNetAssignmentScope, BatchPoolEndpointConfiguration endpointConfiguration, PublicIpAddressConfiguration publicIpAddressConfiguration, bool? enableAcceleratedNetworking, IDictionary serializedAdditionalRawData) @@ -67,13 +67,13 @@ internal NetworkConfiguration(string subnetId, DynamicVNetAssignmentScope? dynam _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The ARM resource identifier of the virtual network subnet which the Compute Nodes of the Pool will join. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}. The virtual network must be in the same region and subscription as the Azure Batch Account. The specified subnet should have enough free IP addresses to accommodate the number of Compute Nodes in the Pool. If the subnet doesn't have enough free IP addresses, the Pool will partially allocate Nodes and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule Tasks on the Nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the Nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the Compute Nodes to unusable. For Pools created with virtualMachineConfiguration only ARM virtual networks ('Microsoft.Network/virtualNetworks') are supported. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication. For Pools created with a virtual machine configuration, enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. Also enable outbound connections to Azure Storage on port 443. For more details see: https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. + /// The ARM resource identifier of the virtual network subnet which the Compute Nodes of the Pool will join. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}. The virtual network must be in the same region and subscription as the Azure Batch Account. The specified subnet should have enough free IP addresses to accommodate the number of Compute Nodes in the Pool. If the subnet doesn't have enough free IP addresses, the Pool will partially allocate Nodes and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule Tasks on the Nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the Nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the Compute Nodes to unusable. Only ARM virtual networks ('Microsoft.Network/virtualNetworks') are supported. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication, including ports 29876 and 29877. Also enable outbound connections to Azure Storage on port 443. For more details see: https://learn.microsoft.com/azure/batch/nodes-and-pools#virtual-network-vnet-and-firewall-configuration. public string SubnetId { get; set; } /// The scope of dynamic vnet assignment. public DynamicVNetAssignmentScope? DynamicVNetAssignmentScope { get; set; } - /// The configuration for endpoints on Compute Nodes in the Batch Pool. Pool endpoint configuration is only supported on Pools with the virtualMachineConfiguration property. + /// The configuration for endpoints on Compute Nodes in the Batch Pool. public BatchPoolEndpointConfiguration EndpointConfiguration { get; set; } - /// The Public IPAddress configuration for Compute Nodes in the Batch Pool. Public IP configuration property is only supported on Pools with the virtualMachineConfiguration property. + /// The Public IPAddress configuration for Compute Nodes in the Batch Pool. public PublicIpAddressConfiguration PublicIpAddressConfiguration { get; set; } /// Whether this pool should enable accelerated networking. Accelerated networking enables single root I/O virtualization (SR-IOV) to a VM, which may lead to improved networking performance. For more details, see: https://learn.microsoft.com/azure/virtual-network/accelerated-networking-overview. public bool? EnableAcceleratedNetworking { get; set; } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/OutputFileBlobContainerDestination.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/OutputFileBlobContainerDestination.cs index 44d0f78eef82..2271ff331361 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/OutputFileBlobContainerDestination.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/OutputFileBlobContainerDestination.cs @@ -60,7 +60,7 @@ public OutputFileBlobContainerDestination(string containerUrl) /// The destination blob or virtual directory within the Azure Storage container. If filePattern refers to a specific file (i.e. contains no wildcards), then path is the name of the blob to which to upload that file. If filePattern contains one or more wildcards (and therefore may match multiple files), then path is the name of the blob virtual directory (which is prepended to each blob name) to which to upload the file(s). If omitted, file(s) are uploaded to the root of the container with a blob name matching their file name. /// The URL of the container within Azure Blob Storage to which to upload the file(s). If not using a managed identity, the URL must include a Shared Access Signature (SAS) granting write permissions to the container. /// The reference to the user assigned identity to use to access Azure Blob Storage specified by containerUrl. The identity must have write access to the Azure Blob Storage container. - /// A list of name-value pairs for headers to be used in uploading output files. These headers will be specified when uploading files to Azure Storage. Official document on allowed headers when uploading blobs: https://docs.microsoft.com/en-us/rest/api/storageservices/put-blob#request-headers-all-blob-types. + /// A list of name-value pairs for headers to be used in uploading output files. These headers will be specified when uploading files to Azure Storage. Official document on allowed headers when uploading blobs: https://learn.microsoft.com/rest/api/storageservices/put-blob#request-headers-all-blob-types. /// Keeps track of any properties unknown to the library. internal OutputFileBlobContainerDestination(string path, string containerUrl, BatchNodeIdentityReference identityReference, IList uploadHeaders, IDictionary serializedAdditionalRawData) { @@ -82,7 +82,7 @@ internal OutputFileBlobContainerDestination() public string ContainerUrl { get; set; } /// The reference to the user assigned identity to use to access Azure Blob Storage specified by containerUrl. The identity must have write access to the Azure Blob Storage container. public BatchNodeIdentityReference IdentityReference { get; set; } - /// A list of name-value pairs for headers to be used in uploading output files. These headers will be specified when uploading files to Azure Storage. Official document on allowed headers when uploading blobs: https://docs.microsoft.com/en-us/rest/api/storageservices/put-blob#request-headers-all-blob-types. + /// A list of name-value pairs for headers to be used in uploading output files. These headers will be specified when uploading files to Azure Storage. Official document on allowed headers when uploading blobs: https://learn.microsoft.com/rest/api/storageservices/put-blob#request-headers-all-blob-types. public IList UploadHeaders { get; } } } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/SecurityEncryptionTypes.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/SecurityEncryptionTypes.cs new file mode 100644 index 000000000000..2ab799148d35 --- /dev/null +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/SecurityEncryptionTypes.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Compute.Batch +{ + /// SecurityEncryptionTypes enums. + public readonly partial struct SecurityEncryptionTypes : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SecurityEncryptionTypes(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NonPersistedTPMValue = "NonPersistedTPM"; + private const string VMGuestStateOnlyValue = "VMGuestStateOnly"; + + /// NonPersistedTPM. + public static SecurityEncryptionTypes NonPersistedTPM { get; } = new SecurityEncryptionTypes(NonPersistedTPMValue); + /// VMGuestStateOnly. + public static SecurityEncryptionTypes VMGuestStateOnly { get; } = new SecurityEncryptionTypes(VMGuestStateOnlyValue); + /// Determines if two values are the same. + public static bool operator ==(SecurityEncryptionTypes left, SecurityEncryptionTypes right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SecurityEncryptionTypes left, SecurityEncryptionTypes right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SecurityEncryptionTypes(string value) => new SecurityEncryptionTypes(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SecurityEncryptionTypes other && Equals(other); + /// + public bool Equals(SecurityEncryptionTypes 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/batch/Azure.Compute.Batch/src/Generated/SecurityProfile.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/SecurityProfile.cs index 4f81495d150a..d34a776e1368 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/SecurityProfile.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/SecurityProfile.cs @@ -46,7 +46,7 @@ public partial class SecurityProfile private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// This property can be used by user in the request to enable or disable the Host Encryption for the virtual machine or virtual machine scale set. This will enable the encryption for all the disks including Resource/Temp disk at host itself. + /// This property can be used by user in the request to enable or disable the Host Encryption for the virtual machine or virtual machine scale set. This will enable the encryption for all the disks including Resource/Temp disk at host itself. For more information on encryption at host requirements, please refer to https://learn.microsoft.com/azure/virtual-machines/disk-encryption#supported-vm-sizes. /// Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. /// Specifies the security settings like secure boot and vTPM used while creating the virtual machine. Specifies the security settings like secure boot and vTPM used while creating the virtual machine. /// is null. @@ -60,7 +60,7 @@ public SecurityProfile(bool encryptionAtHost, SecurityTypes securityType, UefiSe } /// Initializes a new instance of . - /// This property can be used by user in the request to enable or disable the Host Encryption for the virtual machine or virtual machine scale set. This will enable the encryption for all the disks including Resource/Temp disk at host itself. + /// This property can be used by user in the request to enable or disable the Host Encryption for the virtual machine or virtual machine scale set. This will enable the encryption for all the disks including Resource/Temp disk at host itself. For more information on encryption at host requirements, please refer to https://learn.microsoft.com/azure/virtual-machines/disk-encryption#supported-vm-sizes. /// Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. /// Specifies the security settings like secure boot and vTPM used while creating the virtual machine. Specifies the security settings like secure boot and vTPM used while creating the virtual machine. /// Keeps track of any properties unknown to the library. @@ -77,7 +77,7 @@ internal SecurityProfile() { } - /// This property can be used by user in the request to enable or disable the Host Encryption for the virtual machine or virtual machine scale set. This will enable the encryption for all the disks including Resource/Temp disk at host itself. + /// This property can be used by user in the request to enable or disable the Host Encryption for the virtual machine or virtual machine scale set. This will enable the encryption for all the disks including Resource/Temp disk at host itself. For more information on encryption at host requirements, please refer to https://learn.microsoft.com/azure/virtual-machines/disk-encryption#supported-vm-sizes. public bool EncryptionAtHost { get; set; } /// Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. public SecurityTypes SecurityType { get; set; } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/SecurityTypes.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/SecurityTypes.cs index 699dde2ed57c..bd2f2b9cd274 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/SecurityTypes.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/SecurityTypes.cs @@ -23,9 +23,12 @@ public SecurityTypes(string value) } private const string TrustedLaunchValue = "trustedLaunch"; + private const string ConfidentialVMValue = "confidentialVM"; /// Trusted launch protects against advanced and persistent attack techniques. public static SecurityTypes TrustedLaunch { get; } = new SecurityTypes(TrustedLaunchValue); + /// Azure confidential computing offers confidential VMs are for tenants with high security and confidentiality requirements. These VMs provide a strong, hardware-enforced boundary to help meet your security needs. You can use confidential VMs for migrations without making changes to your code, with the platform protecting your VM's state from being read or modified. + public static SecurityTypes ConfidentialVM { get; } = new SecurityTypes(ConfidentialVMValue); /// Determines if two values are the same. public static bool operator ==(SecurityTypes left, SecurityTypes right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/UpgradePolicy.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/UpgradePolicy.cs index ff0839122bf2..cb00df229578 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/UpgradePolicy.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/UpgradePolicy.cs @@ -55,7 +55,7 @@ public UpgradePolicy(UpgradeMode mode) /// Initializes a new instance of . /// Specifies the mode of an upgrade to virtual machines in the scale set.<br /><br /> Possible values are:<br /><br /> **Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade action.<br /><br /> **Automatic** - All virtual machines in the scale set are automatically updated at the same time.<br /><br /> **Rolling** - Scale set performs updates in batches with an optional pause time in between. /// Configuration parameters used for performing automatic OS Upgrade. The configuration parameters used for performing automatic OS upgrade. - /// The configuration parameters used while performing a rolling upgrade. This property is only supported on Pools with the virtualMachineConfiguration property. + /// The configuration parameters used while performing a rolling upgrade. /// Keeps track of any properties unknown to the library. internal UpgradePolicy(UpgradeMode mode, AutomaticOsUpgradePolicy automaticOsUpgradePolicy, RollingUpgradePolicy rollingUpgradePolicy, IDictionary serializedAdditionalRawData) { @@ -74,7 +74,7 @@ internal UpgradePolicy() public UpgradeMode Mode { get; set; } /// Configuration parameters used for performing automatic OS Upgrade. The configuration parameters used for performing automatic OS upgrade. public AutomaticOsUpgradePolicy AutomaticOsUpgradePolicy { get; set; } - /// The configuration parameters used while performing a rolling upgrade. This property is only supported on Pools with the virtualMachineConfiguration property. + /// The configuration parameters used while performing a rolling upgrade. public RollingUpgradePolicy RollingUpgradePolicy { get; set; } } } diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/VMDiskSecurityProfile.Serialization.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/VMDiskSecurityProfile.Serialization.cs new file mode 100644 index 000000000000..e9b0fb5d2ed0 --- /dev/null +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/VMDiskSecurityProfile.Serialization.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Compute.Batch +{ + public partial class VMDiskSecurityProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMDiskSecurityProfile)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(SecurityEncryptionType)) + { + writer.WritePropertyName("securityEncryptionType"u8); + writer.WriteStringValue(SecurityEncryptionType.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VMDiskSecurityProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMDiskSecurityProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMDiskSecurityProfile(document.RootElement, options); + } + + internal static VMDiskSecurityProfile DeserializeVMDiskSecurityProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SecurityEncryptionTypes? securityEncryptionType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("securityEncryptionType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securityEncryptionType = new SecurityEncryptionTypes(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMDiskSecurityProfile(securityEncryptionType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VMDiskSecurityProfile)} does not support writing '{options.Format}' format."); + } + } + + VMDiskSecurityProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVMDiskSecurityProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMDiskSecurityProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static VMDiskSecurityProfile FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeVMDiskSecurityProfile(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/batch/Azure.Compute.Batch/src/Generated/VMDiskSecurityProfile.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/VMDiskSecurityProfile.cs new file mode 100644 index 000000000000..2405e8506ee0 --- /dev/null +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/VMDiskSecurityProfile.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Compute.Batch +{ + /// Specifies the security profile settings for the managed disk. **Note**: It can only be set for Confidential VMs and required when using Confidential VMs. + public partial class VMDiskSecurityProfile + { + /// + /// 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; + + /// Initializes a new instance of . + public VMDiskSecurityProfile() + { + } + + /// Initializes a new instance of . + /// Specifies the EncryptionType of the managed disk. It is set to VMGuestStateOnly for encryption of just the VMGuestState blob, and NonPersistedTPM for not persisting firmware state in the VMGuestState blob. **Note**: It can be set for only Confidential VMs and is required when using Confidential VMs. + /// Keeps track of any properties unknown to the library. + internal VMDiskSecurityProfile(SecurityEncryptionTypes? securityEncryptionType, IDictionary serializedAdditionalRawData) + { + SecurityEncryptionType = securityEncryptionType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies the EncryptionType of the managed disk. It is set to VMGuestStateOnly for encryption of just the VMGuestState blob, and NonPersistedTPM for not persisting firmware state in the VMGuestState blob. **Note**: It can be set for only Confidential VMs and is required when using Confidential VMs. + public SecurityEncryptionTypes? SecurityEncryptionType { get; set; } + } +} diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/VirtualMachineConfiguration.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/VirtualMachineConfiguration.cs index 8923d6045e32..ea1946689c31 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/VirtualMachineConfiguration.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/VirtualMachineConfiguration.cs @@ -67,7 +67,7 @@ public VirtualMachineConfiguration(ImageReference imageReference, string nodeAge /// A reference to the Azure Virtual Machines Marketplace Image or the custom Virtual Machine Image to use. /// The SKU of the Batch Compute Node agent to be provisioned on Compute Nodes in the Pool. The Batch Compute Node agent is a program that runs on each Compute Node in the Pool, and provides the command-and-control interface between the Compute Node and the Batch service. There are different implementations of the Compute Node agent, known as SKUs, for different operating systems. You must specify a Compute Node agent SKU which matches the selected Image reference. To get the list of supported Compute Node agent SKUs along with their list of verified Image references, see the 'List supported Compute Node agent SKUs' operation. /// Windows operating system settings on the virtual machine. This property must not be specified if the imageReference property specifies a Linux OS Image. - /// The configuration for data disks attached to the Compute Nodes in the Pool. This property must be specified if the Compute Nodes in the Pool need to have empty data disks attached to them. This cannot be updated. Each Compute Node gets its own disk (the disk is not a file share). Existing disks cannot be attached, each attached disk is empty. When the Compute Node is removed from the Pool, the disk and all data associated with it is also deleted. The disk is not formatted after being attached, it must be formatted before use - for more information see https://docs.microsoft.com/en-us/azure/virtual-machines/linux/classic/attach-disk#initialize-a-new-data-disk-in-linux and https://docs.microsoft.com/en-us/azure/virtual-machines/windows/attach-disk-ps#add-an-empty-data-disk-to-a-virtual-machine. + /// The configuration for data disks attached to the Compute Nodes in the Pool. This property must be specified if the Compute Nodes in the Pool need to have empty data disks attached to them. This cannot be updated. Each Compute Node gets its own disk (the disk is not a file share). Existing disks cannot be attached, each attached disk is empty. When the Compute Node is removed from the Pool, the disk and all data associated with it is also deleted. The disk is not formatted after being attached, it must be formatted before use - for more information see https://learn.microsoft.com/azure/virtual-machines/linux/classic/attach-disk#initialize-a-new-data-disk-in-linux and https://learn.microsoft.com/azure/virtual-machines/windows/attach-disk-ps#add-an-empty-data-disk-to-a-virtual-machine. /// /// This only applies to Images that contain the Windows operating system, and /// should only be used when you hold valid on-premises licenses for the Compute @@ -115,7 +115,7 @@ internal VirtualMachineConfiguration() public string NodeAgentSkuId { get; set; } /// Windows operating system settings on the virtual machine. This property must not be specified if the imageReference property specifies a Linux OS Image. public WindowsConfiguration WindowsConfiguration { get; set; } - /// The configuration for data disks attached to the Compute Nodes in the Pool. This property must be specified if the Compute Nodes in the Pool need to have empty data disks attached to them. This cannot be updated. Each Compute Node gets its own disk (the disk is not a file share). Existing disks cannot be attached, each attached disk is empty. When the Compute Node is removed from the Pool, the disk and all data associated with it is also deleted. The disk is not formatted after being attached, it must be formatted before use - for more information see https://docs.microsoft.com/en-us/azure/virtual-machines/linux/classic/attach-disk#initialize-a-new-data-disk-in-linux and https://docs.microsoft.com/en-us/azure/virtual-machines/windows/attach-disk-ps#add-an-empty-data-disk-to-a-virtual-machine. + /// The configuration for data disks attached to the Compute Nodes in the Pool. This property must be specified if the Compute Nodes in the Pool need to have empty data disks attached to them. This cannot be updated. Each Compute Node gets its own disk (the disk is not a file share). Existing disks cannot be attached, each attached disk is empty. When the Compute Node is removed from the Pool, the disk and all data associated with it is also deleted. The disk is not formatted after being attached, it must be formatted before use - for more information see https://learn.microsoft.com/azure/virtual-machines/linux/classic/attach-disk#initialize-a-new-data-disk-in-linux and https://learn.microsoft.com/azure/virtual-machines/windows/attach-disk-ps#add-an-empty-data-disk-to-a-virtual-machine. public IList DataDisks { get; } /// /// This only applies to Images that contain the Windows operating system, and diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/WindowsUserConfiguration.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/WindowsUserConfiguration.cs index 1f3173fcb231..c096f45f3294 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/WindowsUserConfiguration.cs +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/WindowsUserConfiguration.cs @@ -51,7 +51,7 @@ public WindowsUserConfiguration() } /// Initializes a new instance of . - /// The login mode for the user. The default value for VirtualMachineConfiguration Pools is 'batch'. + /// The login mode for the user. The default is 'batch'. /// Keeps track of any properties unknown to the library. internal WindowsUserConfiguration(LoginMode? loginMode, IDictionary serializedAdditionalRawData) { @@ -59,7 +59,7 @@ internal WindowsUserConfiguration(LoginMode? loginMode, IDictionary The login mode for the user. The default value for VirtualMachineConfiguration Pools is 'batch'. + /// The login mode for the user. The default is 'batch'. public LoginMode? LoginMode { get; set; } } } diff --git a/sdk/batch/Azure.Compute.Batch/tests/Generated/Samples/Samples_BatchClient.cs b/sdk/batch/Azure.Compute.Batch/tests/Generated/Samples/Samples_BatchClient.cs index 274be47c20ed..ce0bb02a54a9 100644 --- a/sdk/batch/Azure.Compute.Batch/tests/Generated/Samples/Samples_BatchClient.cs +++ b/sdk/batch/Azure.Compute.Batch/tests/Generated/Samples/Samples_BatchClient.cs @@ -20,7 +20,7 @@ public partial class Samples_BatchClient { [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetApplication_GetApplications() + public void Example_BatchClient_GetApplication_GetApplications() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -36,7 +36,7 @@ public void Example_Batch_GetApplication_GetApplications() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetApplication_GetApplications_Async() + public async Task Example_BatchClient_GetApplication_GetApplications_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -52,7 +52,7 @@ public async Task Example_Batch_GetApplication_GetApplications_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetApplication_GetApplications_Convenience() + public void Example_BatchClient_GetApplication_GetApplications_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -63,7 +63,7 @@ public void Example_Batch_GetApplication_GetApplications_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetApplication_GetApplications_Convenience_Async() + public async Task Example_BatchClient_GetApplication_GetApplications_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -74,7 +74,7 @@ public async Task Example_Batch_GetApplication_GetApplications_Convenience_Async [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreatePool_CreatesAPoolWithAcceleratedNetworking() + public void Example_BatchClient_CreatePool_CreatesAPoolWithAcceleratedNetworking() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -108,7 +108,7 @@ public void Example_Batch_CreatePool_CreatesAPoolWithAcceleratedNetworking() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreatePool_CreatesAPoolWithAcceleratedNetworking_Async() + public async Task Example_BatchClient_CreatePool_CreatesAPoolWithAcceleratedNetworking_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -142,7 +142,7 @@ public async Task Example_Batch_CreatePool_CreatesAPoolWithAcceleratedNetworking [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreatePool_CreatesAPoolWithAcceleratedNetworking_Convenience() + public void Example_BatchClient_CreatePool_CreatesAPoolWithAcceleratedNetworking_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -168,7 +168,7 @@ public void Example_Batch_CreatePool_CreatesAPoolWithAcceleratedNetworking_Conve [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreatePool_CreatesAPoolWithAcceleratedNetworking_Convenience_Async() + public async Task Example_BatchClient_CreatePool_CreatesAPoolWithAcceleratedNetworking_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -194,7 +194,7 @@ public async Task Example_Batch_CreatePool_CreatesAPoolWithAcceleratedNetworking [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreatePool_CreatesAPoolWithMountDriveSpecified() + public void Example_BatchClient_CreatePool_CreatesAPoolWithMountDriveSpecified() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -275,7 +275,7 @@ public void Example_Batch_CreatePool_CreatesAPoolWithMountDriveSpecified() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreatePool_CreatesAPoolWithMountDriveSpecified_Async() + public async Task Example_BatchClient_CreatePool_CreatesAPoolWithMountDriveSpecified_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -356,7 +356,7 @@ public async Task Example_Batch_CreatePool_CreatesAPoolWithMountDriveSpecified_A [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreatePool_CreatesAPoolWithMountDriveSpecified_Convenience() + public void Example_BatchClient_CreatePool_CreatesAPoolWithMountDriveSpecified_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -407,7 +407,7 @@ public void Example_Batch_CreatePool_CreatesAPoolWithMountDriveSpecified_Conveni [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreatePool_CreatesAPoolWithMountDriveSpecified_Convenience_Async() + public async Task Example_BatchClient_CreatePool_CreatesAPoolWithMountDriveSpecified_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -458,7 +458,7 @@ public async Task Example_Batch_CreatePool_CreatesAPoolWithMountDriveSpecified_C [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWithOSDisk() + public void Example_BatchClient_CreatePool_CreatesAVirtualMachineConfigurationPoolWithOSDisk() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -504,7 +504,7 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWith [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWithOSDisk_Async() + public async Task Example_BatchClient_CreatePool_CreatesAVirtualMachineConfigurationPoolWithOSDisk_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -550,7 +550,7 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWithOSDisk_Convenience() + public void Example_BatchClient_CreatePool_CreatesAVirtualMachineConfigurationPoolWithOSDisk_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -573,7 +573,10 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWith }, Caching = CachingType.ReadWrite, DiskSizeGB = 100, - ManagedDisk = new ManagedDisk(StorageAccountType.StandardSSDLRS), + ManagedDisk = new ManagedDisk + { + StorageAccountType = StorageAccountType.StandardSSDLRS, + }, }, }, ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), @@ -587,7 +590,7 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWith [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWithOSDisk_Convenience_Async() + public async Task Example_BatchClient_CreatePool_CreatesAVirtualMachineConfigurationPoolWithOSDisk_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -610,7 +613,10 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo }, Caching = CachingType.ReadWrite, DiskSizeGB = 100, - ManagedDisk = new ManagedDisk(StorageAccountType.StandardSSDLRS), + ManagedDisk = new ManagedDisk + { + StorageAccountType = StorageAccountType.StandardSSDLRS, + }, }, }, ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), @@ -624,7 +630,7 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreatePool_CreatesASimplePoolWithResourceTags() + public void Example_BatchClient_CreatePool_CreatesASimplePoolWithResourceTags() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -659,7 +665,7 @@ public void Example_Batch_CreatePool_CreatesASimplePoolWithResourceTags() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreatePool_CreatesASimplePoolWithResourceTags_Async() + public async Task Example_BatchClient_CreatePool_CreatesASimplePoolWithResourceTags_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -694,7 +700,7 @@ public async Task Example_Batch_CreatePool_CreatesASimplePoolWithResourceTags_As [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreatePool_CreatesASimplePoolWithResourceTags_Convenience() + public void Example_BatchClient_CreatePool_CreatesASimplePoolWithResourceTags_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -721,7 +727,7 @@ public void Example_Batch_CreatePool_CreatesASimplePoolWithResourceTags_Convenie [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreatePool_CreatesASimplePoolWithResourceTags_Convenience_Async() + public async Task Example_BatchClient_CreatePool_CreatesASimplePoolWithResourceTags_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -748,7 +754,7 @@ public async Task Example_Batch_CreatePool_CreatesASimplePoolWithResourceTags_Co [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreatePool_CreatesAPoolWithSecurityProfile() + public void Example_BatchClient_CreatePool_CreatesAPoolWithSecurityProfile() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -787,7 +793,7 @@ public void Example_Batch_CreatePool_CreatesAPoolWithSecurityProfile() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreatePool_CreatesAPoolWithSecurityProfile_Async() + public async Task Example_BatchClient_CreatePool_CreatesAPoolWithSecurityProfile_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -826,7 +832,7 @@ public async Task Example_Batch_CreatePool_CreatesAPoolWithSecurityProfile_Async [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreatePool_CreatesAPoolWithSecurityProfile_Convenience() + public void Example_BatchClient_CreatePool_CreatesAPoolWithSecurityProfile_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -854,7 +860,7 @@ public void Example_Batch_CreatePool_CreatesAPoolWithSecurityProfile_Convenience [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreatePool_CreatesAPoolWithSecurityProfile_Convenience_Async() + public async Task Example_BatchClient_CreatePool_CreatesAPoolWithSecurityProfile_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -882,7 +888,7 @@ public async Task Example_Batch_CreatePool_CreatesAPoolWithSecurityProfile_Conve [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPool() + public void Example_BatchClient_CreatePool_CreatesAVirtualMachineConfigurationPool() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -928,7 +934,7 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPool() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPool_Async() + public async Task Example_BatchClient_CreatePool_CreatesAVirtualMachineConfigurationPool_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -974,7 +980,7 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPool_Convenience() + public void Example_BatchClient_CreatePool_CreatesAVirtualMachineConfigurationPool_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1002,7 +1008,7 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPool_Con [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPool_Convenience_Async() + public async Task Example_BatchClient_CreatePool_CreatesAVirtualMachineConfigurationPool_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1030,7 +1036,7 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWithContainers() + public void Example_BatchClient_CreatePool_CreatesAVirtualMachineConfigurationPoolWithContainers() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1075,7 +1081,7 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWith [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWithContainers_Async() + public async Task Example_BatchClient_CreatePool_CreatesAVirtualMachineConfigurationPoolWithContainers_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1120,7 +1126,7 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWithContainers_Convenience() + public void Example_BatchClient_CreatePool_CreatesAVirtualMachineConfigurationPoolWithContainers_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1152,7 +1158,7 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWith [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWithContainers_Convenience_Async() + public async Task Example_BatchClient_CreatePool_CreatesAVirtualMachineConfigurationPoolWithContainers_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1184,7 +1190,7 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWithExtensions() + public void Example_BatchClient_CreatePool_CreatesAVirtualMachineConfigurationPoolWithExtensions() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1248,7 +1254,7 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWith [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWithExtensions_Async() + public async Task Example_BatchClient_CreatePool_CreatesAVirtualMachineConfigurationPoolWithExtensions_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1312,7 +1318,7 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWithExtensions_Convenience() + public void Example_BatchClient_CreatePool_CreatesAVirtualMachineConfigurationPoolWithExtensions_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1354,7 +1360,7 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWith [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWithExtensions_Convenience_Async() + public async Task Example_BatchClient_CreatePool_CreatesAVirtualMachineConfigurationPoolWithExtensions_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1396,7 +1402,7 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWithServiceArtifactReference() + public void Example_BatchClient_CreatePool_CreatesAVirtualMachineConfigurationPoolWithServiceArtifactReference() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1434,7 +1440,7 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWith [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWithServiceArtifactReference_Async() + public async Task Example_BatchClient_CreatePool_CreatesAVirtualMachineConfigurationPoolWithServiceArtifactReference_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1472,7 +1478,7 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWithServiceArtifactReference_Convenience() + public void Example_BatchClient_CreatePool_CreatesAVirtualMachineConfigurationPoolWithServiceArtifactReference_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1501,7 +1507,7 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWith [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWithServiceArtifactReference_Convenience_Async() + public async Task Example_BatchClient_CreatePool_CreatesAVirtualMachineConfigurationPoolWithServiceArtifactReference_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1530,7 +1536,7 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_DeletePool_PoolDelete() + public void Example_BatchClient_DeletePool_PoolDelete() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1543,7 +1549,7 @@ public void Example_Batch_DeletePool_PoolDelete() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_DeletePool_PoolDelete_Async() + public async Task Example_BatchClient_DeletePool_PoolDelete_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1556,7 +1562,7 @@ public async Task Example_Batch_DeletePool_PoolDelete_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetPool_GetAPoolWithAcceleratedNetworking() + public void Example_BatchClient_GetPool_GetAPoolWithAcceleratedNetworking() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1570,7 +1576,7 @@ public void Example_Batch_GetPool_GetAPoolWithAcceleratedNetworking() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetPool_GetAPoolWithAcceleratedNetworking_Async() + public async Task Example_BatchClient_GetPool_GetAPoolWithAcceleratedNetworking_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1584,7 +1590,7 @@ public async Task Example_Batch_GetPool_GetAPoolWithAcceleratedNetworking_Async( [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetPool_GetAPoolWithAcceleratedNetworking_Convenience() + public void Example_BatchClient_GetPool_GetAPoolWithAcceleratedNetworking_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1595,7 +1601,7 @@ public void Example_Batch_GetPool_GetAPoolWithAcceleratedNetworking_Convenience( [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetPool_GetAPoolWithAcceleratedNetworking_Convenience_Async() + public async Task Example_BatchClient_GetPool_GetAPoolWithAcceleratedNetworking_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1606,7 +1612,7 @@ public async Task Example_Batch_GetPool_GetAPoolWithAcceleratedNetworking_Conven [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetPool_PoolGet() + public void Example_BatchClient_GetPool_PoolGet() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1620,7 +1626,7 @@ public void Example_Batch_GetPool_PoolGet() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetPool_PoolGet_Async() + public async Task Example_BatchClient_GetPool_PoolGet_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1634,7 +1640,7 @@ public async Task Example_Batch_GetPool_PoolGet_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetPool_PoolGet_Convenience() + public void Example_BatchClient_GetPool_PoolGet_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1645,7 +1651,7 @@ public void Example_Batch_GetPool_PoolGet_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetPool_PoolGet_Convenience_Async() + public async Task Example_BatchClient_GetPool_PoolGet_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1656,7 +1662,7 @@ public async Task Example_Batch_GetPool_PoolGet_Convenience_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetPool_GetAVirtualMachineConfigurationPoolWithSecurityProfile() + public void Example_BatchClient_GetPool_GetAVirtualMachineConfigurationPoolWithSecurityProfile() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1670,7 +1676,7 @@ public void Example_Batch_GetPool_GetAVirtualMachineConfigurationPoolWithSecurit [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetPool_GetAVirtualMachineConfigurationPoolWithSecurityProfile_Async() + public async Task Example_BatchClient_GetPool_GetAVirtualMachineConfigurationPoolWithSecurityProfile_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1684,7 +1690,7 @@ public async Task Example_Batch_GetPool_GetAVirtualMachineConfigurationPoolWithS [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetPool_GetAVirtualMachineConfigurationPoolWithSecurityProfile_Convenience() + public void Example_BatchClient_GetPool_GetAVirtualMachineConfigurationPoolWithSecurityProfile_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1695,7 +1701,7 @@ public void Example_Batch_GetPool_GetAVirtualMachineConfigurationPoolWithSecurit [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetPool_GetAVirtualMachineConfigurationPoolWithSecurityProfile_Convenience_Async() + public async Task Example_BatchClient_GetPool_GetAVirtualMachineConfigurationPoolWithSecurityProfile_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1706,7 +1712,7 @@ public async Task Example_Batch_GetPool_GetAVirtualMachineConfigurationPoolWithS [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetPool_GetAVirtualMachineConfigurationPoolWithExtensions() + public void Example_BatchClient_GetPool_GetAVirtualMachineConfigurationPoolWithExtensions() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1720,7 +1726,7 @@ public void Example_Batch_GetPool_GetAVirtualMachineConfigurationPoolWithExtensi [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetPool_GetAVirtualMachineConfigurationPoolWithExtensions_Async() + public async Task Example_BatchClient_GetPool_GetAVirtualMachineConfigurationPoolWithExtensions_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1734,7 +1740,7 @@ public async Task Example_Batch_GetPool_GetAVirtualMachineConfigurationPoolWithE [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetPool_GetAVirtualMachineConfigurationPoolWithExtensions_Convenience() + public void Example_BatchClient_GetPool_GetAVirtualMachineConfigurationPoolWithExtensions_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1745,7 +1751,7 @@ public void Example_Batch_GetPool_GetAVirtualMachineConfigurationPoolWithExtensi [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetPool_GetAVirtualMachineConfigurationPoolWithExtensions_Convenience_Async() + public async Task Example_BatchClient_GetPool_GetAVirtualMachineConfigurationPoolWithExtensions_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1756,7 +1762,7 @@ public async Task Example_Batch_GetPool_GetAVirtualMachineConfigurationPoolWithE [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetPool_AddAVirtualMachineConfigurationPoolWithOSDisk() + public void Example_BatchClient_GetPool_AddAVirtualMachineConfigurationPoolWithOSDisk() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1770,7 +1776,7 @@ public void Example_Batch_GetPool_AddAVirtualMachineConfigurationPoolWithOSDisk( [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetPool_AddAVirtualMachineConfigurationPoolWithOSDisk_Async() + public async Task Example_BatchClient_GetPool_AddAVirtualMachineConfigurationPoolWithOSDisk_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1784,7 +1790,7 @@ public async Task Example_Batch_GetPool_AddAVirtualMachineConfigurationPoolWithO [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetPool_AddAVirtualMachineConfigurationPoolWithOSDisk_Convenience() + public void Example_BatchClient_GetPool_AddAVirtualMachineConfigurationPoolWithOSDisk_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1795,7 +1801,7 @@ public void Example_Batch_GetPool_AddAVirtualMachineConfigurationPoolWithOSDisk_ [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetPool_AddAVirtualMachineConfigurationPoolWithOSDisk_Convenience_Async() + public async Task Example_BatchClient_GetPool_AddAVirtualMachineConfigurationPoolWithOSDisk_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1806,7 +1812,7 @@ public async Task Example_Batch_GetPool_AddAVirtualMachineConfigurationPoolWithO [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetPool_GetAVirtualMachineConfigurationPoolWithServiceArtifactReference() + public void Example_BatchClient_GetPool_GetAVirtualMachineConfigurationPoolWithServiceArtifactReference() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1820,7 +1826,7 @@ public void Example_Batch_GetPool_GetAVirtualMachineConfigurationPoolWithService [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetPool_GetAVirtualMachineConfigurationPoolWithServiceArtifactReference_Async() + public async Task Example_BatchClient_GetPool_GetAVirtualMachineConfigurationPoolWithServiceArtifactReference_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1834,7 +1840,7 @@ public async Task Example_Batch_GetPool_GetAVirtualMachineConfigurationPoolWithS [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetPool_GetAVirtualMachineConfigurationPoolWithServiceArtifactReference_Convenience() + public void Example_BatchClient_GetPool_GetAVirtualMachineConfigurationPoolWithServiceArtifactReference_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1845,7 +1851,7 @@ public void Example_Batch_GetPool_GetAVirtualMachineConfigurationPoolWithService [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetPool_GetAVirtualMachineConfigurationPoolWithServiceArtifactReference_Convenience_Async() + public async Task Example_BatchClient_GetPool_GetAVirtualMachineConfigurationPoolWithServiceArtifactReference_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1856,7 +1862,7 @@ public async Task Example_Batch_GetPool_GetAVirtualMachineConfigurationPoolWithS [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_UpdatePool_PatchThePool() + public void Example_BatchClient_UpdatePool_PatchThePool() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1876,7 +1882,7 @@ public void Example_Batch_UpdatePool_PatchThePool() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_UpdatePool_PatchThePool_Async() + public async Task Example_BatchClient_UpdatePool_PatchThePool_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1896,7 +1902,7 @@ public async Task Example_Batch_UpdatePool_PatchThePool_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_DisablePoolAutoScale_DisablePoolAutoscale() + public void Example_BatchClient_DisablePoolAutoScale_DisablePoolAutoscale() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1909,7 +1915,7 @@ public void Example_Batch_DisablePoolAutoScale_DisablePoolAutoscale() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_DisablePoolAutoScale_DisablePoolAutoscale_Async() + public async Task Example_BatchClient_DisablePoolAutoScale_DisablePoolAutoscale_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1922,7 +1928,7 @@ public async Task Example_Batch_DisablePoolAutoScale_DisablePoolAutoscale_Async( [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_EnablePoolAutoScale_PoolEnableAutoscale() + public void Example_BatchClient_EnablePoolAutoScale_PoolEnableAutoscale() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1940,7 +1946,7 @@ public void Example_Batch_EnablePoolAutoScale_PoolEnableAutoscale() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_EnablePoolAutoScale_PoolEnableAutoscale_Async() + public async Task Example_BatchClient_EnablePoolAutoScale_PoolEnableAutoscale_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1958,7 +1964,7 @@ public async Task Example_Batch_EnablePoolAutoScale_PoolEnableAutoscale_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_EnablePoolAutoScale_PoolEnableAutoscale_Convenience() + public void Example_BatchClient_EnablePoolAutoScale_PoolEnableAutoscale_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1974,7 +1980,7 @@ public void Example_Batch_EnablePoolAutoScale_PoolEnableAutoscale_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_EnablePoolAutoScale_PoolEnableAutoscale_Convenience_Async() + public async Task Example_BatchClient_EnablePoolAutoScale_PoolEnableAutoscale_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -1990,7 +1996,7 @@ public async Task Example_Batch_EnablePoolAutoScale_PoolEnableAutoscale_Convenie [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_EvaluatePoolAutoScale_PoolEvaluateAutoscale() + public void Example_BatchClient_EvaluatePoolAutoScale_PoolEvaluateAutoscale() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2008,7 +2014,7 @@ public void Example_Batch_EvaluatePoolAutoScale_PoolEvaluateAutoscale() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_EvaluatePoolAutoScale_PoolEvaluateAutoscale_Async() + public async Task Example_BatchClient_EvaluatePoolAutoScale_PoolEvaluateAutoscale_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2026,7 +2032,7 @@ public async Task Example_Batch_EvaluatePoolAutoScale_PoolEvaluateAutoscale_Asyn [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_EvaluatePoolAutoScale_PoolEvaluateAutoscale_Convenience() + public void Example_BatchClient_EvaluatePoolAutoScale_PoolEvaluateAutoscale_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2038,7 +2044,7 @@ public void Example_Batch_EvaluatePoolAutoScale_PoolEvaluateAutoscale_Convenienc [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_EvaluatePoolAutoScale_PoolEvaluateAutoscale_Convenience_Async() + public async Task Example_BatchClient_EvaluatePoolAutoScale_PoolEvaluateAutoscale_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2050,7 +2056,7 @@ public async Task Example_Batch_EvaluatePoolAutoScale_PoolEvaluateAutoscale_Conv [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_ResizePool_PoolResize() + public void Example_BatchClient_ResizePool_PoolResize() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2068,7 +2074,7 @@ public void Example_Batch_ResizePool_PoolResize() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_ResizePool_PoolResize_Async() + public async Task Example_BatchClient_ResizePool_PoolResize_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2086,7 +2092,7 @@ public async Task Example_Batch_ResizePool_PoolResize_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_ResizePool_PoolResize_Convenience() + public void Example_BatchClient_ResizePool_PoolResize_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2102,7 +2108,7 @@ public void Example_Batch_ResizePool_PoolResize_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_ResizePool_PoolResize_Convenience_Async() + public async Task Example_BatchClient_ResizePool_PoolResize_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2118,7 +2124,7 @@ public async Task Example_Batch_ResizePool_PoolResize_Convenience_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_StopPoolResize_PoolStopResize() + public void Example_BatchClient_StopPoolResize_PoolStopResize() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2131,7 +2137,7 @@ public void Example_Batch_StopPoolResize_PoolStopResize() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_StopPoolResize_PoolStopResize_Async() + public async Task Example_BatchClient_StopPoolResize_PoolStopResize_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2144,7 +2150,7 @@ public async Task Example_Batch_StopPoolResize_PoolStopResize_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_ReplacePoolProperties_PoolUpdate() + public void Example_BatchClient_ReplacePoolProperties_PoolUpdate() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2166,7 +2172,7 @@ public void Example_Batch_ReplacePoolProperties_PoolUpdate() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_ReplacePoolProperties_PoolUpdate_Async() + public async Task Example_BatchClient_ReplacePoolProperties_PoolUpdate_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2188,7 +2194,7 @@ public async Task Example_Batch_ReplacePoolProperties_PoolUpdate_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_ReplacePoolProperties_PoolUpdate_Convenience() + public void Example_BatchClient_ReplacePoolProperties_PoolUpdate_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2203,7 +2209,7 @@ public void Example_Batch_ReplacePoolProperties_PoolUpdate_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_ReplacePoolProperties_PoolUpdate_Convenience_Async() + public async Task Example_BatchClient_ReplacePoolProperties_PoolUpdate_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2218,7 +2224,7 @@ public async Task Example_Batch_ReplacePoolProperties_PoolUpdate_Convenience_Asy [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_RemoveNodes_PoolRemoveNodes() + public void Example_BatchClient_RemoveNodes_PoolRemoveNodes() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2239,7 +2245,7 @@ public void Example_Batch_RemoveNodes_PoolRemoveNodes() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_RemoveNodes_PoolRemoveNodes_Async() + public async Task Example_BatchClient_RemoveNodes_PoolRemoveNodes_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2260,7 +2266,7 @@ public async Task Example_Batch_RemoveNodes_PoolRemoveNodes_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_RemoveNodes_PoolRemoveNodes_Convenience() + public void Example_BatchClient_RemoveNodes_PoolRemoveNodes_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2272,7 +2278,7 @@ public void Example_Batch_RemoveNodes_PoolRemoveNodes_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_RemoveNodes_PoolRemoveNodes_Convenience_Async() + public async Task Example_BatchClient_RemoveNodes_PoolRemoveNodes_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2284,7 +2290,7 @@ public async Task Example_Batch_RemoveNodes_PoolRemoveNodes_Convenience_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_DeleteJob_DeleteJob() + public void Example_BatchClient_DeleteJob_DeleteJob() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2297,7 +2303,7 @@ public void Example_Batch_DeleteJob_DeleteJob() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_DeleteJob_DeleteJob_Async() + public async Task Example_BatchClient_DeleteJob_DeleteJob_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2310,7 +2316,7 @@ public async Task Example_Batch_DeleteJob_DeleteJob_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetJob_JobGet() + public void Example_BatchClient_GetJob_JobGet() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2324,7 +2330,7 @@ public void Example_Batch_GetJob_JobGet() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetJob_JobGet_Async() + public async Task Example_BatchClient_GetJob_JobGet_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2338,7 +2344,7 @@ public async Task Example_Batch_GetJob_JobGet_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetJob_JobGet_Convenience() + public void Example_BatchClient_GetJob_JobGet_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2349,7 +2355,7 @@ public void Example_Batch_GetJob_JobGet_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetJob_JobGet_Convenience_Async() + public async Task Example_BatchClient_GetJob_JobGet_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2360,7 +2366,7 @@ public async Task Example_Batch_GetJob_JobGet_Convenience_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_UpdateJob_JobPatch() + public void Example_BatchClient_UpdateJob_JobUpdate() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2386,7 +2392,7 @@ public void Example_Batch_UpdateJob_JobPatch() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_UpdateJob_JobPatch_Async() + public async Task Example_BatchClient_UpdateJob_JobUpdate_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2412,7 +2418,7 @@ public async Task Example_Batch_UpdateJob_JobPatch_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_ReplaceJob_JobUpdate() + public void Example_BatchClient_ReplaceJob_JobPatch() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2438,7 +2444,7 @@ public void Example_Batch_ReplaceJob_JobUpdate() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_ReplaceJob_JobUpdate_Async() + public async Task Example_BatchClient_ReplaceJob_JobPatch_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2464,7 +2470,7 @@ public async Task Example_Batch_ReplaceJob_JobUpdate_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_ReplaceJob_JobUpdate_Convenience() + public void Example_BatchClient_ReplaceJob_JobPatch_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2487,7 +2493,7 @@ public void Example_Batch_ReplaceJob_JobUpdate_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_ReplaceJob_JobUpdate_Convenience_Async() + public async Task Example_BatchClient_ReplaceJob_JobPatch_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2510,7 +2516,7 @@ public async Task Example_Batch_ReplaceJob_JobUpdate_Convenience_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_DisableJob_JobDisable() + public void Example_BatchClient_DisableJob_JobDisable() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2527,7 +2533,7 @@ public void Example_Batch_DisableJob_JobDisable() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_DisableJob_JobDisable_Async() + public async Task Example_BatchClient_DisableJob_JobDisable_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2544,7 +2550,7 @@ public async Task Example_Batch_DisableJob_JobDisable_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_DisableJob_JobDisable_Convenience() + public void Example_BatchClient_DisableJob_JobDisable_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2556,7 +2562,7 @@ public void Example_Batch_DisableJob_JobDisable_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_DisableJob_JobDisable_Convenience_Async() + public async Task Example_BatchClient_DisableJob_JobDisable_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2568,7 +2574,7 @@ public async Task Example_Batch_DisableJob_JobDisable_Convenience_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_EnableJob_JobEnable() + public void Example_BatchClient_EnableJob_JobEnable() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2581,7 +2587,7 @@ public void Example_Batch_EnableJob_JobEnable() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_EnableJob_JobEnable_Async() + public async Task Example_BatchClient_EnableJob_JobEnable_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2594,7 +2600,7 @@ public async Task Example_Batch_EnableJob_JobEnable_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_TerminateJob_JobTerminate() + public void Example_BatchClient_TerminateJob_JobTerminate() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2608,7 +2614,7 @@ public void Example_Batch_TerminateJob_JobTerminate() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_TerminateJob_JobTerminate_Async() + public async Task Example_BatchClient_TerminateJob_JobTerminate_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2622,7 +2628,7 @@ public async Task Example_Batch_TerminateJob_JobTerminate_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_TerminateJob_JobTerminate_Convenience() + public void Example_BatchClient_TerminateJob_JobTerminate_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2633,7 +2639,7 @@ public void Example_Batch_TerminateJob_JobTerminate_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_TerminateJob_JobTerminate_Convenience_Async() + public async Task Example_BatchClient_TerminateJob_JobTerminate_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2644,7 +2650,7 @@ public async Task Example_Batch_TerminateJob_JobTerminate_Convenience_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreateJob_CreatesABasicJob() + public void Example_BatchClient_CreateJob_CreatesABasicJob() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2666,7 +2672,7 @@ public void Example_Batch_CreateJob_CreatesABasicJob() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreateJob_CreatesABasicJob_Async() + public async Task Example_BatchClient_CreateJob_CreatesABasicJob_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2688,7 +2694,7 @@ public async Task Example_Batch_CreateJob_CreatesABasicJob_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreateJob_CreatesABasicJob_Convenience() + public void Example_BatchClient_CreateJob_CreatesABasicJob_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2706,7 +2712,7 @@ public void Example_Batch_CreateJob_CreatesABasicJob_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreateJob_CreatesABasicJob_Convenience_Async() + public async Task Example_BatchClient_CreateJob_CreatesABasicJob_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2724,7 +2730,7 @@ public async Task Example_Batch_CreateJob_CreatesABasicJob_Convenience_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreateJob_CreatesAComplexJob() + public void Example_BatchClient_CreateJob_CreatesAComplexJob() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2790,7 +2796,7 @@ public void Example_Batch_CreateJob_CreatesAComplexJob() poolLifetimeOption = "job", pool = new { - vmSize = "Standard_D1_v2", + vmSize = "STANDARD_D2S_V3", virtualMachineConfiguration = new { imageReference = new @@ -2801,6 +2807,14 @@ public void Example_Batch_CreateJob_CreatesAComplexJob() version = "latest", }, nodeAgentSKUId = "batch.node.windows amd64", + windowsConfiguration = new + { + enableAutomaticUpdates = false, + }, + nodePlacementConfiguration = new + { + policy = "zonal", + }, }, resizeTimeout = "PT15M", targetDedicatedNodes = 3, @@ -2870,7 +2884,7 @@ public void Example_Batch_CreateJob_CreatesAComplexJob() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreateJob_CreatesAComplexJob_Async() + public async Task Example_BatchClient_CreateJob_CreatesAComplexJob_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -2936,7 +2950,7 @@ public async Task Example_Batch_CreateJob_CreatesAComplexJob_Async() poolLifetimeOption = "job", pool = new { - vmSize = "Standard_D1_v2", + vmSize = "STANDARD_D2S_V3", virtualMachineConfiguration = new { imageReference = new @@ -2947,6 +2961,14 @@ public async Task Example_Batch_CreateJob_CreatesAComplexJob_Async() version = "latest", }, nodeAgentSKUId = "batch.node.windows amd64", + windowsConfiguration = new + { + enableAutomaticUpdates = false, + }, + nodePlacementConfiguration = new + { + policy = "zonal", + }, }, resizeTimeout = "PT15M", targetDedicatedNodes = 3, @@ -3016,7 +3038,7 @@ public async Task Example_Batch_CreateJob_CreatesAComplexJob_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreateJob_CreatesAComplexJob_Convenience() + public void Example_BatchClient_CreateJob_CreatesAComplexJob_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3027,7 +3049,7 @@ public void Example_Batch_CreateJob_CreatesAComplexJob_Convenience() AutoPoolSpecification = new BatchAutoPoolSpecification(BatchPoolLifetimeOption.Job) { AutoPoolIdPrefix = "mypool", - Pool = new BatchPoolSpecification("Standard_D1_v2") + Pool = new BatchPoolSpecification("STANDARD_D2S_V3") { VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference { @@ -3035,7 +3057,17 @@ public void Example_Batch_CreateJob_CreatesAComplexJob_Convenience() Offer = "WindowsServer", Sku = "2016-datacenter-smalldisk", Version = "latest", - }, "batch.node.windows amd64"), + }, "batch.node.windows amd64") + { + WindowsConfiguration = new WindowsConfiguration + { + EnableAutomaticUpdates = false, + }, + NodePlacementConfiguration = new BatchNodePlacementConfiguration + { + Policy = BatchNodePlacementPolicyType.Zonal, + }, + }, TaskSlotsPerNode = 2, TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), @@ -3117,7 +3149,7 @@ public void Example_Batch_CreateJob_CreatesAComplexJob_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreateJob_CreatesAComplexJob_Convenience_Async() + public async Task Example_BatchClient_CreateJob_CreatesAComplexJob_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3128,7 +3160,7 @@ public async Task Example_Batch_CreateJob_CreatesAComplexJob_Convenience_Async() AutoPoolSpecification = new BatchAutoPoolSpecification(BatchPoolLifetimeOption.Job) { AutoPoolIdPrefix = "mypool", - Pool = new BatchPoolSpecification("Standard_D1_v2") + Pool = new BatchPoolSpecification("STANDARD_D2S_V3") { VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference { @@ -3136,7 +3168,17 @@ public async Task Example_Batch_CreateJob_CreatesAComplexJob_Convenience_Async() Offer = "WindowsServer", Sku = "2016-datacenter-smalldisk", Version = "latest", - }, "batch.node.windows amd64"), + }, "batch.node.windows amd64") + { + WindowsConfiguration = new WindowsConfiguration + { + EnableAutomaticUpdates = false, + }, + NodePlacementConfiguration = new BatchNodePlacementConfiguration + { + Policy = BatchNodePlacementPolicyType.Zonal, + }, + }, TaskSlotsPerNode = 2, TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), @@ -3218,7 +3260,7 @@ public async Task Example_Batch_CreateJob_CreatesAComplexJob_Convenience_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetJobTaskCounts_JobGetTaskCounts() + public void Example_BatchClient_GetJobTaskCounts_JobGetTaskCounts() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3241,7 +3283,7 @@ public void Example_Batch_GetJobTaskCounts_JobGetTaskCounts() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetJobTaskCounts_JobGetTaskCounts_Async() + public async Task Example_BatchClient_GetJobTaskCounts_JobGetTaskCounts_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3264,7 +3306,7 @@ public async Task Example_Batch_GetJobTaskCounts_JobGetTaskCounts_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetJobTaskCounts_JobGetTaskCounts_Convenience() + public void Example_BatchClient_GetJobTaskCounts_JobGetTaskCounts_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3275,7 +3317,7 @@ public void Example_Batch_GetJobTaskCounts_JobGetTaskCounts_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetJobTaskCounts_JobGetTaskCounts_Convenience_Async() + public async Task Example_BatchClient_GetJobTaskCounts_JobGetTaskCounts_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3286,7 +3328,7 @@ public async Task Example_Batch_GetJobTaskCounts_JobGetTaskCounts_Convenience_As [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_DeleteJobSchedule_JobScheduleDelete() + public void Example_BatchClient_DeleteJobSchedule_JobScheduleDelete() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3299,7 +3341,7 @@ public void Example_Batch_DeleteJobSchedule_JobScheduleDelete() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_DeleteJobSchedule_JobScheduleDelete_Async() + public async Task Example_BatchClient_DeleteJobSchedule_JobScheduleDelete_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3312,7 +3354,7 @@ public async Task Example_Batch_DeleteJobSchedule_JobScheduleDelete_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetJobSchedule_JobScheduleGet() + public void Example_BatchClient_GetJobSchedule_JobScheduleGet() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3326,7 +3368,7 @@ public void Example_Batch_GetJobSchedule_JobScheduleGet() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetJobSchedule_JobScheduleGet_Async() + public async Task Example_BatchClient_GetJobSchedule_JobScheduleGet_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3340,7 +3382,7 @@ public async Task Example_Batch_GetJobSchedule_JobScheduleGet_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetJobSchedule_JobScheduleGet_Convenience() + public void Example_BatchClient_GetJobSchedule_JobScheduleGet_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3351,7 +3393,7 @@ public void Example_Batch_GetJobSchedule_JobScheduleGet_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetJobSchedule_JobScheduleGet_Convenience_Async() + public async Task Example_BatchClient_GetJobSchedule_JobScheduleGet_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3362,7 +3404,7 @@ public async Task Example_Batch_GetJobSchedule_JobScheduleGet_Convenience_Async( [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_UpdateJobSchedule_JobSchedulePatch() + public void Example_BatchClient_UpdateJobSchedule_JobScheduleUpdate() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3396,7 +3438,7 @@ public void Example_Batch_UpdateJobSchedule_JobSchedulePatch() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_UpdateJobSchedule_JobSchedulePatch_Async() + public async Task Example_BatchClient_UpdateJobSchedule_JobScheduleUpdate_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3430,7 +3472,7 @@ public async Task Example_Batch_UpdateJobSchedule_JobSchedulePatch_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_ReplaceJobSchedule_JobScheduleUpdate() + public void Example_BatchClient_ReplaceJobSchedule_JobSchedulePatch() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3464,7 +3506,7 @@ public void Example_Batch_ReplaceJobSchedule_JobScheduleUpdate() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_ReplaceJobSchedule_JobScheduleUpdate_Async() + public async Task Example_BatchClient_ReplaceJobSchedule_JobSchedulePatch_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3498,7 +3540,7 @@ public async Task Example_Batch_ReplaceJobSchedule_JobScheduleUpdate_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_ReplaceJobSchedule_JobScheduleUpdate_Convenience() + public void Example_BatchClient_ReplaceJobSchedule_JobSchedulePatch_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3528,7 +3570,7 @@ public void Example_Batch_ReplaceJobSchedule_JobScheduleUpdate_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_ReplaceJobSchedule_JobScheduleUpdate_Convenience_Async() + public async Task Example_BatchClient_ReplaceJobSchedule_JobSchedulePatch_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3558,7 +3600,7 @@ public async Task Example_Batch_ReplaceJobSchedule_JobScheduleUpdate_Convenience [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_DisableJobSchedule_JobScheduleDisable() + public void Example_BatchClient_DisableJobSchedule_JobScheduleDisable() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3571,7 +3613,7 @@ public void Example_Batch_DisableJobSchedule_JobScheduleDisable() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_DisableJobSchedule_JobScheduleDisable_Async() + public async Task Example_BatchClient_DisableJobSchedule_JobScheduleDisable_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3584,7 +3626,7 @@ public async Task Example_Batch_DisableJobSchedule_JobScheduleDisable_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_EnableJobSchedule_JobScheduleEnable() + public void Example_BatchClient_EnableJobSchedule_JobScheduleEnable() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3597,7 +3639,7 @@ public void Example_Batch_EnableJobSchedule_JobScheduleEnable() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_EnableJobSchedule_JobScheduleEnable_Async() + public async Task Example_BatchClient_EnableJobSchedule_JobScheduleEnable_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3610,7 +3652,7 @@ public async Task Example_Batch_EnableJobSchedule_JobScheduleEnable_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_TerminateJobSchedule_JobScheduleTerminate() + public void Example_BatchClient_TerminateJobSchedule_JobScheduleTerminate() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3623,7 +3665,7 @@ public void Example_Batch_TerminateJobSchedule_JobScheduleTerminate() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_TerminateJobSchedule_JobScheduleTerminate_Async() + public async Task Example_BatchClient_TerminateJobSchedule_JobScheduleTerminate_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3636,7 +3678,7 @@ public async Task Example_Batch_TerminateJobSchedule_JobScheduleTerminate_Async( [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreateJobSchedule_CreatesABasicJobSchedule() + public void Example_BatchClient_CreateJobSchedule_CreatesABasicJobSchedule() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3664,7 +3706,7 @@ public void Example_Batch_CreateJobSchedule_CreatesABasicJobSchedule() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreateJobSchedule_CreatesABasicJobSchedule_Async() + public async Task Example_BatchClient_CreateJobSchedule_CreatesABasicJobSchedule_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3692,7 +3734,7 @@ public async Task Example_Batch_CreateJobSchedule_CreatesABasicJobSchedule_Async [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreateJobSchedule_CreatesABasicJobSchedule_Convenience() + public void Example_BatchClient_CreateJobSchedule_CreatesABasicJobSchedule_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3710,7 +3752,7 @@ public void Example_Batch_CreateJobSchedule_CreatesABasicJobSchedule_Convenience [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreateJobSchedule_CreatesABasicJobSchedule_Convenience_Async() + public async Task Example_BatchClient_CreateJobSchedule_CreatesABasicJobSchedule_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3728,7 +3770,7 @@ public async Task Example_Batch_CreateJobSchedule_CreatesABasicJobSchedule_Conve [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreateJobSchedule_CreatesAComplexJobScheduleAdd() + public void Example_BatchClient_CreateJobSchedule_CreatesAComplexJobScheduleAdd() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3803,7 +3845,7 @@ public void Example_Batch_CreateJobSchedule_CreatesAComplexJobScheduleAdd() poolLifetimeOption = "jobschedule", pool = new { - vmSize = "Standard_D1_v2", + vmSize = "STANDARD_D2S_V3", virtualMachineConfiguration = new { imageReference = new @@ -3814,6 +3856,14 @@ public void Example_Batch_CreateJobSchedule_CreatesAComplexJobScheduleAdd() version = "latest", }, nodeAgentSKUId = "batch.node.windows amd64", + windowsConfiguration = new + { + enableAutomaticUpdates = false, + }, + nodePlacementConfiguration = new + { + policy = "zonal", + }, }, resizeTimeout = "PT15M", targetDedicatedNodes = 3, @@ -3884,7 +3934,7 @@ public void Example_Batch_CreateJobSchedule_CreatesAComplexJobScheduleAdd() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreateJobSchedule_CreatesAComplexJobScheduleAdd_Async() + public async Task Example_BatchClient_CreateJobSchedule_CreatesAComplexJobScheduleAdd_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -3959,7 +4009,7 @@ public async Task Example_Batch_CreateJobSchedule_CreatesAComplexJobScheduleAdd_ poolLifetimeOption = "jobschedule", pool = new { - vmSize = "Standard_D1_v2", + vmSize = "STANDARD_D2S_V3", virtualMachineConfiguration = new { imageReference = new @@ -3970,6 +4020,14 @@ public async Task Example_Batch_CreateJobSchedule_CreatesAComplexJobScheduleAdd_ version = "latest", }, nodeAgentSKUId = "batch.node.windows amd64", + windowsConfiguration = new + { + enableAutomaticUpdates = false, + }, + nodePlacementConfiguration = new + { + policy = "zonal", + }, }, resizeTimeout = "PT15M", targetDedicatedNodes = 3, @@ -4040,7 +4098,7 @@ public async Task Example_Batch_CreateJobSchedule_CreatesAComplexJobScheduleAdd_ [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreateJobSchedule_CreatesAComplexJobScheduleAdd_Convenience() + public void Example_BatchClient_CreateJobSchedule_CreatesAComplexJobScheduleAdd_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -4057,7 +4115,7 @@ public void Example_Batch_CreateJobSchedule_CreatesAComplexJobScheduleAdd_Conven AutoPoolSpecification = new BatchAutoPoolSpecification(BatchPoolLifetimeOption.JobSchedule) { AutoPoolIdPrefix = "mypool", - Pool = new BatchPoolSpecification("Standard_D1_v2") + Pool = new BatchPoolSpecification("STANDARD_D2S_V3") { VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference { @@ -4065,7 +4123,17 @@ public void Example_Batch_CreateJobSchedule_CreatesAComplexJobScheduleAdd_Conven Offer = "WindowsServer", Sku = "2016-datacenter-smalldisk", Version = "latest", - }, "batch.node.windows amd64"), + }, "batch.node.windows amd64") + { + WindowsConfiguration = new WindowsConfiguration + { + EnableAutomaticUpdates = false, + }, + NodePlacementConfiguration = new BatchNodePlacementConfiguration + { + Policy = BatchNodePlacementPolicyType.Zonal, + }, + }, TaskSlotsPerNode = 2, TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), @@ -4149,7 +4217,7 @@ public void Example_Batch_CreateJobSchedule_CreatesAComplexJobScheduleAdd_Conven [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreateJobSchedule_CreatesAComplexJobScheduleAdd_Convenience_Async() + public async Task Example_BatchClient_CreateJobSchedule_CreatesAComplexJobScheduleAdd_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -4166,7 +4234,7 @@ public async Task Example_Batch_CreateJobSchedule_CreatesAComplexJobScheduleAdd_ AutoPoolSpecification = new BatchAutoPoolSpecification(BatchPoolLifetimeOption.JobSchedule) { AutoPoolIdPrefix = "mypool", - Pool = new BatchPoolSpecification("Standard_D1_v2") + Pool = new BatchPoolSpecification("STANDARD_D2S_V3") { VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference { @@ -4174,7 +4242,17 @@ public async Task Example_Batch_CreateJobSchedule_CreatesAComplexJobScheduleAdd_ Offer = "WindowsServer", Sku = "2016-datacenter-smalldisk", Version = "latest", - }, "batch.node.windows amd64"), + }, "batch.node.windows amd64") + { + WindowsConfiguration = new WindowsConfiguration + { + EnableAutomaticUpdates = false, + }, + NodePlacementConfiguration = new BatchNodePlacementConfiguration + { + Policy = BatchNodePlacementPolicyType.Zonal, + }, + }, TaskSlotsPerNode = 2, TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), @@ -4258,7 +4336,7 @@ public async Task Example_Batch_CreateJobSchedule_CreatesAComplexJobScheduleAdd_ [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreateTask_CreatesABasicTask() + public void Example_BatchClient_CreateTask_CreatesABasicTask() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -4276,7 +4354,7 @@ public void Example_Batch_CreateTask_CreatesABasicTask() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreateTask_CreatesABasicTask_Async() + public async Task Example_BatchClient_CreateTask_CreatesABasicTask_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -4294,7 +4372,7 @@ public async Task Example_Batch_CreateTask_CreatesABasicTask_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreateTask_CreatesABasicTask_Convenience() + public void Example_BatchClient_CreateTask_CreatesABasicTask_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -4306,7 +4384,7 @@ public void Example_Batch_CreateTask_CreatesABasicTask_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreateTask_CreatesABasicTask_Convenience_Async() + public async Task Example_BatchClient_CreateTask_CreatesABasicTask_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -4318,7 +4396,7 @@ public async Task Example_Batch_CreateTask_CreatesABasicTask_Convenience_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreateTask_CreatesATaskWithContainerSettings() + public void Example_BatchClient_CreateTask_CreatesATaskWithContainerSettings() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -4349,7 +4427,7 @@ public void Example_Batch_CreateTask_CreatesATaskWithContainerSettings() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreateTask_CreatesATaskWithContainerSettings_Async() + public async Task Example_BatchClient_CreateTask_CreatesATaskWithContainerSettings_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -4380,7 +4458,7 @@ public async Task Example_Batch_CreateTask_CreatesATaskWithContainerSettings_Asy [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreateTask_CreatesATaskWithContainerSettings_Convenience() + public void Example_BatchClient_CreateTask_CreatesATaskWithContainerSettings_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -4406,7 +4484,7 @@ public void Example_Batch_CreateTask_CreatesATaskWithContainerSettings_Convenien [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreateTask_CreatesATaskWithContainerSettings_Convenience_Async() + public async Task Example_BatchClient_CreateTask_CreatesATaskWithContainerSettings_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -4432,7 +4510,297 @@ public async Task Example_Batch_CreateTask_CreatesATaskWithContainerSettings_Con [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreateTask_CreatesATaskWithExitConditions() + public void Example_BatchClient_CreateTask_CreatesATaskWithContainerSettingsWithDataIsolation() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + BatchClient client = new BatchClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + id = "taskId", + commandLine = "bash -c 'echo hello'", + containerSettings = new + { + imageName = "ubuntu", + containerHostBatchBindMounts = new object[] + { +new +{ +source = "Task", +isReadOnly = true, +} + }, + }, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + }); + Response response = client.CreateTask("jobId", content); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_BatchClient_CreateTask_CreatesATaskWithContainerSettingsWithDataIsolation_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + BatchClient client = new BatchClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + id = "taskId", + commandLine = "bash -c 'echo hello'", + containerSettings = new + { + imageName = "ubuntu", + containerHostBatchBindMounts = new object[] + { +new +{ +source = "Task", +isReadOnly = true, +} + }, + }, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + }); + Response response = await client.CreateTaskAsync("jobId", content); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_BatchClient_CreateTask_CreatesATaskWithContainerSettingsWithDataIsolation_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + BatchClient client = new BatchClient(endpoint, credential); + + BatchTaskCreateContent task = new BatchTaskCreateContent("taskId", "bash -c 'echo hello'") + { + ContainerSettings = new BatchTaskContainerSettings("ubuntu") + { + ContainerHostBatchBindMounts = {new ContainerHostBatchBindMountEntry +{ +Source = ContainerHostDataPath.Task, +IsReadOnly = true, +}}, + }, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.NonAdmin, + }, + }, + }; + Response response = client.CreateTask("jobId", task); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_BatchClient_CreateTask_CreatesATaskWithContainerSettingsWithDataIsolation_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + BatchClient client = new BatchClient(endpoint, credential); + + BatchTaskCreateContent task = new BatchTaskCreateContent("taskId", "bash -c 'echo hello'") + { + ContainerSettings = new BatchTaskContainerSettings("ubuntu") + { + ContainerHostBatchBindMounts = {new ContainerHostBatchBindMountEntry +{ +Source = ContainerHostDataPath.Task, +IsReadOnly = true, +}}, + }, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.NonAdmin, + }, + }, + }; + Response response = await client.CreateTaskAsync("jobId", task); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_BatchClient_CreateTask_CreatesATaskWithContainerSettingsWithDuplicateSource() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + BatchClient client = new BatchClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + id = "taskId", + commandLine = "bash -c 'echo hello'", + containerSettings = new + { + imageName = "ubuntu", + containerHostBatchBindMounts = new object[] + { +new +{ +source = "Task", +isReadOnly = true, +}, +new +{ +source = "Task", +isReadOnly = true, +} + }, + }, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + }); + Response response = client.CreateTask("jobId", content); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_BatchClient_CreateTask_CreatesATaskWithContainerSettingsWithDuplicateSource_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + BatchClient client = new BatchClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + id = "taskId", + commandLine = "bash -c 'echo hello'", + containerSettings = new + { + imageName = "ubuntu", + containerHostBatchBindMounts = new object[] + { +new +{ +source = "Task", +isReadOnly = true, +}, +new +{ +source = "Task", +isReadOnly = true, +} + }, + }, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + }); + Response response = await client.CreateTaskAsync("jobId", content); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_BatchClient_CreateTask_CreatesATaskWithContainerSettingsWithDuplicateSource_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + BatchClient client = new BatchClient(endpoint, credential); + + BatchTaskCreateContent task = new BatchTaskCreateContent("taskId", "bash -c 'echo hello'") + { + ContainerSettings = new BatchTaskContainerSettings("ubuntu") + { + ContainerHostBatchBindMounts = {new ContainerHostBatchBindMountEntry +{ +Source = ContainerHostDataPath.Task, +IsReadOnly = true, +}, new ContainerHostBatchBindMountEntry +{ +Source = ContainerHostDataPath.Task, +IsReadOnly = true, +}}, + }, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.NonAdmin, + }, + }, + }; + Response response = client.CreateTask("jobId", task); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_BatchClient_CreateTask_CreatesATaskWithContainerSettingsWithDuplicateSource_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + BatchClient client = new BatchClient(endpoint, credential); + + BatchTaskCreateContent task = new BatchTaskCreateContent("taskId", "bash -c 'echo hello'") + { + ContainerSettings = new BatchTaskContainerSettings("ubuntu") + { + ContainerHostBatchBindMounts = {new ContainerHostBatchBindMountEntry +{ +Source = ContainerHostDataPath.Task, +IsReadOnly = true, +}, new ContainerHostBatchBindMountEntry +{ +Source = ContainerHostDataPath.Task, +IsReadOnly = true, +}}, + }, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.NonAdmin, + }, + }, + }; + Response response = await client.CreateTaskAsync("jobId", task); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_BatchClient_CreateTask_CreatesATaskWithExitConditions() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -4473,7 +4841,7 @@ public void Example_Batch_CreateTask_CreatesATaskWithExitConditions() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreateTask_CreatesATaskWithExitConditions_Async() + public async Task Example_BatchClient_CreateTask_CreatesATaskWithExitConditions_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -4514,7 +4882,7 @@ public async Task Example_Batch_CreateTask_CreatesATaskWithExitConditions_Async( [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreateTask_CreatesATaskWithExitConditions_Convenience() + public void Example_BatchClient_CreateTask_CreatesATaskWithExitConditions_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -4543,7 +4911,7 @@ public void Example_Batch_CreateTask_CreatesATaskWithExitConditions_Convenience( [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreateTask_CreatesATaskWithExitConditions_Convenience_Async() + public async Task Example_BatchClient_CreateTask_CreatesATaskWithExitConditions_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -4572,7 +4940,7 @@ public async Task Example_Batch_CreateTask_CreatesATaskWithExitConditions_Conven [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreateTask_CreatesATaskWithExtraSlotRequirement() + public void Example_BatchClient_CreateTask_CreatesATaskWithExtraSlotRequirement() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -4591,7 +4959,7 @@ public void Example_Batch_CreateTask_CreatesATaskWithExtraSlotRequirement() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreateTask_CreatesATaskWithExtraSlotRequirement_Async() + public async Task Example_BatchClient_CreateTask_CreatesATaskWithExtraSlotRequirement_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -4610,7 +4978,7 @@ public async Task Example_Batch_CreateTask_CreatesATaskWithExtraSlotRequirement_ [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreateTask_CreatesATaskWithExtraSlotRequirement_Convenience() + public void Example_BatchClient_CreateTask_CreatesATaskWithExtraSlotRequirement_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -4625,7 +4993,7 @@ public void Example_Batch_CreateTask_CreatesATaskWithExtraSlotRequirement_Conven [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreateTask_CreatesATaskWithExtraSlotRequirement_Convenience_Async() + public async Task Example_BatchClient_CreateTask_CreatesATaskWithExtraSlotRequirement_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -4640,7 +5008,7 @@ public async Task Example_Batch_CreateTask_CreatesATaskWithExtraSlotRequirement_ [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreateTaskCollection_CreatesABasicCollectionOfTasks() + public void Example_BatchClient_CreateTaskCollection_CreatesABasicCollectionOfTasks() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -4670,7 +5038,7 @@ public void Example_Batch_CreateTaskCollection_CreatesABasicCollectionOfTasks() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreateTaskCollection_CreatesABasicCollectionOfTasks_Async() + public async Task Example_BatchClient_CreateTaskCollection_CreatesABasicCollectionOfTasks_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -4700,7 +5068,7 @@ public async Task Example_Batch_CreateTaskCollection_CreatesABasicCollectionOfTa [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreateTaskCollection_CreatesABasicCollectionOfTasks_Convenience() + public void Example_BatchClient_CreateTaskCollection_CreatesABasicCollectionOfTasks_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -4716,7 +5084,7 @@ public void Example_Batch_CreateTaskCollection_CreatesABasicCollectionOfTasks_Co [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreateTaskCollection_CreatesABasicCollectionOfTasks_Convenience_Async() + public async Task Example_BatchClient_CreateTaskCollection_CreatesABasicCollectionOfTasks_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -4732,7 +5100,7 @@ public async Task Example_Batch_CreateTaskCollection_CreatesABasicCollectionOfTa [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreateTaskCollection_CreatesAComplexCollectionOfTasks() + public void Example_BatchClient_CreateTaskCollection_CreatesAComplexCollectionOfTasks() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -4807,7 +5175,7 @@ public void Example_Batch_CreateTaskCollection_CreatesAComplexCollectionOfTasks( [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreateTaskCollection_CreatesAComplexCollectionOfTasks_Async() + public async Task Example_BatchClient_CreateTaskCollection_CreatesAComplexCollectionOfTasks_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -4882,7 +5250,7 @@ public async Task Example_Batch_CreateTaskCollection_CreatesAComplexCollectionOf [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreateTaskCollection_CreatesAComplexCollectionOfTasks_Convenience() + public void Example_BatchClient_CreateTaskCollection_CreatesAComplexCollectionOfTasks_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -4929,7 +5297,7 @@ public void Example_Batch_CreateTaskCollection_CreatesAComplexCollectionOfTasks_ [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreateTaskCollection_CreatesAComplexCollectionOfTasks_Convenience_Async() + public async Task Example_BatchClient_CreateTaskCollection_CreatesAComplexCollectionOfTasks_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -4976,7 +5344,7 @@ public async Task Example_Batch_CreateTaskCollection_CreatesAComplexCollectionOf [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_DeleteTask_TaskDelete() + public void Example_BatchClient_DeleteTask_TaskDelete() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -4989,7 +5357,7 @@ public void Example_Batch_DeleteTask_TaskDelete() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_DeleteTask_TaskDelete_Async() + public async Task Example_BatchClient_DeleteTask_TaskDelete_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5002,7 +5370,7 @@ public async Task Example_Batch_DeleteTask_TaskDelete_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetTask_TaskGet() + public void Example_BatchClient_GetTask_TaskGet() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5016,7 +5384,7 @@ public void Example_Batch_GetTask_TaskGet() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetTask_TaskGet_Async() + public async Task Example_BatchClient_GetTask_TaskGet_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5030,7 +5398,7 @@ public async Task Example_Batch_GetTask_TaskGet_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetTask_TaskGet_Convenience() + public void Example_BatchClient_GetTask_TaskGet_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5041,7 +5409,7 @@ public void Example_Batch_GetTask_TaskGet_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetTask_TaskGet_Convenience_Async() + public async Task Example_BatchClient_GetTask_TaskGet_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5052,7 +5420,7 @@ public async Task Example_Batch_GetTask_TaskGet_Convenience_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_ReplaceTask_TaskUpdate() + public void Example_BatchClient_ReplaceTask_TaskUpdate() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5074,7 +5442,7 @@ public void Example_Batch_ReplaceTask_TaskUpdate() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_ReplaceTask_TaskUpdate_Async() + public async Task Example_BatchClient_ReplaceTask_TaskUpdate_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5096,7 +5464,7 @@ public async Task Example_Batch_ReplaceTask_TaskUpdate_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_ReplaceTask_TaskUpdate_Convenience() + public void Example_BatchClient_ReplaceTask_TaskUpdate_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5116,7 +5484,7 @@ public void Example_Batch_ReplaceTask_TaskUpdate_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_ReplaceTask_TaskUpdate_Convenience_Async() + public async Task Example_BatchClient_ReplaceTask_TaskUpdate_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5136,7 +5504,7 @@ public async Task Example_Batch_ReplaceTask_TaskUpdate_Convenience_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_TerminateTask_TaskTerminate() + public void Example_BatchClient_TerminateTask_TaskTerminate() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5149,7 +5517,7 @@ public void Example_Batch_TerminateTask_TaskTerminate() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_TerminateTask_TaskTerminate_Async() + public async Task Example_BatchClient_TerminateTask_TaskTerminate_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5162,7 +5530,7 @@ public async Task Example_Batch_TerminateTask_TaskTerminate_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_ReactivateTask_TaskReactivate() + public void Example_BatchClient_ReactivateTask_TaskReactivate() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5175,7 +5543,7 @@ public void Example_Batch_ReactivateTask_TaskReactivate() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_ReactivateTask_TaskReactivate_Async() + public async Task Example_BatchClient_ReactivateTask_TaskReactivate_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5188,7 +5556,7 @@ public async Task Example_Batch_ReactivateTask_TaskReactivate_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_DeleteTaskFile_FileDeleteFromTask() + public void Example_BatchClient_DeleteTaskFile_FileDeleteFromTask() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5201,7 +5569,7 @@ public void Example_Batch_DeleteTaskFile_FileDeleteFromTask() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_DeleteTaskFile_FileDeleteFromTask_Async() + public async Task Example_BatchClient_DeleteTaskFile_FileDeleteFromTask_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5214,7 +5582,7 @@ public async Task Example_Batch_DeleteTaskFile_FileDeleteFromTask_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetTaskFile_GetFileFromTask() + public void Example_BatchClient_GetTaskFile_GetFileFromTask() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5228,7 +5596,7 @@ public void Example_Batch_GetTaskFile_GetFileFromTask() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetTaskFile_GetFileFromTask_Async() + public async Task Example_BatchClient_GetTaskFile_GetFileFromTask_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5242,7 +5610,7 @@ public async Task Example_Batch_GetTaskFile_GetFileFromTask_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetTaskFile_GetFileFromTask_Convenience() + public void Example_BatchClient_GetTaskFile_GetFileFromTask_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5253,7 +5621,7 @@ public void Example_Batch_GetTaskFile_GetFileFromTask_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetTaskFile_GetFileFromTask_Convenience_Async() + public async Task Example_BatchClient_GetTaskFile_GetFileFromTask_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5264,7 +5632,7 @@ public async Task Example_Batch_GetTaskFile_GetFileFromTask_Convenience_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreateNodeUser_NodeCreateUser() + public void Example_BatchClient_CreateNodeUser_NodeCreateUser() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5284,7 +5652,7 @@ public void Example_Batch_CreateNodeUser_NodeCreateUser() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreateNodeUser_NodeCreateUser_Async() + public async Task Example_BatchClient_CreateNodeUser_NodeCreateUser_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5304,7 +5672,7 @@ public async Task Example_Batch_CreateNodeUser_NodeCreateUser_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_CreateNodeUser_NodeCreateUser_Convenience() + public void Example_BatchClient_CreateNodeUser_NodeCreateUser_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5321,7 +5689,7 @@ public void Example_Batch_CreateNodeUser_NodeCreateUser_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_CreateNodeUser_NodeCreateUser_Convenience_Async() + public async Task Example_BatchClient_CreateNodeUser_NodeCreateUser_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5338,7 +5706,7 @@ public async Task Example_Batch_CreateNodeUser_NodeCreateUser_Convenience_Async( [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_DeleteNodeUser_NodeDeleteUser() + public void Example_BatchClient_DeleteNodeUser_NodeDeleteUser() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5351,7 +5719,7 @@ public void Example_Batch_DeleteNodeUser_NodeDeleteUser() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_DeleteNodeUser_NodeDeleteUser_Async() + public async Task Example_BatchClient_DeleteNodeUser_NodeDeleteUser_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5364,7 +5732,7 @@ public async Task Example_Batch_DeleteNodeUser_NodeDeleteUser_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_ReplaceNodeUser_NodeUpdateUser() + public void Example_BatchClient_ReplaceNodeUser_NodeUpdateUser() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5382,7 +5750,7 @@ public void Example_Batch_ReplaceNodeUser_NodeUpdateUser() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_ReplaceNodeUser_NodeUpdateUser_Async() + public async Task Example_BatchClient_ReplaceNodeUser_NodeUpdateUser_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5400,7 +5768,7 @@ public async Task Example_Batch_ReplaceNodeUser_NodeUpdateUser_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_ReplaceNodeUser_NodeUpdateUser_Convenience() + public void Example_BatchClient_ReplaceNodeUser_NodeUpdateUser_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5416,7 +5784,7 @@ public void Example_Batch_ReplaceNodeUser_NodeUpdateUser_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_ReplaceNodeUser_NodeUpdateUser_Convenience_Async() + public async Task Example_BatchClient_ReplaceNodeUser_NodeUpdateUser_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5432,7 +5800,7 @@ public async Task Example_Batch_ReplaceNodeUser_NodeUpdateUser_Convenience_Async [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetNode_NodeGet() + public void Example_BatchClient_GetNode_NodeGet() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5446,7 +5814,7 @@ public void Example_Batch_GetNode_NodeGet() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetNode_NodeGet_Async() + public async Task Example_BatchClient_GetNode_NodeGet_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5460,7 +5828,7 @@ public async Task Example_Batch_GetNode_NodeGet_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetNode_NodeGet_Convenience() + public void Example_BatchClient_GetNode_NodeGet_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5471,7 +5839,7 @@ public void Example_Batch_GetNode_NodeGet_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetNode_NodeGet_Convenience_Async() + public async Task Example_BatchClient_GetNode_NodeGet_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5482,7 +5850,7 @@ public async Task Example_Batch_GetNode_NodeGet_Convenience_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_RebootNode_NodeReboot() + public void Example_BatchClient_RebootNode_NodeReboot() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5496,7 +5864,7 @@ public void Example_Batch_RebootNode_NodeReboot() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_RebootNode_NodeReboot_Async() + public async Task Example_BatchClient_RebootNode_NodeReboot_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5510,7 +5878,7 @@ public async Task Example_Batch_RebootNode_NodeReboot_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_RebootNode_NodeReboot_Convenience() + public void Example_BatchClient_RebootNode_NodeReboot_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5521,7 +5889,7 @@ public void Example_Batch_RebootNode_NodeReboot_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_RebootNode_NodeReboot_Convenience_Async() + public async Task Example_BatchClient_RebootNode_NodeReboot_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5532,7 +5900,133 @@ public async Task Example_Batch_RebootNode_NodeReboot_Convenience_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_DisableNodeScheduling_NodeDisableScheduling() + public void Example_BatchClient_StartNode_NodeStart() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + BatchClient client = new BatchClient(endpoint, credential); + + Response response = client.StartNode("poolId", "tvm-1695681911_1-20161122t193202z"); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_BatchClient_StartNode_NodeStart_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + BatchClient client = new BatchClient(endpoint, credential); + + Response response = await client.StartNodeAsync("poolId", "tvm-1695681911_1-20161122t193202z"); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_BatchClient_ReimageNode_NodeReimage() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + BatchClient client = new BatchClient(endpoint, credential); + + using RequestContent content = null; + Response response = client.ReimageNode("poolId", "tvm-1695681911_1-20161122t193202z", content); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_BatchClient_ReimageNode_NodeReimage_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + BatchClient client = new BatchClient(endpoint, credential); + + using RequestContent content = null; + Response response = await client.ReimageNodeAsync("poolId", "tvm-1695681911_1-20161122t193202z", content); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_BatchClient_ReimageNode_NodeReimage_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + BatchClient client = new BatchClient(endpoint, credential); + + Response response = client.ReimageNode("poolId", "tvm-1695681911_1-20161122t193202z"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_BatchClient_ReimageNode_NodeReimage_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + BatchClient client = new BatchClient(endpoint, credential); + + Response response = await client.ReimageNodeAsync("poolId", "tvm-1695681911_1-20161122t193202z"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_BatchClient_DeallocateNode_NodeDeallocate() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + BatchClient client = new BatchClient(endpoint, credential); + + using RequestContent content = null; + Response response = client.DeallocateNode("poolId", "tvm-1695681911_1-20161122t193202z", content); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_BatchClient_DeallocateNode_NodeDeallocate_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + BatchClient client = new BatchClient(endpoint, credential); + + using RequestContent content = null; + Response response = await client.DeallocateNodeAsync("poolId", "tvm-1695681911_1-20161122t193202z", content); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_BatchClient_DeallocateNode_NodeDeallocate_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + BatchClient client = new BatchClient(endpoint, credential); + + Response response = client.DeallocateNode("poolId", "tvm-1695681911_1-20161122t193202z"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_BatchClient_DeallocateNode_NodeDeallocate_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + BatchClient client = new BatchClient(endpoint, credential); + + Response response = await client.DeallocateNodeAsync("poolId", "tvm-1695681911_1-20161122t193202z"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_BatchClient_DisableNodeScheduling_NodeDisableScheduling() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5546,7 +6040,7 @@ public void Example_Batch_DisableNodeScheduling_NodeDisableScheduling() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_DisableNodeScheduling_NodeDisableScheduling_Async() + public async Task Example_BatchClient_DisableNodeScheduling_NodeDisableScheduling_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5560,7 +6054,7 @@ public async Task Example_Batch_DisableNodeScheduling_NodeDisableScheduling_Asyn [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_DisableNodeScheduling_NodeDisableScheduling_Convenience() + public void Example_BatchClient_DisableNodeScheduling_NodeDisableScheduling_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5571,7 +6065,7 @@ public void Example_Batch_DisableNodeScheduling_NodeDisableScheduling_Convenienc [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_DisableNodeScheduling_NodeDisableScheduling_Convenience_Async() + public async Task Example_BatchClient_DisableNodeScheduling_NodeDisableScheduling_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5582,7 +6076,7 @@ public async Task Example_Batch_DisableNodeScheduling_NodeDisableScheduling_Conv [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_EnableNodeScheduling_NodeEnableScheduling() + public void Example_BatchClient_EnableNodeScheduling_NodeEnableScheduling() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5595,7 +6089,7 @@ public void Example_Batch_EnableNodeScheduling_NodeEnableScheduling() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_EnableNodeScheduling_NodeEnableScheduling_Async() + public async Task Example_BatchClient_EnableNodeScheduling_NodeEnableScheduling_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5608,7 +6102,7 @@ public async Task Example_Batch_EnableNodeScheduling_NodeEnableScheduling_Async( [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetNodeRemoteLoginSettings_NodeGetRemoteLoginSettings() + public void Example_BatchClient_GetNodeRemoteLoginSettings_NodeGetRemoteLoginSettings() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5623,7 +6117,7 @@ public void Example_Batch_GetNodeRemoteLoginSettings_NodeGetRemoteLoginSettings( [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetNodeRemoteLoginSettings_NodeGetRemoteLoginSettings_Async() + public async Task Example_BatchClient_GetNodeRemoteLoginSettings_NodeGetRemoteLoginSettings_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5638,7 +6132,7 @@ public async Task Example_Batch_GetNodeRemoteLoginSettings_NodeGetRemoteLoginSet [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetNodeRemoteLoginSettings_NodeGetRemoteLoginSettings_Convenience() + public void Example_BatchClient_GetNodeRemoteLoginSettings_NodeGetRemoteLoginSettings_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5649,7 +6143,7 @@ public void Example_Batch_GetNodeRemoteLoginSettings_NodeGetRemoteLoginSettings_ [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetNodeRemoteLoginSettings_NodeGetRemoteLoginSettings_Convenience_Async() + public async Task Example_BatchClient_GetNodeRemoteLoginSettings_NodeGetRemoteLoginSettings_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5660,7 +6154,7 @@ public async Task Example_Batch_GetNodeRemoteLoginSettings_NodeGetRemoteLoginSet [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_UploadNodeLogs_UploadBatchServiceLogs() + public void Example_BatchClient_UploadNodeLogs_UploadBatchServiceLogs() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5680,7 +6174,7 @@ public void Example_Batch_UploadNodeLogs_UploadBatchServiceLogs() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_UploadNodeLogs_UploadBatchServiceLogs_Async() + public async Task Example_BatchClient_UploadNodeLogs_UploadBatchServiceLogs_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5700,7 +6194,7 @@ public async Task Example_Batch_UploadNodeLogs_UploadBatchServiceLogs_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_UploadNodeLogs_UploadBatchServiceLogs_Convenience() + public void Example_BatchClient_UploadNodeLogs_UploadBatchServiceLogs_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5712,7 +6206,7 @@ public void Example_Batch_UploadNodeLogs_UploadBatchServiceLogs_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_UploadNodeLogs_UploadBatchServiceLogs_Convenience_Async() + public async Task Example_BatchClient_UploadNodeLogs_UploadBatchServiceLogs_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5724,7 +6218,7 @@ public async Task Example_Batch_UploadNodeLogs_UploadBatchServiceLogs_Convenienc [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetNodeExtension_GetBatchNodeExtension() + public void Example_BatchClient_GetNodeExtension_GetBatchNodeExtension() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5738,7 +6232,7 @@ public void Example_Batch_GetNodeExtension_GetBatchNodeExtension() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetNodeExtension_GetBatchNodeExtension_Async() + public async Task Example_BatchClient_GetNodeExtension_GetBatchNodeExtension_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5752,7 +6246,7 @@ public async Task Example_Batch_GetNodeExtension_GetBatchNodeExtension_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetNodeExtension_GetBatchNodeExtension_Convenience() + public void Example_BatchClient_GetNodeExtension_GetBatchNodeExtension_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5763,7 +6257,7 @@ public void Example_Batch_GetNodeExtension_GetBatchNodeExtension_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetNodeExtension_GetBatchNodeExtension_Convenience_Async() + public async Task Example_BatchClient_GetNodeExtension_GetBatchNodeExtension_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5774,7 +6268,7 @@ public async Task Example_Batch_GetNodeExtension_GetBatchNodeExtension_Convenien [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_DeleteNodeFile_FileDeleteFromNode() + public void Example_BatchClient_DeleteNodeFile_FileDeleteFromNode() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5787,7 +6281,7 @@ public void Example_Batch_DeleteNodeFile_FileDeleteFromNode() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_DeleteNodeFile_FileDeleteFromNode_Async() + public async Task Example_BatchClient_DeleteNodeFile_FileDeleteFromNode_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5800,7 +6294,7 @@ public async Task Example_Batch_DeleteNodeFile_FileDeleteFromNode_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetNodeFile_GetFileFromComputeNode() + public void Example_BatchClient_GetNodeFile_GetFileFromComputeNode() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5814,7 +6308,7 @@ public void Example_Batch_GetNodeFile_GetFileFromComputeNode() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetNodeFile_GetFileFromComputeNode_Async() + public async Task Example_BatchClient_GetNodeFile_GetFileFromComputeNode_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5828,7 +6322,7 @@ public async Task Example_Batch_GetNodeFile_GetFileFromComputeNode_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetNodeFile_GetFileFromComputeNode_Convenience() + public void Example_BatchClient_GetNodeFile_GetFileFromComputeNode_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5839,7 +6333,7 @@ public void Example_Batch_GetNodeFile_GetFileFromComputeNode_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetNodeFile_GetFileFromComputeNode_Convenience_Async() + public async Task Example_BatchClient_GetNodeFile_GetFileFromComputeNode_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5850,7 +6344,7 @@ public async Task Example_Batch_GetNodeFile_GetFileFromComputeNode_Convenience_A [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetApplications_ListApplications() + public void Example_BatchClient_GetApplications_ListApplications() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5867,7 +6361,7 @@ public void Example_Batch_GetApplications_ListApplications() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetApplications_ListApplications_Async() + public async Task Example_BatchClient_GetApplications_ListApplications_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5884,7 +6378,7 @@ public async Task Example_Batch_GetApplications_ListApplications_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetApplications_ListApplications_Convenience() + public void Example_BatchClient_GetApplications_ListApplications_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5897,7 +6391,7 @@ public void Example_Batch_GetApplications_ListApplications_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetApplications_ListApplications_Convenience_Async() + public async Task Example_BatchClient_GetApplications_ListApplications_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5910,7 +6404,7 @@ public async Task Example_Batch_GetApplications_ListApplications_Convenience_Asy [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetPoolUsageMetrics_PoolListUsageMetrics() + public void Example_BatchClient_GetPoolUsageMetrics_PoolListUsageMetrics() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5929,7 +6423,7 @@ public void Example_Batch_GetPoolUsageMetrics_PoolListUsageMetrics() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetPoolUsageMetrics_PoolListUsageMetrics_Async() + public async Task Example_BatchClient_GetPoolUsageMetrics_PoolListUsageMetrics_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5948,7 +6442,7 @@ public async Task Example_Batch_GetPoolUsageMetrics_PoolListUsageMetrics_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetPoolUsageMetrics_PoolListUsageMetrics_Convenience() + public void Example_BatchClient_GetPoolUsageMetrics_PoolListUsageMetrics_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5961,7 +6455,7 @@ public void Example_Batch_GetPoolUsageMetrics_PoolListUsageMetrics_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetPoolUsageMetrics_PoolListUsageMetrics_Convenience_Async() + public async Task Example_BatchClient_GetPoolUsageMetrics_PoolListUsageMetrics_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5974,7 +6468,7 @@ public async Task Example_Batch_GetPoolUsageMetrics_PoolListUsageMetrics_Conveni [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetPools_PoolList() + public void Example_BatchClient_GetPools_PoolList() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -5989,7 +6483,7 @@ public void Example_Batch_GetPools_PoolList() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetPools_PoolList_Async() + public async Task Example_BatchClient_GetPools_PoolList_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6004,7 +6498,7 @@ public async Task Example_Batch_GetPools_PoolList_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetPools_PoolList_Convenience() + public void Example_BatchClient_GetPools_PoolList_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6017,7 +6511,7 @@ public void Example_Batch_GetPools_PoolList_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetPools_PoolList_Convenience_Async() + public async Task Example_BatchClient_GetPools_PoolList_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6030,7 +6524,7 @@ public async Task Example_Batch_GetPools_PoolList_Convenience_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetSupportedImages_AccountListNodeAgentSkus() + public void Example_BatchClient_GetSupportedImages_AccountListNodeAgentSkus() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6048,7 +6542,7 @@ public void Example_Batch_GetSupportedImages_AccountListNodeAgentSkus() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetSupportedImages_AccountListNodeAgentSkus_Async() + public async Task Example_BatchClient_GetSupportedImages_AccountListNodeAgentSkus_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6066,7 +6560,7 @@ public async Task Example_Batch_GetSupportedImages_AccountListNodeAgentSkus_Asyn [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetSupportedImages_AccountListNodeAgentSkus_Convenience() + public void Example_BatchClient_GetSupportedImages_AccountListNodeAgentSkus_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6079,7 +6573,7 @@ public void Example_Batch_GetSupportedImages_AccountListNodeAgentSkus_Convenienc [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetSupportedImages_AccountListNodeAgentSkus_Convenience_Async() + public async Task Example_BatchClient_GetSupportedImages_AccountListNodeAgentSkus_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6092,7 +6586,7 @@ public async Task Example_Batch_GetSupportedImages_AccountListNodeAgentSkus_Conv [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetPoolNodeCounts_NodeCountsPayload() + public void Example_BatchClient_GetPoolNodeCounts_NodeCountsPayload() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6107,7 +6601,7 @@ public void Example_Batch_GetPoolNodeCounts_NodeCountsPayload() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetPoolNodeCounts_NodeCountsPayload_Async() + public async Task Example_BatchClient_GetPoolNodeCounts_NodeCountsPayload_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6122,7 +6616,7 @@ public async Task Example_Batch_GetPoolNodeCounts_NodeCountsPayload_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetPoolNodeCounts_NodeCountsPayload_Convenience() + public void Example_BatchClient_GetPoolNodeCounts_NodeCountsPayload_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6135,7 +6629,7 @@ public void Example_Batch_GetPoolNodeCounts_NodeCountsPayload_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetPoolNodeCounts_NodeCountsPayload_Convenience_Async() + public async Task Example_BatchClient_GetPoolNodeCounts_NodeCountsPayload_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6148,7 +6642,7 @@ public async Task Example_Batch_GetPoolNodeCounts_NodeCountsPayload_Convenience_ [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetJobs_JobList() + public void Example_BatchClient_GetJobs_JobList() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6163,7 +6657,7 @@ public void Example_Batch_GetJobs_JobList() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetJobs_JobList_Async() + public async Task Example_BatchClient_GetJobs_JobList_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6178,7 +6672,7 @@ public async Task Example_Batch_GetJobs_JobList_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetJobs_JobList_Convenience() + public void Example_BatchClient_GetJobs_JobList_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6191,7 +6685,7 @@ public void Example_Batch_GetJobs_JobList_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetJobs_JobList_Convenience_Async() + public async Task Example_BatchClient_GetJobs_JobList_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6204,7 +6698,7 @@ public async Task Example_Batch_GetJobs_JobList_Convenience_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetJobsFromSchedules_ListJobUnderJobSchedule() + public void Example_BatchClient_GetJobsFromSchedules_ListJobUnderJobSchedule() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6219,7 +6713,7 @@ public void Example_Batch_GetJobsFromSchedules_ListJobUnderJobSchedule() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetJobsFromSchedules_ListJobUnderJobSchedule_Async() + public async Task Example_BatchClient_GetJobsFromSchedules_ListJobUnderJobSchedule_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6234,7 +6728,7 @@ public async Task Example_Batch_GetJobsFromSchedules_ListJobUnderJobSchedule_Asy [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetJobsFromSchedules_ListJobUnderJobSchedule_Convenience() + public void Example_BatchClient_GetJobsFromSchedules_ListJobUnderJobSchedule_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6247,7 +6741,7 @@ public void Example_Batch_GetJobsFromSchedules_ListJobUnderJobSchedule_Convenien [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetJobsFromSchedules_ListJobUnderJobSchedule_Convenience_Async() + public async Task Example_BatchClient_GetJobsFromSchedules_ListJobUnderJobSchedule_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6260,7 +6754,7 @@ public async Task Example_Batch_GetJobsFromSchedules_ListJobUnderJobSchedule_Con [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetJobPreparationAndReleaseTaskStatuses_JobListPreparationAndReleaseTaskStatus() + public void Example_BatchClient_GetJobPreparationAndReleaseTaskStatuses_JobListPreparationAndReleaseTaskStatus() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6275,7 +6769,7 @@ public void Example_Batch_GetJobPreparationAndReleaseTaskStatuses_JobListPrepara [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetJobPreparationAndReleaseTaskStatuses_JobListPreparationAndReleaseTaskStatus_Async() + public async Task Example_BatchClient_GetJobPreparationAndReleaseTaskStatuses_JobListPreparationAndReleaseTaskStatus_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6290,7 +6784,7 @@ public async Task Example_Batch_GetJobPreparationAndReleaseTaskStatuses_JobListP [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetJobPreparationAndReleaseTaskStatuses_JobListPreparationAndReleaseTaskStatus_Convenience() + public void Example_BatchClient_GetJobPreparationAndReleaseTaskStatuses_JobListPreparationAndReleaseTaskStatus_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6303,7 +6797,7 @@ public void Example_Batch_GetJobPreparationAndReleaseTaskStatuses_JobListPrepara [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetJobPreparationAndReleaseTaskStatuses_JobListPreparationAndReleaseTaskStatus_Convenience_Async() + public async Task Example_BatchClient_GetJobPreparationAndReleaseTaskStatuses_JobListPreparationAndReleaseTaskStatus_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6316,7 +6810,7 @@ public async Task Example_Batch_GetJobPreparationAndReleaseTaskStatuses_JobListP [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetJobSchedules_JobScheduleList() + public void Example_BatchClient_GetJobSchedules_JobScheduleList() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6331,7 +6825,7 @@ public void Example_Batch_GetJobSchedules_JobScheduleList() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetJobSchedules_JobScheduleList_Async() + public async Task Example_BatchClient_GetJobSchedules_JobScheduleList_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6346,7 +6840,7 @@ public async Task Example_Batch_GetJobSchedules_JobScheduleList_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetJobSchedules_JobScheduleList_Convenience() + public void Example_BatchClient_GetJobSchedules_JobScheduleList_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6359,7 +6853,7 @@ public void Example_Batch_GetJobSchedules_JobScheduleList_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetJobSchedules_JobScheduleList_Convenience_Async() + public async Task Example_BatchClient_GetJobSchedules_JobScheduleList_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6372,7 +6866,7 @@ public async Task Example_Batch_GetJobSchedules_JobScheduleList_Convenience_Asyn [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetTasks_TaskList() + public void Example_BatchClient_GetTasks_TaskList() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6387,7 +6881,7 @@ public void Example_Batch_GetTasks_TaskList() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetTasks_TaskList_Async() + public async Task Example_BatchClient_GetTasks_TaskList_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6402,7 +6896,7 @@ public async Task Example_Batch_GetTasks_TaskList_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetTasks_TaskList_Convenience() + public void Example_BatchClient_GetTasks_TaskList_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6415,7 +6909,7 @@ public void Example_Batch_GetTasks_TaskList_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetTasks_TaskList_Convenience_Async() + public async Task Example_BatchClient_GetTasks_TaskList_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6428,7 +6922,7 @@ public async Task Example_Batch_GetTasks_TaskList_Convenience_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetSubTasks_TaskListSubtasks() + public void Example_BatchClient_GetSubTasks_TaskListSubtasks() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6443,7 +6937,7 @@ public void Example_Batch_GetSubTasks_TaskListSubtasks() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetSubTasks_TaskListSubtasks_Async() + public async Task Example_BatchClient_GetSubTasks_TaskListSubtasks_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6458,7 +6952,7 @@ public async Task Example_Batch_GetSubTasks_TaskListSubtasks_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetSubTasks_TaskListSubtasks_Convenience() + public void Example_BatchClient_GetSubTasks_TaskListSubtasks_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6471,7 +6965,7 @@ public void Example_Batch_GetSubTasks_TaskListSubtasks_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetSubTasks_TaskListSubtasks_Convenience_Async() + public async Task Example_BatchClient_GetSubTasks_TaskListSubtasks_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6484,7 +6978,7 @@ public async Task Example_Batch_GetSubTasks_TaskListSubtasks_Convenience_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetTaskFiles_FileListFromTask() + public void Example_BatchClient_GetTaskFiles_FileListFromTask() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6499,7 +6993,7 @@ public void Example_Batch_GetTaskFiles_FileListFromTask() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetTaskFiles_FileListFromTask_Async() + public async Task Example_BatchClient_GetTaskFiles_FileListFromTask_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6514,7 +7008,7 @@ public async Task Example_Batch_GetTaskFiles_FileListFromTask_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetTaskFiles_FileListFromTask_Convenience() + public void Example_BatchClient_GetTaskFiles_FileListFromTask_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6527,7 +7021,7 @@ public void Example_Batch_GetTaskFiles_FileListFromTask_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetTaskFiles_FileListFromTask_Convenience_Async() + public async Task Example_BatchClient_GetTaskFiles_FileListFromTask_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6540,7 +7034,7 @@ public async Task Example_Batch_GetTaskFiles_FileListFromTask_Convenience_Async( [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetNodes_NodeList() + public void Example_BatchClient_GetNodes_NodeList() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6555,7 +7049,7 @@ public void Example_Batch_GetNodes_NodeList() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetNodes_NodeList_Async() + public async Task Example_BatchClient_GetNodes_NodeList_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6570,7 +7064,7 @@ public async Task Example_Batch_GetNodes_NodeList_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetNodes_NodeList_Convenience() + public void Example_BatchClient_GetNodes_NodeList_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6583,7 +7077,7 @@ public void Example_Batch_GetNodes_NodeList_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetNodes_NodeList_Convenience_Async() + public async Task Example_BatchClient_GetNodes_NodeList_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6596,7 +7090,7 @@ public async Task Example_Batch_GetNodes_NodeList_Convenience_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetNodeExtensions_ListComputeNodeExtensions() + public void Example_BatchClient_GetNodeExtensions_ListComputeNodeExtensions() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6611,7 +7105,7 @@ public void Example_Batch_GetNodeExtensions_ListComputeNodeExtensions() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetNodeExtensions_ListComputeNodeExtensions_Async() + public async Task Example_BatchClient_GetNodeExtensions_ListComputeNodeExtensions_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6626,7 +7120,7 @@ public async Task Example_Batch_GetNodeExtensions_ListComputeNodeExtensions_Asyn [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetNodeExtensions_ListComputeNodeExtensions_Convenience() + public void Example_BatchClient_GetNodeExtensions_ListComputeNodeExtensions_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6639,7 +7133,7 @@ public void Example_Batch_GetNodeExtensions_ListComputeNodeExtensions_Convenienc [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetNodeExtensions_ListComputeNodeExtensions_Convenience_Async() + public async Task Example_BatchClient_GetNodeExtensions_ListComputeNodeExtensions_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6652,7 +7146,7 @@ public async Task Example_Batch_GetNodeExtensions_ListComputeNodeExtensions_Conv [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetNodeFiles_FileListFromNode() + public void Example_BatchClient_GetNodeFiles_FileListFromNode() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6667,7 +7161,7 @@ public void Example_Batch_GetNodeFiles_FileListFromNode() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetNodeFiles_FileListFromNode_Async() + public async Task Example_BatchClient_GetNodeFiles_FileListFromNode_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6682,7 +7176,7 @@ public async Task Example_Batch_GetNodeFiles_FileListFromNode_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Batch_GetNodeFiles_FileListFromNode_Convenience() + public void Example_BatchClient_GetNodeFiles_FileListFromNode_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -6695,7 +7189,7 @@ public void Example_Batch_GetNodeFiles_FileListFromNode_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Batch_GetNodeFiles_FileListFromNode_Convenience_Async() + public async Task Example_BatchClient_GetNodeFiles_FileListFromNode_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); diff --git a/sdk/batch/Azure.Compute.Batch/tsp-location.yaml b/sdk/batch/Azure.Compute.Batch/tsp-location.yaml index 399863ae4a83..1694a9605ddd 100644 --- a/sdk/batch/Azure.Compute.Batch/tsp-location.yaml +++ b/sdk/batch/Azure.Compute.Batch/tsp-location.yaml @@ -1,3 +1,4 @@ directory: specification/batch/Azure.Batch -commit: 9df71d5a717e4ed5e6728e7e6ba2fead60f62243 +commit: 7c52cf4d9a41dd06846b099946e8b85a9504cf1e repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/ArmBatchModelFactory.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/ArmBatchModelFactory.cs index 323aebfd1b45..82fa75346623 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/ArmBatchModelFactory.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/ArmBatchModelFactory.cs @@ -426,7 +426,7 @@ public static BatchPrivateLinkResourceData BatchPrivateLinkResourceData(Resource /// The time at which the pool entered its current state. /// Whether the pool is resizing. /// The time at which the pool entered its current allocation state. - /// For information about available VM sizes, see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). + /// For information about available VM sizes, see Sizes for Virtual Machines in Azure (https://learn.microsoft.com/azure/virtual-machines/sizes/overview). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). /// Deployment configuration properties. /// The number of dedicated compute nodes currently in the pool. /// The number of Spot/low-priority compute nodes currently in the pool. diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountPoolData.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountPoolData.cs index bf9d11430eb6..08769d5f2a48 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountPoolData.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountPoolData.cs @@ -77,7 +77,7 @@ public BatchAccountPoolData() /// The time at which the pool entered its current state. /// Whether the pool is resizing. /// The time at which the pool entered its current allocation state. - /// For information about available VM sizes, see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). + /// For information about available VM sizes, see Sizes for Virtual Machines in Azure (https://learn.microsoft.com/azure/virtual-machines/sizes/overview). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). /// Deployment configuration properties. /// The number of dedicated compute nodes currently in the pool. /// The number of Spot/low-priority compute nodes currently in the pool. @@ -159,7 +159,7 @@ internal BatchAccountPoolData(ResourceIdentifier id, string name, ResourceType r public BatchAccountPoolAllocationState? AllocationState { get; } /// The time at which the pool entered its current allocation state. public DateTimeOffset? AllocationStateTransitionOn { get; } - /// For information about available VM sizes, see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). + /// For information about available VM sizes, see Sizes for Virtual Machines in Azure (https://learn.microsoft.com/azure/virtual-machines/sizes/overview). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). public string VmSize { get; set; } /// The configuration for compute nodes in a pool based on the Azure Virtual Machines infrastructure. public BatchVmConfiguration DeploymentVmConfiguration diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountResource.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountResource.cs index 2c45397ad1ad..5060f9c67489 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountResource.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountResource.cs @@ -1058,7 +1058,7 @@ public virtual Response GetKeys(CancellationToken cancellation } /// - /// Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. + /// Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://learn.microsoft.com/azure/batch/batch-virtual-network. /// /// /// Request Path @@ -1088,7 +1088,7 @@ public virtual AsyncPageable GetOutboun } /// - /// Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. + /// Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://learn.microsoft.com/azure/batch/batch-virtual-network. /// /// /// Request Path diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/AutomaticOSUpgradePolicy.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/AutomaticOSUpgradePolicy.cs index 2a35975bc69c..c7eb18aff82f 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/AutomaticOSUpgradePolicy.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/AutomaticOSUpgradePolicy.cs @@ -52,7 +52,7 @@ public AutomaticOSUpgradePolicy() /// Initializes a new instance of . /// Whether OS image rollback feature should be disabled. - /// Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. <br /><br /> If this is set to true for Windows based pools, [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/en-us/rest/api/batchmanagement/pool/create?tabs=HTTP#windowsconfiguration) cannot be set to true. + /// Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. <br /><br /> If this is set to true for Windows based pools, [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/rest/api/batchmanagement/pool/create?tabs=HTTP#windowsconfiguration) cannot be set to true. /// Indicates whether rolling upgrade policy should be used during Auto OS Upgrade. Auto OS Upgrade will fallback to the default policy if no policy is defined on the VMSS. /// Defer OS upgrades on the TVMs if they are running tasks. /// Keeps track of any properties unknown to the library. @@ -67,7 +67,7 @@ internal AutomaticOSUpgradePolicy(bool? disableAutomaticRollback, bool? enableAu /// Whether OS image rollback feature should be disabled. public bool? DisableAutomaticRollback { get; set; } - /// Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. <br /><br /> If this is set to true for Windows based pools, [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/en-us/rest/api/batchmanagement/pool/create?tabs=HTTP#windowsconfiguration) cannot be set to true. + /// Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. <br /><br /> If this is set to true for Windows based pools, [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/rest/api/batchmanagement/pool/create?tabs=HTTP#windowsconfiguration) cannot be set to true. public bool? EnableAutomaticOSUpgrade { get; set; } /// Indicates whether rolling upgrade policy should be used during Auto OS Upgrade. Auto OS Upgrade will fallback to the default policy if no policy is defined on the VMSS. public bool? UseRollingUpgradePolicy { get; set; } diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchDiffDiskPlacement.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchDiffDiskPlacement.cs index 326191d9b4af..2e50c6f8f081 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchDiffDiskPlacement.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchDiffDiskPlacement.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Batch.Models { - /// This property can be used by user in the request to choose which location the operating system should be in. e.g., cache disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk size requirements for Windows VMs at https://docs.microsoft.com/en-us/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. + /// This property can be used by user in the request to choose which location the operating system should be in. e.g., cache disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk size requirements for Windows VMs at https://learn.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at https://learn.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. public readonly partial struct BatchDiffDiskPlacement : IEquatable { private readonly string _value; diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchImageReference.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchImageReference.cs index d4284074a1ed..8b4938d41bd0 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchImageReference.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchImageReference.cs @@ -56,7 +56,7 @@ public BatchImageReference() /// For example, UbuntuServer or WindowsServer. /// For example, 18.04-LTS or 2022-datacenter. /// A value of 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'. - /// This property is mutually exclusive with other properties. The Azure Compute Gallery Image must have replicas in the same region as the Azure Batch account. For information about the firewall settings for the Batch node agent to communicate with the Batch service see https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. + /// This property is mutually exclusive with other properties. The Azure Compute Gallery Image must have replicas in the same region as the Azure Batch account. For information about the firewall settings for the Batch node agent to communicate with the Batch service see https://learn.microsoft.com/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. /// This property is mutually exclusive with other properties and can be fetched from shared gallery image GET call. /// This property is mutually exclusive with other properties and can be fetched from community gallery image GET call. /// Keeps track of any properties unknown to the library. @@ -80,7 +80,7 @@ internal BatchImageReference(string publisher, string offer, string sku, string public string Sku { get; set; } /// A value of 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'. public string Version { get; set; } - /// This property is mutually exclusive with other properties. The Azure Compute Gallery Image must have replicas in the same region as the Azure Batch account. For information about the firewall settings for the Batch node agent to communicate with the Batch service see https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. + /// This property is mutually exclusive with other properties. The Azure Compute Gallery Image must have replicas in the same region as the Azure Batch account. For information about the firewall settings for the Batch node agent to communicate with the Batch service see https://learn.microsoft.com/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. public ResourceIdentifier Id { get; set; } /// This property is mutually exclusive with other properties and can be fetched from shared gallery image GET call. public string SharedGalleryImageId { get; set; } diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchInboundNatPool.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchInboundNatPool.cs index 19462ffa53ab..95bc37265923 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchInboundNatPool.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchInboundNatPool.cs @@ -48,7 +48,7 @@ public partial class BatchInboundNatPool /// Initializes a new instance of . /// The name must be unique within a Batch pool, can contain letters, numbers, underscores, periods, and hyphens. Names must start with a letter or number, must end with a letter, number, or underscore, and cannot exceed 77 characters. If any invalid values are provided the request fails with HTTP status code 400. /// The protocol of the endpoint. - /// This must be unique within a Batch pool. Acceptable values are between 1 and 65535 except for 22, 3389, 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. + /// This must be unique within a Batch pool. Acceptable values are between 1 and 65535 except for 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. /// Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved. All ranges within a pool must be distinct and cannot overlap. If any reserved or overlapping values are provided the request fails with HTTP status code 400. /// Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved by the Batch service. All ranges within a pool must be distinct and cannot overlap. If any reserved or overlapping values are provided the request fails with HTTP status code 400. /// is null. @@ -67,7 +67,7 @@ public BatchInboundNatPool(string name, BatchInboundEndpointProtocol protocol, i /// Initializes a new instance of . /// The name must be unique within a Batch pool, can contain letters, numbers, underscores, periods, and hyphens. Names must start with a letter or number, must end with a letter, number, or underscore, and cannot exceed 77 characters. If any invalid values are provided the request fails with HTTP status code 400. /// The protocol of the endpoint. - /// This must be unique within a Batch pool. Acceptable values are between 1 and 65535 except for 22, 3389, 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. + /// This must be unique within a Batch pool. Acceptable values are between 1 and 65535 except for 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. /// Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved. All ranges within a pool must be distinct and cannot overlap. If any reserved or overlapping values are provided the request fails with HTTP status code 400. /// Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved by the Batch service. All ranges within a pool must be distinct and cannot overlap. If any reserved or overlapping values are provided the request fails with HTTP status code 400. /// The maximum number of rules that can be specified across all the endpoints on a Batch pool is 25. If no network security group rules are specified, a default rule will be created to allow inbound access to the specified backendPort. If the maximum number of network security group rules is exceeded the request fails with HTTP status code 400. @@ -92,7 +92,7 @@ internal BatchInboundNatPool() public string Name { get; set; } /// The protocol of the endpoint. public BatchInboundEndpointProtocol Protocol { get; set; } - /// This must be unique within a Batch pool. Acceptable values are between 1 and 65535 except for 22, 3389, 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. + /// This must be unique within a Batch pool. Acceptable values are between 1 and 65535 except for 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. public int BackendPort { get; set; } /// Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved. All ranges within a pool must be distinct and cannot overlap. If any reserved or overlapping values are provided the request fails with HTTP status code 400. public int FrontendPortRangeStart { get; set; } diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchNetworkConfiguration.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchNetworkConfiguration.cs index 9dbdff49437c..b08aebe2347f 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchNetworkConfiguration.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchNetworkConfiguration.cs @@ -52,7 +52,7 @@ public BatchNetworkConfiguration() } /// Initializes a new instance of . - /// The virtual network must be in the same region and subscription as the Azure Batch account. The specified subnet should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't have enough free IP addresses, the pool will partially allocate compute nodes and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule tasks on the compute nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the compute nodes to unusable. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication. Enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. Also enable outbound connections to Azure Storage on port 443. For more details see: https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. + /// The virtual network must be in the same region and subscription as the Azure Batch account. The specified subnet should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't have enough free IP addresses, the pool will partially allocate compute nodes and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule tasks on the compute nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the compute nodes to unusable. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication,including ports 29876 and 29877. Also enable outbound connections to Azure Storage on port 443. For more details see: https://learn.microsoft.com/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. /// The scope of dynamic vnet assignment. /// The endpoint configuration for a pool. /// The public IP Address configuration of the networking configuration of a Pool. @@ -68,7 +68,7 @@ internal BatchNetworkConfiguration(ResourceIdentifier subnetId, DynamicVNetAssig _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The virtual network must be in the same region and subscription as the Azure Batch account. The specified subnet should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't have enough free IP addresses, the pool will partially allocate compute nodes and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule tasks on the compute nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the compute nodes to unusable. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication. Enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. Also enable outbound connections to Azure Storage on port 443. For more details see: https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. + /// The virtual network must be in the same region and subscription as the Azure Batch account. The specified subnet should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't have enough free IP addresses, the pool will partially allocate compute nodes and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule tasks on the compute nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the compute nodes to unusable. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication,including ports 29876 and 29877. Also enable outbound connections to Azure Storage on port 443. For more details see: https://learn.microsoft.com/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. public ResourceIdentifier SubnetId { get; set; } /// The scope of dynamic vnet assignment. public DynamicVNetAssignmentScope? DynamicVNetAssignmentScope { get; set; } diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchOSDisk.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchOSDisk.cs index 69c86e39dbb4..225d214b07b8 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchOSDisk.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchOSDisk.cs @@ -69,7 +69,7 @@ internal BatchOSDisk(DiffDiskSettings ephemeralOSDiskSettings, BatchDiskCachingT /// Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. internal DiffDiskSettings EphemeralOSDiskSettings { get; set; } - /// This property can be used by user in the request to choose which location the operating system should be in. e.g., cache disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk size requirements for Windows VMs at https://docs.microsoft.com/en-us/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. + /// This property can be used by user in the request to choose which location the operating system should be in. e.g., cache disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk size requirements for Windows VMs at https://learn.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at https://learn.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. public BatchDiffDiskPlacement? EphemeralOSDiskPlacement { get => EphemeralOSDiskSettings is null ? default : EphemeralOSDiskSettings.Placement; diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/DiffDiskSettings.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/DiffDiskSettings.cs index f03202a6036f..f749e9c67a65 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/DiffDiskSettings.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/DiffDiskSettings.cs @@ -51,7 +51,7 @@ public DiffDiskSettings() } /// Initializes a new instance of . - /// This property can be used by user in the request to choose which location the operating system should be in. e.g., cache disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk size requirements for Windows VMs at https://docs.microsoft.com/en-us/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. + /// This property can be used by user in the request to choose which location the operating system should be in. e.g., cache disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk size requirements for Windows VMs at https://learn.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at https://learn.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. /// Keeps track of any properties unknown to the library. internal DiffDiskSettings(BatchDiffDiskPlacement? placement, IDictionary serializedAdditionalRawData) { @@ -59,7 +59,7 @@ internal DiffDiskSettings(BatchDiffDiskPlacement? placement, IDictionary This property can be used by user in the request to choose which location the operating system should be in. e.g., cache disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk size requirements for Windows VMs at https://docs.microsoft.com/en-us/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. + /// This property can be used by user in the request to choose which location the operating system should be in. e.g., cache disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk size requirements for Windows VMs at https://learn.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at https://learn.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. public BatchDiffDiskPlacement? Placement { get; set; } } } diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/RestOperations/BatchAccountRestOperations.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/RestOperations/BatchAccountRestOperations.cs index 725fec7b026a..cc89549b6573 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/RestOperations/BatchAccountRestOperations.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/RestOperations/BatchAccountRestOperations.cs @@ -1088,7 +1088,7 @@ internal HttpMessage CreateListOutboundNetworkDependenciesEndpointsRequest(strin return message; } - /// Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. + /// Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://learn.microsoft.com/azure/batch/batch-virtual-network. /// The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). /// The name of the resource group that contains the Batch account. /// The name of the Batch account. @@ -1117,7 +1117,7 @@ public async Task> ListOutboundN } } - /// Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. + /// Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://learn.microsoft.com/azure/batch/batch-virtual-network. /// The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). /// The name of the resource group that contains the Batch account. /// The name of the Batch account. @@ -1408,7 +1408,7 @@ internal HttpMessage CreateListOutboundNetworkDependenciesEndpointsNextPageReque return message; } - /// Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. + /// Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://learn.microsoft.com/azure/batch/batch-virtual-network. /// The URL to the next page of results. /// The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). /// The name of the resource group that contains the Batch account. @@ -1439,7 +1439,7 @@ public async Task> ListOutboundN } } - /// Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. + /// Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://learn.microsoft.com/azure/batch/batch-virtual-network. /// The URL to the next page of results. /// The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). /// The name of the resource group that contains the Batch account. diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/autorest.md b/sdk/batch/Azure.ResourceManager.Batch/src/autorest.md index d4eb24a31dc2..4a277015bde7 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/autorest.md +++ b/sdk/batch/Azure.ResourceManager.Batch/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: Batch namespace: Azure.ResourceManager.Batch -require: https://github.com/Azure/azure-rest-api-specs/blob/d85634405ec3b905f1b0bfc350e47cb704aedb61/specification/batch/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/batch/resource-manager/readme.md #tag: package-2024-07 output-folder: $(this-folder)/Generated clear-output-folder: true diff --git a/sdk/batch/ci.mgmt.yml b/sdk/batch/ci.mgmt.yml index fdb37873525c..304b3e731c1c 100644 --- a/sdk/batch/ci.mgmt.yml +++ b/sdk/batch/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/batch/ci.mgmt.yml - sdk/batch/Azure.ResourceManager.Batch/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/batch/ci.mgmt.yml + - sdk/batch/Azure.ResourceManager.Batch/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/batch/ci.mgmt.yml + - sdk/batch/Azure.ResourceManager.Batch/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/batch/ci.mgmt.yml + - sdk/batch/Azure.ResourceManager.Batch/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/batch/ci.mgmt.yml + - sdk/batch/Azure.ResourceManager.Batch/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/batch/ci.mgmt.yml + - sdk/batch/Azure.ResourceManager.Batch/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/batch/ci.mgmt.yml + - sdk/batch/Azure.ResourceManager.Batch/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/batch/ci.mgmt.yml + - sdk/batch/Azure.ResourceManager.Batch/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/batch/ci.mgmt.yml + - sdk/batch/Azure.ResourceManager.Batch/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/batch/ci.mgmt.yml + - sdk/batch/Azure.ResourceManager.Batch/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/billing/ci.mgmt.yml b/sdk/billing/ci.mgmt.yml index 67cf904850c6..c79030cd71b3 100644 --- a/sdk/billing/ci.mgmt.yml +++ b/sdk/billing/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/billing/ci.mgmt.yml - sdk/billing/Azure.ResourceManager.Billing/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/billing/ci.mgmt.yml + - sdk/billing/Azure.ResourceManager.Billing/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/billing/ci.mgmt.yml + - sdk/billing/Azure.ResourceManager.Billing/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/billing/ci.mgmt.yml + - sdk/billing/Azure.ResourceManager.Billing/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/billing/ci.mgmt.yml + - sdk/billing/Azure.ResourceManager.Billing/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/billing/ci.mgmt.yml + - sdk/billing/Azure.ResourceManager.Billing/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/billing/ci.mgmt.yml + - sdk/billing/Azure.ResourceManager.Billing/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/billing/ci.mgmt.yml + - sdk/billing/Azure.ResourceManager.Billing/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/billing/ci.mgmt.yml + - sdk/billing/Azure.ResourceManager.Billing/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/billing/ci.mgmt.yml + - sdk/billing/Azure.ResourceManager.Billing/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/billingbenefits/ci.mgmt.yml b/sdk/billingbenefits/ci.mgmt.yml index 9900a842be4f..483e832cfa89 100644 --- a/sdk/billingbenefits/ci.mgmt.yml +++ b/sdk/billingbenefits/ci.mgmt.yml @@ -2,6 +2,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -14,6 +15,114 @@ pr: - sdk/billingbenefits/ci.mgmt.yml - sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/billingbenefits/ci.mgmt.yml + - sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/billingbenefits/ci.mgmt.yml + - sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/billingbenefits/ci.mgmt.yml + - sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/billingbenefits/ci.mgmt.yml + - sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/billingbenefits/ci.mgmt.yml + - sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/billingbenefits/ci.mgmt.yml + - sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/billingbenefits/ci.mgmt.yml + - sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/billingbenefits/ci.mgmt.yml + - sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/billingbenefits/ci.mgmt.yml + - sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/blueprint/ci.mgmt.yml b/sdk/blueprint/ci.mgmt.yml index 65bd23b77f51..72803d5baf04 100644 --- a/sdk/blueprint/ci.mgmt.yml +++ b/sdk/blueprint/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/blueprint/ci.mgmt.yml - sdk/blueprint/Azure.ResourceManager.Blueprint/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/blueprint/ci.mgmt.yml + - sdk/blueprint/Azure.ResourceManager.Blueprint/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/blueprint/ci.mgmt.yml + - sdk/blueprint/Azure.ResourceManager.Blueprint/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/blueprint/ci.mgmt.yml + - sdk/blueprint/Azure.ResourceManager.Blueprint/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/blueprint/ci.mgmt.yml + - sdk/blueprint/Azure.ResourceManager.Blueprint/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/blueprint/ci.mgmt.yml + - sdk/blueprint/Azure.ResourceManager.Blueprint/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/blueprint/ci.mgmt.yml + - sdk/blueprint/Azure.ResourceManager.Blueprint/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/blueprint/ci.mgmt.yml + - sdk/blueprint/Azure.ResourceManager.Blueprint/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/blueprint/ci.mgmt.yml + - sdk/blueprint/Azure.ResourceManager.Blueprint/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/blueprint/ci.mgmt.yml + - sdk/blueprint/Azure.ResourceManager.Blueprint/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/botservice/ci.mgmt.yml b/sdk/botservice/ci.mgmt.yml index 8e5444ff3f9a..86ef8aa70293 100644 --- a/sdk/botservice/ci.mgmt.yml +++ b/sdk/botservice/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/botservice/ci.mgmt.yml - sdk/botservice/Azure.ResourceManager.BotService/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/botservice/ci.mgmt.yml + - sdk/botservice/Azure.ResourceManager.BotService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/botservice/ci.mgmt.yml + - sdk/botservice/Azure.ResourceManager.BotService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/botservice/ci.mgmt.yml + - sdk/botservice/Azure.ResourceManager.BotService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/botservice/ci.mgmt.yml + - sdk/botservice/Azure.ResourceManager.BotService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/botservice/ci.mgmt.yml + - sdk/botservice/Azure.ResourceManager.BotService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/botservice/ci.mgmt.yml + - sdk/botservice/Azure.ResourceManager.BotService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/botservice/ci.mgmt.yml + - sdk/botservice/Azure.ResourceManager.BotService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/botservice/ci.mgmt.yml + - sdk/botservice/Azure.ResourceManager.BotService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/botservice/ci.mgmt.yml + - sdk/botservice/Azure.ResourceManager.BotService/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/cdn/ci.mgmt.yml b/sdk/cdn/ci.mgmt.yml index ac2ea82249d1..1394eb5f17a8 100644 --- a/sdk/cdn/ci.mgmt.yml +++ b/sdk/cdn/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/cdn/ci.mgmt.yml - sdk/cdn/Azure.ResourceManager.Cdn/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cdn/ci.mgmt.yml + - sdk/cdn/Azure.ResourceManager.Cdn/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cdn/ci.mgmt.yml + - sdk/cdn/Azure.ResourceManager.Cdn/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cdn/ci.mgmt.yml + - sdk/cdn/Azure.ResourceManager.Cdn/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cdn/ci.mgmt.yml + - sdk/cdn/Azure.ResourceManager.Cdn/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cdn/ci.mgmt.yml + - sdk/cdn/Azure.ResourceManager.Cdn/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cdn/ci.mgmt.yml + - sdk/cdn/Azure.ResourceManager.Cdn/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cdn/ci.mgmt.yml + - sdk/cdn/Azure.ResourceManager.Cdn/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cdn/ci.mgmt.yml + - sdk/cdn/Azure.ResourceManager.Cdn/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cdn/ci.mgmt.yml + - sdk/cdn/Azure.ResourceManager.Cdn/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/changeanalysis/ci.mgmt.yml b/sdk/changeanalysis/ci.mgmt.yml index 65c6e90d195a..e3995421fb6b 100644 --- a/sdk/changeanalysis/ci.mgmt.yml +++ b/sdk/changeanalysis/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/changeanalysis/ci.mgmt.yml - sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/changeanalysis/ci.mgmt.yml + - sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/changeanalysis/ci.mgmt.yml + - sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/changeanalysis/ci.mgmt.yml + - sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/changeanalysis/ci.mgmt.yml + - sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/changeanalysis/ci.mgmt.yml + - sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/changeanalysis/ci.mgmt.yml + - sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/changeanalysis/ci.mgmt.yml + - sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/changeanalysis/ci.mgmt.yml + - sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/changeanalysis/ci.mgmt.yml + - sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/Configuration.json b/sdk/chaos/Azure.ResourceManager.Chaos/Configuration.json new file mode 100644 index 000000000000..3e2c4c512cd3 --- /dev/null +++ b/sdk/chaos/Azure.ResourceManager.Chaos/Configuration.json @@ -0,0 +1,13 @@ +{ + "output-folder": ".", + "namespace": "Azure.ResourceManager.Chaos", + "library-name": "Azure.ResourceManager.Chaos", + "model-namespace": false, + "flavor": "azure", + "use-model-reader-writer": true, + "shared-source-folders": [ + "../../TempTypeSpecFiles/node_modules/@autorest/csharp/Generator.Shared", + "../../TempTypeSpecFiles/node_modules/@autorest/csharp/Azure.Core.Shared" + ], + "azure-arm": true +} diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/autorest.md b/sdk/chaos/Azure.ResourceManager.Chaos/src/autorest.md deleted file mode 100644 index 433ca7df8c96..000000000000 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/autorest.md +++ /dev/null @@ -1,81 +0,0 @@ -# Generated code configuration - -Run `dotnet build /t:GenerateCode` to generate code. - -```yaml -azure-arm: true -csharp: true -library-name: Chaos -namespace: Azure.ResourceManager.Chaos -#tag: package-2024-01 -require: https://github.com/Azure/azure-rest-api-specs/blob/f3cd6922dbe117d78b4f719bbf8b03db46b30808/specification/chaos/resource-manager/readme.md -output-folder: $(this-folder)/Generated -clear-output-folder: true -sample-gen: - output-folder: $(this-folder)/../samples/Generated - clear-output-folder: true -skip-csproj: true -modelerfour: - flatten-payloads: false -use-model-reader-writer: true - -#mgmt-debug: -# show-serialized-names: true - -rename-mapping: - ActionStatus: ChaosExperimentRunActionStatus - BranchStatus: ChaosExperimentRunBranchStatus - StepStatus: ChaosExperimentRunStepStatus - TargetReference.id: -|arm-id - CapabilityTypePropertiesRuntimeProperties: ChaosCapabilityTypeRuntimeProperties - ExperimentExecutionDetailsPropertiesRunInformation: ChaosExperimentRunInformation - -prepend-rp-prefix: - - Capability - - CapabilityType - - Experiment - - ExperimentExecution - - Target - - TargetType - - ProvisioningState - - ContinuousAction - - DelayAction - - DiscreteAction - - KeyValuePair - - TargetReference - - TargetReferenceType - -format-by-name-rules: - 'tenantId': 'uuid' - 'ETag': 'etag' - 'location': 'azure-location' - '*Uri': 'Uri' - '*Uris': 'Uri' - -acronym-mapping: - CPU: Cpu - CPUs: Cpus - Os: OS - Ip: IP - Ips: IPs|ips - ID: Id - IDs: Ids - VM: Vm - VMs: Vms - Vmos: VmOS - VMScaleSet: VmScaleSet - DNS: Dns - VPN: Vpn - NAT: Nat - WAN: Wan - Ipv4: IPv4|ipv4 - Ipv6: IPv6|ipv6 - Ipsec: IPsec|ipsec - SSO: Sso - URI: Uri - Etag: ETag|etag - -directive: - - remove-operation: 'OperationStatuses_Get' - -``` diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/tsp-location.yaml b/sdk/chaos/Azure.ResourceManager.Chaos/tsp-location.yaml new file mode 100644 index 000000000000..cf2033c48fdf --- /dev/null +++ b/sdk/chaos/Azure.ResourceManager.Chaos/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/chaos/Chaos.Management +commit: 7c52cf4d9a41dd06846b099946e8b85a9504cf1e +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/tspCodeModel.json b/sdk/chaos/Azure.ResourceManager.Chaos/tspCodeModel.json new file mode 100644 index 000000000000..d7433f3bf8da --- /dev/null +++ b/sdk/chaos/Azure.ResourceManager.Chaos/tspCodeModel.json @@ -0,0 +1,23735 @@ +{ + "$id": "1", + "Name": "Microsoft.Chaos", + "ApiVersions": [ + "2024-11-01-preview" + ], + "Enums": [ + { + "$id": "2", + "kind": "enum", + "name": "createdByType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.createdByType", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "User", + "value": "User", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "The entity was created by a user.", + "decorators": [] + }, + { + "$id": "6", + "kind": "enumvalue", + "name": "Application", + "value": "Application", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "The entity was created by an application.", + "decorators": [] + }, + { + "$id": "8", + "kind": "enumvalue", + "name": "ManagedIdentity", + "value": "ManagedIdentity", + "valueType": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "The entity was created by a managed identity.", + "decorators": [] + }, + { + "$id": "10", + "kind": "enumvalue", + "name": "Key", + "value": "Key", + "valueType": { + "$id": "11", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "The entity was created by a key.", + "decorators": [] + } + ], + "doc": "The kind of entity that created the resource.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "12", + "kind": "enum", + "name": "PrivateEndpointServiceConnectionStatus", + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateEndpointServiceConnectionStatus", + "valueType": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "14", + "kind": "enumvalue", + "name": "Pending", + "value": "Pending", + "valueType": { + "$id": "15", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "12" + }, + "doc": "Pending status.", + "decorators": [] + }, + { + "$id": "16", + "kind": "enumvalue", + "name": "Approved", + "value": "Approved", + "valueType": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "12" + }, + "doc": "Approved status.", + "decorators": [] + }, + { + "$id": "18", + "kind": "enumvalue", + "name": "Rejected", + "value": "Rejected", + "valueType": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "12" + }, + "doc": "Rejected status.", + "decorators": [] + } + ], + "doc": "The private endpoint connection status.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "20", + "kind": "enum", + "name": "ChaosProvisioningState", + "crossLanguageDefinitionId": "Microsoft.Chaos.ProvisioningState", + "valueType": { + "$id": "21", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "22", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$id": "23", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "20" + }, + "doc": "Resource has been created.", + "decorators": [] + }, + { + "$id": "24", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$id": "25", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "20" + }, + "doc": "Resource creation failed.", + "decorators": [] + }, + { + "$id": "26", + "kind": "enumvalue", + "name": "Canceled", + "value": "Canceled", + "valueType": { + "$id": "27", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "20" + }, + "doc": "Resource creation was canceled.", + "decorators": [] + }, + { + "$id": "28", + "kind": "enumvalue", + "name": "Creating", + "value": "Creating", + "valueType": { + "$id": "29", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "20" + }, + "doc": "Initial creation in progress.", + "decorators": [] + }, + { + "$id": "30", + "kind": "enumvalue", + "name": "Updating", + "value": "Updating", + "valueType": { + "$id": "31", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "20" + }, + "doc": "Update in progress.", + "decorators": [] + }, + { + "$id": "32", + "kind": "enumvalue", + "name": "Deleting", + "value": "Deleting", + "valueType": { + "$id": "33", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "20" + }, + "doc": "Deletion in progress.", + "decorators": [] + } + ], + "doc": "Current provisioning state for a given Azure Chaos resource.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "34", + "kind": "enum", + "name": "ResourceProvisioningState", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceProvisioningState", + "valueType": { + "$id": "35", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "36", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$id": "37", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "34" + }, + "doc": "Resource has been created.", + "decorators": [] + }, + { + "$id": "38", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$id": "39", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "34" + }, + "doc": "Resource creation failed.", + "decorators": [] + }, + { + "$id": "40", + "kind": "enumvalue", + "name": "Canceled", + "value": "Canceled", + "valueType": { + "$id": "41", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "34" + }, + "doc": "Resource creation was canceled.", + "decorators": [] + } + ], + "doc": "The provisioning state of a resource type.", + "isFixed": false, + "isFlags": false, + "usage": "LroPolling", + "decorators": [] + }, + { + "$id": "42", + "kind": "enum", + "name": "PublicNetworkAccessOption", + "crossLanguageDefinitionId": "Microsoft.Chaos.PublicNetworkAccessOption", + "valueType": { + "$id": "43", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "44", + "kind": "enumvalue", + "name": "Enabled", + "value": "Enabled", + "valueType": { + "$id": "45", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "42" + }, + "doc": "Enabled access.", + "decorators": [] + }, + { + "$id": "46", + "kind": "enumvalue", + "name": "Disabled", + "value": "Disabled", + "valueType": { + "$id": "47", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "42" + }, + "doc": "Disabled access.", + "decorators": [] + } + ], + "doc": "Public Network Access Control for PrivateAccess resource.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "48", + "kind": "enum", + "name": "ManagedServiceIdentityType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType", + "valueType": { + "$id": "49", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "50", + "kind": "enumvalue", + "name": "None", + "value": "None", + "valueType": { + "$id": "51", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "doc": "No managed identity.", + "decorators": [] + }, + { + "$id": "52", + "kind": "enumvalue", + "name": "SystemAssigned", + "value": "SystemAssigned", + "valueType": { + "$id": "53", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "doc": "System assigned managed identity.", + "decorators": [] + }, + { + "$id": "54", + "kind": "enumvalue", + "name": "UserAssigned", + "value": "UserAssigned", + "valueType": { + "$id": "55", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "doc": "User assigned managed identity.", + "decorators": [] + }, + { + "$id": "56", + "kind": "enumvalue", + "name": "SystemAssigned,UserAssigned", + "value": "SystemAssigned,UserAssigned", + "valueType": { + "$id": "57", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "doc": "System and user assigned managed identity.", + "decorators": [] + } + ], + "doc": "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "58", + "kind": "enum", + "name": "ExperimentActionType", + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentActionType", + "valueType": { + "$id": "59", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "60", + "kind": "enumvalue", + "name": "delay", + "value": "delay", + "valueType": { + "$id": "61", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "58" + }, + "decorators": [] + }, + { + "$id": "62", + "kind": "enumvalue", + "name": "discrete", + "value": "discrete", + "valueType": { + "$id": "63", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "58" + }, + "decorators": [] + }, + { + "$id": "64", + "kind": "enumvalue", + "name": "continuous", + "value": "continuous", + "valueType": { + "$id": "65", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "58" + }, + "decorators": [] + } + ], + "doc": "Enum union of Chaos experiment action types.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "66", + "kind": "enum", + "name": "SelectorType", + "crossLanguageDefinitionId": "Microsoft.Chaos.SelectorType", + "valueType": { + "$id": "67", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "68", + "kind": "enumvalue", + "name": "List", + "value": "List", + "valueType": { + "$id": "69", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "doc": "List selector type.", + "decorators": [] + }, + { + "$id": "70", + "kind": "enumvalue", + "name": "Query", + "value": "Query", + "valueType": { + "$id": "71", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "doc": "Query selector type.", + "decorators": [] + } + ], + "doc": "Enum of the selector type.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "72", + "kind": "enum", + "name": "FilterType", + "crossLanguageDefinitionId": "Microsoft.Chaos.FilterType", + "valueType": { + "$id": "73", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "74", + "kind": "enumvalue", + "name": "Simple", + "value": "Simple", + "valueType": { + "$id": "75", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "72" + }, + "doc": "Simple filter type.", + "decorators": [] + } + ], + "doc": "Enum that discriminates between filter types. Currently only `Simple` type is supported.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "76", + "kind": "enum", + "name": "ChaosTargetReferenceType", + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetReferenceType", + "valueType": { + "$id": "77", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "78", + "kind": "enumvalue", + "name": "ChaosTarget", + "value": "ChaosTarget", + "valueType": { + "$id": "79", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "76" + }, + "doc": "Chaos target reference type.", + "decorators": [] + } + ], + "doc": "Enum of the Target reference type.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "80", + "kind": "enum", + "name": "Origin", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Origin", + "valueType": { + "$id": "81", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "82", + "kind": "enumvalue", + "name": "user", + "value": "user", + "valueType": { + "$id": "83", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "80" + }, + "doc": "Indicates the operation is initiated by a user.", + "decorators": [] + }, + { + "$id": "84", + "kind": "enumvalue", + "name": "system", + "value": "system", + "valueType": { + "$id": "85", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "80" + }, + "doc": "Indicates the operation is initiated by a system.", + "decorators": [] + }, + { + "$id": "86", + "kind": "enumvalue", + "name": "user,system", + "value": "user,system", + "valueType": { + "$id": "87", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "80" + }, + "doc": "Indicates the operation is initiated by a user or system.", + "decorators": [] + } + ], + "doc": "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\"", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "88", + "kind": "enum", + "name": "ActionType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ActionType", + "valueType": { + "$id": "89", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "90", + "kind": "enumvalue", + "name": "Internal", + "value": "Internal", + "valueType": { + "$id": "91", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "88" + }, + "doc": "Actions are for internal-only APIs.", + "decorators": [] + } + ], + "doc": "Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "92", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Microsoft.Chaos.Versions", + "valueType": { + "$id": "93", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "94", + "kind": "enumvalue", + "name": "v2024_11_01_preview", + "value": "2024-11-01-preview", + "valueType": { + "$id": "95", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "92" + }, + "doc": "The 2024-11-01-preview API version.", + "decorators": [] + } + ], + "doc": "The available API versions.", + "isFixed": true, + "isFlags": false, + "usage": "ApiVersionEnum", + "decorators": [] + } + ], + "Models": [ + { + "$id": "96", + "kind": "model", + "name": "OperationStatusResult", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult", + "usage": "Output,Json", + "doc": "The current status of an async operation.", + "decorators": [], + "properties": [ + { + "$id": "97", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Fully qualified ID for the async operation.", + "type": { + "$id": "98", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "99", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.id" + }, + { + "$id": "100", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "Name of the async operation.", + "type": { + "$id": "101", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.name" + }, + { + "$id": "102", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "Operation status.", + "type": { + "$id": "103", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.status" + }, + { + "$id": "104", + "kind": "property", + "name": "percentComplete", + "serializedName": "percentComplete", + "doc": "Percent of the operation that is complete.", + "type": { + "$id": "105", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.percentComplete" + }, + { + "$id": "106", + "kind": "property", + "name": "startTime", + "serializedName": "startTime", + "doc": "The start time of the operation.", + "type": { + "$id": "107", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "108", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.startTime" + }, + { + "$id": "109", + "kind": "property", + "name": "endTime", + "serializedName": "endTime", + "doc": "The end time of the operation.", + "type": { + "$id": "110", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "111", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.endTime" + }, + { + "$id": "112", + "kind": "property", + "name": "operations", + "serializedName": "operations", + "doc": "The operations list.", + "type": { + "$id": "113", + "kind": "array", + "name": "ArrayOperationStatusResult", + "valueType": { + "$ref": "96" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.operations" + }, + { + "$id": "114", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "If present, details of the operation error.", + "type": { + "$id": "115", + "kind": "model", + "name": "ErrorDetail", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "usage": "Output,Json,Exception,LroPolling", + "doc": "The error detail.", + "decorators": [], + "properties": [ + { + "$id": "116", + "kind": "property", + "name": "code", + "serializedName": "code", + "doc": "The error code.", + "type": { + "$id": "117", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.code" + }, + { + "$id": "118", + "kind": "property", + "name": "message", + "serializedName": "message", + "doc": "The error message.", + "type": { + "$id": "119", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.message" + }, + { + "$id": "120", + "kind": "property", + "name": "target", + "serializedName": "target", + "doc": "The error target.", + "type": { + "$id": "121", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.target" + }, + { + "$id": "122", + "kind": "property", + "name": "details", + "serializedName": "details", + "doc": "The error details.", + "type": { + "$id": "123", + "kind": "array", + "name": "ArrayErrorDetail", + "valueType": { + "$ref": "115" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.details" + }, + { + "$id": "124", + "kind": "property", + "name": "additionalInfo", + "serializedName": "additionalInfo", + "doc": "The error additional info.", + "type": { + "$id": "125", + "kind": "array", + "name": "ArrayErrorAdditionalInfo", + "valueType": { + "$id": "126", + "kind": "model", + "name": "ErrorAdditionalInfo", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "usage": "Output,Json,Exception,LroPolling", + "doc": "The resource management error additional info.", + "decorators": [], + "properties": [ + { + "$id": "127", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The additional info type.", + "type": { + "$id": "128", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.type" + }, + { + "$id": "129", + "kind": "property", + "name": "info", + "serializedName": "info", + "doc": "The additional info.", + "type": { + "$id": "130", + "kind": "model", + "name": "ErrorAdditionalInfoInfo", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.info.anonymous", + "usage": "Output,Json,Exception,LroPolling", + "decorators": [], + "properties": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.info" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.additionalInfo" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.error" + }, + { + "$id": "131", + "kind": "property", + "name": "resourceId", + "serializedName": "resourceId", + "doc": "Fully qualified ID of the resource against which the original async operation was started.", + "type": { + "$id": "132", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationStatusResult.resourceId" + } + ] + }, + { + "$ref": "115" + }, + { + "$ref": "126" + }, + { + "$ref": "130" + }, + { + "$id": "133", + "kind": "model", + "name": "ErrorResponse", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "usage": "Error,Json,Exception", + "doc": "Common error response for all Azure Resource Manager APIs to return error details for failed operations.", + "decorators": [], + "properties": [ + { + "$id": "134", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "The error object.", + "type": { + "$ref": "115" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse.error" + } + ] + }, + { + "$id": "135", + "kind": "model", + "name": "ChaosTargetMetadata", + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetType", + "usage": "Output,Json", + "doc": "Model that represents a Target Type resource.", + "decorators": [], + "baseModel": { + "$id": "136", + "kind": "model", + "name": "ProxyResource", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ProxyResource", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location", + "decorators": [], + "baseModel": { + "$id": "137", + "kind": "model", + "name": "Resource", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Common fields that are returned in the response for all Azure Resource Manager resources", + "decorators": [], + "properties": [ + { + "$id": "138", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}", + "type": { + "$id": "139", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "140", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.id" + }, + { + "$id": "141", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the resource", + "type": { + "$id": "142", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.name" + }, + { + "$id": "143", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\"", + "type": { + "$id": "144", + "kind": "string", + "name": "armResourceType", + "crossLanguageDefinitionId": "Azure.Core.armResourceType", + "baseType": { + "$id": "145", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.type" + }, + { + "$id": "146", + "kind": "property", + "name": "systemData", + "serializedName": "systemData", + "doc": "Azure Resource Manager metadata containing createdBy and modifiedBy information.", + "type": { + "$id": "147", + "kind": "model", + "name": "SystemData", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData", + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Metadata pertaining to creation and last modification of the resource.", + "decorators": [], + "properties": [ + { + "$id": "148", + "kind": "property", + "name": "createdBy", + "serializedName": "createdBy", + "doc": "The identity that created the resource.", + "type": { + "$id": "149", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdBy" + }, + { + "$id": "150", + "kind": "property", + "name": "createdByType", + "serializedName": "createdByType", + "doc": "The type of identity that created the resource.", + "type": { + "$ref": "2" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdByType" + }, + { + "$id": "151", + "kind": "property", + "name": "createdAt", + "serializedName": "createdAt", + "doc": "The timestamp of resource creation (UTC).", + "type": { + "$id": "152", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "153", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdAt" + }, + { + "$id": "154", + "kind": "property", + "name": "lastModifiedBy", + "serializedName": "lastModifiedBy", + "doc": "The identity that last modified the resource.", + "type": { + "$id": "155", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedBy" + }, + { + "$id": "156", + "kind": "property", + "name": "lastModifiedByType", + "serializedName": "lastModifiedByType", + "doc": "The type of identity that last modified the resource.", + "type": { + "$ref": "2" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedByType" + }, + { + "$id": "157", + "kind": "property", + "name": "lastModifiedAt", + "serializedName": "lastModifiedAt", + "doc": "The timestamp of resource last modification (UTC)", + "type": { + "$id": "158", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "159", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedAt" + } + ] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.systemData" + } + ] + }, + "properties": [] + }, + "properties": [ + { + "$id": "160", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The properties of the target type resource.", + "type": { + "$id": "161", + "kind": "model", + "name": "TargetTypeProperties", + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetTypeProperties", + "usage": "Output,Json", + "doc": "Model that represents the base Target Type properties model.", + "decorators": [], + "properties": [ + { + "$id": "162", + "kind": "property", + "name": "displayName", + "serializedName": "displayName", + "doc": "Localized string of the display name.", + "type": { + "$id": "163", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetTypeProperties.displayName" + }, + { + "$id": "164", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "Localized string of the description.", + "type": { + "$id": "165", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetTypeProperties.description" + }, + { + "$id": "166", + "kind": "property", + "name": "propertiesSchema", + "serializedName": "propertiesSchema", + "doc": "URL to retrieve JSON schema of the Target Type properties.", + "type": { + "$id": "167", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetTypeProperties.propertiesSchema" + }, + { + "$id": "168", + "kind": "property", + "name": "resourceTypes", + "serializedName": "resourceTypes", + "doc": "List of resource types this Target Type can extend.", + "type": { + "$id": "169", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "170", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetTypeProperties.resourceTypes" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": true, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetType.properties" + } + ] + }, + { + "$ref": "161" + }, + { + "$ref": "136" + }, + { + "$ref": "137" + }, + { + "$ref": "147" + }, + { + "$id": "171", + "kind": "model", + "name": "TargetTypeListResult", + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetTypeListResult", + "usage": "Output,Json", + "doc": "Model that represents a list of Target Type resources and a link for pagination.", + "decorators": [], + "properties": [ + { + "$id": "172", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The TargetType items on this page", + "type": { + "$id": "173", + "kind": "array", + "name": "ArrayTargetType", + "valueType": { + "$ref": "135" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetTypeListResult.value" + }, + { + "$id": "174", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "175", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "176", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetTypeListResult.nextLink" + } + ] + }, + { + "$id": "177", + "kind": "model", + "name": "PrivateEndpointConnection", + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateEndpointConnection", + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "doc": "The private endpoint connection resource.", + "decorators": [], + "baseModel": { + "$ref": "136" + }, + "properties": [ + { + "$id": "178", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "Resource properties.", + "type": { + "$id": "179", + "kind": "model", + "name": "PrivateEndpointConnectionProperties", + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateEndpointConnectionProperties", + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Properties of the private endpoint connection.", + "decorators": [], + "properties": [ + { + "$id": "180", + "kind": "property", + "name": "groupIds", + "serializedName": "groupIds", + "doc": "The group ids for the private endpoint resource.", + "type": { + "$id": "181", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "182", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateEndpointConnectionProperties.groupIds" + }, + { + "$id": "183", + "kind": "property", + "name": "privateEndpoint", + "serializedName": "privateEndpoint", + "doc": "The private endpoint resource.", + "type": { + "$id": "184", + "kind": "model", + "name": "PrivateEndpoint", + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateEndpoint", + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "doc": "The private endpoint resource.", + "decorators": [], + "properties": [ + { + "$id": "185", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "The ARM identifier for private endpoint.", + "type": { + "$id": "186", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateEndpoint.id" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateEndpointConnectionProperties.privateEndpoint" + }, + { + "$id": "187", + "kind": "property", + "name": "privateLinkServiceConnectionState", + "serializedName": "privateLinkServiceConnectionState", + "doc": "A collection of information about the state of the connection between service consumer and provider.", + "type": { + "$id": "188", + "kind": "model", + "name": "PrivateLinkServiceConnectionState", + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateLinkServiceConnectionState", + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "doc": "A collection of information about the state of the connection between service consumer and provider.", + "decorators": [], + "properties": [ + { + "$id": "189", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", + "type": { + "$ref": "12" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateLinkServiceConnectionState.status" + }, + { + "$id": "190", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "The reason for approval/rejection of the connection.", + "type": { + "$id": "191", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateLinkServiceConnectionState.description" + }, + { + "$id": "192", + "kind": "property", + "name": "actionsRequired", + "serializedName": "actionsRequired", + "doc": "A message indicating if changes on the service provider require any updates on the consumer.", + "type": { + "$id": "193", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateLinkServiceConnectionState.actionsRequired" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateEndpointConnectionProperties.privateLinkServiceConnectionState" + }, + { + "$id": "194", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The provisioning state of the private endpoint connection resource.", + "type": { + "$ref": "20" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateEndpointConnectionProperties.provisioningState" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateEndpointConnection.properties" + } + ] + }, + { + "$ref": "179" + }, + { + "$ref": "184" + }, + { + "$ref": "188" + }, + { + "$id": "195", + "kind": "model", + "name": "ArmOperationStatusResourceProvisioningState", + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus", + "usage": "LroPolling", + "doc": "Standard Azure Resource Manager operation status response", + "decorators": [], + "properties": [ + { + "$id": "196", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The operation status", + "type": { + "$ref": "34" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.status" + }, + { + "$id": "197", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the operationStatus resource", + "type": { + "$id": "198", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.name" + }, + { + "$id": "199", + "kind": "property", + "name": "startTime", + "serializedName": "startTime", + "doc": "Operation start time", + "type": { + "$id": "200", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "201", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.startTime" + }, + { + "$id": "202", + "kind": "property", + "name": "endTime", + "serializedName": "endTime", + "doc": "Operation complete time", + "type": { + "$id": "203", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "204", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.endTime" + }, + { + "$id": "205", + "kind": "property", + "name": "percentComplete", + "serializedName": "percentComplete", + "doc": "The progress made toward completing the operation", + "type": { + "$id": "206", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.percentComplete" + }, + { + "$id": "207", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "Errors that occurred if the operation ended with Canceled or Failed status", + "type": { + "$ref": "115" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.error" + } + ] + }, + { + "$id": "208", + "kind": "model", + "name": "PrivateEndpointConnectionListResult", + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateEndpointConnectionListResult", + "usage": "Output,Json", + "doc": "A list of private link resources", + "decorators": [], + "properties": [ + { + "$id": "209", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The PrivateEndpointConnection items on this page", + "type": { + "$id": "210", + "kind": "array", + "name": "ArrayPrivateEndpointConnection", + "valueType": { + "$ref": "177" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateEndpointConnectionListResult.value" + }, + { + "$id": "211", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "212", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "213", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateEndpointConnectionListResult.nextLink" + } + ] + }, + { + "$id": "214", + "kind": "model", + "name": "PrivateAccess", + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateAccess", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "PrivateAccesses tracked resource.", + "decorators": [], + "baseModel": { + "$id": "215", + "kind": "model", + "name": "TrackedResource", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'", + "decorators": [], + "baseModel": { + "$ref": "137" + }, + "properties": [ + { + "$id": "216", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "217", + "kind": "dict", + "keyType": { + "$id": "218", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "219", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource.tags" + }, + { + "$id": "220", + "kind": "property", + "name": "location", + "serializedName": "location", + "doc": "The geo-location where the resource lives", + "type": { + "$id": "221", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource.location" + } + ] + }, + "properties": [ + { + "$id": "222", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "223", + "kind": "model", + "name": "PrivateAccessProperties", + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateAccessProperties", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "The properties of a private access resource", + "decorators": [], + "properties": [ + { + "$id": "224", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "Most recent provisioning state for the given privateAccess resource.", + "type": { + "$ref": "20" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateAccessProperties.provisioningState" + }, + { + "$id": "225", + "kind": "property", + "name": "privateEndpointConnections", + "serializedName": "privateEndpointConnections", + "doc": "A readonly collection of private endpoint connection. Currently only one endpoint connection is supported.", + "type": { + "$id": "226", + "kind": "array", + "name": "ArrayPrivateEndpointConnection", + "valueType": { + "$ref": "177" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateAccessProperties.privateEndpointConnections" + }, + { + "$id": "227", + "kind": "property", + "name": "publicNetworkAccess", + "serializedName": "publicNetworkAccess", + "doc": "Public Network Access Control for PrivateAccess resource.", + "type": { + "$ref": "42" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateAccessProperties.publicNetworkAccess" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateAccess.properties" + } + ] + }, + { + "$ref": "223" + }, + { + "$ref": "215" + }, + { + "$id": "228", + "kind": "model", + "name": "PrivateAccessPatch", + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateAccessPatch", + "usage": "Input,Json", + "doc": "Describes a private access update.", + "decorators": [], + "properties": [ + { + "$id": "229", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "230", + "kind": "dict", + "keyType": { + "$id": "231", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "232", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateAccessPatch.tags" + } + ] + }, + { + "$id": "233", + "kind": "model", + "name": "PrivateAccessListResult", + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateAccessListResult", + "usage": "Output,Json", + "doc": "Model that represents a list of private access resources and a link for pagination.", + "decorators": [], + "properties": [ + { + "$id": "234", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The PrivateAccess items on this page", + "type": { + "$id": "235", + "kind": "array", + "name": "ArrayPrivateAccess", + "valueType": { + "$ref": "214" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateAccessListResult.value" + }, + { + "$id": "236", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "237", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "238", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateAccessListResult.nextLink" + } + ] + }, + { + "$id": "239", + "kind": "model", + "name": "PrivateLinkResourceListResult", + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateLinkResourceListResult", + "usage": "Output,Json", + "doc": "A list of private link resources", + "decorators": [], + "properties": [ + { + "$id": "240", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The PrivateLinkResource items on this page", + "type": { + "$id": "241", + "kind": "array", + "name": "ArrayPrivateLinkResource", + "valueType": { + "$id": "242", + "kind": "model", + "name": "PrivateLinkResource", + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateLinkResource", + "usage": "Output,Json", + "doc": "A private link resource.", + "decorators": [], + "baseModel": { + "$ref": "215" + }, + "properties": [ + { + "$id": "243", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "244", + "kind": "model", + "name": "PrivateLinkResourceProperties", + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateLinkResourceProperties", + "usage": "Output,Json", + "doc": "Properties of a private link resource.", + "decorators": [], + "properties": [ + { + "$id": "245", + "kind": "property", + "name": "groupId", + "serializedName": "groupId", + "doc": "The private link resource group id.", + "type": { + "$id": "246", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateLinkResourceProperties.groupId" + }, + { + "$id": "247", + "kind": "property", + "name": "requiredMembers", + "serializedName": "requiredMembers", + "doc": "The private link resource required member names.", + "type": { + "$id": "248", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "249", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateLinkResourceProperties.requiredMembers" + }, + { + "$id": "250", + "kind": "property", + "name": "requiredZoneNames", + "serializedName": "requiredZoneNames", + "doc": "The private link resource private link DNS zone name.", + "type": { + "$id": "251", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "252", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateLinkResourceProperties.requiredZoneNames" + }, + { + "$id": "253", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "Resource provisioning state. Not currently in use.", + "type": { + "$ref": "20" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateLinkResourceProperties.provisioningState" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateLinkResource.properties" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateLinkResourceListResult.value" + }, + { + "$id": "254", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "255", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "256", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.PrivateLinkResourceListResult.nextLink" + } + ] + }, + { + "$ref": "242" + }, + { + "$ref": "244" + }, + { + "$id": "257", + "kind": "model", + "name": "ChaosExperimentExecution", + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecution", + "usage": "Output,Json", + "doc": "Model that represents the execution of a Experiment.", + "decorators": [], + "baseModel": { + "$ref": "136" + }, + "properties": [ + { + "$id": "258", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The properties of experiment execution status.", + "type": { + "$id": "259", + "kind": "model", + "name": "ExperimentExecutionProperties", + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionProperties", + "usage": "Output,Json", + "doc": "Model that represents the execution properties of an Experiment.", + "decorators": [], + "properties": [ + { + "$id": "260", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The status of the execution.", + "type": { + "$id": "261", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionProperties.status" + }, + { + "$id": "262", + "kind": "property", + "name": "startedAt", + "serializedName": "startedAt", + "doc": "String that represents the start date time.", + "type": { + "$id": "263", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "264", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionProperties.startedAt" + }, + { + "$id": "265", + "kind": "property", + "name": "stoppedAt", + "serializedName": "stoppedAt", + "doc": "String that represents the stop date time.", + "type": { + "$id": "266", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "267", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionProperties.stoppedAt" + }, + { + "$id": "268", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "Resource provisioning state. Not currently in use for executions.", + "type": { + "$ref": "20" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionProperties.provisioningState" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": true, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecution.properties" + } + ] + }, + { + "$ref": "259" + }, + { + "$id": "269", + "kind": "model", + "name": "ExperimentExecutionListResult", + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionListResult", + "usage": "Output,Json", + "doc": "Model that represents a list of Experiment executions and a link for pagination.", + "decorators": [], + "properties": [ + { + "$id": "270", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The ExperimentExecution items on this page", + "type": { + "$id": "271", + "kind": "array", + "name": "ArrayExperimentExecution", + "valueType": { + "$ref": "257" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionListResult.value" + }, + { + "$id": "272", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "273", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "274", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionListResult.nextLink" + } + ] + }, + { + "$id": "275", + "kind": "model", + "name": "ExperimentExecutionDetails", + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetails", + "usage": "Output,Json", + "doc": "Model that represents the execution details of an Experiment.", + "decorators": [], + "properties": [ + { + "$id": "276", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "String of the resource type.", + "type": { + "$id": "277", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetails.type" + }, + { + "$id": "278", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "String of the fully qualified resource ID.", + "type": { + "$id": "279", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetails.id" + }, + { + "$id": "280", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "String of the resource name.", + "type": { + "$id": "281", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetails.name" + }, + { + "$id": "282", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The properties of the experiment execution details.", + "type": { + "$id": "283", + "kind": "model", + "name": "ExperimentExecutionDetailsProperties", + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetailsProperties", + "usage": "Output,Json", + "doc": "Model that represents the extended properties of an experiment execution.", + "decorators": [], + "properties": [ + { + "$id": "284", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The status of the execution.", + "type": { + "$id": "285", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetailsProperties.status" + }, + { + "$id": "286", + "kind": "property", + "name": "startedAt", + "serializedName": "startedAt", + "doc": "String that represents the start date time.", + "type": { + "$id": "287", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "288", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetailsProperties.startedAt" + }, + { + "$id": "289", + "kind": "property", + "name": "stoppedAt", + "serializedName": "stoppedAt", + "doc": "String that represents the stop date time.", + "type": { + "$id": "290", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "291", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetailsProperties.stoppedAt" + }, + { + "$id": "292", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "Resource provisioning state. Not currently in use for executions.", + "type": { + "$ref": "20" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetailsProperties.provisioningState" + }, + { + "$id": "293", + "kind": "property", + "name": "failureReason", + "serializedName": "failureReason", + "doc": "The reason why the execution failed.", + "type": { + "$id": "294", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetailsProperties.failureReason" + }, + { + "$id": "295", + "kind": "property", + "name": "lastActionAt", + "serializedName": "lastActionAt", + "doc": "String that represents the last action date time.", + "type": { + "$id": "296", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "297", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetailsProperties.lastActionAt" + }, + { + "$id": "298", + "kind": "property", + "name": "runInformation", + "serializedName": "runInformation", + "doc": "The information of the experiment run.", + "type": { + "$id": "299", + "kind": "model", + "name": "ExperimentExecutionDetailsPropertiesRunInformation", + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetailsPropertiesRunInformation", + "usage": "Output,Json", + "doc": "The information of the experiment run.", + "decorators": [], + "properties": [ + { + "$id": "300", + "kind": "property", + "name": "steps", + "serializedName": "steps", + "doc": "The steps of the experiment run.", + "type": { + "$id": "301", + "kind": "array", + "name": "ArrayStepStatus", + "valueType": { + "$id": "302", + "kind": "model", + "name": "ChaosExperimentRunStepStatus", + "crossLanguageDefinitionId": "Microsoft.Chaos.StepStatus", + "usage": "Output,Json", + "doc": "Model that represents the a list of branches and branch statuses.", + "decorators": [], + "properties": [ + { + "$id": "303", + "kind": "property", + "name": "stepName", + "serializedName": "stepName", + "doc": "The name of the step.", + "type": { + "$id": "304", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.StepStatus.stepName" + }, + { + "$id": "305", + "kind": "property", + "name": "stepId", + "serializedName": "stepId", + "doc": "The id of the step.", + "type": { + "$id": "306", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.StepStatus.stepId" + }, + { + "$id": "307", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The value of the status of the step.", + "type": { + "$id": "308", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.StepStatus.status" + }, + { + "$id": "309", + "kind": "property", + "name": "branches", + "serializedName": "branches", + "doc": "The array of branches.", + "type": { + "$id": "310", + "kind": "array", + "name": "ArrayBranchStatus", + "valueType": { + "$id": "311", + "kind": "model", + "name": "ChaosExperimentRunBranchStatus", + "crossLanguageDefinitionId": "Microsoft.Chaos.BranchStatus", + "usage": "Output,Json", + "doc": "Model that represents the a list of actions and action statuses.", + "decorators": [], + "properties": [ + { + "$id": "312", + "kind": "property", + "name": "branchName", + "serializedName": "branchName", + "doc": "The name of the branch status.", + "type": { + "$id": "313", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.BranchStatus.branchName" + }, + { + "$id": "314", + "kind": "property", + "name": "branchId", + "serializedName": "branchId", + "doc": "The id of the branch status.", + "type": { + "$id": "315", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.BranchStatus.branchId" + }, + { + "$id": "316", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The status of the branch.", + "type": { + "$id": "317", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.BranchStatus.status" + }, + { + "$id": "318", + "kind": "property", + "name": "actions", + "serializedName": "actions", + "doc": "The array of actions.", + "type": { + "$id": "319", + "kind": "array", + "name": "ArrayActionStatus", + "valueType": { + "$id": "320", + "kind": "model", + "name": "ChaosExperimentRunActionStatus", + "crossLanguageDefinitionId": "Microsoft.Chaos.ActionStatus", + "usage": "Output,Json", + "doc": "Model that represents the an action and its status.", + "decorators": [], + "properties": [ + { + "$id": "321", + "kind": "property", + "name": "actionName", + "serializedName": "actionName", + "doc": "The name of the action status.", + "type": { + "$id": "322", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ActionStatus.actionName" + }, + { + "$id": "323", + "kind": "property", + "name": "actionId", + "serializedName": "actionId", + "doc": "The id of the action status.", + "type": { + "$id": "324", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ActionStatus.actionId" + }, + { + "$id": "325", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The status of the action.", + "type": { + "$id": "326", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ActionStatus.status" + }, + { + "$id": "327", + "kind": "property", + "name": "startTime", + "serializedName": "startTime", + "doc": "String that represents the start time of the action.", + "type": { + "$id": "328", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "329", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ActionStatus.startTime" + }, + { + "$id": "330", + "kind": "property", + "name": "endTime", + "serializedName": "endTime", + "doc": "String that represents the end time of the action.", + "type": { + "$id": "331", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "332", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ActionStatus.endTime" + }, + { + "$id": "333", + "kind": "property", + "name": "targets", + "serializedName": "targets", + "doc": "The array of targets.", + "type": { + "$id": "334", + "kind": "array", + "name": "ArrayExperimentExecutionActionTargetDetailsProperties", + "valueType": { + "$id": "335", + "kind": "model", + "name": "ExperimentExecutionActionTargetDetailsProperties", + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionActionTargetDetailsProperties", + "usage": "Output,Json", + "doc": "Model that represents the Experiment action target details properties model.", + "decorators": [], + "properties": [ + { + "$id": "336", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The status of the execution.", + "type": { + "$id": "337", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionActionTargetDetailsProperties.status" + }, + { + "$id": "338", + "kind": "property", + "name": "target", + "serializedName": "target", + "doc": "The target for the action.", + "type": { + "$id": "339", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionActionTargetDetailsProperties.target" + }, + { + "$id": "340", + "kind": "property", + "name": "targetFailedTime", + "serializedName": "targetFailedTime", + "doc": "String that represents the failed date time.", + "type": { + "$id": "341", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "342", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionActionTargetDetailsProperties.targetFailedTime" + }, + { + "$id": "343", + "kind": "property", + "name": "targetCompletedTime", + "serializedName": "targetCompletedTime", + "doc": "String that represents the completed date time.", + "type": { + "$id": "344", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "345", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionActionTargetDetailsProperties.targetCompletedTime" + }, + { + "$id": "346", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "The error of the action.", + "type": { + "$id": "347", + "kind": "model", + "name": "ExperimentExecutionActionTargetDetailsError", + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionActionTargetDetailsError", + "usage": "Output,Json", + "doc": "Model that represents the Experiment action target details error model.", + "decorators": [], + "properties": [ + { + "$id": "348", + "kind": "property", + "name": "code", + "serializedName": "code", + "doc": "The error code.", + "type": { + "$id": "349", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionActionTargetDetailsError.code" + }, + { + "$id": "350", + "kind": "property", + "name": "message", + "serializedName": "message", + "doc": "The error message", + "type": { + "$id": "351", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionActionTargetDetailsError.message" + } + ] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionActionTargetDetailsProperties.error" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ActionStatus.targets" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.BranchStatus.actions" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.StepStatus.branches" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetailsPropertiesRunInformation.steps" + } + ] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetailsProperties.runInformation" + } + ] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": true, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutionDetails.properties" + } + ] + }, + { + "$ref": "283" + }, + { + "$ref": "299" + }, + { + "$ref": "302" + }, + { + "$ref": "311" + }, + { + "$ref": "320" + }, + { + "$ref": "335" + }, + { + "$ref": "347" + }, + { + "$id": "352", + "kind": "model", + "name": "ChaosExperiment", + "crossLanguageDefinitionId": "Microsoft.Chaos.Experiment", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents a Experiment resource.", + "decorators": [], + "baseModel": { + "$ref": "215" + }, + "properties": [ + { + "$id": "353", + "kind": "property", + "name": "identity", + "serializedName": "identity", + "doc": "The managed service identities assigned to this resource.", + "type": { + "$id": "354", + "kind": "model", + "name": "ManagedServiceIdentity", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Managed service identity (system assigned and/or user assigned identities)", + "decorators": [], + "properties": [ + { + "$id": "355", + "kind": "property", + "name": "principalId", + "serializedName": "principalId", + "doc": "The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity.", + "type": { + "$id": "356", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "357", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.principalId" + }, + { + "$id": "358", + "kind": "property", + "name": "tenantId", + "serializedName": "tenantId", + "doc": "The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity.", + "type": { + "$id": "359", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "360", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.tenantId" + }, + { + "$id": "361", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The type of managed identity assigned to this resource.", + "type": { + "$ref": "48" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.type" + }, + { + "$id": "362", + "kind": "property", + "name": "userAssignedIdentities", + "serializedName": "userAssignedIdentities", + "doc": "The identities assigned to this resource by the user.", + "type": { + "$id": "363", + "kind": "dict", + "keyType": { + "$id": "364", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "365", + "kind": "nullable", + "type": { + "$id": "366", + "kind": "model", + "name": "UserAssignedIdentity", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "User assigned identity properties", + "decorators": [], + "properties": [ + { + "$id": "367", + "kind": "property", + "name": "principalId", + "serializedName": "principalId", + "doc": "The principal ID of the assigned identity.", + "type": { + "$id": "368", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "369", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity.principalId" + }, + { + "$id": "370", + "kind": "property", + "name": "clientId", + "serializedName": "clientId", + "doc": "The client ID of the assigned identity.", + "type": { + "$id": "371", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "372", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity.clientId" + } + ] + } + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.userAssignedIdentities" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.Experiment.identity" + }, + { + "$id": "373", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The properties of the experiment resource.", + "type": { + "$id": "374", + "kind": "model", + "name": "ExperimentProperties", + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentProperties", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents the Experiment properties model.", + "decorators": [], + "properties": [ + { + "$id": "375", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "Most recent provisioning state for the given experiment resource.", + "type": { + "$ref": "20" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentProperties.provisioningState" + }, + { + "$id": "376", + "kind": "property", + "name": "steps", + "serializedName": "steps", + "doc": "List of steps.", + "type": { + "$id": "377", + "kind": "array", + "name": "ArrayChaosExperimentStep", + "valueType": { + "$id": "378", + "kind": "model", + "name": "ChaosExperimentStep", + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosExperimentStep", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents a step in the Experiment resource.", + "decorators": [], + "properties": [ + { + "$id": "379", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "String of the step name.", + "type": { + "$id": "380", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosExperimentStep.name" + }, + { + "$id": "381", + "kind": "property", + "name": "branches", + "serializedName": "branches", + "doc": "List of branches.", + "type": { + "$id": "382", + "kind": "array", + "name": "ArrayChaosExperimentBranch", + "valueType": { + "$id": "383", + "kind": "model", + "name": "ChaosExperimentBranch", + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosExperimentBranch", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents a branch in the step. 9 total per experiment.", + "decorators": [], + "properties": [ + { + "$id": "384", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "String of the branch name.", + "type": { + "$id": "385", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosExperimentBranch.name" + }, + { + "$id": "386", + "kind": "property", + "name": "actions", + "serializedName": "actions", + "doc": "List of actions.", + "type": { + "$id": "387", + "kind": "array", + "name": "ArrayChaosExperimentAction", + "valueType": { + "$id": "388", + "kind": "model", + "name": "ChaosExperimentAction", + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosExperimentAction", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents the base action model. 9 total per experiment.", + "decorators": [], + "discriminatorProperty": { + "$id": "389", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "Chaos experiment action discriminator type", + "type": { + "$ref": "58" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosExperimentAction.type" + }, + "properties": [ + { + "$id": "390", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "String that represents a Capability URN.", + "type": { + "$id": "391", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosExperimentAction.name" + }, + { + "$ref": "389" + } + ], + "discriminatedSubtypes": { + "$id": "392", + "continuous": { + "$id": "393", + "kind": "model", + "name": "ChaosContinuousAction", + "crossLanguageDefinitionId": "Microsoft.Chaos.ContinuousAction", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents a continuous action.", + "discriminatorValue": "continuous", + "decorators": [], + "baseModel": { + "$ref": "388" + }, + "properties": [ + { + "$id": "394", + "kind": "property", + "name": "duration", + "serializedName": "duration", + "doc": "ISO8601 formatted string that represents a duration.", + "type": { + "$id": "395", + "kind": "duration", + "name": "duration", + "encode": "ISO8601", + "wireType": { + "$id": "396", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.duration", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ContinuousAction.duration" + }, + { + "$id": "397", + "kind": "property", + "name": "parameters", + "serializedName": "parameters", + "doc": "List of key value pairs.", + "type": { + "$id": "398", + "kind": "array", + "name": "ArrayKeyValuePair", + "valueType": { + "$id": "399", + "kind": "model", + "name": "ChaosKeyValuePair", + "crossLanguageDefinitionId": "Microsoft.Chaos.KeyValuePair", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "A map to describe the settings of an action.", + "decorators": [], + "properties": [ + { + "$id": "400", + "kind": "property", + "name": "key", + "serializedName": "key", + "doc": "The name of the setting for the action.", + "type": { + "$id": "401", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.KeyValuePair.key" + }, + { + "$id": "402", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The value of the setting for the action.", + "type": { + "$id": "403", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.KeyValuePair.value" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ContinuousAction.parameters" + }, + { + "$id": "404", + "kind": "property", + "name": "selectorId", + "serializedName": "selectorId", + "doc": "String that represents a selector.", + "type": { + "$id": "405", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ContinuousAction.selectorId" + }, + { + "$id": "406", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "Enum that discriminates between action models.", + "type": { + "$id": "407", + "kind": "constant", + "valueType": { + "$id": "408", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "continuous", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ContinuousAction.type" + } + ] + }, + "delay": { + "$id": "409", + "kind": "model", + "name": "ChaosDelayAction", + "crossLanguageDefinitionId": "Microsoft.Chaos.DelayAction", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents a delay action.", + "discriminatorValue": "delay", + "decorators": [], + "baseModel": { + "$ref": "388" + }, + "properties": [ + { + "$id": "410", + "kind": "property", + "name": "duration", + "serializedName": "duration", + "doc": "ISO8601 formatted string that represents a duration.", + "type": { + "$id": "411", + "kind": "duration", + "name": "duration", + "encode": "ISO8601", + "wireType": { + "$id": "412", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.duration", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.DelayAction.duration" + }, + { + "$id": "413", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "Enum that discriminates between action models.", + "type": { + "$id": "414", + "kind": "constant", + "valueType": { + "$id": "415", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "delay", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.DelayAction.type" + } + ] + }, + "discrete": { + "$id": "416", + "kind": "model", + "name": "ChaosDiscreteAction", + "crossLanguageDefinitionId": "Microsoft.Chaos.DiscreteAction", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents a discrete action.", + "discriminatorValue": "discrete", + "decorators": [], + "baseModel": { + "$ref": "388" + }, + "properties": [ + { + "$id": "417", + "kind": "property", + "name": "parameters", + "serializedName": "parameters", + "doc": "List of key value pairs.", + "type": { + "$id": "418", + "kind": "array", + "name": "ArrayKeyValuePair", + "valueType": { + "$ref": "399" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.DiscreteAction.parameters" + }, + { + "$id": "419", + "kind": "property", + "name": "selectorId", + "serializedName": "selectorId", + "doc": "String that represents a selector.", + "type": { + "$id": "420", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.DiscreteAction.selectorId" + }, + { + "$id": "421", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "Enum that discriminates between action models.", + "type": { + "$id": "422", + "kind": "constant", + "valueType": { + "$id": "423", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "discrete", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.DiscreteAction.type" + } + ] + } + } + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosExperimentBranch.actions" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosExperimentStep.branches" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentProperties.steps" + }, + { + "$id": "424", + "kind": "property", + "name": "selectors", + "serializedName": "selectors", + "doc": "List of selectors.", + "type": { + "$id": "425", + "kind": "array", + "name": "ArrayChaosTargetSelector", + "valueType": { + "$id": "426", + "kind": "model", + "name": "ChaosTargetSelector", + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetSelector", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents a selector in the Experiment resource.", + "decorators": [], + "discriminatorProperty": { + "$id": "427", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "Chaos target selector discriminator type", + "type": { + "$ref": "66" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetSelector.type" + }, + "properties": [ + { + "$id": "428", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "String of the selector ID.", + "type": { + "$id": "429", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetSelector.id" + }, + { + "$ref": "427" + }, + { + "$id": "430", + "kind": "property", + "name": "filter", + "serializedName": "filter", + "doc": "Model that represents available filter types that can be applied to a targets list.", + "type": { + "$id": "431", + "kind": "model", + "name": "ChaosTargetFilter", + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetFilter", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents available filter types that can be applied to a targets list.", + "decorators": [], + "discriminatorProperty": { + "$id": "432", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "Chaos target filter discriminator type", + "type": { + "$ref": "72" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetFilter.type" + }, + "properties": [ + { + "$ref": "432" + } + ], + "discriminatedSubtypes": { + "$id": "433", + "Simple": { + "$id": "434", + "kind": "model", + "name": "ChaosTargetSimpleFilter", + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetSimpleFilter", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents a simple target filter.", + "discriminatorValue": "Simple", + "decorators": [], + "baseModel": { + "$ref": "431" + }, + "properties": [ + { + "$id": "435", + "kind": "property", + "name": "parameters", + "serializedName": "parameters", + "doc": "Model that represents the Simple filter parameters.", + "type": { + "$id": "436", + "kind": "model", + "name": "ChaosTargetSimpleFilterParameters", + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetSimpleFilterParameters", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents the Simple filter parameters.", + "decorators": [], + "properties": [ + { + "$id": "437", + "kind": "property", + "name": "zones", + "serializedName": "zones", + "doc": "List of Azure availability zones to filter targets by.", + "type": { + "$id": "438", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "439", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetSimpleFilterParameters.zones" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetSimpleFilter.parameters" + }, + { + "$id": "440", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "Enum that discriminates between filter types. Currently only `Simple` type is supported.", + "type": { + "$id": "441", + "kind": "constant", + "valueType": { + "$id": "442", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "Simple", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetSimpleFilter.type" + } + ] + } + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetSelector.filter" + } + ], + "discriminatedSubtypes": { + "$id": "443", + "List": { + "$id": "444", + "kind": "model", + "name": "ChaosTargetListSelector", + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetListSelector", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents a list selector.", + "discriminatorValue": "List", + "decorators": [], + "baseModel": { + "$ref": "426" + }, + "properties": [ + { + "$id": "445", + "kind": "property", + "name": "targets", + "serializedName": "targets", + "doc": "List of Target references.", + "type": { + "$id": "446", + "kind": "array", + "name": "ArrayTargetReference", + "valueType": { + "$id": "447", + "kind": "model", + "name": "ChaosTargetReference", + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetReference", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents a reference to a Target in the selector.", + "decorators": [], + "properties": [ + { + "$id": "448", + "kind": "property", + "name": "ReferenceType", + "serializedName": "type", + "doc": "Enum of the Target reference type.", + "type": { + "$ref": "76" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetReference.type" + }, + { + "$id": "449", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "String of the resource ID of a Target resource.", + "type": { + "$id": "450", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "451", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetReference.id" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetListSelector.targets" + }, + { + "$id": "452", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "Enum of the selector type.", + "type": { + "$id": "453", + "kind": "constant", + "valueType": { + "$id": "454", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "List", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetListSelector.type" + } + ] + }, + "Query": { + "$id": "455", + "kind": "model", + "name": "ChaosTargetQuerySelector", + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetQuerySelector", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents a query selector.", + "discriminatorValue": "Query", + "decorators": [], + "baseModel": { + "$ref": "426" + }, + "properties": [ + { + "$id": "456", + "kind": "property", + "name": "queryString", + "serializedName": "queryString", + "doc": "Azure Resource Graph (ARG) Query Language query for target resources.", + "type": { + "$id": "457", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetQuerySelector.queryString" + }, + { + "$id": "458", + "kind": "property", + "name": "subscriptionIds", + "serializedName": "subscriptionIds", + "doc": "Subscription id list to scope resource query.", + "type": { + "$id": "459", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "460", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetQuerySelector.subscriptionIds" + }, + { + "$id": "461", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "Enum of the selector type.", + "type": { + "$id": "462", + "kind": "constant", + "valueType": { + "$id": "463", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "Query", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ChaosTargetQuerySelector.type" + } + ] + } + } + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentProperties.selectors" + }, + { + "$id": "464", + "kind": "property", + "name": "customerDataStorage", + "serializedName": "customerDataStorage", + "doc": "Optional customer-managed Storage account where Experiment schema will be stored.", + "type": { + "$id": "465", + "kind": "model", + "name": "CustomerDataStorageProperties", + "crossLanguageDefinitionId": "Microsoft.Chaos.CustomerDataStorageProperties", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Model that represents the Customer Managed Storage for an Experiment.", + "decorators": [], + "properties": [ + { + "$id": "466", + "kind": "property", + "name": "storageAccountResourceId", + "serializedName": "storageAccountResourceId", + "doc": "ARM Resource ID of the Storage account to use for Customer Data storage.", + "type": { + "$id": "467", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "468", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CustomerDataStorageProperties.storageAccountResourceId" + }, + { + "$id": "469", + "kind": "property", + "name": "blobContainerName", + "serializedName": "blobContainerName", + "doc": "Name of the Azure Blob Storage container to use or create.", + "type": { + "$id": "470", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CustomerDataStorageProperties.blobContainerName" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentProperties.customerDataStorage" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": true, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.Experiment.properties" + } + ] + }, + { + "$ref": "354" + }, + { + "$ref": "366" + }, + { + "$ref": "374" + }, + { + "$ref": "378" + }, + { + "$ref": "383" + }, + { + "$ref": "388" + }, + { + "$ref": "393" + }, + { + "$ref": "399" + }, + { + "$ref": "409" + }, + { + "$ref": "416" + }, + { + "$ref": "426" + }, + { + "$ref": "431" + }, + { + "$ref": "434" + }, + { + "$ref": "436" + }, + { + "$ref": "444" + }, + { + "$ref": "447" + }, + { + "$ref": "455" + }, + { + "$ref": "465" + }, + { + "$id": "471", + "kind": "model", + "name": "ExperimentUpdate", + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentUpdate", + "usage": "Input,Json", + "doc": "Describes an experiment update.", + "decorators": [], + "properties": [ + { + "$id": "472", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "473", + "kind": "dict", + "keyType": { + "$id": "474", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "475", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentUpdate.tags" + }, + { + "$id": "476", + "kind": "property", + "name": "identity", + "serializedName": "identity", + "doc": "The managed service identities assigned to this resource.", + "type": { + "$ref": "354" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentUpdate.identity" + } + ] + }, + { + "$id": "477", + "kind": "model", + "name": "ExperimentListResult", + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentListResult", + "usage": "Output,Json", + "doc": "Model that represents a list of Experiment resources and a link for pagination.", + "decorators": [], + "properties": [ + { + "$id": "478", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The Experiment items on this page", + "type": { + "$id": "479", + "kind": "array", + "name": "ArrayExperiment", + "valueType": { + "$ref": "352" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentListResult.value" + }, + { + "$id": "480", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "481", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "482", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.ExperimentListResult.nextLink" + } + ] + }, + { + "$id": "483", + "kind": "model", + "name": "ChaosCapabilityMetadata", + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityType", + "usage": "Output,Json", + "doc": "Model that represents a Capability Type resource.", + "decorators": [], + "baseModel": { + "$ref": "136" + }, + "properties": [ + { + "$id": "484", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The properties of the capability type resource.", + "type": { + "$id": "485", + "kind": "model", + "name": "CapabilityTypeProperties", + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeProperties", + "usage": "Output,Json", + "doc": "Model that represents the Capability Type properties model.", + "decorators": [], + "properties": [ + { + "$id": "486", + "kind": "property", + "name": "publisher", + "serializedName": "publisher", + "doc": "String of the Publisher that this Capability Type extends.", + "type": { + "$id": "487", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeProperties.publisher" + }, + { + "$id": "488", + "kind": "property", + "name": "targetType", + "serializedName": "targetType", + "doc": "String of the Target Type that this Capability Type extends.", + "type": { + "$id": "489", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeProperties.targetType" + }, + { + "$id": "490", + "kind": "property", + "name": "displayName", + "serializedName": "displayName", + "doc": "Localized string of the display name.", + "type": { + "$id": "491", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeProperties.displayName" + }, + { + "$id": "492", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "Localized string of the description.", + "type": { + "$id": "493", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeProperties.description" + }, + { + "$id": "494", + "kind": "property", + "name": "parametersSchema", + "serializedName": "parametersSchema", + "doc": "URL to retrieve JSON schema of the Capability Type parameters.", + "type": { + "$id": "495", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeProperties.parametersSchema" + }, + { + "$id": "496", + "kind": "property", + "name": "urn", + "serializedName": "urn", + "doc": "String of the URN for this Capability Type.", + "type": { + "$id": "497", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeProperties.urn" + }, + { + "$id": "498", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "String of the kind of this Capability Type.", + "type": { + "$id": "499", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeProperties.kind" + }, + { + "$id": "500", + "kind": "property", + "name": "azureRbacActions", + "serializedName": "azureRbacActions", + "doc": "Control plane actions necessary to execute capability type.", + "type": { + "$id": "501", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "502", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeProperties.azureRbacActions" + }, + { + "$id": "503", + "kind": "property", + "name": "azureRbacDataActions", + "serializedName": "azureRbacDataActions", + "doc": "Data plane actions necessary to execute capability type.", + "type": { + "$id": "504", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "505", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeProperties.azureRbacDataActions" + }, + { + "$id": "506", + "kind": "property", + "name": "runtimeProperties", + "serializedName": "runtimeProperties", + "doc": "Runtime properties of this Capability Type.", + "type": { + "$id": "507", + "kind": "model", + "name": "ChaosCapabilityMetadataRuntimeProperties", + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypePropertiesRuntimeProperties", + "usage": "Output,Json", + "doc": "Runtime properties of this Capability Type.", + "decorators": [], + "properties": [ + { + "$id": "508", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "doc": "String of the kind of the resource's action type (continuous or discrete).", + "type": { + "$id": "509", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypePropertiesRuntimeProperties.kind" + } + ] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeProperties.runtimeProperties" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": true, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityType.properties" + } + ] + }, + { + "$ref": "485" + }, + { + "$ref": "507" + }, + { + "$id": "510", + "kind": "model", + "name": "CapabilityTypeListResult", + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeListResult", + "usage": "Output,Json", + "doc": "Model that represents a list of Capability Type resources and a link for pagination.", + "decorators": [], + "properties": [ + { + "$id": "511", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The CapabilityType items on this page", + "type": { + "$id": "512", + "kind": "array", + "name": "ArrayCapabilityType", + "valueType": { + "$ref": "483" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeListResult.value" + }, + { + "$id": "513", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "514", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "515", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypeListResult.nextLink" + } + ] + }, + { + "$id": "516", + "kind": "model", + "name": "ChaosTarget", + "crossLanguageDefinitionId": "Microsoft.Chaos.Target", + "usage": "Input,Output,Json", + "doc": "Model that represents a Target resource.", + "decorators": [], + "baseModel": { + "$ref": "136" + }, + "properties": [ + { + "$id": "517", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The properties of the target resource.", + "type": { + "$id": "518", + "kind": "dict", + "keyType": { + "$id": "519", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "520", + "kind": "unknown", + "name": "unknown", + "crossLanguageDefinitionId": "", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.Target.properties" + }, + { + "$id": "521", + "kind": "property", + "name": "location", + "serializedName": "location", + "doc": "Azure resource location.", + "type": { + "$id": "522", + "kind": "string", + "name": "azureLocation", + "crossLanguageDefinitionId": "Azure.Core.azureLocation", + "baseType": { + "$id": "523", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.Target.location" + } + ] + }, + { + "$id": "524", + "kind": "model", + "name": "TargetListResult", + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetListResult", + "usage": "Output,Json", + "doc": "Model that represents a list of Target resources and a link for pagination.", + "decorators": [], + "properties": [ + { + "$id": "525", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The Target items on this page", + "type": { + "$id": "526", + "kind": "array", + "name": "ArrayTarget", + "valueType": { + "$ref": "516" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetListResult.value" + }, + { + "$id": "527", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "528", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "529", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.TargetListResult.nextLink" + } + ] + }, + { + "$id": "530", + "kind": "model", + "name": "OperationListResult", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult", + "usage": "Output,Json", + "doc": "A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.", + "decorators": [], + "properties": [ + { + "$id": "531", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The Operation items on this page", + "type": { + "$id": "532", + "kind": "array", + "name": "ArrayOperation", + "valueType": { + "$id": "533", + "kind": "model", + "name": "Operation", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation", + "usage": "Output,Json", + "doc": "Details of a REST API operation, returned from the Resource Provider Operations API", + "decorators": [], + "properties": [ + { + "$id": "534", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the operation, as per Resource-Based Access Control (RBAC). Examples: \"Microsoft.Compute/virtualMachines/write\", \"Microsoft.Compute/virtualMachines/capture/action\"", + "type": { + "$id": "535", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.name" + }, + { + "$id": "536", + "kind": "property", + "name": "isDataAction", + "serializedName": "isDataAction", + "doc": "Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for Azure Resource Manager/control-plane operations.", + "type": { + "$id": "537", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.isDataAction" + }, + { + "$id": "538", + "kind": "property", + "name": "display", + "serializedName": "display", + "doc": "Localized display information for this particular operation.", + "type": { + "$id": "539", + "kind": "model", + "name": "OperationDisplay", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "usage": "Output,Json", + "doc": "Localized display information for and operation.", + "decorators": [], + "properties": [ + { + "$id": "540", + "kind": "property", + "name": "provider", + "serializedName": "provider", + "doc": "The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring Insights\" or \"Microsoft Compute\".", + "type": { + "$id": "541", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.provider" + }, + { + "$id": "542", + "kind": "property", + "name": "resource", + "serializedName": "resource", + "doc": "The localized friendly name of the resource type related to this operation. E.g. \"Virtual Machines\" or \"Job Schedule Collections\".", + "type": { + "$id": "543", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.resource" + }, + { + "$id": "544", + "kind": "property", + "name": "operation", + "serializedName": "operation", + "doc": "The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create or Update Virtual Machine\", \"Restart Virtual Machine\".", + "type": { + "$id": "545", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.operation" + }, + { + "$id": "546", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "The short, localized friendly description of the operation; suitable for tool tips and detailed views.", + "type": { + "$id": "547", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.description" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.display" + }, + { + "$id": "548", + "kind": "property", + "name": "origin", + "serializedName": "origin", + "doc": "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\"", + "type": { + "$ref": "80" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.origin" + }, + { + "$id": "549", + "kind": "property", + "name": "actionType", + "serializedName": "actionType", + "doc": "Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs.", + "type": { + "$ref": "88" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.actionType" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult.value" + }, + { + "$id": "550", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "551", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "552", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult.nextLink" + } + ] + }, + { + "$ref": "533" + }, + { + "$ref": "539" + }, + { + "$id": "553", + "kind": "model", + "name": "ChaosCapability", + "crossLanguageDefinitionId": "Microsoft.Chaos.Capability", + "usage": "Input,Output,Json", + "doc": "Model that represents a Capability resource.", + "decorators": [], + "baseModel": { + "$ref": "136" + }, + "properties": [ + { + "$id": "554", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The properties of a capability resource.", + "type": { + "$id": "555", + "kind": "model", + "name": "CapabilityProperties", + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityProperties", + "usage": "Input,Output,Json", + "doc": "Model that represents the Capability properties model.", + "decorators": [], + "properties": [ + { + "$id": "556", + "kind": "property", + "name": "publisher", + "serializedName": "publisher", + "doc": "String of the Publisher that this Capability extends.", + "type": { + "$id": "557", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityProperties.publisher" + }, + { + "$id": "558", + "kind": "property", + "name": "targetType", + "serializedName": "targetType", + "doc": "String of the Target Type that this Capability extends.", + "type": { + "$id": "559", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityProperties.targetType" + }, + { + "$id": "560", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "Localized string of the description.", + "type": { + "$id": "561", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityProperties.description" + }, + { + "$id": "562", + "kind": "property", + "name": "parametersSchema", + "serializedName": "parametersSchema", + "doc": "URL to retrieve JSON schema of the Capability parameters.", + "type": { + "$id": "563", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityProperties.parametersSchema" + }, + { + "$id": "564", + "kind": "property", + "name": "urn", + "serializedName": "urn", + "doc": "String of the URN for this Capability Type.", + "type": { + "$id": "565", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityProperties.urn" + }, + { + "$id": "566", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "Resource provisioning state. Not currently in use because resource is created synchronously.", + "type": { + "$ref": "20" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityProperties.provisioningState" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": true, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.Capability.properties" + } + ] + }, + { + "$ref": "555" + }, + { + "$id": "567", + "kind": "model", + "name": "CapabilityListResult", + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityListResult", + "usage": "Output,Json", + "doc": "Model that represents a list of Capability resources and a link for pagination.", + "decorators": [], + "properties": [ + { + "$id": "568", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The Capability items on this page", + "type": { + "$id": "569", + "kind": "array", + "name": "ArrayCapability", + "valueType": { + "$ref": "553" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityListResult.value" + }, + { + "$id": "570", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "571", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "572", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.CapabilityListResult.nextLink" + } + ] + }, + { + "$id": "573", + "kind": "model", + "name": "OperationStatus", + "crossLanguageDefinitionId": "Microsoft.Chaos.OperationStatus", + "usage": "Error", + "doc": "The status of operation.", + "decorators": [], + "baseModel": { + "$ref": "133" + }, + "properties": [ + { + "$id": "574", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "The operation Id.", + "type": { + "$id": "575", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.OperationStatus.id" + }, + { + "$id": "576", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The operation name.", + "type": { + "$id": "577", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.OperationStatus.name" + }, + { + "$id": "578", + "kind": "property", + "name": "startTime", + "serializedName": "startTime", + "doc": "The start time of the operation.", + "type": { + "$id": "579", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "580", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.OperationStatus.startTime" + }, + { + "$id": "581", + "kind": "property", + "name": "endTime", + "serializedName": "endTime", + "doc": "The end time of the operation.", + "type": { + "$id": "582", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "583", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.OperationStatus.endTime" + }, + { + "$id": "584", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The status of the operation.", + "type": { + "$id": "585", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.Chaos.OperationStatus.status" + } + ] + } + ], + "Clients": [ + { + "$id": "586", + "Name": "ChaosClient", + "Doc": "Chaos Management Client", + "Operations": [], + "Protocol": { + "$id": "587" + }, + "Parameters": [ + { + "$id": "588", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "589", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "590", + "Type": { + "$id": "591", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "592", + "Name": "Capabilities", + "Operations": [ + { + "$id": "593", + "Name": "get", + "ResourceName": "Capability", + "Doc": "Get a Capability resource that extends a Target resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "594", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "595", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "596", + "Type": { + "$id": "597", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "598", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "599", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "600", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "601", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "602", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "603", + "Name": "parentProviderNamespace", + "NameInRequest": "parentProviderNamespace", + "Doc": "The parent resource provider namespace.", + "Type": { + "$id": "604", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "605", + "Name": "parentResourceType", + "NameInRequest": "parentResourceType", + "Doc": "The parent resource type.", + "Type": { + "$id": "606", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "607", + "Name": "parentResourceName", + "NameInRequest": "parentResourceName", + "Doc": "The parent resource name.", + "Type": { + "$id": "608", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "609", + "Name": "targetName", + "NameInRequest": "targetName", + "Doc": "String that represents a Target resource name.", + "Type": { + "$id": "610", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "611", + "Name": "capabilityName", + "NameInRequest": "capabilityName", + "Doc": "String that represents a Capability resource name.", + "Type": { + "$id": "612", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "613", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "614", + "kind": "constant", + "valueType": { + "$id": "615", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "616", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "553" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}/capabilities/{capabilityName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Capabilities.get", + "Decorators": [], + "Examples": [ + { + "$id": "617", + "kind": "http", + "name": "Get a Capability that extends a virtual machine Target resource.", + "description": "Get a Capability that extends a virtual machine Target resource.", + "filePath": "2024-11-01-preview/Capabilities_Get.json", + "parameters": [ + { + "$id": "618", + "parameter": { + "$ref": "594" + }, + "value": { + "$id": "619", + "kind": "string", + "type": { + "$ref": "595" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "620", + "parameter": { + "$ref": "611" + }, + "value": { + "$id": "621", + "kind": "string", + "type": { + "$ref": "612" + }, + "value": "Shutdown-1.0" + } + }, + { + "$id": "622", + "parameter": { + "$ref": "603" + }, + "value": { + "$id": "623", + "kind": "string", + "type": { + "$ref": "604" + }, + "value": "Microsoft.Compute" + } + }, + { + "$id": "624", + "parameter": { + "$ref": "607" + }, + "value": { + "$id": "625", + "kind": "string", + "type": { + "$ref": "608" + }, + "value": "exampleVM" + } + }, + { + "$id": "626", + "parameter": { + "$ref": "605" + }, + "value": { + "$id": "627", + "kind": "string", + "type": { + "$ref": "606" + }, + "value": "virtualMachines" + } + }, + { + "$id": "628", + "parameter": { + "$ref": "601" + }, + "value": { + "$id": "629", + "kind": "string", + "type": { + "$ref": "602" + }, + "value": "exampleRG" + } + }, + { + "$id": "630", + "parameter": { + "$ref": "598" + }, + "value": { + "$id": "631", + "kind": "string", + "type": { + "$ref": "599" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + }, + { + "$id": "632", + "parameter": { + "$ref": "609" + }, + "value": { + "$id": "633", + "kind": "string", + "type": { + "$ref": "610" + }, + "value": "Microsoft-VirtualMachine" + } + } + ], + "responses": [ + { + "$id": "634", + "response": { + "$ref": "616" + }, + "statusCode": 200, + "bodyValue": { + "$id": "635", + "kind": "model", + "type": { + "$ref": "553" + }, + "value": { + "$id": "636", + "name": { + "$id": "637", + "kind": "string", + "type": { + "$id": "638", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "Shutdown-1.0" + }, + "type": { + "$id": "639", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/targets/capabilities" + }, + "id": { + "$id": "640", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0" + }, + "properties": { + "$id": "641", + "kind": "model", + "type": { + "$ref": "555" + }, + "value": { + "$id": "642", + "description": { + "$id": "643", + "kind": "string", + "type": { + "$ref": "561" + }, + "value": "Shutdown an Azure Virtual Machine for a defined period of time." + }, + "parametersSchema": { + "$id": "644", + "kind": "string", + "type": { + "$ref": "563" + }, + "value": "https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0.json" + }, + "publisher": { + "$id": "645", + "kind": "string", + "type": { + "$ref": "557" + }, + "value": "Microsoft" + }, + "targetType": { + "$id": "646", + "kind": "string", + "type": { + "$ref": "559" + }, + "value": "VirtualMachine" + }, + "urn": { + "$id": "647", + "kind": "string", + "type": { + "$ref": "565" + }, + "value": "urn:csci:microsoft:virtualMachine:shutdown/1.0" + } + } + }, + "systemData": { + "$id": "648", + "kind": "model", + "type": { + "$ref": "147" + }, + "value": { + "$id": "649", + "createdAt": { + "$id": "650", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "2020-05-14T05:08:38.4662189Z" + }, + "lastModifiedAt": { + "$id": "651", + "kind": "string", + "type": { + "$ref": "158" + }, + "value": "2020-05-14T05:08:38.4662189Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "652", + "Name": "createOrUpdate", + "ResourceName": "Capability", + "Doc": "Create or update a Capability resource that extends a Target resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "653", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "654", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "655", + "Type": { + "$id": "656", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "657", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "658", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "659", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "660", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "661", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "662", + "Name": "parentProviderNamespace", + "NameInRequest": "parentProviderNamespace", + "Doc": "The parent resource provider namespace.", + "Type": { + "$id": "663", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "664", + "Name": "parentResourceType", + "NameInRequest": "parentResourceType", + "Doc": "The parent resource type.", + "Type": { + "$id": "665", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "666", + "Name": "parentResourceName", + "NameInRequest": "parentResourceName", + "Doc": "The parent resource name.", + "Type": { + "$id": "667", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "668", + "Name": "targetName", + "NameInRequest": "targetName", + "Doc": "String that represents a Target resource name.", + "Type": { + "$id": "669", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "670", + "Name": "capabilityName", + "NameInRequest": "capabilityName", + "Doc": "String that represents a Capability resource name.", + "Type": { + "$id": "671", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "672", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "673", + "kind": "constant", + "valueType": { + "$id": "674", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "675", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "676", + "kind": "constant", + "valueType": { + "$id": "677", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "678", + "Name": "resource", + "NameInRequest": "resource", + "Doc": "Capability resource to be created or updated.", + "Type": { + "$ref": "553" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "679", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "553" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + }, + { + "$id": "680", + "StatusCodes": [ + 201 + ], + "BodyType": { + "$ref": "553" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}/capabilities/{capabilityName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Capabilities.createOrUpdate", + "Decorators": [], + "Examples": [ + { + "$id": "681", + "kind": "http", + "name": "Create/update a Capability that extends a virtual machine Target resource.", + "description": "Create/update a Capability that extends a virtual machine Target resource.", + "filePath": "2024-11-01-preview/Capabilities_CreateOrUpdate.json", + "parameters": [ + { + "$id": "682", + "parameter": { + "$ref": "653" + }, + "value": { + "$id": "683", + "kind": "string", + "type": { + "$ref": "654" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "684", + "parameter": { + "$ref": "678" + }, + "value": { + "$id": "685", + "kind": "model", + "type": { + "$ref": "553" + }, + "value": { + "$id": "686", + "properties": { + "$id": "687", + "kind": "model", + "type": { + "$ref": "555" + }, + "value": { + "$id": "688" + } + } + } + } + }, + { + "$id": "689", + "parameter": { + "$ref": "670" + }, + "value": { + "$id": "690", + "kind": "string", + "type": { + "$ref": "671" + }, + "value": "Shutdown-1.0" + } + }, + { + "$id": "691", + "parameter": { + "$ref": "662" + }, + "value": { + "$id": "692", + "kind": "string", + "type": { + "$ref": "663" + }, + "value": "Microsoft.Compute" + } + }, + { + "$id": "693", + "parameter": { + "$ref": "666" + }, + "value": { + "$id": "694", + "kind": "string", + "type": { + "$ref": "667" + }, + "value": "exampleVM" + } + }, + { + "$id": "695", + "parameter": { + "$ref": "664" + }, + "value": { + "$id": "696", + "kind": "string", + "type": { + "$ref": "665" + }, + "value": "virtualMachines" + } + }, + { + "$id": "697", + "parameter": { + "$ref": "660" + }, + "value": { + "$id": "698", + "kind": "string", + "type": { + "$ref": "661" + }, + "value": "exampleRG" + } + }, + { + "$id": "699", + "parameter": { + "$ref": "657" + }, + "value": { + "$id": "700", + "kind": "string", + "type": { + "$ref": "658" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + }, + { + "$id": "701", + "parameter": { + "$ref": "668" + }, + "value": { + "$id": "702", + "kind": "string", + "type": { + "$ref": "669" + }, + "value": "Microsoft-VirtualMachine" + } + } + ], + "responses": [ + { + "$id": "703", + "response": { + "$ref": "679" + }, + "statusCode": 200, + "bodyValue": { + "$id": "704", + "kind": "model", + "type": { + "$ref": "553" + }, + "value": { + "$id": "705", + "name": { + "$id": "706", + "kind": "string", + "type": { + "$ref": "638" + }, + "value": "Shutdown-1.0" + }, + "type": { + "$id": "707", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/targets/capabilities" + }, + "id": { + "$id": "708", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0" + }, + "properties": { + "$id": "709", + "kind": "model", + "type": { + "$ref": "555" + }, + "value": { + "$id": "710", + "description": { + "$id": "711", + "kind": "string", + "type": { + "$ref": "561" + }, + "value": "Shutdown an Azure Virtual Machine for a defined period of time." + }, + "parametersSchema": { + "$id": "712", + "kind": "string", + "type": { + "$ref": "563" + }, + "value": "https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0.json" + }, + "publisher": { + "$id": "713", + "kind": "string", + "type": { + "$ref": "557" + }, + "value": "Microsoft" + }, + "targetType": { + "$id": "714", + "kind": "string", + "type": { + "$ref": "559" + }, + "value": "VirtualMachine" + }, + "urn": { + "$id": "715", + "kind": "string", + "type": { + "$ref": "565" + }, + "value": "urn:csci:microsoft:virtualMachine:shutdown/1.0" + } + } + }, + "systemData": { + "$id": "716", + "kind": "model", + "type": { + "$ref": "147" + }, + "value": { + "$id": "717", + "createdAt": { + "$id": "718", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "2020-05-14T05:08:38.4662189Z" + }, + "lastModifiedAt": { + "$id": "719", + "kind": "string", + "type": { + "$ref": "158" + }, + "value": "2020-05-14T05:08:38.4662189Z" + } + } + } + } + } + }, + { + "$id": "720", + "response": { + "$ref": "680" + }, + "statusCode": 201, + "bodyValue": { + "$id": "721", + "kind": "model", + "type": { + "$ref": "553" + }, + "value": { + "$id": "722", + "name": { + "$id": "723", + "kind": "string", + "type": { + "$ref": "638" + }, + "value": "Shutdown-1.0" + }, + "type": { + "$id": "724", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/targets/capabilities" + }, + "id": { + "$id": "725", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0" + }, + "properties": { + "$id": "726", + "kind": "model", + "type": { + "$ref": "555" + }, + "value": { + "$id": "727", + "description": { + "$id": "728", + "kind": "string", + "type": { + "$ref": "561" + }, + "value": "Shutdown an Azure Virtual Machine for a defined period of time." + }, + "parametersSchema": { + "$id": "729", + "kind": "string", + "type": { + "$ref": "563" + }, + "value": "https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0.json" + }, + "publisher": { + "$id": "730", + "kind": "string", + "type": { + "$ref": "557" + }, + "value": "Microsoft" + }, + "targetType": { + "$id": "731", + "kind": "string", + "type": { + "$ref": "559" + }, + "value": "VirtualMachine" + }, + "urn": { + "$id": "732", + "kind": "string", + "type": { + "$ref": "565" + }, + "value": "urn:csci:microsoft:virtualMachine:shutdown/1.0" + } + } + }, + "systemData": { + "$id": "733", + "kind": "model", + "type": { + "$ref": "147" + }, + "value": { + "$id": "734", + "createdAt": { + "$id": "735", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "2020-05-14T05:08:38.4662189Z" + }, + "lastModifiedAt": { + "$id": "736", + "kind": "string", + "type": { + "$ref": "158" + }, + "value": "2020-05-14T05:08:38.4662189Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "737", + "Name": "delete", + "ResourceName": "Capability", + "Doc": "Delete a Capability that extends a Target resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "738", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "739", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "740", + "Type": { + "$id": "741", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "742", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "743", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "744", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "745", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "746", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "747", + "Name": "parentProviderNamespace", + "NameInRequest": "parentProviderNamespace", + "Doc": "The parent resource provider namespace.", + "Type": { + "$id": "748", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "749", + "Name": "parentResourceType", + "NameInRequest": "parentResourceType", + "Doc": "The parent resource type.", + "Type": { + "$id": "750", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "751", + "Name": "parentResourceName", + "NameInRequest": "parentResourceName", + "Doc": "The parent resource name.", + "Type": { + "$id": "752", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "753", + "Name": "targetName", + "NameInRequest": "targetName", + "Doc": "String that represents a Target resource name.", + "Type": { + "$id": "754", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "755", + "Name": "capabilityName", + "NameInRequest": "capabilityName", + "Doc": "String that represents a Capability resource name.", + "Type": { + "$id": "756", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "757", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "758", + "kind": "constant", + "valueType": { + "$id": "759", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "760", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + }, + { + "$id": "761", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "DELETE", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}/capabilities/{capabilityName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Capabilities.delete", + "Decorators": [], + "Examples": [ + { + "$id": "762", + "kind": "http", + "name": "Delete a Capability that extends a virtual machine Target resource.", + "description": "Delete a Capability that extends a virtual machine Target resource.", + "filePath": "2024-11-01-preview/Capabilities_Delete.json", + "parameters": [ + { + "$id": "763", + "parameter": { + "$ref": "738" + }, + "value": { + "$id": "764", + "kind": "string", + "type": { + "$ref": "739" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "765", + "parameter": { + "$ref": "755" + }, + "value": { + "$id": "766", + "kind": "string", + "type": { + "$ref": "756" + }, + "value": "Shutdown-1.0" + } + }, + { + "$id": "767", + "parameter": { + "$ref": "747" + }, + "value": { + "$id": "768", + "kind": "string", + "type": { + "$ref": "748" + }, + "value": "Microsoft.Compute" + } + }, + { + "$id": "769", + "parameter": { + "$ref": "751" + }, + "value": { + "$id": "770", + "kind": "string", + "type": { + "$ref": "752" + }, + "value": "exampleVM" + } + }, + { + "$id": "771", + "parameter": { + "$ref": "749" + }, + "value": { + "$id": "772", + "kind": "string", + "type": { + "$ref": "750" + }, + "value": "virtualMachines" + } + }, + { + "$id": "773", + "parameter": { + "$ref": "745" + }, + "value": { + "$id": "774", + "kind": "string", + "type": { + "$ref": "746" + }, + "value": "exampleRG" + } + }, + { + "$id": "775", + "parameter": { + "$ref": "742" + }, + "value": { + "$id": "776", + "kind": "string", + "type": { + "$ref": "743" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + }, + { + "$id": "777", + "parameter": { + "$ref": "753" + }, + "value": { + "$id": "778", + "kind": "string", + "type": { + "$ref": "754" + }, + "value": "Microsoft-VirtualMachine" + } + } + ], + "responses": [ + { + "$id": "779", + "response": { + "$ref": "760" + }, + "statusCode": 200 + }, + { + "$id": "780", + "response": { + "$ref": "761" + }, + "statusCode": 204 + } + ] + } + ] + }, + { + "$id": "781", + "Name": "list", + "ResourceName": "Capability", + "Doc": "Get a list of Capability resources that extend a Target resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "782", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "783", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "784", + "Type": { + "$id": "785", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "786", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "787", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "788", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "789", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "790", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "791", + "Name": "parentProviderNamespace", + "NameInRequest": "parentProviderNamespace", + "Doc": "The parent resource provider namespace.", + "Type": { + "$id": "792", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "793", + "Name": "parentResourceType", + "NameInRequest": "parentResourceType", + "Doc": "The parent resource type.", + "Type": { + "$id": "794", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "795", + "Name": "parentResourceName", + "NameInRequest": "parentResourceName", + "Doc": "The parent resource name.", + "Type": { + "$id": "796", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "797", + "Name": "continuationToken", + "NameInRequest": "continuationToken", + "Doc": "String that sets the continuation token.", + "Type": { + "$id": "798", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "799", + "Name": "targetName", + "NameInRequest": "targetName", + "Doc": "String that represents a Target resource name.", + "Type": { + "$id": "800", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "801", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "802", + "kind": "constant", + "valueType": { + "$id": "803", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "804", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "567" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}/capabilities", + "BufferResponse": true, + "Paging": { + "$id": "805", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Capabilities.list", + "Decorators": [], + "Examples": [ + { + "$id": "806", + "kind": "http", + "name": "List all Capabilities that extend a virtual machine Target resource.", + "description": "List all Capabilities that extend a virtual machine Target resource.", + "filePath": "2024-11-01-preview/Capabilities_List.json", + "parameters": [ + { + "$id": "807", + "parameter": { + "$ref": "782" + }, + "value": { + "$id": "808", + "kind": "string", + "type": { + "$ref": "783" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "809", + "parameter": { + "$ref": "791" + }, + "value": { + "$id": "810", + "kind": "string", + "type": { + "$ref": "792" + }, + "value": "Microsoft.Compute" + } + }, + { + "$id": "811", + "parameter": { + "$ref": "795" + }, + "value": { + "$id": "812", + "kind": "string", + "type": { + "$ref": "796" + }, + "value": "exampleVM" + } + }, + { + "$id": "813", + "parameter": { + "$ref": "793" + }, + "value": { + "$id": "814", + "kind": "string", + "type": { + "$ref": "794" + }, + "value": "virtualMachines" + } + }, + { + "$id": "815", + "parameter": { + "$ref": "789" + }, + "value": { + "$id": "816", + "kind": "string", + "type": { + "$ref": "790" + }, + "value": "exampleRG" + } + }, + { + "$id": "817", + "parameter": { + "$ref": "786" + }, + "value": { + "$id": "818", + "kind": "string", + "type": { + "$ref": "787" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + }, + { + "$id": "819", + "parameter": { + "$ref": "799" + }, + "value": { + "$id": "820", + "kind": "string", + "type": { + "$ref": "800" + }, + "value": "Microsoft-VirtualMachine" + } + } + ], + "responses": [ + { + "$id": "821", + "response": { + "$ref": "804" + }, + "statusCode": 200, + "bodyValue": { + "$id": "822", + "kind": "model", + "type": { + "$ref": "567" + }, + "value": { + "$id": "823", + "nextLink": { + "$id": "824", + "kind": "string", + "type": { + "$ref": "571" + }, + "value": "https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine/capabilities?continuationToken=&api-version=2024-11-01-preview" + }, + "value": { + "$id": "825", + "kind": "array", + "type": { + "$ref": "569" + }, + "value": [ + { + "$id": "826", + "kind": "model", + "type": { + "$ref": "553" + }, + "value": { + "$id": "827", + "name": { + "$id": "828", + "kind": "string", + "type": { + "$ref": "638" + }, + "value": "Shutdown-1.0" + }, + "type": { + "$id": "829", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/targets/capabilities" + }, + "id": { + "$id": "830", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0" + }, + "properties": { + "$id": "831", + "kind": "model", + "type": { + "$ref": "555" + }, + "value": { + "$id": "832", + "description": { + "$id": "833", + "kind": "string", + "type": { + "$ref": "561" + }, + "value": "Shutdown an Azure Virtual Machine for a defined period of time." + }, + "parametersSchema": { + "$id": "834", + "kind": "string", + "type": { + "$ref": "563" + }, + "value": "https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0.json" + }, + "publisher": { + "$id": "835", + "kind": "string", + "type": { + "$ref": "557" + }, + "value": "Microsoft" + }, + "targetType": { + "$id": "836", + "kind": "string", + "type": { + "$ref": "559" + }, + "value": "VirtualMachine" + }, + "urn": { + "$id": "837", + "kind": "string", + "type": { + "$ref": "565" + }, + "value": "urn:csci:microsoft:virtualMachine:shutdown/1.0" + } + } + }, + "systemData": { + "$id": "838", + "kind": "model", + "type": { + "$ref": "147" + }, + "value": { + "$id": "839", + "createdAt": { + "$id": "840", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "2020-05-14T05:08:38.4662189Z" + }, + "lastModifiedAt": { + "$id": "841", + "kind": "string", + "type": { + "$ref": "158" + }, + "value": "2020-05-14T05:08:38.4662189Z" + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "842" + }, + "Parent": "ChaosClient", + "Parameters": [ + { + "$id": "843", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "844", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "845", + "Type": { + "$id": "846", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "847", + "Name": "Operations", + "Operations": [ + { + "$id": "848", + "Name": "list", + "ResourceName": "Operations", + "Doc": "List the operations for the provider", + "Accessibility": "public", + "Parameters": [ + { + "$id": "849", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "850", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "851", + "Type": { + "$id": "852", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "853", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "854", + "kind": "constant", + "valueType": { + "$id": "855", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "856", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "530" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/providers/Microsoft.Chaos/operations", + "BufferResponse": true, + "Paging": { + "$id": "857", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Azure.ResourceManager.Operations.list", + "Decorators": [], + "Examples": [ + { + "$id": "858", + "kind": "http", + "name": "Lists all Chaos Studio operations.", + "description": "Lists all Chaos Studio operations.", + "filePath": "2024-11-01-preview/Operations_List.json", + "parameters": [ + { + "$id": "859", + "parameter": { + "$ref": "849" + }, + "value": { + "$id": "860", + "kind": "string", + "type": { + "$ref": "850" + }, + "value": "2024-11-01-preview" + } + } + ], + "responses": [ + { + "$id": "861", + "response": { + "$ref": "856" + }, + "statusCode": 200, + "bodyValue": { + "$id": "862", + "kind": "model", + "type": { + "$ref": "530" + }, + "value": { + "$id": "863", + "nextLink": { + "$id": "864", + "kind": "string", + "type": { + "$ref": "551" + }, + "value": "https://management.azure.com/providers/Microsoft.Chaos/operations?continuationToken=myContinuationToken&api-version=2024-11-01-preview" + }, + "value": { + "$id": "865", + "kind": "array", + "type": { + "$ref": "532" + }, + "value": [ + { + "$id": "866", + "kind": "model", + "type": { + "$ref": "533" + }, + "value": { + "$id": "867", + "name": { + "$id": "868", + "kind": "string", + "type": { + "$ref": "535" + }, + "value": "Microsoft.Chaos/experiments/read" + }, + "display": { + "$id": "869", + "kind": "model", + "type": { + "$ref": "539" + }, + "value": { + "$id": "870", + "provider": { + "$id": "871", + "kind": "string", + "type": { + "$ref": "541" + }, + "value": "Microsoft Chaos" + }, + "resource": { + "$id": "872", + "kind": "string", + "type": { + "$ref": "543" + }, + "value": "Chaos Experiment" + }, + "operation": { + "$id": "873", + "kind": "string", + "type": { + "$ref": "545" + }, + "value": "Gets all Chaos Experiments." + }, + "description": { + "$id": "874", + "kind": "string", + "type": { + "$ref": "547" + }, + "value": "Gets all Chaos Experiments in a resource group." + } + } + }, + "isDataAction": { + "$id": "875", + "kind": "boolean", + "type": { + "$ref": "537" + }, + "value": false + }, + "origin": { + "$id": "876", + "kind": "string", + "type": { + "$ref": "80" + }, + "value": "user,system" + } + } + } + ] + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "877" + }, + "Parent": "ChaosClient", + "Parameters": [ + { + "$id": "878", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "879", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "880", + "Type": { + "$id": "881", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "882", + "Name": "Targets", + "Operations": [ + { + "$id": "883", + "Name": "get", + "ResourceName": "Target", + "Doc": "Get a Target resource that extends a tracked regional resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "884", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "885", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "886", + "Type": { + "$id": "887", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "888", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "889", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "890", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "891", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "892", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "893", + "Name": "parentProviderNamespace", + "NameInRequest": "parentProviderNamespace", + "Doc": "The parent resource provider namespace.", + "Type": { + "$id": "894", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "895", + "Name": "parentResourceType", + "NameInRequest": "parentResourceType", + "Doc": "The parent resource type.", + "Type": { + "$id": "896", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "897", + "Name": "parentResourceName", + "NameInRequest": "parentResourceName", + "Doc": "The parent resource name.", + "Type": { + "$id": "898", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "899", + "Name": "targetName", + "NameInRequest": "targetName", + "Doc": "String that represents a Target resource name.", + "Type": { + "$id": "900", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "901", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "902", + "kind": "constant", + "valueType": { + "$id": "903", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "904", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "516" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Targets.get", + "Decorators": [], + "Examples": [ + { + "$id": "905", + "kind": "http", + "name": "Get a Target that extends a virtual machine resource.", + "description": "Get a Target that extends a virtual machine resource.", + "filePath": "2024-11-01-preview/Targets_Get.json", + "parameters": [ + { + "$id": "906", + "parameter": { + "$ref": "884" + }, + "value": { + "$id": "907", + "kind": "string", + "type": { + "$ref": "885" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "908", + "parameter": { + "$ref": "893" + }, + "value": { + "$id": "909", + "kind": "string", + "type": { + "$ref": "894" + }, + "value": "Microsoft.Compute" + } + }, + { + "$id": "910", + "parameter": { + "$ref": "897" + }, + "value": { + "$id": "911", + "kind": "string", + "type": { + "$ref": "898" + }, + "value": "exampleVM" + } + }, + { + "$id": "912", + "parameter": { + "$ref": "895" + }, + "value": { + "$id": "913", + "kind": "string", + "type": { + "$ref": "896" + }, + "value": "virtualMachines" + } + }, + { + "$id": "914", + "parameter": { + "$ref": "891" + }, + "value": { + "$id": "915", + "kind": "string", + "type": { + "$ref": "892" + }, + "value": "exampleRG" + } + }, + { + "$id": "916", + "parameter": { + "$ref": "888" + }, + "value": { + "$id": "917", + "kind": "string", + "type": { + "$ref": "889" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + }, + { + "$id": "918", + "parameter": { + "$ref": "899" + }, + "value": { + "$id": "919", + "kind": "string", + "type": { + "$ref": "900" + }, + "value": "Microsoft-Agent" + } + } + ], + "responses": [ + { + "$id": "920", + "response": { + "$ref": "904" + }, + "statusCode": 200, + "bodyValue": { + "$id": "921", + "kind": "model", + "type": { + "$ref": "516" + }, + "value": { + "$id": "922", + "name": { + "$id": "923", + "kind": "string", + "type": { + "$id": "924", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "Microsoft-Agent" + }, + "type": { + "$id": "925", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/targets" + }, + "id": { + "$id": "926", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-Agent" + }, + "location": { + "$id": "927", + "kind": "string", + "type": { + "$ref": "522" + }, + "value": "centraluseuap" + }, + "properties": { + "$id": "928", + "kind": "dict", + "type": { + "$ref": "518" + }, + "value": { + "$id": "929", + "agentProfileId": { + "$id": "930", + "kind": "unknown", + "type": { + "$ref": "520" + }, + "value": "ac4e8251-fdc9-4277-8e87-dc57fe5794cf" + }, + "identities": { + "$id": "931", + "kind": "unknown", + "type": { + "$ref": "520" + }, + "value": [ + { + "$id": "932", + "type": "CertificateSubjectIssuer", + "subject": "CN=example.subject" + } + ] + } + } + }, + "systemData": { + "$id": "933", + "kind": "model", + "type": { + "$ref": "147" + }, + "value": { + "$id": "934", + "createdAt": { + "$id": "935", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedAt": { + "$id": "936", + "kind": "string", + "type": { + "$ref": "158" + }, + "value": "2021-07-01T00:00:00.0Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "937", + "Name": "createOrUpdate", + "ResourceName": "Target", + "Doc": "Create or update a Target resource that extends a tracked regional resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "938", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "939", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "940", + "Type": { + "$id": "941", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "942", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "943", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "944", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "945", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "946", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "947", + "Name": "parentProviderNamespace", + "NameInRequest": "parentProviderNamespace", + "Doc": "The parent resource provider namespace.", + "Type": { + "$id": "948", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "949", + "Name": "parentResourceType", + "NameInRequest": "parentResourceType", + "Doc": "The parent resource type.", + "Type": { + "$id": "950", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "951", + "Name": "parentResourceName", + "NameInRequest": "parentResourceName", + "Doc": "The parent resource name.", + "Type": { + "$id": "952", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "953", + "Name": "targetName", + "NameInRequest": "targetName", + "Doc": "String that represents a Target resource name.", + "Type": { + "$id": "954", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "955", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "956", + "kind": "constant", + "valueType": { + "$id": "957", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "958", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "959", + "kind": "constant", + "valueType": { + "$id": "960", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "961", + "Name": "resource", + "NameInRequest": "resource", + "Doc": "Target resource to be created or updated.", + "Type": { + "$ref": "516" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "962", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "516" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + }, + { + "$id": "963", + "StatusCodes": [ + 201 + ], + "BodyType": { + "$ref": "516" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Targets.createOrUpdate", + "Decorators": [], + "Examples": [ + { + "$id": "964", + "kind": "http", + "name": "Create/update a Target that extends a virtual machine resource.", + "description": "Create/update a Target that extends a virtual machine resource.", + "filePath": "2024-11-01-preview/Targets_CreateOrUpdate.json", + "parameters": [ + { + "$id": "965", + "parameter": { + "$ref": "938" + }, + "value": { + "$id": "966", + "kind": "string", + "type": { + "$ref": "939" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "967", + "parameter": { + "$ref": "947" + }, + "value": { + "$id": "968", + "kind": "string", + "type": { + "$ref": "948" + }, + "value": "Microsoft.Compute" + } + }, + { + "$id": "969", + "parameter": { + "$ref": "951" + }, + "value": { + "$id": "970", + "kind": "string", + "type": { + "$ref": "952" + }, + "value": "exampleVM" + } + }, + { + "$id": "971", + "parameter": { + "$ref": "949" + }, + "value": { + "$id": "972", + "kind": "string", + "type": { + "$ref": "950" + }, + "value": "virtualMachines" + } + }, + { + "$id": "973", + "parameter": { + "$ref": "945" + }, + "value": { + "$id": "974", + "kind": "string", + "type": { + "$ref": "946" + }, + "value": "exampleRG" + } + }, + { + "$id": "975", + "parameter": { + "$ref": "942" + }, + "value": { + "$id": "976", + "kind": "string", + "type": { + "$ref": "943" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + }, + { + "$id": "977", + "parameter": { + "$ref": "961" + }, + "value": { + "$id": "978", + "kind": "model", + "type": { + "$ref": "516" + }, + "value": { + "$id": "979", + "properties": { + "$id": "980", + "kind": "dict", + "type": { + "$ref": "518" + }, + "value": { + "$id": "981" + } + } + } + } + }, + { + "$id": "982", + "parameter": { + "$ref": "953" + }, + "value": { + "$id": "983", + "kind": "string", + "type": { + "$ref": "954" + }, + "value": "Microsoft-VirtualMachine" + } + } + ], + "responses": [ + { + "$id": "984", + "response": { + "$ref": "962" + }, + "statusCode": 200, + "bodyValue": { + "$id": "985", + "kind": "model", + "type": { + "$ref": "516" + }, + "value": { + "$id": "986", + "name": { + "$id": "987", + "kind": "string", + "type": { + "$ref": "924" + }, + "value": "Microsoft-VirtualMachine" + }, + "type": { + "$id": "988", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/targets" + }, + "id": { + "$id": "989", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine" + }, + "properties": { + "$id": "990", + "kind": "dict", + "type": { + "$ref": "518" + }, + "value": { + "$id": "991" + } + }, + "systemData": { + "$id": "992", + "kind": "model", + "type": { + "$ref": "147" + }, + "value": { + "$id": "993", + "createdAt": { + "$id": "994", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedAt": { + "$id": "995", + "kind": "string", + "type": { + "$ref": "158" + }, + "value": "2021-07-01T00:00:00.0Z" + } + } + } + } + } + }, + { + "$id": "996", + "response": { + "$ref": "963" + }, + "statusCode": 201, + "bodyValue": { + "$id": "997", + "kind": "model", + "type": { + "$ref": "516" + }, + "value": { + "$id": "998", + "name": { + "$id": "999", + "kind": "string", + "type": { + "$ref": "924" + }, + "value": "Microsoft-VirtualMachine" + }, + "type": { + "$id": "1000", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/targets" + }, + "id": { + "$id": "1001", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine" + }, + "properties": { + "$id": "1002", + "kind": "dict", + "type": { + "$ref": "518" + }, + "value": { + "$id": "1003" + } + }, + "systemData": { + "$id": "1004", + "kind": "model", + "type": { + "$ref": "147" + }, + "value": { + "$id": "1005", + "createdAt": { + "$id": "1006", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedAt": { + "$id": "1007", + "kind": "string", + "type": { + "$ref": "158" + }, + "value": "2021-07-01T00:00:00.0Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1008", + "Name": "delete", + "ResourceName": "Target", + "Doc": "Delete a Target resource that extends a tracked regional resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1009", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1010", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1011", + "Type": { + "$id": "1012", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1013", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1014", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1015", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1016", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1017", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1018", + "Name": "parentProviderNamespace", + "NameInRequest": "parentProviderNamespace", + "Doc": "The parent resource provider namespace.", + "Type": { + "$id": "1019", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1020", + "Name": "parentResourceType", + "NameInRequest": "parentResourceType", + "Doc": "The parent resource type.", + "Type": { + "$id": "1021", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1022", + "Name": "parentResourceName", + "NameInRequest": "parentResourceName", + "Doc": "The parent resource name.", + "Type": { + "$id": "1023", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1024", + "Name": "targetName", + "NameInRequest": "targetName", + "Doc": "String that represents a Target resource name.", + "Type": { + "$id": "1025", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1026", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1027", + "kind": "constant", + "valueType": { + "$id": "1028", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1029", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + }, + { + "$id": "1030", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "DELETE", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Targets.delete", + "Decorators": [], + "Examples": [ + { + "$id": "1031", + "kind": "http", + "name": "Delete a Target that extends a virtual machine resource.", + "description": "Delete a Target that extends a virtual machine resource.", + "filePath": "2024-11-01-preview/Targets_Delete.json", + "parameters": [ + { + "$id": "1032", + "parameter": { + "$ref": "1009" + }, + "value": { + "$id": "1033", + "kind": "string", + "type": { + "$ref": "1010" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "1034", + "parameter": { + "$ref": "1018" + }, + "value": { + "$id": "1035", + "kind": "string", + "type": { + "$ref": "1019" + }, + "value": "Microsoft.Compute" + } + }, + { + "$id": "1036", + "parameter": { + "$ref": "1022" + }, + "value": { + "$id": "1037", + "kind": "string", + "type": { + "$ref": "1023" + }, + "value": "exampleVM" + } + }, + { + "$id": "1038", + "parameter": { + "$ref": "1020" + }, + "value": { + "$id": "1039", + "kind": "string", + "type": { + "$ref": "1021" + }, + "value": "virtualMachines" + } + }, + { + "$id": "1040", + "parameter": { + "$ref": "1016" + }, + "value": { + "$id": "1041", + "kind": "string", + "type": { + "$ref": "1017" + }, + "value": "exampleRG" + } + }, + { + "$id": "1042", + "parameter": { + "$ref": "1013" + }, + "value": { + "$id": "1043", + "kind": "string", + "type": { + "$ref": "1014" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + }, + { + "$id": "1044", + "parameter": { + "$ref": "1024" + }, + "value": { + "$id": "1045", + "kind": "string", + "type": { + "$ref": "1025" + }, + "value": "Microsoft-Agent" + } + } + ], + "responses": [ + { + "$id": "1046", + "response": { + "$ref": "1029" + }, + "statusCode": 200 + }, + { + "$id": "1047", + "response": { + "$ref": "1030" + }, + "statusCode": 204 + } + ] + } + ] + }, + { + "$id": "1048", + "Name": "list", + "ResourceName": "Target", + "Doc": "Get a list of Target resources that extend a tracked regional resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1049", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1050", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1051", + "Type": { + "$id": "1052", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1053", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1054", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1055", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1056", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1057", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1058", + "Name": "parentProviderNamespace", + "NameInRequest": "parentProviderNamespace", + "Doc": "The parent resource provider namespace.", + "Type": { + "$id": "1059", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1060", + "Name": "parentResourceType", + "NameInRequest": "parentResourceType", + "Doc": "The parent resource type.", + "Type": { + "$id": "1061", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1062", + "Name": "parentResourceName", + "NameInRequest": "parentResourceName", + "Doc": "The parent resource name.", + "Type": { + "$id": "1063", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1064", + "Name": "continuationToken", + "NameInRequest": "continuationToken", + "Doc": "String that sets the continuation token.", + "Type": { + "$id": "1065", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1066", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1067", + "kind": "constant", + "valueType": { + "$id": "1068", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1069", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "524" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets", + "BufferResponse": true, + "Paging": { + "$id": "1070", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Targets.list", + "Decorators": [], + "Examples": [ + { + "$id": "1071", + "kind": "http", + "name": "List all Targets that extend a virtual machine resource.", + "description": "List all Targets that extend a virtual machine resource.", + "filePath": "2024-11-01-preview/Targets_List.json", + "parameters": [ + { + "$id": "1072", + "parameter": { + "$ref": "1049" + }, + "value": { + "$id": "1073", + "kind": "string", + "type": { + "$ref": "1050" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "1074", + "parameter": { + "$ref": "1058" + }, + "value": { + "$id": "1075", + "kind": "string", + "type": { + "$ref": "1059" + }, + "value": "Microsoft.Compute" + } + }, + { + "$id": "1076", + "parameter": { + "$ref": "1062" + }, + "value": { + "$id": "1077", + "kind": "string", + "type": { + "$ref": "1063" + }, + "value": "exampleVM" + } + }, + { + "$id": "1078", + "parameter": { + "$ref": "1060" + }, + "value": { + "$id": "1079", + "kind": "string", + "type": { + "$ref": "1061" + }, + "value": "virtualMachines" + } + }, + { + "$id": "1080", + "parameter": { + "$ref": "1056" + }, + "value": { + "$id": "1081", + "kind": "string", + "type": { + "$ref": "1057" + }, + "value": "exampleRG" + } + }, + { + "$id": "1082", + "parameter": { + "$ref": "1053" + }, + "value": { + "$id": "1083", + "kind": "string", + "type": { + "$ref": "1054" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "1084", + "response": { + "$ref": "1069" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1085", + "kind": "model", + "type": { + "$ref": "524" + }, + "value": { + "$id": "1086", + "nextLink": { + "$id": "1087", + "kind": "string", + "type": { + "$ref": "528" + }, + "value": "https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets?continuationToken=&api-version=2024-11-01-preview" + }, + "value": { + "$id": "1088", + "kind": "array", + "type": { + "$ref": "526" + }, + "value": [ + { + "$id": "1089", + "kind": "model", + "type": { + "$ref": "516" + }, + "value": { + "$id": "1090", + "name": { + "$id": "1091", + "kind": "string", + "type": { + "$ref": "924" + }, + "value": "Microsoft-Agent" + }, + "type": { + "$id": "1092", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/targets" + }, + "id": { + "$id": "1093", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-Agent" + }, + "location": { + "$id": "1094", + "kind": "string", + "type": { + "$ref": "522" + }, + "value": "centraluseuap" + }, + "properties": { + "$id": "1095", + "kind": "dict", + "type": { + "$ref": "518" + }, + "value": { + "$id": "1096", + "agentProfileId": { + "$id": "1097", + "kind": "unknown", + "type": { + "$ref": "520" + }, + "value": "ac4e8251-fdc9-4277-8e87-dc57fe5794cf" + }, + "identities": { + "$id": "1098", + "kind": "unknown", + "type": { + "$ref": "520" + }, + "value": [ + { + "$id": "1099", + "type": "CertificateSubjectIssuer", + "subject": "CN=example.subject" + } + ] + } + } + }, + "systemData": { + "$id": "1100", + "kind": "model", + "type": { + "$ref": "147" + }, + "value": { + "$id": "1101", + "createdAt": { + "$id": "1102", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedAt": { + "$id": "1103", + "kind": "string", + "type": { + "$ref": "158" + }, + "value": "2021-07-01T00:00:00.0Z" + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "1104" + }, + "Parent": "ChaosClient", + "Parameters": [ + { + "$id": "1105", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "1106", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "1107", + "Type": { + "$id": "1108", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "1109", + "Name": "CapabilityTypes", + "Operations": [ + { + "$id": "1110", + "Name": "get", + "ResourceName": "CapabilityType", + "Doc": "Get a Capability Type resource for given Target Type and location.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1111", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1112", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1113", + "Type": { + "$id": "1114", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1115", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1116", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1117", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1118", + "Name": "location", + "NameInRequest": "location", + "Doc": "The name of the Azure region.", + "Type": { + "$id": "1119", + "kind": "string", + "name": "azureLocation", + "crossLanguageDefinitionId": "Azure.Core.azureLocation", + "baseType": { + "$id": "1120", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1121", + "Name": "targetTypeName", + "NameInRequest": "targetTypeName", + "Doc": "String that represents a Target Type resource name.", + "Type": { + "$id": "1122", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1123", + "Name": "capabilityTypeName", + "NameInRequest": "capabilityTypeName", + "Doc": "String that represents a Capability Type resource name.", + "Type": { + "$id": "1124", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1125", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1126", + "kind": "constant", + "valueType": { + "$id": "1127", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1128", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "483" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypes.get", + "Decorators": [], + "Examples": [ + { + "$id": "1129", + "kind": "http", + "name": "Get a Capability Type for a virtual machine Target resource on westus2 location.", + "description": "Get a Capability Type for a virtual machine Target resource on westus2 location.", + "filePath": "2024-11-01-preview/CapabilityTypes_Get.json", + "parameters": [ + { + "$id": "1130", + "parameter": { + "$ref": "1111" + }, + "value": { + "$id": "1131", + "kind": "string", + "type": { + "$ref": "1112" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "1132", + "parameter": { + "$ref": "1123" + }, + "value": { + "$id": "1133", + "kind": "string", + "type": { + "$ref": "1124" + }, + "value": "Shutdown-1.0" + } + }, + { + "$id": "1134", + "parameter": { + "$ref": "1118" + }, + "value": { + "$id": "1135", + "kind": "string", + "type": { + "$ref": "1119" + }, + "value": "westus2" + } + }, + { + "$id": "1136", + "parameter": { + "$ref": "1115" + }, + "value": { + "$id": "1137", + "kind": "string", + "type": { + "$ref": "1116" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + }, + { + "$id": "1138", + "parameter": { + "$ref": "1121" + }, + "value": { + "$id": "1139", + "kind": "string", + "type": { + "$ref": "1122" + }, + "value": "Microsoft-VirtualMachine" + } + } + ], + "responses": [ + { + "$id": "1140", + "response": { + "$ref": "1128" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1141", + "kind": "model", + "type": { + "$ref": "483" + }, + "value": { + "$id": "1142", + "name": { + "$id": "1143", + "kind": "string", + "type": { + "$id": "1144", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "Shutdown-1.0" + }, + "type": { + "$id": "1145", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/locations/targetTypes/capabilityTypes" + }, + "id": { + "$id": "1146", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/providers/Microsoft.Chaos/locations/westus2/targetTypes/Microsoft-VirtualMachine/capabilityTypes/Shutdown-1.0" + }, + "properties": { + "$id": "1147", + "kind": "model", + "type": { + "$ref": "485" + }, + "value": { + "$id": "1148", + "description": { + "$id": "1149", + "kind": "string", + "type": { + "$ref": "493" + }, + "value": "Shutdown an Azure Virtual Machine for a defined period of time." + }, + "displayName": { + "$id": "1150", + "kind": "string", + "type": { + "$ref": "491" + }, + "value": "Shutdown VM" + }, + "kind": { + "$id": "1151", + "kind": "string", + "type": { + "$ref": "499" + }, + "value": "fault" + }, + "parametersSchema": { + "$id": "1152", + "kind": "string", + "type": { + "$ref": "495" + }, + "value": "https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0.json" + }, + "publisher": { + "$id": "1153", + "kind": "string", + "type": { + "$ref": "487" + }, + "value": "Microsoft" + }, + "runtimeProperties": { + "$id": "1154", + "kind": "model", + "type": { + "$ref": "507" + }, + "value": { + "$id": "1155", + "kind": { + "$id": "1156", + "kind": "string", + "type": { + "$ref": "509" + }, + "value": "continuous" + } + } + }, + "targetType": { + "$id": "1157", + "kind": "string", + "type": { + "$ref": "489" + }, + "value": "VirtualMachine" + }, + "urn": { + "$id": "1158", + "kind": "string", + "type": { + "$ref": "497" + }, + "value": "urn:csci:microsoft:virtualMachine:shutdown/1.0" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1159", + "Name": "list", + "ResourceName": "CapabilityType", + "Doc": "Get a list of Capability Type resources for given Target Type and location.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1160", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1161", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1162", + "Type": { + "$id": "1163", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1164", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1165", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1166", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1167", + "Name": "location", + "NameInRequest": "location", + "Doc": "The name of the Azure region.", + "Type": { + "$id": "1168", + "kind": "string", + "name": "azureLocation", + "crossLanguageDefinitionId": "Azure.Core.azureLocation", + "baseType": { + "$id": "1169", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1170", + "Name": "targetTypeName", + "NameInRequest": "targetTypeName", + "Doc": "String that represents a Target Type resource name.", + "Type": { + "$id": "1171", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1172", + "Name": "continuationToken", + "NameInRequest": "continuationToken", + "Doc": "String that sets the continuation token.", + "Type": { + "$id": "1173", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1174", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1175", + "kind": "constant", + "valueType": { + "$id": "1176", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1177", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "510" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName}/capabilityTypes", + "BufferResponse": true, + "Paging": { + "$id": "1178", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.CapabilityTypes.list", + "Decorators": [], + "Examples": [ + { + "$id": "1179", + "kind": "http", + "name": "List all Capability Types for a virtual machine Target resource on westus2 location.", + "description": "List all Capability Types for a virtual machine Target resource on westus2 location.", + "filePath": "2024-11-01-preview/CapabilityTypes_List.json", + "parameters": [ + { + "$id": "1180", + "parameter": { + "$ref": "1160" + }, + "value": { + "$id": "1181", + "kind": "string", + "type": { + "$ref": "1161" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "1182", + "parameter": { + "$ref": "1167" + }, + "value": { + "$id": "1183", + "kind": "string", + "type": { + "$ref": "1168" + }, + "value": "westus2" + } + }, + { + "$id": "1184", + "parameter": { + "$ref": "1164" + }, + "value": { + "$id": "1185", + "kind": "string", + "type": { + "$ref": "1165" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + }, + { + "$id": "1186", + "parameter": { + "$ref": "1170" + }, + "value": { + "$id": "1187", + "kind": "string", + "type": { + "$ref": "1171" + }, + "value": "Microsoft-VirtualMachine" + } + } + ], + "responses": [ + { + "$id": "1188", + "response": { + "$ref": "1177" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1189", + "kind": "model", + "type": { + "$ref": "510" + }, + "value": { + "$id": "1190", + "nextLink": { + "$id": "1191", + "kind": "string", + "type": { + "$ref": "514" + }, + "value": "https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/providers/Microsoft.Chaos/locations/westus2/targetTypes/Microsoft-VirtualMachine/capabilityTypes?continuationToken=&api-version=2024-11-01-preview" + }, + "value": { + "$id": "1192", + "kind": "array", + "type": { + "$ref": "512" + }, + "value": [ + { + "$id": "1193", + "kind": "model", + "type": { + "$ref": "483" + }, + "value": { + "$id": "1194", + "name": { + "$id": "1195", + "kind": "string", + "type": { + "$ref": "1144" + }, + "value": "Shutdown-1.0" + }, + "type": { + "$id": "1196", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/locations/targetTypes/capabilityTypes" + }, + "id": { + "$id": "1197", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/providers/Microsoft.Chaos/locations/westus2/targetTypes/Microsoft-VirtualMachine/capabilityTypes/Shutdown-1.0" + }, + "properties": { + "$id": "1198", + "kind": "model", + "type": { + "$ref": "485" + }, + "value": { + "$id": "1199", + "description": { + "$id": "1200", + "kind": "string", + "type": { + "$ref": "493" + }, + "value": "Shutdown an Azure Virtual Machine for a defined period of time." + }, + "displayName": { + "$id": "1201", + "kind": "string", + "type": { + "$ref": "491" + }, + "value": "Shutdown VM" + }, + "kind": { + "$id": "1202", + "kind": "string", + "type": { + "$ref": "499" + }, + "value": "fault" + }, + "parametersSchema": { + "$id": "1203", + "kind": "string", + "type": { + "$ref": "495" + }, + "value": "https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine/capabilities/Shutdown-1.0.json" + }, + "publisher": { + "$id": "1204", + "kind": "string", + "type": { + "$ref": "487" + }, + "value": "Microsoft" + }, + "runtimeProperties": { + "$id": "1205", + "kind": "model", + "type": { + "$ref": "507" + }, + "value": { + "$id": "1206", + "kind": { + "$id": "1207", + "kind": "string", + "type": { + "$ref": "509" + }, + "value": "continuous" + } + } + }, + "targetType": { + "$id": "1208", + "kind": "string", + "type": { + "$ref": "489" + }, + "value": "VirtualMachine" + }, + "urn": { + "$id": "1209", + "kind": "string", + "type": { + "$ref": "497" + }, + "value": "urn:csci:microsoft:virtualMachine:shutdown/1.0" + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "1210" + }, + "Parent": "ChaosClient", + "Parameters": [ + { + "$id": "1211", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "1212", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "1213", + "Type": { + "$id": "1214", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "1215", + "Name": "Experiments", + "Operations": [ + { + "$id": "1216", + "Name": "get", + "ResourceName": "Experiment", + "Doc": "Get a Experiment resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1217", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1218", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1219", + "Type": { + "$id": "1220", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1221", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1222", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1223", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1224", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1225", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1226", + "Name": "experimentName", + "NameInRequest": "experimentName", + "Doc": "String that represents a Experiment resource name.", + "Type": { + "$id": "1227", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1228", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1229", + "kind": "constant", + "valueType": { + "$id": "1230", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1231", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "352" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Experiments.get", + "Decorators": [], + "Examples": [ + { + "$id": "1232", + "kind": "http", + "name": "Get a Experiment in a resource group.", + "description": "Get a Experiment in a resource group.", + "filePath": "2024-11-01-preview/Experiments_Get.json", + "parameters": [ + { + "$id": "1233", + "parameter": { + "$ref": "1217" + }, + "value": { + "$id": "1234", + "kind": "string", + "type": { + "$ref": "1218" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "1235", + "parameter": { + "$ref": "1226" + }, + "value": { + "$id": "1236", + "kind": "string", + "type": { + "$ref": "1227" + }, + "value": "exampleExperiment" + } + }, + { + "$id": "1237", + "parameter": { + "$ref": "1224" + }, + "value": { + "$id": "1238", + "kind": "string", + "type": { + "$ref": "1225" + }, + "value": "exampleRG" + } + }, + { + "$id": "1239", + "parameter": { + "$ref": "1221" + }, + "value": { + "$id": "1240", + "kind": "string", + "type": { + "$ref": "1222" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "1241", + "response": { + "$ref": "1231" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1242", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1243", + "name": { + "$id": "1244", + "kind": "string", + "type": { + "$id": "1245", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "exampleExperiment" + }, + "type": { + "$id": "1246", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/experiments" + }, + "id": { + "$id": "1247", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment" + }, + "identity": { + "$id": "1248", + "kind": "model", + "type": { + "$ref": "354" + }, + "value": { + "$id": "1249", + "type": { + "$id": "1250", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "SystemAssigned" + }, + "principalId": { + "$id": "1251", + "kind": "string", + "type": { + "$ref": "356" + }, + "value": "d04ab567-2c07-43ef-a7f4-4527626b7f56" + }, + "tenantId": { + "$id": "1252", + "kind": "string", + "type": { + "$ref": "359" + }, + "value": "8c3e2fb2-fe7a-4bf1-b779-d73990782fe6" + } + } + }, + "location": { + "$id": "1253", + "kind": "string", + "type": { + "$ref": "221" + }, + "value": "centraluseuap" + }, + "properties": { + "$id": "1254", + "kind": "model", + "type": { + "$ref": "374" + }, + "value": { + "$id": "1255", + "customerDataStorage": { + "$id": "1256", + "kind": "model", + "type": { + "$ref": "465" + }, + "value": { + "$id": "1257", + "blobContainerName": { + "$id": "1258", + "kind": "string", + "type": { + "$ref": "470" + }, + "value": "azurechaosstudioexperiments" + }, + "storageAccountResourceId": { + "$id": "1259", + "kind": "string", + "type": { + "$ref": "467" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/exampleRG/providers/Microsoft.Storage/storageAccounts/exampleStorage" + } + } + }, + "selectors": { + "$id": "1260", + "kind": "array", + "type": { + "$ref": "425" + }, + "value": [ + { + "$id": "1261", + "kind": "model", + "type": { + "$ref": "444" + }, + "value": { + "$id": "1262", + "type": { + "$id": "1263", + "kind": "string", + "type": { + "$ref": "453" + }, + "value": "List" + }, + "id": { + "$id": "1264", + "kind": "string", + "type": { + "$ref": "429" + }, + "value": "selector1" + }, + "targets": { + "$id": "1265", + "kind": "array", + "type": { + "$ref": "446" + }, + "value": [ + { + "$id": "1266", + "kind": "model", + "type": { + "$ref": "447" + }, + "value": { + "$id": "1267", + "type": { + "$id": "1268", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "ChaosTarget" + }, + "id": { + "$id": "1269", + "kind": "string", + "type": { + "$ref": "450" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine" + } + } + } + ] + } + } + } + ] + }, + "steps": { + "$id": "1270", + "kind": "array", + "type": { + "$ref": "377" + }, + "value": [ + { + "$id": "1271", + "kind": "model", + "type": { + "$ref": "378" + }, + "value": { + "$id": "1272", + "name": { + "$id": "1273", + "kind": "string", + "type": { + "$ref": "380" + }, + "value": "step1" + }, + "branches": { + "$id": "1274", + "kind": "array", + "type": { + "$ref": "382" + }, + "value": [ + { + "$id": "1275", + "kind": "model", + "type": { + "$ref": "383" + }, + "value": { + "$id": "1276", + "name": { + "$id": "1277", + "kind": "string", + "type": { + "$ref": "385" + }, + "value": "branch1" + }, + "actions": { + "$id": "1278", + "kind": "array", + "type": { + "$ref": "387" + }, + "value": [ + { + "$id": "1279", + "kind": "model", + "type": { + "$ref": "393" + }, + "value": { + "$id": "1280", + "name": { + "$id": "1281", + "kind": "string", + "type": { + "$ref": "391" + }, + "value": "urn:csci:provider:providername:Shutdown/1.0" + }, + "type": { + "$id": "1282", + "kind": "string", + "type": { + "$ref": "407" + }, + "value": "continuous" + }, + "duration": { + "$id": "1283", + "kind": "string", + "type": { + "$ref": "395" + }, + "value": "PT10M" + }, + "parameters": { + "$id": "1284", + "kind": "array", + "type": { + "$ref": "398" + }, + "value": [ + { + "$id": "1285", + "kind": "model", + "type": { + "$ref": "399" + }, + "value": { + "$id": "1286", + "key": { + "$id": "1287", + "kind": "string", + "type": { + "$ref": "401" + }, + "value": "abruptShutdown" + }, + "value": { + "$id": "1288", + "kind": "string", + "type": { + "$ref": "403" + }, + "value": "false" + } + } + } + ] + }, + "selectorId": { + "$id": "1289", + "kind": "string", + "type": { + "$ref": "405" + }, + "value": "selector1" + } + } + } + ] + } + } + } + ] + } + } + } + ] + } + } + }, + "systemData": { + "$id": "1290", + "kind": "model", + "type": { + "$ref": "147" + }, + "value": { + "$id": "1291", + "createdAt": { + "$id": "1292", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "createdBy": { + "$id": "1293", + "kind": "string", + "type": { + "$ref": "149" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1294", + "kind": "string", + "type": { + "$ref": "158" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedBy": { + "$id": "1295", + "kind": "string", + "type": { + "$ref": "155" + }, + "value": "User" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1296", + "Name": "createOrUpdate", + "ResourceName": "Experiment", + "Doc": "Create or update a Experiment resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1297", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1298", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1299", + "Type": { + "$id": "1300", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1301", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1302", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1303", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1304", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1305", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1306", + "Name": "experimentName", + "NameInRequest": "experimentName", + "Doc": "String that represents a Experiment resource name.", + "Type": { + "$id": "1307", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1308", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "1309", + "kind": "constant", + "valueType": { + "$id": "1310", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1311", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1312", + "kind": "constant", + "valueType": { + "$id": "1313", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1314", + "Name": "resource", + "NameInRequest": "resource", + "Doc": "Experiment resource to be created or updated.", + "Type": { + "$ref": "352" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1315", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "352" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + }, + { + "$id": "1316", + "StatusCodes": [ + 201 + ], + "BodyType": { + "$ref": "352" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "1317", + "Name": "azureAsyncOperation", + "NameInResponse": "Azure-AsyncOperation", + "Doc": "A link to the status monitor", + "Type": { + "$id": "1318", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1319", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "1320", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "1321", + "FinalStateVia": 0, + "FinalResponse": { + "$id": "1322", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "352" + }, + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Experiments.createOrUpdate", + "Decorators": [], + "Examples": [ + { + "$id": "1323", + "kind": "http", + "name": "Create/update a Experiment in a resource group.", + "description": "Create/update a Experiment in a resource group.", + "filePath": "2024-11-01-preview/Experiments_CreateOrUpdate.json", + "parameters": [ + { + "$id": "1324", + "parameter": { + "$ref": "1297" + }, + "value": { + "$id": "1325", + "kind": "string", + "type": { + "$ref": "1298" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "1326", + "parameter": { + "$ref": "1314" + }, + "value": { + "$id": "1327", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1328", + "identity": { + "$id": "1329", + "kind": "model", + "type": { + "$ref": "354" + }, + "value": { + "$id": "1330", + "type": { + "$id": "1331", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "SystemAssigned" + } + } + }, + "tags": { + "$id": "1332", + "kind": "dict", + "type": { + "$ref": "217" + }, + "value": { + "$id": "1333", + "key7131": { + "$id": "1334", + "kind": "string", + "type": { + "$ref": "219" + }, + "value": "ryohwcoiccwsnewjigfmijz" + }, + "key2138": { + "$id": "1335", + "kind": "string", + "type": { + "$ref": "219" + }, + "value": "fjaeecgnvqd" + } + } + }, + "location": { + "$id": "1336", + "kind": "string", + "type": { + "$ref": "221" + }, + "value": "eastus2euap" + }, + "properties": { + "$id": "1337", + "kind": "model", + "type": { + "$ref": "374" + }, + "value": { + "$id": "1338", + "customerDataStorage": { + "$id": "1339", + "kind": "model", + "type": { + "$ref": "465" + }, + "value": { + "$id": "1340", + "blobContainerName": { + "$id": "1341", + "kind": "string", + "type": { + "$ref": "470" + }, + "value": "azurechaosstudioexperiments" + }, + "storageAccountResourceId": { + "$id": "1342", + "kind": "string", + "type": { + "$ref": "467" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/exampleRG/providers/Microsoft.Storage/storageAccounts/exampleStorage" + } + } + }, + "selectors": { + "$id": "1343", + "kind": "array", + "type": { + "$ref": "425" + }, + "value": [ + { + "$id": "1344", + "kind": "model", + "type": { + "$ref": "444" + }, + "value": { + "$id": "1345", + "type": { + "$id": "1346", + "kind": "string", + "type": { + "$ref": "453" + }, + "value": "List" + }, + "id": { + "$id": "1347", + "kind": "string", + "type": { + "$ref": "429" + }, + "value": "selector1" + }, + "targets": { + "$id": "1348", + "kind": "array", + "type": { + "$ref": "446" + }, + "value": [ + { + "$id": "1349", + "kind": "model", + "type": { + "$ref": "447" + }, + "value": { + "$id": "1350", + "type": { + "$id": "1351", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "ChaosTarget" + }, + "id": { + "$id": "1352", + "kind": "string", + "type": { + "$ref": "450" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine" + } + } + } + ] + } + } + } + ] + }, + "steps": { + "$id": "1353", + "kind": "array", + "type": { + "$ref": "377" + }, + "value": [ + { + "$id": "1354", + "kind": "model", + "type": { + "$ref": "378" + }, + "value": { + "$id": "1355", + "name": { + "$id": "1356", + "kind": "string", + "type": { + "$ref": "380" + }, + "value": "step1" + }, + "branches": { + "$id": "1357", + "kind": "array", + "type": { + "$ref": "382" + }, + "value": [ + { + "$id": "1358", + "kind": "model", + "type": { + "$ref": "383" + }, + "value": { + "$id": "1359", + "name": { + "$id": "1360", + "kind": "string", + "type": { + "$ref": "385" + }, + "value": "branch1" + }, + "actions": { + "$id": "1361", + "kind": "array", + "type": { + "$ref": "387" + }, + "value": [ + { + "$id": "1362", + "kind": "model", + "type": { + "$ref": "393" + }, + "value": { + "$id": "1363", + "name": { + "$id": "1364", + "kind": "string", + "type": { + "$ref": "391" + }, + "value": "urn:csci:microsoft:virtualMachine:shutdown/1.0" + }, + "type": { + "$id": "1365", + "kind": "string", + "type": { + "$ref": "407" + }, + "value": "continuous" + }, + "duration": { + "$id": "1366", + "kind": "string", + "type": { + "$ref": "395" + }, + "value": "PT10M" + }, + "parameters": { + "$id": "1367", + "kind": "array", + "type": { + "$ref": "398" + }, + "value": [ + { + "$id": "1368", + "kind": "model", + "type": { + "$ref": "399" + }, + "value": { + "$id": "1369", + "key": { + "$id": "1370", + "kind": "string", + "type": { + "$ref": "401" + }, + "value": "abruptShutdown" + }, + "value": { + "$id": "1371", + "kind": "string", + "type": { + "$ref": "403" + }, + "value": "false" + } + } + } + ] + }, + "selectorId": { + "$id": "1372", + "kind": "string", + "type": { + "$ref": "405" + }, + "value": "selector1" + } + } + } + ] + } + } + } + ] + } + } + } + ] + } + } + } + } + } + }, + { + "$id": "1373", + "parameter": { + "$ref": "1306" + }, + "value": { + "$id": "1374", + "kind": "string", + "type": { + "$ref": "1307" + }, + "value": "exampleExperiment" + } + }, + { + "$id": "1375", + "parameter": { + "$ref": "1304" + }, + "value": { + "$id": "1376", + "kind": "string", + "type": { + "$ref": "1305" + }, + "value": "exampleRG" + } + }, + { + "$id": "1377", + "parameter": { + "$ref": "1301" + }, + "value": { + "$id": "1378", + "kind": "string", + "type": { + "$ref": "1302" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "1379", + "response": { + "$ref": "1315" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1380", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1381", + "name": { + "$id": "1382", + "kind": "string", + "type": { + "$ref": "1245" + }, + "value": "exampleExperiment" + }, + "type": { + "$id": "1383", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/experiments" + }, + "id": { + "$id": "1384", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment" + }, + "identity": { + "$id": "1385", + "kind": "model", + "type": { + "$ref": "354" + }, + "value": { + "$id": "1386", + "type": { + "$id": "1387", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "SystemAssigned" + }, + "principalId": { + "$id": "1388", + "kind": "string", + "type": { + "$ref": "356" + }, + "value": "d04ab567-2c07-43ef-a7f4-4527626b7f56" + }, + "tenantId": { + "$id": "1389", + "kind": "string", + "type": { + "$ref": "359" + }, + "value": "8c3e2fb2-fe7a-4bf1-b779-d73990782fe6" + } + } + }, + "tags": { + "$id": "1390", + "kind": "dict", + "type": { + "$ref": "217" + }, + "value": { + "$id": "1391", + "key7131": { + "$id": "1392", + "kind": "string", + "type": { + "$ref": "219" + }, + "value": "ryohwcoiccwsnewjigfmijz" + }, + "key2138": { + "$id": "1393", + "kind": "string", + "type": { + "$ref": "219" + }, + "value": "fjaeecgnvqd" + } + } + }, + "location": { + "$id": "1394", + "kind": "string", + "type": { + "$ref": "221" + }, + "value": "eastus2euap" + }, + "properties": { + "$id": "1395", + "kind": "model", + "type": { + "$ref": "374" + }, + "value": { + "$id": "1396", + "customerDataStorage": { + "$id": "1397", + "kind": "model", + "type": { + "$ref": "465" + }, + "value": { + "$id": "1398", + "blobContainerName": { + "$id": "1399", + "kind": "string", + "type": { + "$ref": "470" + }, + "value": "azurechaosstudioexperiments" + }, + "storageAccountResourceId": { + "$id": "1400", + "kind": "string", + "type": { + "$ref": "467" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/exampleRG/providers/Microsoft.Storage/storageAccounts/exampleStorage" + } + } + }, + "provisioningState": { + "$id": "1401", + "kind": "string", + "type": { + "$ref": "20" + }, + "value": "Updating" + }, + "selectors": { + "$id": "1402", + "kind": "array", + "type": { + "$ref": "425" + }, + "value": [ + { + "$id": "1403", + "kind": "model", + "type": { + "$ref": "444" + }, + "value": { + "$id": "1404", + "type": { + "$id": "1405", + "kind": "string", + "type": { + "$ref": "453" + }, + "value": "List" + }, + "id": { + "$id": "1406", + "kind": "string", + "type": { + "$ref": "429" + }, + "value": "selector1" + }, + "targets": { + "$id": "1407", + "kind": "array", + "type": { + "$ref": "446" + }, + "value": [ + { + "$id": "1408", + "kind": "model", + "type": { + "$ref": "447" + }, + "value": { + "$id": "1409", + "type": { + "$id": "1410", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "ChaosTarget" + }, + "id": { + "$id": "1411", + "kind": "string", + "type": { + "$ref": "450" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine" + } + } + } + ] + } + } + } + ] + }, + "steps": { + "$id": "1412", + "kind": "array", + "type": { + "$ref": "377" + }, + "value": [ + { + "$id": "1413", + "kind": "model", + "type": { + "$ref": "378" + }, + "value": { + "$id": "1414", + "name": { + "$id": "1415", + "kind": "string", + "type": { + "$ref": "380" + }, + "value": "step1" + }, + "branches": { + "$id": "1416", + "kind": "array", + "type": { + "$ref": "382" + }, + "value": [ + { + "$id": "1417", + "kind": "model", + "type": { + "$ref": "383" + }, + "value": { + "$id": "1418", + "name": { + "$id": "1419", + "kind": "string", + "type": { + "$ref": "385" + }, + "value": "branch1" + }, + "actions": { + "$id": "1420", + "kind": "array", + "type": { + "$ref": "387" + }, + "value": [ + { + "$id": "1421", + "kind": "model", + "type": { + "$ref": "393" + }, + "value": { + "$id": "1422", + "name": { + "$id": "1423", + "kind": "string", + "type": { + "$ref": "391" + }, + "value": "urn:csci:microsoft:virtualMachine:shutdown/1.0" + }, + "type": { + "$id": "1424", + "kind": "string", + "type": { + "$ref": "407" + }, + "value": "continuous" + }, + "duration": { + "$id": "1425", + "kind": "string", + "type": { + "$ref": "395" + }, + "value": "PT10M" + }, + "parameters": { + "$id": "1426", + "kind": "array", + "type": { + "$ref": "398" + }, + "value": [ + { + "$id": "1427", + "kind": "model", + "type": { + "$ref": "399" + }, + "value": { + "$id": "1428", + "key": { + "$id": "1429", + "kind": "string", + "type": { + "$ref": "401" + }, + "value": "abruptShutdown" + }, + "value": { + "$id": "1430", + "kind": "string", + "type": { + "$ref": "403" + }, + "value": "false" + } + } + } + ] + }, + "selectorId": { + "$id": "1431", + "kind": "string", + "type": { + "$ref": "405" + }, + "value": "selector1" + } + } + } + ] + } + } + } + ] + } + } + } + ] + } + } + }, + "systemData": { + "$id": "1432", + "kind": "model", + "type": { + "$ref": "147" + }, + "value": { + "$id": "1433", + "createdAt": { + "$id": "1434", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "createdBy": { + "$id": "1435", + "kind": "string", + "type": { + "$ref": "149" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1436", + "kind": "string", + "type": { + "$ref": "158" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedBy": { + "$id": "1437", + "kind": "string", + "type": { + "$ref": "155" + }, + "value": "User" + } + } + } + } + } + }, + { + "$id": "1438", + "response": { + "$ref": "1316" + }, + "statusCode": 201, + "bodyValue": { + "$id": "1439", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1440", + "name": { + "$id": "1441", + "kind": "string", + "type": { + "$ref": "1245" + }, + "value": "exampleExperiment" + }, + "type": { + "$id": "1442", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/experiments" + }, + "id": { + "$id": "1443", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment" + }, + "identity": { + "$id": "1444", + "kind": "model", + "type": { + "$ref": "354" + }, + "value": { + "$id": "1445", + "type": { + "$id": "1446", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "SystemAssigned" + }, + "principalId": { + "$id": "1447", + "kind": "string", + "type": { + "$ref": "356" + }, + "value": "d04ab567-2c07-43ef-a7f4-4527626b7f56" + }, + "tenantId": { + "$id": "1448", + "kind": "string", + "type": { + "$ref": "359" + }, + "value": "8c3e2fb2-fe7a-4bf1-b779-d73990782fe6" + } + } + }, + "tags": { + "$id": "1449", + "kind": "dict", + "type": { + "$ref": "217" + }, + "value": { + "$id": "1450", + "key7131": { + "$id": "1451", + "kind": "string", + "type": { + "$ref": "219" + }, + "value": "ryohwcoiccwsnewjigfmijz" + }, + "key2138": { + "$id": "1452", + "kind": "string", + "type": { + "$ref": "219" + }, + "value": "fjaeecgnvqd" + } + } + }, + "location": { + "$id": "1453", + "kind": "string", + "type": { + "$ref": "221" + }, + "value": "eastus2euap" + }, + "properties": { + "$id": "1454", + "kind": "model", + "type": { + "$ref": "374" + }, + "value": { + "$id": "1455", + "customerDataStorage": { + "$id": "1456", + "kind": "model", + "type": { + "$ref": "465" + }, + "value": { + "$id": "1457", + "blobContainerName": { + "$id": "1458", + "kind": "string", + "type": { + "$ref": "470" + }, + "value": "azurechaosstudioexperiments" + }, + "storageAccountResourceId": { + "$id": "1459", + "kind": "string", + "type": { + "$ref": "467" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/exampleRG/providers/Microsoft.Storage/storageAccounts/exampleStorage" + } + } + }, + "provisioningState": { + "$id": "1460", + "kind": "string", + "type": { + "$ref": "20" + }, + "value": "Creating" + }, + "selectors": { + "$id": "1461", + "kind": "array", + "type": { + "$ref": "425" + }, + "value": [ + { + "$id": "1462", + "kind": "model", + "type": { + "$ref": "444" + }, + "value": { + "$id": "1463", + "type": { + "$id": "1464", + "kind": "string", + "type": { + "$ref": "453" + }, + "value": "List" + }, + "id": { + "$id": "1465", + "kind": "string", + "type": { + "$ref": "429" + }, + "value": "selector1" + }, + "targets": { + "$id": "1466", + "kind": "array", + "type": { + "$ref": "446" + }, + "value": [ + { + "$id": "1467", + "kind": "model", + "type": { + "$ref": "447" + }, + "value": { + "$id": "1468", + "type": { + "$id": "1469", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "ChaosTarget" + }, + "id": { + "$id": "1470", + "kind": "string", + "type": { + "$ref": "450" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine" + } + } + } + ] + } + } + } + ] + }, + "steps": { + "$id": "1471", + "kind": "array", + "type": { + "$ref": "377" + }, + "value": [ + { + "$id": "1472", + "kind": "model", + "type": { + "$ref": "378" + }, + "value": { + "$id": "1473", + "name": { + "$id": "1474", + "kind": "string", + "type": { + "$ref": "380" + }, + "value": "step1" + }, + "branches": { + "$id": "1475", + "kind": "array", + "type": { + "$ref": "382" + }, + "value": [ + { + "$id": "1476", + "kind": "model", + "type": { + "$ref": "383" + }, + "value": { + "$id": "1477", + "name": { + "$id": "1478", + "kind": "string", + "type": { + "$ref": "385" + }, + "value": "branch1" + }, + "actions": { + "$id": "1479", + "kind": "array", + "type": { + "$ref": "387" + }, + "value": [ + { + "$id": "1480", + "kind": "model", + "type": { + "$ref": "393" + }, + "value": { + "$id": "1481", + "name": { + "$id": "1482", + "kind": "string", + "type": { + "$ref": "391" + }, + "value": "urn:csci:microsoft:virtualMachine:shutdown/1.0" + }, + "type": { + "$id": "1483", + "kind": "string", + "type": { + "$ref": "407" + }, + "value": "continuous" + }, + "duration": { + "$id": "1484", + "kind": "string", + "type": { + "$ref": "395" + }, + "value": "PT10M" + }, + "parameters": { + "$id": "1485", + "kind": "array", + "type": { + "$ref": "398" + }, + "value": [ + { + "$id": "1486", + "kind": "model", + "type": { + "$ref": "399" + }, + "value": { + "$id": "1487", + "key": { + "$id": "1488", + "kind": "string", + "type": { + "$ref": "401" + }, + "value": "abruptShutdown" + }, + "value": { + "$id": "1489", + "kind": "string", + "type": { + "$ref": "403" + }, + "value": "false" + } + } + } + ] + }, + "selectorId": { + "$id": "1490", + "kind": "string", + "type": { + "$ref": "405" + }, + "value": "selector1" + } + } + } + ] + } + } + } + ] + } + } + } + ] + } + } + }, + "systemData": { + "$id": "1491", + "kind": "model", + "type": { + "$ref": "147" + }, + "value": { + "$id": "1492", + "createdAt": { + "$id": "1493", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "createdBy": { + "$id": "1494", + "kind": "string", + "type": { + "$ref": "149" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1495", + "kind": "string", + "type": { + "$ref": "158" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedBy": { + "$id": "1496", + "kind": "string", + "type": { + "$ref": "155" + }, + "value": "User" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1497", + "Name": "update", + "ResourceName": "Experiment", + "Doc": "The operation to update an experiment.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1498", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1499", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1500", + "Type": { + "$id": "1501", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1502", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1503", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1504", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1505", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1506", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1507", + "Name": "experimentName", + "NameInRequest": "experimentName", + "Doc": "String that represents a Experiment resource name.", + "Type": { + "$id": "1508", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1509", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "1510", + "kind": "constant", + "valueType": { + "$id": "1511", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1512", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1513", + "kind": "constant", + "valueType": { + "$id": "1514", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1515", + "Name": "properties", + "NameInRequest": "properties", + "Doc": "Parameters supplied to the Update experiment operation.", + "Type": { + "$ref": "471" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1516", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "352" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + }, + { + "$id": "1517", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "1518", + "Name": "location", + "NameInResponse": "Location", + "Doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "Type": { + "$id": "1519", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1520", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "1521", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "1522", + "FinalStateVia": 1, + "FinalResponse": { + "$id": "1523", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "352" + }, + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Experiments.update", + "Decorators": [], + "Examples": [ + { + "$id": "1524", + "kind": "http", + "name": "Update an Experiment in a resource group.", + "description": "Update an Experiment in a resource group.", + "filePath": "2024-11-01-preview/Experiments_Update.json", + "parameters": [ + { + "$id": "1525", + "parameter": { + "$ref": "1498" + }, + "value": { + "$id": "1526", + "kind": "string", + "type": { + "$ref": "1499" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "1527", + "parameter": { + "$ref": "1515" + }, + "value": { + "$id": "1528", + "kind": "model", + "type": { + "$ref": "471" + }, + "value": { + "$id": "1529", + "identity": { + "$id": "1530", + "kind": "model", + "type": { + "$ref": "354" + }, + "value": { + "$id": "1531", + "type": { + "$id": "1532", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "UserAssigned" + }, + "userAssignedIdentities": { + "$id": "1533", + "kind": "dict", + "type": { + "$ref": "363" + }, + "value": { + "$id": "1534", + "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.ManagedIdentity/userAssignedIdentity/exampleUMI": { + "$id": "1535", + "kind": "model", + "type": { + "$ref": "366" + }, + "value": { + "$id": "1536" + } + } + } + } + } + }, + "tags": { + "$id": "1537", + "kind": "dict", + "type": { + "$ref": "473" + }, + "value": { + "$id": "1538", + "key1": { + "$id": "1539", + "kind": "string", + "type": { + "$ref": "475" + }, + "value": "value1" + }, + "key2": { + "$id": "1540", + "kind": "string", + "type": { + "$ref": "475" + }, + "value": "value2" + } + } + } + } + } + }, + { + "$id": "1541", + "parameter": { + "$ref": "1507" + }, + "value": { + "$id": "1542", + "kind": "string", + "type": { + "$ref": "1508" + }, + "value": "exampleExperiment" + } + }, + { + "$id": "1543", + "parameter": { + "$ref": "1505" + }, + "value": { + "$id": "1544", + "kind": "string", + "type": { + "$ref": "1506" + }, + "value": "exampleRG" + } + }, + { + "$id": "1545", + "parameter": { + "$ref": "1502" + }, + "value": { + "$id": "1546", + "kind": "string", + "type": { + "$ref": "1503" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "1547", + "response": { + "$ref": "1516" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1548", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1549", + "name": { + "$id": "1550", + "kind": "string", + "type": { + "$ref": "1245" + }, + "value": "exampleExperiment" + }, + "type": { + "$id": "1551", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/experiments" + }, + "id": { + "$id": "1552", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment" + }, + "identity": { + "$id": "1553", + "kind": "model", + "type": { + "$ref": "354" + }, + "value": { + "$id": "1554", + "type": { + "$id": "1555", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "UserAssigned" + }, + "principalId": { + "$id": "1556", + "kind": "string", + "type": { + "$ref": "356" + }, + "value": "d04ab567-2c07-43ef-a7f4-4527626b7f56" + }, + "tenantId": { + "$id": "1557", + "kind": "string", + "type": { + "$ref": "359" + }, + "value": "8c3e2fb2-fe7a-4bf1-b779-d73990782fe6" + }, + "userAssignedIdentities": { + "$id": "1558", + "kind": "dict", + "type": { + "$ref": "363" + }, + "value": { + "$id": "1559", + "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.ManagedIdentity/userAssignedIdentity/exampleUMI": { + "$id": "1560", + "kind": "model", + "type": { + "$ref": "366" + }, + "value": { + "$id": "1561" + } + } + } + } + } + }, + "location": { + "$id": "1562", + "kind": "string", + "type": { + "$ref": "221" + }, + "value": "centraluseuap" + }, + "properties": { + "$id": "1563", + "kind": "model", + "type": { + "$ref": "374" + }, + "value": { + "$id": "1564", + "customerDataStorage": { + "$id": "1565", + "kind": "model", + "type": { + "$ref": "465" + }, + "value": { + "$id": "1566", + "blobContainerName": { + "$id": "1567", + "kind": "string", + "type": { + "$ref": "470" + }, + "value": "azurechaosstudioexperiments" + }, + "storageAccountResourceId": { + "$id": "1568", + "kind": "string", + "type": { + "$ref": "467" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Storage/storageAccounts/exampleStorage" + } + } + }, + "selectors": { + "$id": "1569", + "kind": "array", + "type": { + "$ref": "425" + }, + "value": [ + { + "$id": "1570", + "kind": "model", + "type": { + "$ref": "444" + }, + "value": { + "$id": "1571", + "type": { + "$id": "1572", + "kind": "string", + "type": { + "$ref": "453" + }, + "value": "List" + }, + "id": { + "$id": "1573", + "kind": "string", + "type": { + "$ref": "429" + }, + "value": "selector1" + }, + "targets": { + "$id": "1574", + "kind": "array", + "type": { + "$ref": "446" + }, + "value": [ + { + "$id": "1575", + "kind": "model", + "type": { + "$ref": "447" + }, + "value": { + "$id": "1576", + "type": { + "$id": "1577", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "ChaosTarget" + }, + "id": { + "$id": "1578", + "kind": "string", + "type": { + "$ref": "450" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine" + } + } + } + ] + } + } + } + ] + }, + "steps": { + "$id": "1579", + "kind": "array", + "type": { + "$ref": "377" + }, + "value": [ + { + "$id": "1580", + "kind": "model", + "type": { + "$ref": "378" + }, + "value": { + "$id": "1581", + "name": { + "$id": "1582", + "kind": "string", + "type": { + "$ref": "380" + }, + "value": "step1" + }, + "branches": { + "$id": "1583", + "kind": "array", + "type": { + "$ref": "382" + }, + "value": [ + { + "$id": "1584", + "kind": "model", + "type": { + "$ref": "383" + }, + "value": { + "$id": "1585", + "name": { + "$id": "1586", + "kind": "string", + "type": { + "$ref": "385" + }, + "value": "branch1" + }, + "actions": { + "$id": "1587", + "kind": "array", + "type": { + "$ref": "387" + }, + "value": [ + { + "$id": "1588", + "kind": "model", + "type": { + "$ref": "393" + }, + "value": { + "$id": "1589", + "name": { + "$id": "1590", + "kind": "string", + "type": { + "$ref": "391" + }, + "value": "urn:csci:provider:providername:Shutdown/1.0" + }, + "type": { + "$id": "1591", + "kind": "string", + "type": { + "$ref": "407" + }, + "value": "continuous" + }, + "duration": { + "$id": "1592", + "kind": "string", + "type": { + "$ref": "395" + }, + "value": "PT10M" + }, + "parameters": { + "$id": "1593", + "kind": "array", + "type": { + "$ref": "398" + }, + "value": [ + { + "$id": "1594", + "kind": "model", + "type": { + "$ref": "399" + }, + "value": { + "$id": "1595", + "key": { + "$id": "1596", + "kind": "string", + "type": { + "$ref": "401" + }, + "value": "abruptShutdown" + }, + "value": { + "$id": "1597", + "kind": "string", + "type": { + "$ref": "403" + }, + "value": "false" + } + } + } + ] + }, + "selectorId": { + "$id": "1598", + "kind": "string", + "type": { + "$ref": "405" + }, + "value": "selector1" + } + } + } + ] + } + } + } + ] + } + } + } + ] + } + } + }, + "systemData": { + "$id": "1599", + "kind": "model", + "type": { + "$ref": "147" + }, + "value": { + "$id": "1600", + "createdAt": { + "$id": "1601", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "createdBy": { + "$id": "1602", + "kind": "string", + "type": { + "$ref": "149" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1603", + "kind": "string", + "type": { + "$ref": "158" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedBy": { + "$id": "1604", + "kind": "string", + "type": { + "$ref": "155" + }, + "value": "User" + } + } + }, + "tags": { + "$id": "1605", + "kind": "dict", + "type": { + "$ref": "217" + }, + "value": { + "$id": "1606", + "key1": { + "$id": "1607", + "kind": "string", + "type": { + "$ref": "219" + }, + "value": "value1" + }, + "key2": { + "$id": "1608", + "kind": "string", + "type": { + "$ref": "219" + }, + "value": "value2" + } + } + } + } + } + }, + { + "$id": "1609", + "response": { + "$ref": "1517" + }, + "statusCode": 202 + } + ] + } + ] + }, + { + "$id": "1610", + "Name": "delete", + "ResourceName": "Experiment", + "Doc": "Delete a Experiment resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1611", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1612", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1613", + "Type": { + "$id": "1614", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1615", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1616", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1617", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1618", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1619", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1620", + "Name": "experimentName", + "NameInRequest": "experimentName", + "Doc": "String that represents a Experiment resource name.", + "Type": { + "$id": "1621", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1622", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1623", + "kind": "constant", + "valueType": { + "$id": "1624", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1625", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "1626", + "Name": "location", + "NameInResponse": "Location", + "Doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "Type": { + "$id": "1627", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1628", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "1629", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false + }, + { + "$id": "1630", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "DELETE", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}", + "BufferResponse": true, + "LongRunning": { + "$id": "1631", + "FinalStateVia": 1, + "FinalResponse": { + "$id": "1632", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Experiments.delete", + "Decorators": [], + "Examples": [ + { + "$id": "1633", + "kind": "http", + "name": "Delete a Experiment in a resource group.", + "description": "Delete a Experiment in a resource group.", + "filePath": "2024-11-01-preview/Experiments_Delete.json", + "parameters": [ + { + "$id": "1634", + "parameter": { + "$ref": "1611" + }, + "value": { + "$id": "1635", + "kind": "string", + "type": { + "$ref": "1612" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "1636", + "parameter": { + "$ref": "1620" + }, + "value": { + "$id": "1637", + "kind": "string", + "type": { + "$ref": "1621" + }, + "value": "exampleExperiment" + } + }, + { + "$id": "1638", + "parameter": { + "$ref": "1618" + }, + "value": { + "$id": "1639", + "kind": "string", + "type": { + "$ref": "1619" + }, + "value": "exampleRG" + } + }, + { + "$id": "1640", + "parameter": { + "$ref": "1615" + }, + "value": { + "$id": "1641", + "kind": "string", + "type": { + "$ref": "1616" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "1642", + "response": { + "$ref": "1625" + }, + "statusCode": 202 + }, + { + "$id": "1643", + "response": { + "$ref": "1630" + }, + "statusCode": 204 + } + ] + } + ] + }, + { + "$id": "1644", + "Name": "list", + "ResourceName": "Experiment", + "Doc": "Get a list of Experiment resources in a resource group.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1645", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1646", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1647", + "Type": { + "$id": "1648", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1649", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1650", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1651", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1652", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1653", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1654", + "Name": "running", + "NameInRequest": "running", + "Doc": "Optional value that indicates whether to filter results based on if the Experiment is currently running. If null, then the results will not be filtered.", + "Type": { + "$id": "1655", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1656", + "Name": "continuationToken", + "NameInRequest": "continuationToken", + "Doc": "String that sets the continuation token.", + "Type": { + "$id": "1657", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1658", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1659", + "kind": "constant", + "valueType": { + "$id": "1660", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1661", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "477" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments", + "BufferResponse": true, + "Paging": { + "$id": "1662", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Experiments.list", + "Decorators": [], + "Examples": [ + { + "$id": "1663", + "kind": "http", + "name": "List all Experiments in a resource group.", + "description": "List all Experiments in a resource group.", + "filePath": "2024-11-01-preview/Experiments_List.json", + "parameters": [ + { + "$id": "1664", + "parameter": { + "$ref": "1645" + }, + "value": { + "$id": "1665", + "kind": "string", + "type": { + "$ref": "1646" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "1666", + "parameter": { + "$ref": "1652" + }, + "value": { + "$id": "1667", + "kind": "string", + "type": { + "$ref": "1653" + }, + "value": "exampleRG" + } + }, + { + "$id": "1668", + "parameter": { + "$ref": "1649" + }, + "value": { + "$id": "1669", + "kind": "string", + "type": { + "$ref": "1650" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "1670", + "response": { + "$ref": "1661" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1671", + "kind": "model", + "type": { + "$ref": "477" + }, + "value": { + "$id": "1672", + "nextLink": { + "$id": "1673", + "kind": "string", + "type": { + "$ref": "481" + }, + "value": "https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments?continuationToken=&api-version=2024-11-01-preview" + }, + "value": { + "$id": "1674", + "kind": "array", + "type": { + "$ref": "479" + }, + "value": [ + { + "$id": "1675", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1676", + "name": { + "$id": "1677", + "kind": "string", + "type": { + "$ref": "1245" + }, + "value": "exampleExperiment" + }, + "type": { + "$id": "1678", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/experiments" + }, + "id": { + "$id": "1679", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment" + }, + "identity": { + "$id": "1680", + "kind": "model", + "type": { + "$ref": "354" + }, + "value": { + "$id": "1681", + "type": { + "$id": "1682", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "SystemAssigned" + }, + "principalId": { + "$id": "1683", + "kind": "string", + "type": { + "$ref": "356" + }, + "value": "d04ab567-2c07-43ef-a7f4-4527626b7f56" + }, + "tenantId": { + "$id": "1684", + "kind": "string", + "type": { + "$ref": "359" + }, + "value": "8c3e2fb2-fe7a-4bf1-b779-d73990782fe6" + } + } + }, + "location": { + "$id": "1685", + "kind": "string", + "type": { + "$ref": "221" + }, + "value": "centraluseuap" + }, + "properties": { + "$id": "1686", + "kind": "model", + "type": { + "$ref": "374" + }, + "value": { + "$id": "1687", + "customerDataStorage": { + "$id": "1688", + "kind": "model", + "type": { + "$ref": "465" + }, + "value": { + "$id": "1689", + "blobContainerName": { + "$id": "1690", + "kind": "string", + "type": { + "$ref": "470" + }, + "value": "azurechaosstudioexperiments" + }, + "storageAccountResourceId": { + "$id": "1691", + "kind": "string", + "type": { + "$ref": "467" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Storage/storageAccounts/exampleStorage" + } + } + }, + "selectors": { + "$id": "1692", + "kind": "array", + "type": { + "$ref": "425" + }, + "value": [ + { + "$id": "1693", + "kind": "model", + "type": { + "$ref": "444" + }, + "value": { + "$id": "1694", + "type": { + "$id": "1695", + "kind": "string", + "type": { + "$ref": "453" + }, + "value": "List" + }, + "id": { + "$id": "1696", + "kind": "string", + "type": { + "$ref": "429" + }, + "value": "selector1" + }, + "targets": { + "$id": "1697", + "kind": "array", + "type": { + "$ref": "446" + }, + "value": [ + { + "$id": "1698", + "kind": "model", + "type": { + "$ref": "447" + }, + "value": { + "$id": "1699", + "type": { + "$id": "1700", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "ChaosTarget" + }, + "id": { + "$id": "1701", + "kind": "string", + "type": { + "$ref": "450" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine" + } + } + } + ] + } + } + } + ] + }, + "steps": { + "$id": "1702", + "kind": "array", + "type": { + "$ref": "377" + }, + "value": [ + { + "$id": "1703", + "kind": "model", + "type": { + "$ref": "378" + }, + "value": { + "$id": "1704", + "name": { + "$id": "1705", + "kind": "string", + "type": { + "$ref": "380" + }, + "value": "step1" + }, + "branches": { + "$id": "1706", + "kind": "array", + "type": { + "$ref": "382" + }, + "value": [ + { + "$id": "1707", + "kind": "model", + "type": { + "$ref": "383" + }, + "value": { + "$id": "1708", + "name": { + "$id": "1709", + "kind": "string", + "type": { + "$ref": "385" + }, + "value": "branch1" + }, + "actions": { + "$id": "1710", + "kind": "array", + "type": { + "$ref": "387" + }, + "value": [ + { + "$id": "1711", + "kind": "model", + "type": { + "$ref": "393" + }, + "value": { + "$id": "1712", + "name": { + "$id": "1713", + "kind": "string", + "type": { + "$ref": "391" + }, + "value": "urn:csci:provider:providername:Shutdown/1.0" + }, + "type": { + "$id": "1714", + "kind": "string", + "type": { + "$ref": "407" + }, + "value": "continuous" + }, + "duration": { + "$id": "1715", + "kind": "string", + "type": { + "$ref": "395" + }, + "value": "PT10M" + }, + "parameters": { + "$id": "1716", + "kind": "array", + "type": { + "$ref": "398" + }, + "value": [ + { + "$id": "1717", + "kind": "model", + "type": { + "$ref": "399" + }, + "value": { + "$id": "1718", + "key": { + "$id": "1719", + "kind": "string", + "type": { + "$ref": "401" + }, + "value": "abruptShutdown" + }, + "value": { + "$id": "1720", + "kind": "string", + "type": { + "$ref": "403" + }, + "value": "false" + } + } + } + ] + }, + "selectorId": { + "$id": "1721", + "kind": "string", + "type": { + "$ref": "405" + }, + "value": "selector1" + } + } + } + ] + } + } + } + ] + } + } + } + ] + } + } + }, + "systemData": { + "$id": "1722", + "kind": "model", + "type": { + "$ref": "147" + }, + "value": { + "$id": "1723", + "createdAt": { + "$id": "1724", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "createdBy": { + "$id": "1725", + "kind": "string", + "type": { + "$ref": "149" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1726", + "kind": "string", + "type": { + "$ref": "158" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedBy": { + "$id": "1727", + "kind": "string", + "type": { + "$ref": "155" + }, + "value": "User" + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + }, + { + "$id": "1728", + "Name": "listAll", + "ResourceName": "Experiment", + "Doc": "Get a list of Experiment resources in a subscription.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1729", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1730", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1731", + "Type": { + "$id": "1732", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1733", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1734", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1735", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1736", + "Name": "running", + "NameInRequest": "running", + "Doc": "Optional value that indicates whether to filter results based on if the Experiment is currently running. If null, then the results will not be filtered.", + "Type": { + "$id": "1737", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1738", + "Name": "continuationToken", + "NameInRequest": "continuationToken", + "Doc": "String that sets the continuation token.", + "Type": { + "$id": "1739", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1740", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1741", + "kind": "constant", + "valueType": { + "$id": "1742", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1743", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "477" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/experiments", + "BufferResponse": true, + "Paging": { + "$id": "1744", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Experiments.listAll", + "Decorators": [], + "Examples": [ + { + "$id": "1745", + "kind": "http", + "name": "List all Experiments in a subscription.", + "description": "List all Experiments in a subscription.", + "filePath": "2024-11-01-preview/Experiments_ListAll.json", + "parameters": [ + { + "$id": "1746", + "parameter": { + "$ref": "1729" + }, + "value": { + "$id": "1747", + "kind": "string", + "type": { + "$ref": "1730" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "1748", + "parameter": { + "$ref": "1733" + }, + "value": { + "$id": "1749", + "kind": "string", + "type": { + "$ref": "1734" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "1750", + "response": { + "$ref": "1743" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1751", + "kind": "model", + "type": { + "$ref": "477" + }, + "value": { + "$id": "1752", + "nextLink": { + "$id": "1753", + "kind": "string", + "type": { + "$ref": "481" + }, + "value": "https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/providers/Microsoft.Chaos/experiments?continuationToken=&api-version=2024-11-01-preview" + }, + "value": { + "$id": "1754", + "kind": "array", + "type": { + "$ref": "479" + }, + "value": [ + { + "$id": "1755", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1756", + "name": { + "$id": "1757", + "kind": "string", + "type": { + "$ref": "1245" + }, + "value": "exampleExperiment" + }, + "type": { + "$id": "1758", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/experiments" + }, + "id": { + "$id": "1759", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment" + }, + "identity": { + "$id": "1760", + "kind": "model", + "type": { + "$ref": "354" + }, + "value": { + "$id": "1761", + "type": { + "$id": "1762", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "SystemAssigned" + }, + "principalId": { + "$id": "1763", + "kind": "string", + "type": { + "$ref": "356" + }, + "value": "d04ab567-2c07-43ef-a7f4-4527626b7f56" + }, + "tenantId": { + "$id": "1764", + "kind": "string", + "type": { + "$ref": "359" + }, + "value": "8c3e2fb2-fe7a-4bf1-b779-d73990782fe6" + } + } + }, + "location": { + "$id": "1765", + "kind": "string", + "type": { + "$ref": "221" + }, + "value": "centraluseuap" + }, + "properties": { + "$id": "1766", + "kind": "model", + "type": { + "$ref": "374" + }, + "value": { + "$id": "1767", + "customerDataStorage": { + "$id": "1768", + "kind": "model", + "type": { + "$ref": "465" + }, + "value": { + "$id": "1769", + "blobContainerName": { + "$id": "1770", + "kind": "string", + "type": { + "$ref": "470" + }, + "value": "azurechaosstudioexperiments" + }, + "storageAccountResourceId": { + "$id": "1771", + "kind": "string", + "type": { + "$ref": "467" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Storage/storageAccounts/exampleStorage" + } + } + }, + "selectors": { + "$id": "1772", + "kind": "array", + "type": { + "$ref": "425" + }, + "value": [ + { + "$id": "1773", + "kind": "model", + "type": { + "$ref": "444" + }, + "value": { + "$id": "1774", + "type": { + "$id": "1775", + "kind": "string", + "type": { + "$ref": "453" + }, + "value": "List" + }, + "id": { + "$id": "1776", + "kind": "string", + "type": { + "$ref": "429" + }, + "value": "selector1" + }, + "targets": { + "$id": "1777", + "kind": "array", + "type": { + "$ref": "446" + }, + "value": [ + { + "$id": "1778", + "kind": "model", + "type": { + "$ref": "447" + }, + "value": { + "$id": "1779", + "type": { + "$id": "1780", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "ChaosTarget" + }, + "id": { + "$id": "1781", + "kind": "string", + "type": { + "$ref": "450" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine" + } + } + } + ] + } + } + } + ] + }, + "steps": { + "$id": "1782", + "kind": "array", + "type": { + "$ref": "377" + }, + "value": [ + { + "$id": "1783", + "kind": "model", + "type": { + "$ref": "378" + }, + "value": { + "$id": "1784", + "name": { + "$id": "1785", + "kind": "string", + "type": { + "$ref": "380" + }, + "value": "step1" + }, + "branches": { + "$id": "1786", + "kind": "array", + "type": { + "$ref": "382" + }, + "value": [ + { + "$id": "1787", + "kind": "model", + "type": { + "$ref": "383" + }, + "value": { + "$id": "1788", + "name": { + "$id": "1789", + "kind": "string", + "type": { + "$ref": "385" + }, + "value": "branch1" + }, + "actions": { + "$id": "1790", + "kind": "array", + "type": { + "$ref": "387" + }, + "value": [ + { + "$id": "1791", + "kind": "model", + "type": { + "$ref": "393" + }, + "value": { + "$id": "1792", + "name": { + "$id": "1793", + "kind": "string", + "type": { + "$ref": "391" + }, + "value": "urn:csci:provider:providername:Shutdown/1.0" + }, + "type": { + "$id": "1794", + "kind": "string", + "type": { + "$ref": "407" + }, + "value": "continuous" + }, + "duration": { + "$id": "1795", + "kind": "string", + "type": { + "$ref": "395" + }, + "value": "PT10M" + }, + "parameters": { + "$id": "1796", + "kind": "array", + "type": { + "$ref": "398" + }, + "value": [ + { + "$id": "1797", + "kind": "model", + "type": { + "$ref": "399" + }, + "value": { + "$id": "1798", + "key": { + "$id": "1799", + "kind": "string", + "type": { + "$ref": "401" + }, + "value": "abruptShutdown" + }, + "value": { + "$id": "1800", + "kind": "string", + "type": { + "$ref": "403" + }, + "value": "false" + } + } + } + ] + }, + "selectorId": { + "$id": "1801", + "kind": "string", + "type": { + "$ref": "405" + }, + "value": "selector1" + } + } + } + ] + } + } + } + ] + } + } + } + ] + } + } + }, + "systemData": { + "$id": "1802", + "kind": "model", + "type": { + "$ref": "147" + }, + "value": { + "$id": "1803", + "createdAt": { + "$id": "1804", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "createdBy": { + "$id": "1805", + "kind": "string", + "type": { + "$ref": "149" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1806", + "kind": "string", + "type": { + "$ref": "158" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedBy": { + "$id": "1807", + "kind": "string", + "type": { + "$ref": "155" + }, + "value": "User" + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + }, + { + "$id": "1808", + "Name": "cancel", + "ResourceName": "Experiments", + "Doc": "Cancel a running Experiment resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1809", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1810", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1811", + "Type": { + "$id": "1812", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1813", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1814", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1815", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1816", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1817", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1818", + "Name": "experimentName", + "NameInRequest": "experimentName", + "Doc": "String that represents a Experiment resource name.", + "Type": { + "$id": "1819", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1820", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1821", + "kind": "constant", + "valueType": { + "$id": "1822", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1823", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "1824", + "Name": "location", + "NameInResponse": "Location", + "Doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "Type": { + "$id": "1825", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1826", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "1827", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/cancel", + "BufferResponse": true, + "LongRunning": { + "$id": "1828", + "FinalStateVia": 1, + "FinalResponse": { + "$id": "1829", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Experiments.cancel", + "Decorators": [], + "Examples": [ + { + "$id": "1830", + "kind": "http", + "name": "Cancel a running Experiment.", + "description": "Cancel a running Experiment.", + "filePath": "2024-11-01-preview/Experiments_Cancel.json", + "parameters": [ + { + "$id": "1831", + "parameter": { + "$ref": "1809" + }, + "value": { + "$id": "1832", + "kind": "string", + "type": { + "$ref": "1810" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "1833", + "parameter": { + "$ref": "1818" + }, + "value": { + "$id": "1834", + "kind": "string", + "type": { + "$ref": "1819" + }, + "value": "exampleExperiment" + } + }, + { + "$id": "1835", + "parameter": { + "$ref": "1816" + }, + "value": { + "$id": "1836", + "kind": "string", + "type": { + "$ref": "1817" + }, + "value": "exampleRG" + } + }, + { + "$id": "1837", + "parameter": { + "$ref": "1813" + }, + "value": { + "$id": "1838", + "kind": "string", + "type": { + "$ref": "1814" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "1839", + "response": { + "$ref": "1823" + }, + "statusCode": 202 + } + ] + } + ] + }, + { + "$id": "1840", + "Name": "start", + "ResourceName": "Experiments", + "Doc": "Start a Experiment resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1841", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1842", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1843", + "Type": { + "$id": "1844", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1845", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1846", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1847", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1848", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1849", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1850", + "Name": "experimentName", + "NameInRequest": "experimentName", + "Doc": "String that represents a Experiment resource name.", + "Type": { + "$id": "1851", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1852", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1853", + "kind": "constant", + "valueType": { + "$id": "1854", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1855", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "1856", + "Name": "location", + "NameInResponse": "Location", + "Doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "Type": { + "$id": "1857", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1858", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "1859", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/start", + "BufferResponse": true, + "LongRunning": { + "$id": "1860", + "FinalStateVia": 1, + "FinalResponse": { + "$id": "1861", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.Experiments.start", + "Decorators": [], + "Examples": [ + { + "$id": "1862", + "kind": "http", + "name": "Start a Experiment.", + "description": "Start a Experiment.", + "filePath": "2024-11-01-preview/Experiments_Start.json", + "parameters": [ + { + "$id": "1863", + "parameter": { + "$ref": "1841" + }, + "value": { + "$id": "1864", + "kind": "string", + "type": { + "$ref": "1842" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "1865", + "parameter": { + "$ref": "1850" + }, + "value": { + "$id": "1866", + "kind": "string", + "type": { + "$ref": "1851" + }, + "value": "exampleExperiment" + } + }, + { + "$id": "1867", + "parameter": { + "$ref": "1848" + }, + "value": { + "$id": "1868", + "kind": "string", + "type": { + "$ref": "1849" + }, + "value": "exampleRG" + } + }, + { + "$id": "1869", + "parameter": { + "$ref": "1845" + }, + "value": { + "$id": "1870", + "kind": "string", + "type": { + "$ref": "1846" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "1871", + "response": { + "$ref": "1855" + }, + "statusCode": 202 + } + ] + } + ] + } + ], + "Protocol": { + "$id": "1872" + }, + "Parent": "ChaosClient", + "Parameters": [ + { + "$id": "1873", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "1874", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "1875", + "Type": { + "$id": "1876", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "1877", + "Name": "ExperimentExecutions", + "Operations": [ + { + "$id": "1878", + "Name": "getExecution", + "ResourceName": "ExperimentExecution", + "Doc": "Get an execution of an Experiment resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1879", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1880", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1881", + "Type": { + "$id": "1882", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1883", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1884", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1885", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1886", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1887", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1888", + "Name": "experimentName", + "NameInRequest": "experimentName", + "Doc": "String that represents a Experiment resource name.", + "Type": { + "$id": "1889", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1890", + "Name": "executionId", + "NameInRequest": "executionId", + "Doc": "GUID that represents a Experiment execution detail.", + "Type": { + "$id": "1891", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1892", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1893", + "kind": "constant", + "valueType": { + "$id": "1894", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1895", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "257" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/executions/{executionId}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutions.getExecution", + "Decorators": [], + "Examples": [ + { + "$id": "1896", + "kind": "http", + "name": "Get the execution of a Experiment.", + "description": "Get the execution of a Experiment.", + "filePath": "2024-11-01-preview/Experiments_GetExecution.json", + "parameters": [ + { + "$id": "1897", + "parameter": { + "$ref": "1879" + }, + "value": { + "$id": "1898", + "kind": "string", + "type": { + "$ref": "1880" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "1899", + "parameter": { + "$ref": "1890" + }, + "value": { + "$id": "1900", + "kind": "string", + "type": { + "$ref": "1891" + }, + "value": "f24500ad-744e-4a26-864b-b76199eac333" + } + }, + { + "$id": "1901", + "parameter": { + "$ref": "1888" + }, + "value": { + "$id": "1902", + "kind": "string", + "type": { + "$ref": "1889" + }, + "value": "exampleExperiment" + } + }, + { + "$id": "1903", + "parameter": { + "$ref": "1886" + }, + "value": { + "$id": "1904", + "kind": "string", + "type": { + "$ref": "1887" + }, + "value": "exampleRG" + } + }, + { + "$id": "1905", + "parameter": { + "$ref": "1883" + }, + "value": { + "$id": "1906", + "kind": "string", + "type": { + "$ref": "1884" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "1907", + "response": { + "$ref": "1895" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1908", + "kind": "model", + "type": { + "$ref": "257" + }, + "value": { + "$id": "1909", + "name": { + "$id": "1910", + "kind": "string", + "type": { + "$id": "1911", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "f24500ad-744e-4a26-864b-b76199eac333" + }, + "type": { + "$id": "1912", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/experiments/executions" + }, + "id": { + "$id": "1913", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment/executions/f24500ad-744e-4a26-864b-b76199eac333" + }, + "properties": { + "$id": "1914", + "kind": "model", + "type": { + "$ref": "259" + }, + "value": { + "$id": "1915", + "startedAt": { + "$id": "1916", + "kind": "string", + "type": { + "$ref": "263" + }, + "value": "2020-12-14T21:52:52.2552574Z" + }, + "status": { + "$id": "1917", + "kind": "string", + "type": { + "$ref": "261" + }, + "value": "failed" + }, + "stoppedAt": { + "$id": "1918", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "2020-12-14T21:56:18.9281956Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1919", + "Name": "listAllExecutions", + "ResourceName": "ExperimentExecution", + "Doc": "Get a list of executions of an Experiment resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1920", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1921", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1922", + "Type": { + "$id": "1923", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1924", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1925", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1926", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1927", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1928", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1929", + "Name": "experimentName", + "NameInRequest": "experimentName", + "Doc": "String that represents a Experiment resource name.", + "Type": { + "$id": "1930", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1931", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1932", + "kind": "constant", + "valueType": { + "$id": "1933", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1934", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "269" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/executions", + "BufferResponse": true, + "Paging": { + "$id": "1935", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutions.listAllExecutions", + "Decorators": [], + "Examples": [ + { + "$id": "1936", + "kind": "http", + "name": "List all executions of an Experiment.", + "description": "List all executions of an Experiment.", + "filePath": "2024-11-01-preview/Experiments_ListAllExecutions.json", + "parameters": [ + { + "$id": "1937", + "parameter": { + "$ref": "1920" + }, + "value": { + "$id": "1938", + "kind": "string", + "type": { + "$ref": "1921" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "1939", + "parameter": { + "$ref": "1929" + }, + "value": { + "$id": "1940", + "kind": "string", + "type": { + "$ref": "1930" + }, + "value": "exampleExperiment" + } + }, + { + "$id": "1941", + "parameter": { + "$ref": "1927" + }, + "value": { + "$id": "1942", + "kind": "string", + "type": { + "$ref": "1928" + }, + "value": "exampleRG" + } + }, + { + "$id": "1943", + "parameter": { + "$ref": "1924" + }, + "value": { + "$id": "1944", + "kind": "string", + "type": { + "$ref": "1925" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "1945", + "response": { + "$ref": "1934" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1946", + "kind": "model", + "type": { + "$ref": "269" + }, + "value": { + "$id": "1947", + "nextLink": { + "$id": "1948", + "kind": "string", + "type": { + "$ref": "273" + }, + "value": "https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment/executionDetails?continuationToken=&api-version=2025-01-01" + }, + "value": { + "$id": "1949", + "kind": "array", + "type": { + "$ref": "271" + }, + "value": [ + { + "$id": "1950", + "kind": "model", + "type": { + "$ref": "257" + }, + "value": { + "$id": "1951", + "name": { + "$id": "1952", + "kind": "string", + "type": { + "$ref": "1911" + }, + "value": "f24500ad-744e-4a26-864b-b76199eac333" + }, + "type": { + "$id": "1953", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/experiments/executions" + }, + "id": { + "$id": "1954", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment/executions/f24500ad-744e-4a26-864b-b76199eac333" + }, + "properties": { + "$id": "1955", + "kind": "model", + "type": { + "$ref": "259" + }, + "value": { + "$id": "1956", + "startedAt": { + "$id": "1957", + "kind": "string", + "type": { + "$ref": "263" + }, + "value": "2020-12-14T21:52:52.2552574Z" + }, + "status": { + "$id": "1958", + "kind": "string", + "type": { + "$ref": "261" + }, + "value": "failed" + }, + "stoppedAt": { + "$id": "1959", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "2020-12-14T21:56:18.9281956Z" + } + } + } + } + }, + { + "$id": "1960", + "kind": "model", + "type": { + "$ref": "257" + }, + "value": { + "$id": "1961", + "name": { + "$id": "1962", + "kind": "string", + "type": { + "$ref": "1911" + }, + "value": "14d98367-52ef-4596-be4f-53fc81bbfc33" + }, + "type": { + "$id": "1963", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/experiments/executions" + }, + "id": { + "$id": "1964", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment/executions/14d98367-52ef-4596-be4f-53fc81bbfc33" + }, + "properties": { + "$id": "1965", + "kind": "model", + "type": { + "$ref": "259" + }, + "value": { + "$id": "1966", + "startedAt": { + "$id": "1967", + "kind": "string", + "type": { + "$ref": "263" + }, + "value": "2020-12-14T21:52:52.2552574Z" + }, + "status": { + "$id": "1968", + "kind": "string", + "type": { + "$ref": "261" + }, + "value": "success" + }, + "stoppedAt": { + "$id": "1969", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "2020-12-14T21:56:18.9281956Z" + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + }, + { + "$id": "1970", + "Name": "ExecutionDetails", + "ResourceName": "ExperimentExecutions", + "Doc": "Execution details of an experiment resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1971", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1972", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1973", + "Type": { + "$id": "1974", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1975", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1976", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1977", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1978", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1979", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1980", + "Name": "experimentName", + "NameInRequest": "experimentName", + "Doc": "String that represents a Experiment resource name.", + "Type": { + "$id": "1981", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1982", + "Name": "executionId", + "NameInRequest": "executionId", + "Doc": "GUID that represents a Experiment execution detail.", + "Type": { + "$id": "1983", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1984", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1985", + "kind": "constant", + "valueType": { + "$id": "1986", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1987", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "275" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/executions/{executionId}/getExecutionDetails", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.ExperimentExecutions.getExecutionDetails", + "Decorators": [], + "Examples": [ + { + "$id": "1988", + "kind": "http", + "name": "Get experiment execution details.", + "description": "Get experiment execution details.", + "filePath": "2024-11-01-preview/Experiments_ExecutionDetails.json", + "parameters": [ + { + "$id": "1989", + "parameter": { + "$ref": "1971" + }, + "value": { + "$id": "1990", + "kind": "string", + "type": { + "$ref": "1972" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "1991", + "parameter": { + "$ref": "1982" + }, + "value": { + "$id": "1992", + "kind": "string", + "type": { + "$ref": "1983" + }, + "value": "f24500ad-744e-4a26-864b-b76199eac333" + } + }, + { + "$id": "1993", + "parameter": { + "$ref": "1980" + }, + "value": { + "$id": "1994", + "kind": "string", + "type": { + "$ref": "1981" + }, + "value": "exampleExperiment" + } + }, + { + "$id": "1995", + "parameter": { + "$ref": "1978" + }, + "value": { + "$id": "1996", + "kind": "string", + "type": { + "$ref": "1979" + }, + "value": "exampleRG" + } + }, + { + "$id": "1997", + "parameter": { + "$ref": "1975" + }, + "value": { + "$id": "1998", + "kind": "string", + "type": { + "$ref": "1976" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "1999", + "response": { + "$ref": "1987" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2000", + "kind": "model", + "type": { + "$ref": "275" + }, + "value": { + "$id": "2001", + "name": { + "$id": "2002", + "kind": "string", + "type": { + "$ref": "281" + }, + "value": "f24500ad-744e-4a26-864b-b76199eac333" + }, + "type": { + "$id": "2003", + "kind": "string", + "type": { + "$ref": "277" + }, + "value": "Microsoft.Chaos/experiments/executions/getExecutionDetails" + }, + "id": { + "$id": "2004", + "kind": "string", + "type": { + "$ref": "279" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Chaos/experiments/exampleExperiment/executions/f24500ad-744e-4a26-864b-b76199eac333/getExecutionDetails" + }, + "properties": { + "$id": "2005", + "kind": "model", + "type": { + "$ref": "283" + }, + "value": { + "$id": "2006", + "failureReason": { + "$id": "2007", + "kind": "string", + "type": { + "$ref": "294" + }, + "value": "Dependency failure" + }, + "lastActionAt": { + "$id": "2008", + "kind": "string", + "type": { + "$ref": "296" + }, + "value": "2020-12-14T21:52:52.2552574Z" + }, + "runInformation": { + "$id": "2009", + "kind": "model", + "type": { + "$ref": "299" + }, + "value": { + "$id": "2010", + "steps": { + "$id": "2011", + "kind": "array", + "type": { + "$ref": "301" + }, + "value": [ + { + "$id": "2012", + "kind": "model", + "type": { + "$ref": "302" + }, + "value": { + "$id": "2013", + "branches": { + "$id": "2014", + "kind": "array", + "type": { + "$ref": "310" + }, + "value": [ + { + "$id": "2015", + "kind": "model", + "type": { + "$ref": "311" + }, + "value": { + "$id": "2016", + "actions": { + "$id": "2017", + "kind": "array", + "type": { + "$ref": "319" + }, + "value": [ + { + "$id": "2018", + "kind": "model", + "type": { + "$ref": "320" + }, + "value": { + "$id": "2019", + "actionId": { + "$id": "2020", + "kind": "string", + "type": { + "$ref": "324" + }, + "value": "59499d33-6751-4b6e-a1f6-58f4d56a040a" + }, + "actionName": { + "$id": "2021", + "kind": "string", + "type": { + "$ref": "322" + }, + "value": "urn:provider:agent-v2:Microsoft.Azure.Chaos.Fault.CPUPressureAllProcessors" + }, + "endTime": { + "$id": "2022", + "kind": "string", + "type": { + "$ref": "331" + }, + "value": "2020-12-14T13:56:13.6270153-08:00" + }, + "startTime": { + "$id": "2023", + "kind": "string", + "type": { + "$ref": "328" + }, + "value": "2020-12-14T13:56:13.6270153-08:00" + }, + "status": { + "$id": "2024", + "kind": "string", + "type": { + "$ref": "326" + }, + "value": "failed" + }, + "targets": { + "$id": "2025", + "kind": "array", + "type": { + "$ref": "334" + }, + "value": [ + { + "$id": "2026", + "kind": "model", + "type": { + "$ref": "335" + }, + "value": { + "$id": "2027", + "status": { + "$id": "2028", + "kind": "string", + "type": { + "$ref": "337" + }, + "value": "succeeded" + }, + "target": { + "$id": "2029", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/VM1" + }, + "targetCompletedTime": { + "$id": "2030", + "kind": "string", + "type": { + "$ref": "344" + }, + "value": "2021-04-02T17:30:55+00:00" + }, + "targetFailedTime": { + "$id": "2031", + "kind": "string", + "type": { + "$ref": "341" + }, + "value": "2021-04-02T16:30:55+00:00" + } + } + }, + { + "$id": "2032", + "kind": "model", + "type": { + "$ref": "335" + }, + "value": { + "$id": "2033", + "status": { + "$id": "2034", + "kind": "string", + "type": { + "$ref": "337" + }, + "value": "failed" + }, + "target": { + "$id": "2035", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/VM1" + }, + "targetCompletedTime": { + "$id": "2036", + "kind": "string", + "type": { + "$ref": "344" + }, + "value": "2021-04-02T17:30:55+00:00" + }, + "targetFailedTime": { + "$id": "2037", + "kind": "string", + "type": { + "$ref": "341" + }, + "value": "2021-04-02T16:30:55+00:00" + } + } + } + ] + } + } + } + ] + }, + "branchId": { + "$id": "2038", + "kind": "string", + "type": { + "$ref": "315" + }, + "value": "FirstBranch" + }, + "branchName": { + "$id": "2039", + "kind": "string", + "type": { + "$ref": "313" + }, + "value": "FirstBranch" + }, + "status": { + "$id": "2040", + "kind": "string", + "type": { + "$ref": "317" + }, + "value": "failed" + } + } + } + ] + }, + "status": { + "$id": "2041", + "kind": "string", + "type": { + "$ref": "308" + }, + "value": "failed" + }, + "stepId": { + "$id": "2042", + "kind": "string", + "type": { + "$ref": "306" + }, + "value": "FirstStep" + }, + "stepName": { + "$id": "2043", + "kind": "string", + "type": { + "$ref": "304" + }, + "value": "FirstStep" + } + } + } + ] + } + } + }, + "startedAt": { + "$id": "2044", + "kind": "string", + "type": { + "$ref": "287" + }, + "value": "2020-12-14T21:52:52.2552574Z" + }, + "status": { + "$id": "2045", + "kind": "string", + "type": { + "$ref": "285" + }, + "value": "failed" + }, + "stoppedAt": { + "$id": "2046", + "kind": "string", + "type": { + "$ref": "290" + }, + "value": "2020-12-14T21:56:18.9281956Z" + } + } + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "2047" + }, + "Parent": "ChaosClient", + "Parameters": [ + { + "$id": "2048", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "2049", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "2050", + "Type": { + "$id": "2051", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "2052", + "Name": "PrivateAccesses", + "Operations": [ + { + "$id": "2053", + "Name": "get", + "ResourceName": "PrivateAccess", + "Doc": "Get a private access resource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "2054", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "2055", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "2056", + "Type": { + "$id": "2057", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2058", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "2059", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2060", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2061", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "2062", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2063", + "Name": "privateAccessName", + "NameInRequest": "privateAccessName", + "Doc": "The name of the private access resource that is being created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.", + "Type": { + "$id": "2064", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2065", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "2066", + "kind": "constant", + "valueType": { + "$id": "2067", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "2068", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "214" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/privateAccesses/{privateAccessName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.PrivateAccesses.get", + "Decorators": [], + "Examples": [ + { + "$id": "2069", + "kind": "http", + "name": "Get a private access resource", + "description": "Get a private access resource", + "filePath": "2024-11-01-preview/PrivateAccesses_Get_Get_A_Private_Access_Resource.json", + "parameters": [ + { + "$id": "2070", + "parameter": { + "$ref": "2054" + }, + "value": { + "$id": "2071", + "kind": "string", + "type": { + "$ref": "2055" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "2072", + "parameter": { + "$ref": "2063" + }, + "value": { + "$id": "2073", + "kind": "string", + "type": { + "$ref": "2064" + }, + "value": "myPrivateAccess" + } + }, + { + "$id": "2074", + "parameter": { + "$ref": "2061" + }, + "value": { + "$id": "2075", + "kind": "string", + "type": { + "$ref": "2062" + }, + "value": "myResourceGroup" + } + }, + { + "$id": "2076", + "parameter": { + "$ref": "2058" + }, + "value": { + "$id": "2077", + "kind": "string", + "type": { + "$ref": "2059" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "2078", + "response": { + "$ref": "2068" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2079", + "kind": "model", + "type": { + "$ref": "214" + }, + "value": { + "$id": "2080", + "name": { + "$id": "2081", + "kind": "string", + "type": { + "$id": "2082", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "myPrivateAccess" + }, + "type": { + "$id": "2083", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/privateAccesses" + }, + "id": { + "$id": "2084", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourcegroup/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess" + }, + "location": { + "$id": "2085", + "kind": "string", + "type": { + "$ref": "221" + }, + "value": "centraluseuap" + }, + "properties": { + "$id": "2086", + "kind": "model", + "type": { + "$ref": "223" + }, + "value": { + "$id": "2087" + } + }, + "systemData": { + "$id": "2088", + "kind": "model", + "type": { + "$ref": "147" + }, + "value": { + "$id": "2089", + "createdAt": { + "$id": "2090", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedAt": { + "$id": "2091", + "kind": "string", + "type": { + "$ref": "158" + }, + "value": "2021-07-01T00:00:00.0Z" + } + } + } + } + } + } + ] + }, + { + "$id": "2092", + "kind": "http", + "name": "Get a private access resource with private endpoint", + "description": "Get a private access resource with private endpoint", + "filePath": "2024-11-01-preview/PrivateAccesses_Get_Get_A_Private_Access_Resource_With_Private_Endpoint.json", + "parameters": [ + { + "$id": "2093", + "parameter": { + "$ref": "2054" + }, + "value": { + "$id": "2094", + "kind": "string", + "type": { + "$ref": "2055" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "2095", + "parameter": { + "$ref": "2063" + }, + "value": { + "$id": "2096", + "kind": "string", + "type": { + "$ref": "2064" + }, + "value": "myPrivateAccess" + } + }, + { + "$id": "2097", + "parameter": { + "$ref": "2061" + }, + "value": { + "$id": "2098", + "kind": "string", + "type": { + "$ref": "2062" + }, + "value": "myResourceGroup" + } + }, + { + "$id": "2099", + "parameter": { + "$ref": "2058" + }, + "value": { + "$id": "2100", + "kind": "string", + "type": { + "$ref": "2059" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "2101", + "response": { + "$ref": "2068" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2102", + "kind": "model", + "type": { + "$ref": "214" + }, + "value": { + "$id": "2103", + "name": { + "$id": "2104", + "kind": "string", + "type": { + "$ref": "2082" + }, + "value": "myPrivateAccess" + }, + "type": { + "$id": "2105", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/privateAccesses" + }, + "id": { + "$id": "2106", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/privateAccesses/myprivateAccess" + }, + "location": { + "$id": "2107", + "kind": "string", + "type": { + "$ref": "221" + }, + "value": "centraluseuap" + }, + "properties": { + "$id": "2108", + "kind": "model", + "type": { + "$ref": "223" + }, + "value": { + "$id": "2109", + "privateEndpointConnections": { + "$id": "2110", + "kind": "array", + "type": { + "$ref": "226" + }, + "value": [ + { + "$id": "2111", + "kind": "model", + "type": { + "$ref": "177" + }, + "value": { + "$id": "2112", + "name": { + "$id": "2113", + "kind": "string", + "type": { + "$id": "2114", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "myPrivateAccess.d4914cfa-6bc2-4049-a57c-3d1f622d8eef" + }, + "type": { + "$id": "2115", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/privateAccesses/PrivateEndpointConnections" + }, + "id": { + "$id": "2116", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess/privateEndpoinConnections/myPrivateAccess.d4914cfa-6bc2-4049-a57c-3d1f622d8eef" + }, + "properties": { + "$id": "2117", + "kind": "model", + "type": { + "$ref": "179" + }, + "value": { + "$id": "2118", + "privateEndpoint": { + "$id": "2119", + "kind": "model", + "type": { + "$ref": "184" + }, + "value": { + "$id": "2120", + "id": { + "$id": "2121", + "kind": "string", + "type": { + "$ref": "186" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint" + } + } + }, + "privateLinkServiceConnectionState": { + "$id": "2122", + "kind": "model", + "type": { + "$ref": "188" + }, + "value": { + "$id": "2123", + "description": { + "$id": "2124", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "Auto-Approved" + }, + "actionsRequired": { + "$id": "2125", + "kind": "string", + "type": { + "$ref": "193" + }, + "value": "None" + }, + "status": { + "$id": "2126", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "Approved" + } + } + }, + "provisioningState": { + "$id": "2127", + "kind": "string", + "type": { + "$ref": "20" + }, + "value": "Succeeded" + } + } + } + } + } + ] + }, + "publicNetworkAccess": { + "$id": "2128", + "kind": "string", + "type": { + "$ref": "42" + }, + "value": "Enabled" + } + } + }, + "systemData": { + "$id": "2129", + "kind": "model", + "type": { + "$ref": "147" + }, + "value": { + "$id": "2130", + "createdAt": { + "$id": "2131", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedAt": { + "$id": "2132", + "kind": "string", + "type": { + "$ref": "158" + }, + "value": "2021-07-01T00:00:00.0Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "2133", + "Name": "createOrUpdate", + "ResourceName": "PrivateAccess", + "Doc": "Create or update a private access", + "Accessibility": "public", + "Parameters": [ + { + "$id": "2134", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "2135", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "2136", + "Type": { + "$id": "2137", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2138", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "2139", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2140", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2141", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "2142", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2143", + "Name": "privateAccessName", + "NameInRequest": "privateAccessName", + "Doc": "The name of the private access resource that is being created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.", + "Type": { + "$id": "2144", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2145", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "2146", + "kind": "constant", + "valueType": { + "$id": "2147", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2148", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "2149", + "kind": "constant", + "valueType": { + "$id": "2150", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2151", + "Name": "resource", + "NameInRequest": "resource", + "Doc": "private access resource to be created or updated.", + "Type": { + "$ref": "214" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "2152", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "214" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + }, + { + "$id": "2153", + "StatusCodes": [ + 201 + ], + "BodyType": { + "$ref": "214" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "2154", + "Name": "azureAsyncOperation", + "NameInResponse": "Azure-AsyncOperation", + "Doc": "A link to the status monitor", + "Type": { + "$id": "2155", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "2156", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "2157", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/privateAccesses/{privateAccessName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "2158", + "FinalStateVia": 0, + "FinalResponse": { + "$id": "2159", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "214" + }, + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.PrivateAccesses.createOrUpdate", + "Decorators": [], + "Examples": [ + { + "$id": "2160", + "kind": "http", + "name": "Create or Update a private access resource", + "description": "Create or Update a private access resource", + "filePath": "2024-11-01-preview/PrivateAccesses_CreateOrUpdate_Create_Or_Update_A_Private_Access_Resource.json", + "parameters": [ + { + "$id": "2161", + "parameter": { + "$ref": "2134" + }, + "value": { + "$id": "2162", + "kind": "string", + "type": { + "$ref": "2135" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "2163", + "parameter": { + "$ref": "2151" + }, + "value": { + "$id": "2164", + "kind": "model", + "type": { + "$ref": "214" + }, + "value": { + "$id": "2165", + "location": { + "$id": "2166", + "kind": "string", + "type": { + "$ref": "221" + }, + "value": "centraluseuap" + }, + "properties": { + "$id": "2167", + "kind": "model", + "type": { + "$ref": "223" + }, + "value": { + "$id": "2168" + } + } + } + } + }, + { + "$id": "2169", + "parameter": { + "$ref": "2143" + }, + "value": { + "$id": "2170", + "kind": "string", + "type": { + "$ref": "2144" + }, + "value": "myPrivateAccess" + } + }, + { + "$id": "2171", + "parameter": { + "$ref": "2141" + }, + "value": { + "$id": "2172", + "kind": "string", + "type": { + "$ref": "2142" + }, + "value": "myResourceGroup" + } + }, + { + "$id": "2173", + "parameter": { + "$ref": "2138" + }, + "value": { + "$id": "2174", + "kind": "string", + "type": { + "$ref": "2139" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "2175", + "response": { + "$ref": "2152" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2176", + "kind": "model", + "type": { + "$ref": "214" + }, + "value": { + "$id": "2177", + "name": { + "$id": "2178", + "kind": "string", + "type": { + "$ref": "2082" + }, + "value": "myPrivateAccess" + }, + "type": { + "$id": "2179", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/privateAccesses" + }, + "id": { + "$id": "2180", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourcegroup/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess" + }, + "location": { + "$id": "2181", + "kind": "string", + "type": { + "$ref": "221" + }, + "value": "centraluseuap" + }, + "properties": { + "$id": "2182", + "kind": "model", + "type": { + "$ref": "223" + }, + "value": { + "$id": "2183", + "provisioningState": { + "$id": "2184", + "kind": "string", + "type": { + "$ref": "20" + }, + "value": "Updating" + } + } + }, + "systemData": { + "$id": "2185", + "kind": "model", + "type": { + "$ref": "147" + }, + "value": { + "$id": "2186", + "createdAt": { + "$id": "2187", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedAt": { + "$id": "2188", + "kind": "string", + "type": { + "$ref": "158" + }, + "value": "2021-07-01T00:00:00.0Z" + } + } + } + } + } + }, + { + "$id": "2189", + "response": { + "$ref": "2153" + }, + "statusCode": 201, + "bodyValue": { + "$id": "2190", + "kind": "model", + "type": { + "$ref": "214" + }, + "value": { + "$id": "2191", + "name": { + "$id": "2192", + "kind": "string", + "type": { + "$ref": "2082" + }, + "value": "myPrivateAccess" + }, + "type": { + "$id": "2193", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/privateAccesses" + }, + "id": { + "$id": "2194", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourcegroup/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess" + }, + "location": { + "$id": "2195", + "kind": "string", + "type": { + "$ref": "221" + }, + "value": "centraluseuap" + }, + "properties": { + "$id": "2196", + "kind": "model", + "type": { + "$ref": "223" + }, + "value": { + "$id": "2197", + "provisioningState": { + "$id": "2198", + "kind": "string", + "type": { + "$ref": "20" + }, + "value": "Creating" + } + } + }, + "systemData": { + "$id": "2199", + "kind": "model", + "type": { + "$ref": "147" + }, + "value": { + "$id": "2200", + "createdAt": { + "$id": "2201", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedAt": { + "$id": "2202", + "kind": "string", + "type": { + "$ref": "158" + }, + "value": "2021-07-01T00:00:00.0Z" + } + } + } + } + } + } + ] + }, + { + "$id": "2203", + "kind": "http", + "name": "Create or Update a private access resource with publicNetworkAccess", + "description": "Create or Update a private access resource with publicNetworkAccess", + "filePath": "2024-11-01-preview/PrivateAccesses_CreateOrUpdate_Create_Or_Update_A_Private_Access_Resource_With_Public_Network_Access.json", + "parameters": [ + { + "$id": "2204", + "parameter": { + "$ref": "2134" + }, + "value": { + "$id": "2205", + "kind": "string", + "type": { + "$ref": "2135" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "2206", + "parameter": { + "$ref": "2151" + }, + "value": { + "$id": "2207", + "kind": "model", + "type": { + "$ref": "214" + }, + "value": { + "$id": "2208", + "location": { + "$id": "2209", + "kind": "string", + "type": { + "$ref": "221" + }, + "value": "centraluseuap" + }, + "properties": { + "$id": "2210", + "kind": "model", + "type": { + "$ref": "223" + }, + "value": { + "$id": "2211", + "publicNetworkAccess": { + "$id": "2212", + "kind": "string", + "type": { + "$ref": "42" + }, + "value": "Enabled" + } + } + } + } + } + }, + { + "$id": "2213", + "parameter": { + "$ref": "2143" + }, + "value": { + "$id": "2214", + "kind": "string", + "type": { + "$ref": "2144" + }, + "value": "myPrivateAccess" + } + }, + { + "$id": "2215", + "parameter": { + "$ref": "2141" + }, + "value": { + "$id": "2216", + "kind": "string", + "type": { + "$ref": "2142" + }, + "value": "myResourceGroup" + } + }, + { + "$id": "2217", + "parameter": { + "$ref": "2138" + }, + "value": { + "$id": "2218", + "kind": "string", + "type": { + "$ref": "2139" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "2219", + "response": { + "$ref": "2152" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2220", + "kind": "model", + "type": { + "$ref": "214" + }, + "value": { + "$id": "2221", + "name": { + "$id": "2222", + "kind": "string", + "type": { + "$ref": "2082" + }, + "value": "myPrivateAccess" + }, + "type": { + "$id": "2223", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/privateAccesses" + }, + "id": { + "$id": "2224", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourcegroup/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess" + }, + "location": { + "$id": "2225", + "kind": "string", + "type": { + "$ref": "221" + }, + "value": "centraluseuap" + }, + "properties": { + "$id": "2226", + "kind": "model", + "type": { + "$ref": "223" + }, + "value": { + "$id": "2227", + "provisioningState": { + "$id": "2228", + "kind": "string", + "type": { + "$ref": "20" + }, + "value": "Updating" + }, + "publicNetworkAccess": { + "$id": "2229", + "kind": "string", + "type": { + "$ref": "42" + }, + "value": "Enabled" + } + } + }, + "systemData": { + "$id": "2230", + "kind": "model", + "type": { + "$ref": "147" + }, + "value": { + "$id": "2231", + "createdAt": { + "$id": "2232", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedAt": { + "$id": "2233", + "kind": "string", + "type": { + "$ref": "158" + }, + "value": "2021-07-01T00:00:00.0Z" + } + } + } + } + } + }, + { + "$id": "2234", + "response": { + "$ref": "2153" + }, + "statusCode": 201, + "bodyValue": { + "$id": "2235", + "kind": "model", + "type": { + "$ref": "214" + }, + "value": { + "$id": "2236", + "name": { + "$id": "2237", + "kind": "string", + "type": { + "$ref": "2082" + }, + "value": "myPrivateAccess" + }, + "type": { + "$id": "2238", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/privateAccesses" + }, + "id": { + "$id": "2239", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourcegroup/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess" + }, + "location": { + "$id": "2240", + "kind": "string", + "type": { + "$ref": "221" + }, + "value": "centraluseuap" + }, + "properties": { + "$id": "2241", + "kind": "model", + "type": { + "$ref": "223" + }, + "value": { + "$id": "2242", + "provisioningState": { + "$id": "2243", + "kind": "string", + "type": { + "$ref": "20" + }, + "value": "Creating" + }, + "publicNetworkAccess": { + "$id": "2244", + "kind": "string", + "type": { + "$ref": "42" + }, + "value": "Enabled" + } + } + }, + "systemData": { + "$id": "2245", + "kind": "model", + "type": { + "$ref": "147" + }, + "value": { + "$id": "2246", + "createdAt": { + "$id": "2247", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedAt": { + "$id": "2248", + "kind": "string", + "type": { + "$ref": "158" + }, + "value": "2021-07-01T00:00:00.0Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "2249", + "Name": "update", + "ResourceName": "PrivateAccess", + "Doc": "Patch a private access tags", + "Accessibility": "public", + "Parameters": [ + { + "$id": "2250", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "2251", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "2252", + "Type": { + "$id": "2253", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2254", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "2255", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2256", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2257", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "2258", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2259", + "Name": "privateAccessName", + "NameInRequest": "privateAccessName", + "Doc": "The name of the private access resource that is being created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.", + "Type": { + "$id": "2260", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2261", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "2262", + "kind": "constant", + "valueType": { + "$id": "2263", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2264", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "2265", + "kind": "constant", + "valueType": { + "$id": "2266", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2267", + "Name": "properties", + "NameInRequest": "properties", + "Doc": "private access resource's tags to be updated.", + "Type": { + "$ref": "228" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "2268", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "214" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + }, + { + "$id": "2269", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "2270", + "Name": "location", + "NameInResponse": "Location", + "Doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "Type": { + "$id": "2271", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "2272", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "2273", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/privateAccesses/{privateAccessName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "2274", + "FinalStateVia": 1, + "FinalResponse": { + "$id": "2275", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "214" + }, + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "Microsoft.Chaos.PrivateAccesses.update", + "Decorators": [], + "Examples": [ + { + "$id": "2276", + "kind": "http", + "name": "Update a private access resource's tags", + "description": "Update a private access resource's tags", + "filePath": "2024-11-01-preview/PrivateAccesses_Update.json", + "parameters": [ + { + "$id": "2277", + "parameter": { + "$ref": "2250" + }, + "value": { + "$id": "2278", + "kind": "string", + "type": { + "$ref": "2251" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "2279", + "parameter": { + "$ref": "2259" + }, + "value": { + "$id": "2280", + "kind": "string", + "type": { + "$ref": "2260" + }, + "value": "myPrivateAccess" + } + }, + { + "$id": "2281", + "parameter": { + "$ref": "2267" + }, + "value": { + "$id": "2282", + "kind": "model", + "type": { + "$ref": "228" + }, + "value": { + "$id": "2283", + "tags": { + "$id": "2284", + "kind": "dict", + "type": { + "$ref": "230" + }, + "value": { + "$id": "2285", + "tag1": { + "$id": "2286", + "kind": "string", + "type": { + "$ref": "232" + }, + "value": "value1" + }, + "tag2": { + "$id": "2287", + "kind": "string", + "type": { + "$ref": "232" + }, + "value": "value2" + } + } + } + } + } + }, + { + "$id": "2288", + "parameter": { + "$ref": "2257" + }, + "value": { + "$id": "2289", + "kind": "string", + "type": { + "$ref": "2258" + }, + "value": "myResourceGroup" + } + }, + { + "$id": "2290", + "parameter": { + "$ref": "2254" + }, + "value": { + "$id": "2291", + "kind": "string", + "type": { + "$ref": "2255" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "2292", + "response": { + "$ref": "2268" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2293", + "kind": "model", + "type": { + "$ref": "214" + }, + "value": { + "$id": "2294", + "name": { + "$id": "2295", + "kind": "string", + "type": { + "$ref": "2082" + }, + "value": "myPrivateAccess" + }, + "type": { + "$id": "2296", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/privateAccesses" + }, + "id": { + "$id": "2297", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourcegroup/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess" + }, + "location": { + "$id": "2298", + "kind": "string", + "type": { + "$ref": "221" + }, + "value": "centraluseuap" + }, + "properties": { + "$id": "2299", + "kind": "model", + "type": { + "$ref": "223" + }, + "value": { + "$id": "2300", + "provisioningState": { + "$id": "2301", + "kind": "string", + "type": { + "$ref": "20" + }, + "value": "Succeeded" + } + } + }, + "systemData": { + "$id": "2302", + "kind": "model", + "type": { + "$ref": "147" + }, + "value": { + "$id": "2303", + "createdAt": { + "$id": "2304", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedAt": { + "$id": "2305", + "kind": "string", + "type": { + "$ref": "158" + }, + "value": "2021-07-01T00:00:00.0Z" + } + } + }, + "tags": { + "$id": "2306", + "kind": "dict", + "type": { + "$ref": "217" + }, + "value": { + "$id": "2307", + "tag1": { + "$id": "2308", + "kind": "string", + "type": { + "$ref": "219" + }, + "value": "value1" + }, + "tag2": { + "$id": "2309", + "kind": "string", + "type": { + "$ref": "219" + }, + "value": "value2" + } + } + } + } + } + }, + { + "$id": "2310", + "response": { + "$ref": "2269" + }, + "statusCode": 202 + } + ] + } + ] + }, + { + "$id": "2311", + "Name": "delete", + "ResourceName": "PrivateAccess", + "Doc": "Delete a private access", + "Accessibility": "public", + "Parameters": [ + { + "$id": "2312", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "2313", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "2314", + "Type": { + "$id": "2315", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2316", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "2317", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2318", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2319", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "2320", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2321", + "Name": "privateAccessName", + "NameInRequest": "privateAccessName", + "Doc": "The name of the private access resource that is being created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.", + "Type": { + "$id": "2322", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2323", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "2324", + "kind": "constant", + "valueType": { + "$id": "2325", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "2326", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "2327", + "Name": "location", + "NameInResponse": "Location", + "Doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "Type": { + "$id": "2328", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "2329", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "2330", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false + }, + { + "$id": "2331", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "DELETE", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/privateAccesses/{privateAccessName}", + "BufferResponse": true, + "LongRunning": { + "$id": "2332", + "FinalStateVia": 1, + "FinalResponse": { + "$id": "2333", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.PrivateAccesses.delete", + "Decorators": [], + "Examples": [ + { + "$id": "2334", + "kind": "http", + "name": "Delete a private access resource", + "description": "Delete a private access resource", + "filePath": "2024-11-01-preview/PrivateAccesses_Delete.json", + "parameters": [ + { + "$id": "2335", + "parameter": { + "$ref": "2312" + }, + "value": { + "$id": "2336", + "kind": "string", + "type": { + "$ref": "2313" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "2337", + "parameter": { + "$ref": "2321" + }, + "value": { + "$id": "2338", + "kind": "string", + "type": { + "$ref": "2322" + }, + "value": "myPrivateAccess" + } + }, + { + "$id": "2339", + "parameter": { + "$ref": "2319" + }, + "value": { + "$id": "2340", + "kind": "string", + "type": { + "$ref": "2320" + }, + "value": "myResourceGroup" + } + }, + { + "$id": "2341", + "parameter": { + "$ref": "2316" + }, + "value": { + "$id": "2342", + "kind": "string", + "type": { + "$ref": "2317" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "2343", + "response": { + "$ref": "2326" + }, + "statusCode": 202 + }, + { + "$id": "2344", + "response": { + "$ref": "2331" + }, + "statusCode": 204 + } + ] + } + ] + }, + { + "$id": "2345", + "Name": "list", + "ResourceName": "PrivateAccess", + "Doc": "Get a list of private access resources in a resource group.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "2346", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "2347", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "2348", + "Type": { + "$id": "2349", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2350", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "2351", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2352", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2353", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "2354", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2355", + "Name": "continuationToken", + "NameInRequest": "continuationToken", + "Doc": "String that sets the continuation token.", + "Type": { + "$id": "2356", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2357", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "2358", + "kind": "constant", + "valueType": { + "$id": "2359", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "2360", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "233" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/privateAccesses", + "BufferResponse": true, + "Paging": { + "$id": "2361", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.PrivateAccesses.list", + "Decorators": [], + "Examples": [ + { + "$id": "2362", + "kind": "http", + "name": "List all private access in a resource group.", + "description": "List all private access in a resource group.", + "filePath": "2024-11-01-preview/PrivateAccesses_List.json", + "parameters": [ + { + "$id": "2363", + "parameter": { + "$ref": "2346" + }, + "value": { + "$id": "2364", + "kind": "string", + "type": { + "$ref": "2347" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "2365", + "parameter": { + "$ref": "2353" + }, + "value": { + "$id": "2366", + "kind": "string", + "type": { + "$ref": "2354" + }, + "value": "myResourceGroup" + } + }, + { + "$id": "2367", + "parameter": { + "$ref": "2350" + }, + "value": { + "$id": "2368", + "kind": "string", + "type": { + "$ref": "2351" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "2369", + "response": { + "$ref": "2360" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2370", + "kind": "model", + "type": { + "$ref": "233" + }, + "value": { + "$id": "2371", + "nextLink": { + "$id": "2372", + "kind": "string", + "type": { + "$ref": "237" + }, + "value": "https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/privateAccesses?continuationToken=&api-version=2024-11-01-preview" + }, + "value": { + "$id": "2373", + "kind": "array", + "type": { + "$ref": "235" + }, + "value": [ + { + "$id": "2374", + "kind": "model", + "type": { + "$ref": "214" + }, + "value": { + "$id": "2375", + "name": { + "$id": "2376", + "kind": "string", + "type": { + "$ref": "2082" + }, + "value": "myPrivateAccess2" + }, + "type": { + "$id": "2377", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/privateAccesses" + }, + "id": { + "$id": "2378", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess2" + }, + "location": { + "$id": "2379", + "kind": "string", + "type": { + "$ref": "221" + }, + "value": "centraluseuap" + }, + "properties": { + "$id": "2380", + "kind": "model", + "type": { + "$ref": "223" + }, + "value": { + "$id": "2381" + } + }, + "systemData": { + "$id": "2382", + "kind": "model", + "type": { + "$ref": "147" + }, + "value": { + "$id": "2383", + "createdAt": { + "$id": "2384", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedAt": { + "$id": "2385", + "kind": "string", + "type": { + "$ref": "158" + }, + "value": "2021-07-01T00:00:00.0Z" + } + } + } + } + }, + { + "$id": "2386", + "kind": "model", + "type": { + "$ref": "214" + }, + "value": { + "$id": "2387", + "name": { + "$id": "2388", + "kind": "string", + "type": { + "$ref": "2082" + }, + "value": "myPrivateAccess" + }, + "type": { + "$id": "2389", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/privateAccesses" + }, + "id": { + "$id": "2390", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess" + }, + "location": { + "$id": "2391", + "kind": "string", + "type": { + "$ref": "221" + }, + "value": "centraluseuap" + }, + "properties": { + "$id": "2392", + "kind": "model", + "type": { + "$ref": "223" + }, + "value": { + "$id": "2393", + "privateEndpointConnections": { + "$id": "2394", + "kind": "array", + "type": { + "$ref": "226" + }, + "value": [ + { + "$id": "2395", + "kind": "model", + "type": { + "$ref": "177" + }, + "value": { + "$id": "2396", + "name": { + "$id": "2397", + "kind": "string", + "type": { + "$ref": "2114" + }, + "value": "myPrivateAccess.d4914cfa-6bc2-4049-a57c-3d1f622d8eef" + }, + "type": { + "$id": "2398", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/privateAccesses/PrivateEndpointConnections" + }, + "id": { + "$id": "2399", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess/privateEndpoinConnections/myPrivateAccess.d4914cfa-6bc2-4049-a57c-3d1f622d8eef" + }, + "properties": { + "$id": "2400", + "kind": "model", + "type": { + "$ref": "179" + }, + "value": { + "$id": "2401", + "privateEndpoint": { + "$id": "2402", + "kind": "model", + "type": { + "$ref": "184" + }, + "value": { + "$id": "2403", + "id": { + "$id": "2404", + "kind": "string", + "type": { + "$ref": "186" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint" + } + } + }, + "privateLinkServiceConnectionState": { + "$id": "2405", + "kind": "model", + "type": { + "$ref": "188" + }, + "value": { + "$id": "2406", + "description": { + "$id": "2407", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "Auto-Approved" + }, + "actionsRequired": { + "$id": "2408", + "kind": "string", + "type": { + "$ref": "193" + }, + "value": "None" + }, + "status": { + "$id": "2409", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "Approved" + } + } + } + } + } + } + } + ] + }, + "publicNetworkAccess": { + "$id": "2410", + "kind": "string", + "type": { + "$ref": "42" + }, + "value": "Enabled" + } + } + }, + "systemData": { + "$id": "2411", + "kind": "model", + "type": { + "$ref": "147" + }, + "value": { + "$id": "2412", + "createdAt": { + "$id": "2413", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "2021-08-01T00:00:00.0Z" + }, + "lastModifiedAt": { + "$id": "2414", + "kind": "string", + "type": { + "$ref": "158" + }, + "value": "2021-08-01T00:00:00.0Z" + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + }, + { + "$id": "2415", + "Name": "listAll", + "ResourceName": "PrivateAccess", + "Doc": "Get a list of private access resources in a subscription.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "2416", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "2417", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "2418", + "Type": { + "$id": "2419", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2420", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "2421", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2422", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2423", + "Name": "continuationToken", + "NameInRequest": "continuationToken", + "Doc": "String that sets the continuation token.", + "Type": { + "$id": "2424", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2425", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "2426", + "kind": "constant", + "valueType": { + "$id": "2427", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "2428", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "233" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/privateAccesses", + "BufferResponse": true, + "Paging": { + "$id": "2429", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.PrivateAccesses.listAll", + "Decorators": [], + "Examples": [ + { + "$id": "2430", + "kind": "http", + "name": "List all private accesses in a subscription.", + "description": "List all private accesses in a subscription.", + "filePath": "2024-11-01-preview/PrivateAccesses_ListAll.json", + "parameters": [ + { + "$id": "2431", + "parameter": { + "$ref": "2416" + }, + "value": { + "$id": "2432", + "kind": "string", + "type": { + "$ref": "2417" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "2433", + "parameter": { + "$ref": "2420" + }, + "value": { + "$id": "2434", + "kind": "string", + "type": { + "$ref": "2421" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "2435", + "response": { + "$ref": "2428" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2436", + "kind": "model", + "type": { + "$ref": "233" + }, + "value": { + "$id": "2437", + "nextLink": { + "$id": "2438", + "kind": "string", + "type": { + "$ref": "237" + }, + "value": "https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/providers/Microsoft.Chaos/privateAccesses?continuationToken=&api-version=2024-11-01-preview" + }, + "value": { + "$id": "2439", + "kind": "array", + "type": { + "$ref": "235" + }, + "value": [ + { + "$id": "2440", + "kind": "model", + "type": { + "$ref": "214" + }, + "value": { + "$id": "2441", + "name": { + "$id": "2442", + "kind": "string", + "type": { + "$ref": "2082" + }, + "value": "myPrivateAccess2" + }, + "type": { + "$id": "2443", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/privateAccesses" + }, + "id": { + "$id": "2444", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess2" + }, + "location": { + "$id": "2445", + "kind": "string", + "type": { + "$ref": "221" + }, + "value": "centraluseuap" + }, + "properties": { + "$id": "2446", + "kind": "model", + "type": { + "$ref": "223" + }, + "value": { + "$id": "2447" + } + }, + "systemData": { + "$id": "2448", + "kind": "model", + "type": { + "$ref": "147" + }, + "value": { + "$id": "2449", + "createdAt": { + "$id": "2450", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "2021-07-01T00:00:00.0Z" + }, + "lastModifiedAt": { + "$id": "2451", + "kind": "string", + "type": { + "$ref": "158" + }, + "value": "2021-07-01T00:00:00.0Z" + } + } + } + } + }, + { + "$id": "2452", + "kind": "model", + "type": { + "$ref": "214" + }, + "value": { + "$id": "2453", + "name": { + "$id": "2454", + "kind": "string", + "type": { + "$ref": "2082" + }, + "value": "myPrivateAccess" + }, + "type": { + "$id": "2455", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/privateAccesses" + }, + "id": { + "$id": "2456", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup2/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess" + }, + "location": { + "$id": "2457", + "kind": "string", + "type": { + "$ref": "221" + }, + "value": "centraluseuap" + }, + "properties": { + "$id": "2458", + "kind": "model", + "type": { + "$ref": "223" + }, + "value": { + "$id": "2459", + "privateEndpointConnections": { + "$id": "2460", + "kind": "array", + "type": { + "$ref": "226" + }, + "value": [ + { + "$id": "2461", + "kind": "model", + "type": { + "$ref": "177" + }, + "value": { + "$id": "2462", + "name": { + "$id": "2463", + "kind": "string", + "type": { + "$ref": "2114" + }, + "value": "myPrivateAccess.d4914cfa-6bc2-4049-a57c-3d1f622d8eef" + }, + "type": { + "$id": "2464", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/privateAccesses/PrivateEndpointConnections" + }, + "id": { + "$id": "2465", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup2/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess/privateEndpoinConnections/myPrivateAccess.d4914cfa-6bc2-4049-a57c-3d1f622d8eef" + }, + "properties": { + "$id": "2466", + "kind": "model", + "type": { + "$ref": "179" + }, + "value": { + "$id": "2467", + "privateEndpoint": { + "$id": "2468", + "kind": "model", + "type": { + "$ref": "184" + }, + "value": { + "$id": "2469", + "id": { + "$id": "2470", + "kind": "string", + "type": { + "$ref": "186" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup2/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint" + } + } + }, + "privateLinkServiceConnectionState": { + "$id": "2471", + "kind": "model", + "type": { + "$ref": "188" + }, + "value": { + "$id": "2472", + "description": { + "$id": "2473", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "Auto-Approved" + }, + "actionsRequired": { + "$id": "2474", + "kind": "string", + "type": { + "$ref": "193" + }, + "value": "None" + }, + "status": { + "$id": "2475", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "Approved" + } + } + } + } + } + } + } + ] + }, + "publicNetworkAccess": { + "$id": "2476", + "kind": "string", + "type": { + "$ref": "42" + }, + "value": "Disabled" + } + } + }, + "systemData": { + "$id": "2477", + "kind": "model", + "type": { + "$ref": "147" + }, + "value": { + "$id": "2478", + "createdAt": { + "$id": "2479", + "kind": "string", + "type": { + "$ref": "152" + }, + "value": "2021-08-01T00:00:00.0Z" + }, + "lastModifiedAt": { + "$id": "2480", + "kind": "string", + "type": { + "$ref": "158" + }, + "value": "2021-08-01T00:00:00.0Z" + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + }, + { + "$id": "2481", + "Name": "privateLinkResources", + "ResourceName": "PrivateAccesses", + "Doc": "Gets the private link resources possible under private access resource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "2482", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "2483", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "2484", + "Type": { + "$id": "2485", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2486", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "2487", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2488", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2489", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "2490", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2491", + "Name": "privateAccessName", + "NameInRequest": "privateAccessName", + "Doc": "The name of the private access resource that is being created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.", + "Type": { + "$id": "2492", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2493", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "2494", + "kind": "constant", + "valueType": { + "$id": "2495", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "2496", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "239" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/privateAccesses/{privateAccessName}/privateLinkResources", + "BufferResponse": true, + "Paging": { + "$id": "2497", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.PrivateAccesses.privateLinkResources", + "Decorators": [], + "Examples": [ + { + "$id": "2498", + "kind": "http", + "name": "List all possible private link resources under private access resource.", + "description": "List all possible private link resources under private access resource.", + "filePath": "2024-11-01-preview/PrivateAccesses_GetPrivateLinkResources.json", + "parameters": [ + { + "$id": "2499", + "parameter": { + "$ref": "2482" + }, + "value": { + "$id": "2500", + "kind": "string", + "type": { + "$ref": "2483" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "2501", + "parameter": { + "$ref": "2491" + }, + "value": { + "$id": "2502", + "kind": "string", + "type": { + "$ref": "2492" + }, + "value": "myPrivateAccess" + } + }, + { + "$id": "2503", + "parameter": { + "$ref": "2489" + }, + "value": { + "$id": "2504", + "kind": "string", + "type": { + "$ref": "2490" + }, + "value": "myResourceGroup" + } + }, + { + "$id": "2505", + "parameter": { + "$ref": "2486" + }, + "value": { + "$id": "2506", + "kind": "string", + "type": { + "$ref": "2487" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "2507", + "response": { + "$ref": "2496" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2508", + "kind": "model", + "type": { + "$ref": "239" + }, + "value": { + "$id": "2509", + "value": { + "$id": "2510", + "kind": "array", + "type": { + "$ref": "241" + }, + "value": [ + { + "$id": "2511", + "kind": "model", + "type": { + "$ref": "242" + }, + "value": { + "$id": "2512", + "name": { + "$id": "2513", + "kind": "string", + "type": { + "$id": "2514", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "agents" + }, + "type": { + "$id": "2515", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/privateAccesses/privateLinkResources" + }, + "id": { + "$id": "2516", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess/privateLinkResources/agents" + }, + "location": { + "$id": "2517", + "kind": "string", + "type": { + "$ref": "221" + }, + "value": "centraluseuap" + }, + "properties": { + "$id": "2518", + "kind": "model", + "type": { + "$ref": "244" + }, + "value": { + "$id": "2519", + "groupId": { + "$id": "2520", + "kind": "string", + "type": { + "$ref": "246" + }, + "value": "agents" + }, + "requiredMembers": { + "$id": "2521", + "kind": "array", + "type": { + "$ref": "248" + }, + "value": [ + { + "$id": "2522", + "kind": "string", + "type": { + "$ref": "249" + }, + "value": "privateAccess_1" + } + ] + }, + "requiredZoneNames": { + "$id": "2523", + "kind": "array", + "type": { + "$ref": "251" + }, + "value": [ + { + "$id": "2524", + "kind": "string", + "type": { + "$ref": "252" + }, + "value": "privatelink.agents.core.windows.net" + } + ] + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "2525" + }, + "Parent": "ChaosClient", + "Parameters": [ + { + "$id": "2526", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "2527", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "2528", + "Type": { + "$id": "2529", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "2530", + "Name": "PrivateEndpointConnections", + "Operations": [ + { + "$id": "2531", + "Name": "getAPrivateEndpointConnection", + "ResourceName": "PrivateEndpointConnection", + "Doc": "Gets information about a private endpoint connection under a private access resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "2532", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "2533", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "2534", + "Type": { + "$id": "2535", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2536", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "2537", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2538", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2539", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "2540", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2541", + "Name": "privateAccessName", + "NameInRequest": "privateAccessName", + "Doc": "The name of the private access resource that is being created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.", + "Type": { + "$id": "2542", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2543", + "Name": "privateEndpointConnectionName", + "NameInRequest": "privateEndpointConnectionName", + "Doc": "The name of the private endpoint connection.", + "Type": { + "$id": "2544", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2545", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "2546", + "kind": "constant", + "valueType": { + "$id": "2547", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "2548", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "177" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/privateAccesses/{privateAccessName}/privateEndpointConnections/{privateEndpointConnectionName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.PrivateEndpointConnections.getAPrivateEndpointConnection", + "Decorators": [], + "Examples": [ + { + "$id": "2549", + "kind": "http", + "name": "Get information about a private endpoint connection under a private access resource.", + "description": "Get information about a private endpoint connection under a private access resource.", + "filePath": "2024-11-01-preview/PrivateAccesses_GetAPrivateEndpointConnection.json", + "parameters": [ + { + "$id": "2550", + "parameter": { + "$ref": "2532" + }, + "value": { + "$id": "2551", + "kind": "string", + "type": { + "$ref": "2533" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "2552", + "parameter": { + "$ref": "2541" + }, + "value": { + "$id": "2553", + "kind": "string", + "type": { + "$ref": "2542" + }, + "value": "myPrivateAccess" + } + }, + { + "$id": "2554", + "parameter": { + "$ref": "2543" + }, + "value": { + "$id": "2555", + "kind": "string", + "type": { + "$ref": "2544" + }, + "value": "myPrivateEndpointConnection" + } + }, + { + "$id": "2556", + "parameter": { + "$ref": "2539" + }, + "value": { + "$id": "2557", + "kind": "string", + "type": { + "$ref": "2540" + }, + "value": "myResourceGroup" + } + }, + { + "$id": "2558", + "parameter": { + "$ref": "2536" + }, + "value": { + "$id": "2559", + "kind": "string", + "type": { + "$ref": "2537" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "2560", + "response": { + "$ref": "2548" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2561", + "kind": "model", + "type": { + "$ref": "177" + }, + "value": { + "$id": "2562", + "name": { + "$id": "2563", + "kind": "string", + "type": { + "$ref": "2114" + }, + "value": "myPrivateEndpointConnection" + }, + "type": { + "$id": "2564", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/privateAccesses/PrivateEndpointConnections" + }, + "id": { + "$id": "2565", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess/privateEndpoinConnections/myPrivateEndpointConnection" + }, + "properties": { + "$id": "2566", + "kind": "model", + "type": { + "$ref": "179" + }, + "value": { + "$id": "2567", + "privateEndpoint": { + "$id": "2568", + "kind": "model", + "type": { + "$ref": "184" + }, + "value": { + "$id": "2569", + "id": { + "$id": "2570", + "kind": "string", + "type": { + "$ref": "186" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint" + } + } + }, + "privateLinkServiceConnectionState": { + "$id": "2571", + "kind": "model", + "type": { + "$ref": "188" + }, + "value": { + "$id": "2572", + "description": { + "$id": "2573", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "Auto-Approved" + }, + "actionsRequired": { + "$id": "2574", + "kind": "string", + "type": { + "$ref": "193" + }, + "value": "None" + }, + "status": { + "$id": "2575", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "Approved" + } + } + }, + "provisioningState": { + "$id": "2576", + "kind": "string", + "type": { + "$ref": "20" + }, + "value": "Succeeded" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "2577", + "Name": "deleteAPrivateEndpointConnection", + "ResourceName": "PrivateEndpointConnection", + "Doc": "Deletes a private endpoint connection under a private access resource.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "2578", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "2579", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "2580", + "Type": { + "$id": "2581", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2582", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "2583", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2584", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2585", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "2586", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2587", + "Name": "privateAccessName", + "NameInRequest": "privateAccessName", + "Doc": "The name of the private access resource that is being created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.", + "Type": { + "$id": "2588", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2589", + "Name": "privateEndpointConnectionName", + "NameInRequest": "privateEndpointConnectionName", + "Doc": "The name of the private endpoint connection.", + "Type": { + "$id": "2590", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2591", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "2592", + "kind": "constant", + "valueType": { + "$id": "2593", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "2594", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "2595", + "Name": "location", + "NameInResponse": "Location", + "Doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "Type": { + "$id": "2596", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "2597", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "2598", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false + }, + { + "$id": "2599", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "DELETE", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/privateAccesses/{privateAccessName}/privateEndpointConnections/{privateEndpointConnectionName}", + "BufferResponse": true, + "LongRunning": { + "$id": "2600", + "FinalStateVia": 1, + "FinalResponse": { + "$id": "2601", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.PrivateEndpointConnections.deleteAPrivateEndpointConnection", + "Decorators": [], + "Examples": [ + { + "$id": "2602", + "kind": "http", + "name": "Delete a private endpoint connection under a private access resource.", + "description": "Delete a private endpoint connection under a private access resource.", + "filePath": "2024-11-01-preview/PrivateAccesses_DeleteAPrivateEndpointConnection.json", + "parameters": [ + { + "$id": "2603", + "parameter": { + "$ref": "2578" + }, + "value": { + "$id": "2604", + "kind": "string", + "type": { + "$ref": "2579" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "2605", + "parameter": { + "$ref": "2587" + }, + "value": { + "$id": "2606", + "kind": "string", + "type": { + "$ref": "2588" + }, + "value": "myPrivateAccess" + } + }, + { + "$id": "2607", + "parameter": { + "$ref": "2589" + }, + "value": { + "$id": "2608", + "kind": "string", + "type": { + "$ref": "2590" + }, + "value": "myPrivateEndpointConnection" + } + }, + { + "$id": "2609", + "parameter": { + "$ref": "2585" + }, + "value": { + "$id": "2610", + "kind": "string", + "type": { + "$ref": "2586" + }, + "value": "myResourceGroup" + } + }, + { + "$id": "2611", + "parameter": { + "$ref": "2582" + }, + "value": { + "$id": "2612", + "kind": "string", + "type": { + "$ref": "2583" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "2613", + "response": { + "$ref": "2594" + }, + "statusCode": 202 + }, + { + "$id": "2614", + "response": { + "$ref": "2599" + }, + "statusCode": 204 + } + ] + } + ] + }, + { + "$id": "2615", + "Name": "listPrivateEndpointConnections", + "ResourceName": "PrivateEndpointConnection", + "Doc": "List information about private endpoint connections under a private access resource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "2616", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "2617", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "2618", + "Type": { + "$id": "2619", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2620", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "2621", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2622", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2623", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "2624", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2625", + "Name": "privateAccessName", + "NameInRequest": "privateAccessName", + "Doc": "The name of the private access resource that is being created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.", + "Type": { + "$id": "2626", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2627", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "2628", + "kind": "constant", + "valueType": { + "$id": "2629", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "2630", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "208" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/privateAccesses/{privateAccessName}/privateEndpointConnections", + "BufferResponse": true, + "Paging": { + "$id": "2631", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.PrivateEndpointConnections.listPrivateEndpointConnections", + "Decorators": [], + "Examples": [ + { + "$id": "2632", + "kind": "http", + "name": "List all private endpoint connections under a private access resource.", + "description": "List all private endpoint connections under a private access resource.", + "filePath": "2024-11-01-preview/PrivateAccesses_ListPrivateEndpointConnections.json", + "parameters": [ + { + "$id": "2633", + "parameter": { + "$ref": "2616" + }, + "value": { + "$id": "2634", + "kind": "string", + "type": { + "$ref": "2617" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "2635", + "parameter": { + "$ref": "2625" + }, + "value": { + "$id": "2636", + "kind": "string", + "type": { + "$ref": "2626" + }, + "value": "myPrivateAccess" + } + }, + { + "$id": "2637", + "parameter": { + "$ref": "2623" + }, + "value": { + "$id": "2638", + "kind": "string", + "type": { + "$ref": "2624" + }, + "value": "myResourceGroup" + } + }, + { + "$id": "2639", + "parameter": { + "$ref": "2620" + }, + "value": { + "$id": "2640", + "kind": "string", + "type": { + "$ref": "2621" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "2641", + "response": { + "$ref": "2630" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2642", + "kind": "model", + "type": { + "$ref": "208" + }, + "value": { + "$id": "2643", + "value": { + "$id": "2644", + "kind": "array", + "type": { + "$ref": "210" + }, + "value": [ + { + "$id": "2645", + "kind": "model", + "type": { + "$ref": "177" + }, + "value": { + "$id": "2646", + "name": { + "$id": "2647", + "kind": "string", + "type": { + "$ref": "2114" + }, + "value": "myPrivateEndpointConnection" + }, + "type": { + "$id": "2648", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/privateAccesses/PrivateEndpointConnections" + }, + "id": { + "$id": "2649", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess/privateEndpoinConnections/myPrivateEndpointConnection" + }, + "properties": { + "$id": "2650", + "kind": "model", + "type": { + "$ref": "179" + }, + "value": { + "$id": "2651", + "privateEndpoint": { + "$id": "2652", + "kind": "model", + "type": { + "$ref": "184" + }, + "value": { + "$id": "2653", + "id": { + "$id": "2654", + "kind": "string", + "type": { + "$ref": "186" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint" + } + } + }, + "privateLinkServiceConnectionState": { + "$id": "2655", + "kind": "model", + "type": { + "$ref": "188" + }, + "value": { + "$id": "2656", + "description": { + "$id": "2657", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "Auto-Approved" + }, + "actionsRequired": { + "$id": "2658", + "kind": "string", + "type": { + "$ref": "193" + }, + "value": "None" + }, + "status": { + "$id": "2659", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "Approved" + } + } + }, + "provisioningState": { + "$id": "2660", + "kind": "string", + "type": { + "$ref": "20" + }, + "value": "Succeeded" + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "2661" + }, + "Parent": "ChaosClient", + "Parameters": [ + { + "$id": "2662", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "2663", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "2664", + "Type": { + "$id": "2665", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "2666", + "Name": "TargetTypes", + "Operations": [ + { + "$id": "2667", + "Name": "get", + "ResourceName": "TargetType", + "Doc": "Get a Target Type resources for given location.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "2668", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "2669", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "2670", + "Type": { + "$id": "2671", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2672", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "2673", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2674", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2675", + "Name": "location", + "NameInRequest": "location", + "Doc": "The name of the Azure region.", + "Type": { + "$id": "2676", + "kind": "string", + "name": "azureLocation", + "crossLanguageDefinitionId": "Azure.Core.azureLocation", + "baseType": { + "$id": "2677", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2678", + "Name": "targetTypeName", + "NameInRequest": "targetTypeName", + "Doc": "String that represents a Target Type resource name.", + "Type": { + "$id": "2679", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2680", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "2681", + "kind": "constant", + "valueType": { + "$id": "2682", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "2683", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "135" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.TargetTypes.get", + "Decorators": [], + "Examples": [ + { + "$id": "2684", + "kind": "http", + "name": "Get a Target Type for westus2 location", + "description": "Get a Target Type for westus2 location", + "filePath": "2024-11-01-preview/TargetTypes_Get.json", + "parameters": [ + { + "$id": "2685", + "parameter": { + "$ref": "2668" + }, + "value": { + "$id": "2686", + "kind": "string", + "type": { + "$ref": "2669" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "2687", + "parameter": { + "$ref": "2675" + }, + "value": { + "$id": "2688", + "kind": "string", + "type": { + "$ref": "2676" + }, + "value": "westus2" + } + }, + { + "$id": "2689", + "parameter": { + "$ref": "2672" + }, + "value": { + "$id": "2690", + "kind": "string", + "type": { + "$ref": "2673" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + }, + { + "$id": "2691", + "parameter": { + "$ref": "2678" + }, + "value": { + "$id": "2692", + "kind": "string", + "type": { + "$ref": "2679" + }, + "value": "Microsoft-Agent" + } + } + ], + "responses": [ + { + "$id": "2693", + "response": { + "$ref": "2683" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2694", + "kind": "model", + "type": { + "$ref": "135" + }, + "value": { + "$id": "2695", + "name": { + "$id": "2696", + "kind": "string", + "type": { + "$id": "2697", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "Microsoft-Agent" + }, + "type": { + "$id": "2698", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/locations/targetTypes" + }, + "id": { + "$id": "2699", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/providers/Microsoft.Chaos/locations/westus2/targetTypes/Microsoft-Agent" + }, + "properties": { + "$id": "2700", + "kind": "model", + "type": { + "$ref": "161" + }, + "value": { + "$id": "2701", + "description": { + "$id": "2702", + "kind": "string", + "type": { + "$ref": "165" + }, + "value": "A target represents Chaos Agent." + }, + "displayName": { + "$id": "2703", + "kind": "string", + "type": { + "$ref": "163" + }, + "value": "Chaos Agent" + }, + "propertiesSchema": { + "$id": "2704", + "kind": "string", + "type": { + "$ref": "167" + }, + "value": "https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine.json" + }, + "resourceTypes": { + "$id": "2705", + "kind": "array", + "type": { + "$ref": "169" + }, + "value": [ + { + "$id": "2706", + "kind": "string", + "type": { + "$ref": "170" + }, + "value": "Microsoft.Compute/virtualMachines" + }, + { + "$id": "2707", + "kind": "string", + "type": { + "$ref": "170" + }, + "value": "Microsoft.Compute/virtualMachineScaleSets" + } + ] + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "2708", + "Name": "list", + "ResourceName": "TargetType", + "Doc": "Get a list of Target Type resources for given location.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "2709", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "2710", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "2711", + "Type": { + "$id": "2712", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2713", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "2714", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2715", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2716", + "Name": "location", + "NameInRequest": "location", + "Doc": "The name of the Azure region.", + "Type": { + "$id": "2717", + "kind": "string", + "name": "azureLocation", + "crossLanguageDefinitionId": "Azure.Core.azureLocation", + "baseType": { + "$id": "2718", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2719", + "Name": "continuationToken", + "NameInRequest": "continuationToken", + "Doc": "String that sets the continuation token.", + "Type": { + "$id": "2720", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2721", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "2722", + "kind": "constant", + "valueType": { + "$id": "2723", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "2724", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "171" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes", + "BufferResponse": true, + "Paging": { + "$id": "2725", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.TargetTypes.list", + "Decorators": [], + "Examples": [ + { + "$id": "2726", + "kind": "http", + "name": "List all Target Types for westus2 location.", + "description": "List all Target Types for westus2 location.", + "filePath": "2024-11-01-preview/TargetTypes_List.json", + "parameters": [ + { + "$id": "2727", + "parameter": { + "$ref": "2709" + }, + "value": { + "$id": "2728", + "kind": "string", + "type": { + "$ref": "2710" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "2729", + "parameter": { + "$ref": "2716" + }, + "value": { + "$id": "2730", + "kind": "string", + "type": { + "$ref": "2717" + }, + "value": "westus2" + } + }, + { + "$id": "2731", + "parameter": { + "$ref": "2713" + }, + "value": { + "$id": "2732", + "kind": "string", + "type": { + "$ref": "2714" + }, + "value": "6b052e15-03d3-4f17-b2e1-be7f07588291" + } + } + ], + "responses": [ + { + "$id": "2733", + "response": { + "$ref": "2724" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2734", + "kind": "model", + "type": { + "$ref": "171" + }, + "value": { + "$id": "2735", + "nextLink": { + "$id": "2736", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/providers/Microsoft.Chaos/locations/westus2/targetTypes?continuationToken=&api-version=2024-11-01-preview" + }, + "value": { + "$id": "2737", + "kind": "array", + "type": { + "$ref": "173" + }, + "value": [ + { + "$id": "2738", + "kind": "model", + "type": { + "$ref": "135" + }, + "value": { + "$id": "2739", + "name": { + "$id": "2740", + "kind": "string", + "type": { + "$ref": "2697" + }, + "value": "Microsoft-Agent" + }, + "type": { + "$id": "2741", + "kind": "string", + "type": { + "$ref": "144" + }, + "value": "Microsoft.Chaos/locations/targetTypes" + }, + "id": { + "$id": "2742", + "kind": "string", + "type": { + "$ref": "139" + }, + "value": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/providers/Microsoft.Chaos/locations/westus2/targetTypes/Microsoft-Agent" + }, + "properties": { + "$id": "2743", + "kind": "model", + "type": { + "$ref": "161" + }, + "value": { + "$id": "2744", + "description": { + "$id": "2745", + "kind": "string", + "type": { + "$ref": "165" + }, + "value": "A target represents Chaos Agent." + }, + "displayName": { + "$id": "2746", + "kind": "string", + "type": { + "$ref": "163" + }, + "value": "Chaos Agent" + }, + "propertiesSchema": { + "$id": "2747", + "kind": "string", + "type": { + "$ref": "167" + }, + "value": "https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine.json" + }, + "resourceTypes": { + "$id": "2748", + "kind": "array", + "type": { + "$ref": "169" + }, + "value": [ + { + "$id": "2749", + "kind": "string", + "type": { + "$ref": "170" + }, + "value": "Microsoft.Compute/virtualMachines" + }, + { + "$id": "2750", + "kind": "string", + "type": { + "$ref": "170" + }, + "value": "Microsoft.Compute/virtualMachineScaleSets" + } + ] + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "2751" + }, + "Parent": "ChaosClient", + "Parameters": [ + { + "$id": "2752", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "2753", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "2754", + "Type": { + "$id": "2755", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "2756", + "Name": "OperationStatuses", + "Doc": "Chaos Studio async operation status resource operations.", + "Operations": [ + { + "$id": "2757", + "Name": "get", + "ResourceName": "OperationStatuses", + "Doc": "Returns the current status of an async operation.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "2758", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "2759", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "2760", + "Type": { + "$id": "2761", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-01-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2762", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "2763", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2764", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2765", + "Name": "location", + "NameInRequest": "location", + "Doc": "The location name.", + "Type": { + "$id": "2766", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2767", + "Name": "operationId", + "NameInRequest": "operationId", + "Doc": "The ID of an ongoing async operation.", + "Type": { + "$id": "2768", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "2769", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "2770", + "kind": "constant", + "valueType": { + "$id": "2771", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "2772", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "96" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/operationStatuses/{operationId}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.Chaos.OperationStatuses.get", + "Decorators": [], + "Examples": [ + { + "$id": "2773", + "kind": "http", + "name": "Gets Chaos Studio async operation status.", + "description": "Gets Chaos Studio async operation status.", + "filePath": "2024-11-01-preview/OperationStatuses_Get.json", + "parameters": [ + { + "$id": "2774", + "parameter": { + "$ref": "2758" + }, + "value": { + "$id": "2775", + "kind": "string", + "type": { + "$ref": "2759" + }, + "value": "2024-11-01-preview" + } + }, + { + "$id": "2776", + "parameter": { + "$ref": "2762" + }, + "value": { + "$id": "2777", + "kind": "string", + "type": { + "$ref": "2763" + }, + "value": "e25c0d12-0335-4fec-8ef8-3b4f9a10649e" + } + }, + { + "$id": "2778", + "parameter": { + "$ref": "2765" + }, + "value": { + "$id": "2779", + "kind": "string", + "type": { + "$ref": "2766" + }, + "value": "westus2" + } + }, + { + "$id": "2780", + "parameter": { + "$ref": "2767" + }, + "value": { + "$id": "2781", + "kind": "string", + "type": { + "$ref": "2768" + }, + "value": "4bdadd97-207c-4de8-9bba-08339ae099c7" + } + } + ], + "responses": [ + { + "$id": "2782", + "response": { + "$ref": "2772" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2783", + "kind": "model", + "type": { + "$ref": "96" + }, + "value": { + "$id": "2784", + "id": { + "$id": "2785", + "kind": "string", + "type": { + "$ref": "98" + }, + "value": "/subscriptions/e25c0d12-0335-4fec-8ef8-3b4f9a10649e/providers/Microsoft.Chaos/locations/westus2/operationStatuses/4bdadd97-207c-4de8-9bba-08339ae099c7" + }, + "name": { + "$id": "2786", + "kind": "string", + "type": { + "$ref": "101" + }, + "value": "4bdadd97-207c-4de8-9bba-08339ae099c7" + }, + "startTime": { + "$id": "2787", + "kind": "string", + "type": { + "$ref": "107" + }, + "value": "2024-11-14T21:52:52.2552574Z" + }, + "status": { + "$id": "2788", + "kind": "string", + "type": { + "$ref": "103" + }, + "value": "Creating" + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "2789" + }, + "Parent": "ChaosClient", + "Parameters": [ + { + "$id": "2790", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "2791", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "2792", + "Type": { + "$id": "2793", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + } + ], + "Auth": { + "$id": "2794", + "OAuth2": { + "$id": "2795", + "Scopes": [ + "user_impersonation" + ] + } + } +} diff --git a/sdk/chaos/ci.mgmt.yml b/sdk/chaos/ci.mgmt.yml index 585591bcb6bd..9fe04143c932 100644 --- a/sdk/chaos/ci.mgmt.yml +++ b/sdk/chaos/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/chaos/ci.mgmt.yml - sdk/chaos/Azure.ResourceManager.Chaos/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/chaos/ci.mgmt.yml + - sdk/chaos/Azure.ResourceManager.Chaos/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/chaos/ci.mgmt.yml + - sdk/chaos/Azure.ResourceManager.Chaos/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/chaos/ci.mgmt.yml + - sdk/chaos/Azure.ResourceManager.Chaos/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/chaos/ci.mgmt.yml + - sdk/chaos/Azure.ResourceManager.Chaos/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/chaos/ci.mgmt.yml + - sdk/chaos/Azure.ResourceManager.Chaos/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/chaos/ci.mgmt.yml + - sdk/chaos/Azure.ResourceManager.Chaos/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/chaos/ci.mgmt.yml + - sdk/chaos/Azure.ResourceManager.Chaos/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/chaos/ci.mgmt.yml + - sdk/chaos/Azure.ResourceManager.Chaos/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/chaos/ci.mgmt.yml + - sdk/chaos/Azure.ResourceManager.Chaos/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/cognitiveservices/ci.mgmt.yml b/sdk/cognitiveservices/ci.mgmt.yml index ddeb32b868ce..cd56ea2ae78e 100644 --- a/sdk/cognitiveservices/ci.mgmt.yml +++ b/sdk/cognitiveservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/cognitiveservices/ci.mgmt.yml - sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cognitiveservices/ci.mgmt.yml + - sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cognitiveservices/ci.mgmt.yml + - sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cognitiveservices/ci.mgmt.yml + - sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cognitiveservices/ci.mgmt.yml + - sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cognitiveservices/ci.mgmt.yml + - sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cognitiveservices/ci.mgmt.yml + - sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cognitiveservices/ci.mgmt.yml + - sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cognitiveservices/ci.mgmt.yml + - sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cognitiveservices/ci.mgmt.yml + - sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/communication/ci.mgmt.yml b/sdk/communication/ci.mgmt.yml index 8fc73e107745..4e8c6cba72ba 100644 --- a/sdk/communication/ci.mgmt.yml +++ b/sdk/communication/ci.mgmt.yml @@ -1,5 +1,6 @@ trigger: none + pr: branches: include: @@ -12,6 +13,114 @@ pr: - sdk/communication/ci.mgmt.yml - sdk/communication/Azure.ResourceManager.Communication/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/communication/ci.mgmt.yml + - sdk/communication/Azure.ResourceManager.Communication/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/communication/ci.mgmt.yml + - sdk/communication/Azure.ResourceManager.Communication/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/communication/ci.mgmt.yml + - sdk/communication/Azure.ResourceManager.Communication/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/communication/ci.mgmt.yml + - sdk/communication/Azure.ResourceManager.Communication/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/communication/ci.mgmt.yml + - sdk/communication/Azure.ResourceManager.Communication/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/communication/ci.mgmt.yml + - sdk/communication/Azure.ResourceManager.Communication/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/communication/ci.mgmt.yml + - sdk/communication/Azure.ResourceManager.Communication/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/communication/ci.mgmt.yml + - sdk/communication/Azure.ResourceManager.Communication/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/communication/ci.mgmt.yml + - sdk/communication/Azure.ResourceManager.Communication/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/autorest.md b/sdk/compute/Azure.ResourceManager.Compute/src/autorest.md index 95deffbbf263..be9b8a6c080e 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/autorest.md +++ b/sdk/compute/Azure.ResourceManager.Compute/src/autorest.md @@ -10,7 +10,7 @@ Run `dotnet build /t:GenerateCode` to generate code. azure-arm: true library-name: Compute namespace: Azure.ResourceManager.Compute -require: https://github.com/Azure/azure-rest-api-specs/blob/bf420af156ea90b4226e96582bdb4c9647491ae6/specification/compute/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/compute/resource-manager/readme.md #tag: package-2024-03-03 output-folder: $(this-folder)/Generated clear-output-folder: true diff --git a/sdk/compute/ci.mgmt.yml b/sdk/compute/ci.mgmt.yml index d9520f58d12c..2a7969855522 100644 --- a/sdk/compute/ci.mgmt.yml +++ b/sdk/compute/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/compute/ci.mgmt.yml - sdk/compute/Azure.ResourceManager.Compute/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/compute/ci.mgmt.yml + - sdk/compute/Azure.ResourceManager.Compute/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/compute/ci.mgmt.yml + - sdk/compute/Azure.ResourceManager.Compute/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/compute/ci.mgmt.yml + - sdk/compute/Azure.ResourceManager.Compute/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/compute/ci.mgmt.yml + - sdk/compute/Azure.ResourceManager.Compute/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/compute/ci.mgmt.yml + - sdk/compute/Azure.ResourceManager.Compute/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/compute/ci.mgmt.yml + - sdk/compute/Azure.ResourceManager.Compute/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/compute/ci.mgmt.yml + - sdk/compute/Azure.ResourceManager.Compute/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/compute/ci.mgmt.yml + - sdk/compute/Azure.ResourceManager.Compute/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/compute/ci.mgmt.yml + - sdk/compute/Azure.ResourceManager.Compute/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/computefleet/ci.mgmt.yml b/sdk/computefleet/ci.mgmt.yml index de169e18c599..05d56bf4d23a 100644 --- a/sdk/computefleet/ci.mgmt.yml +++ b/sdk/computefleet/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/computefleet/ci.mgmt.yml - sdk/computefleet/Azure.ResourceManager.ComputeFleet/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/computefleet/ci.mgmt.yml + - sdk/computefleet/Azure.ResourceManager.ComputeFleet/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/computefleet/ci.mgmt.yml + - sdk/computefleet/Azure.ResourceManager.ComputeFleet/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/computefleet/ci.mgmt.yml + - sdk/computefleet/Azure.ResourceManager.ComputeFleet/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/computefleet/ci.mgmt.yml + - sdk/computefleet/Azure.ResourceManager.ComputeFleet/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/computefleet/ci.mgmt.yml + - sdk/computefleet/Azure.ResourceManager.ComputeFleet/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/computefleet/ci.mgmt.yml + - sdk/computefleet/Azure.ResourceManager.ComputeFleet/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/computefleet/ci.mgmt.yml + - sdk/computefleet/Azure.ResourceManager.ComputeFleet/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/computefleet/ci.mgmt.yml + - sdk/computefleet/Azure.ResourceManager.ComputeFleet/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/computefleet/ci.mgmt.yml + - sdk/computefleet/Azure.ResourceManager.ComputeFleet/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/computeschedule/ci.mgmt.yml b/sdk/computeschedule/ci.mgmt.yml index d3a367f82551..18f70457d955 100644 --- a/sdk/computeschedule/ci.mgmt.yml +++ b/sdk/computeschedule/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/computeschedule/ci.mgmt.yml - sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/computeschedule/ci.mgmt.yml + - sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/computeschedule/ci.mgmt.yml + - sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/computeschedule/ci.mgmt.yml + - sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/computeschedule/ci.mgmt.yml + - sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/computeschedule/ci.mgmt.yml + - sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/computeschedule/ci.mgmt.yml + - sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/computeschedule/ci.mgmt.yml + - sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/computeschedule/ci.mgmt.yml + - sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/computeschedule/ci.mgmt.yml + - sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/api/Azure.ResourceManager.ConfidentialLedger.net8.0.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/api/Azure.ResourceManager.ConfidentialLedger.net8.0.cs index 9e9b0508882b..7303199035a7 100644 --- a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/api/Azure.ResourceManager.ConfidentialLedger.net8.0.cs +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/api/Azure.ResourceManager.ConfidentialLedger.net8.0.cs @@ -176,18 +176,36 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ApplicationType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ApplicationType(string value) { throw null; } + public static Azure.ResourceManager.ConfidentialLedger.Models.ApplicationType CodeTransparency { get { throw null; } } + public static Azure.ResourceManager.ConfidentialLedger.Models.ApplicationType ConfidentialLedger { get { throw null; } } + public bool Equals(Azure.ResourceManager.ConfidentialLedger.Models.ApplicationType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ConfidentialLedger.Models.ApplicationType left, Azure.ResourceManager.ConfidentialLedger.Models.ApplicationType right) { throw null; } + public static implicit operator Azure.ResourceManager.ConfidentialLedger.Models.ApplicationType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ConfidentialLedger.Models.ApplicationType left, Azure.ResourceManager.ConfidentialLedger.Models.ApplicationType right) { throw null; } + public override string ToString() { throw null; } + } public static partial class ArmConfidentialLedgerModelFactory { public static Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerBackupContent ConfidentialLedgerBackupContent(string restoreRegion = null, System.Uri uri = null) { throw null; } public static Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerBackupResult ConfidentialLedgerBackupResult(string message = null) { throw null; } public static Azure.ResourceManager.ConfidentialLedger.ConfidentialLedgerData ConfidentialLedgerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerProperties properties = null) { throw null; } public static Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerNameAvailabilityResult ConfidentialLedgerNameAvailabilityResult(bool? isNameAvailable = default(bool?), Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerNameUnavailableReason? reason = default(Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerNameUnavailableReason?), string message = null) { throw null; } - public static Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerProperties ConfidentialLedgerProperties(string ledgerName = null, System.Uri ledgerUri = null, System.Uri identityServiceUri = null, string ledgerInternalNamespace = null, Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerRunningState? runningState = default(Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerRunningState?), Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerType? ledgerType = default(Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerType?), Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerProvisioningState? provisioningState = default(Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerProvisioningState?), Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerSku? ledgerSku = default(Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerSku?), System.Collections.Generic.IEnumerable aadBasedSecurityPrincipals = null, System.Collections.Generic.IEnumerable certBasedSecurityPrincipals = null) { throw null; } + public static Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerProperties ConfidentialLedgerProperties(string ledgerName = null, System.Uri ledgerUri = null, System.Uri identityServiceUri = null, string ledgerInternalNamespace = null, Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerRunningState? runningState = default(Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerRunningState?), Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerType? ledgerType = default(Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerType?), Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerProvisioningState? provisioningState = default(Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerProvisioningState?), Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerSku? ledgerSku = default(Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerSku?), System.Collections.Generic.IEnumerable aadBasedSecurityPrincipals = null, System.Collections.Generic.IEnumerable certBasedSecurityPrincipals = null, string hostLevel = null, int? maxBodySizeInMb = default(int?), string subjectName = null, int? nodeCount = default(int?), string writeLBAddressPrefix = null, int? workerThreads = default(int?), Azure.ResourceManager.ConfidentialLedger.Models.EnclavePlatform? enclavePlatform = default(Azure.ResourceManager.ConfidentialLedger.Models.EnclavePlatform?), Azure.ResourceManager.ConfidentialLedger.Models.ApplicationType? applicationType = default(Azure.ResourceManager.ConfidentialLedger.Models.ApplicationType?)) { throw null; } public static Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerRestoreResult ConfidentialLedgerRestoreResult(string message = null) { throw null; } public static Azure.ResourceManager.ConfidentialLedger.Models.ManagedCcfBackupContent ManagedCcfBackupContent(string restoreRegion = null, System.Uri uri = null) { throw null; } public static Azure.ResourceManager.ConfidentialLedger.Models.ManagedCcfBackupResult ManagedCcfBackupResult(string message = null) { throw null; } public static Azure.ResourceManager.ConfidentialLedger.ManagedCcfData ManagedCcfData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ConfidentialLedger.Models.ManagedCcfProperties properties = null) { throw null; } - public static Azure.ResourceManager.ConfidentialLedger.Models.ManagedCcfProperties ManagedCcfProperties(string appName = null, System.Uri appUri = null, System.Uri identityServiceUri = null, System.Collections.Generic.IEnumerable memberIdentityCertificates = null, Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerDeploymentType deploymentType = null, Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerRunningState? runningState = default(Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerRunningState?), Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerProvisioningState? provisioningState = default(Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerProvisioningState?), int? nodeCount = default(int?)) { throw null; } + public static Azure.ResourceManager.ConfidentialLedger.Models.ManagedCcfProperties ManagedCcfProperties(string appName = null, System.Uri appUri = null, System.Uri identityServiceUri = null, System.Collections.Generic.IEnumerable memberIdentityCertificates = null, Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerDeploymentType deploymentType = null, Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerRunningState? runningState = default(Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerRunningState?), Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerProvisioningState? provisioningState = default(Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerProvisioningState?), int? nodeCount = default(int?), Azure.ResourceManager.ConfidentialLedger.Models.EnclavePlatform? enclavePlatform = default(Azure.ResourceManager.ConfidentialLedger.Models.EnclavePlatform?)) { throw null; } public static Azure.ResourceManager.ConfidentialLedger.Models.ManagedCcfRestoreResult ManagedCcfRestoreResult(string message = null) { throw null; } } public partial class CertBasedSecurityPrincipal : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel @@ -315,15 +333,23 @@ public partial class ConfidentialLedgerProperties : System.ClientModel.Primitive { public ConfidentialLedgerProperties() { } public System.Collections.Generic.IList AadBasedSecurityPrincipals { get { throw null; } } + public Azure.ResourceManager.ConfidentialLedger.Models.ApplicationType? ApplicationType { get { throw null; } set { } } public System.Collections.Generic.IList CertBasedSecurityPrincipals { get { throw null; } } + public Azure.ResourceManager.ConfidentialLedger.Models.EnclavePlatform? EnclavePlatform { get { throw null; } set { } } + public string HostLevel { get { throw null; } set { } } public System.Uri IdentityServiceUri { get { throw null; } } public string LedgerInternalNamespace { get { throw null; } } public string LedgerName { get { throw null; } } public Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerSku? LedgerSku { get { throw null; } set { } } public Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerType? LedgerType { get { throw null; } set { } } public System.Uri LedgerUri { get { throw null; } } + public int? MaxBodySizeInMb { get { throw null; } set { } } + public int? NodeCount { get { throw null; } set { } } public Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerRunningState? RunningState { get { throw null; } set { } } + public string SubjectName { get { throw null; } set { } } + public int? WorkerThreads { get { throw null; } set { } } + public string WriteLBAddressPrefix { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -456,6 +482,24 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerType left, Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerType right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct EnclavePlatform : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EnclavePlatform(string value) { throw null; } + public static Azure.ResourceManager.ConfidentialLedger.Models.EnclavePlatform AmdSevSnp { get { throw null; } } + public static Azure.ResourceManager.ConfidentialLedger.Models.EnclavePlatform IntelSgx { get { throw null; } } + public bool Equals(Azure.ResourceManager.ConfidentialLedger.Models.EnclavePlatform other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ConfidentialLedger.Models.EnclavePlatform left, Azure.ResourceManager.ConfidentialLedger.Models.EnclavePlatform right) { throw null; } + public static implicit operator Azure.ResourceManager.ConfidentialLedger.Models.EnclavePlatform (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ConfidentialLedger.Models.EnclavePlatform left, Azure.ResourceManager.ConfidentialLedger.Models.EnclavePlatform right) { throw null; } + public override string ToString() { throw null; } + } public partial class ManagedCcfBackupContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ManagedCcfBackupContent(System.Uri uri) { } @@ -485,6 +529,7 @@ public ManagedCcfProperties() { } public string AppName { get { throw null; } } public System.Uri AppUri { get { throw null; } } public Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerDeploymentType DeploymentType { get { throw null; } set { } } + public Azure.ResourceManager.ConfidentialLedger.Models.EnclavePlatform? EnclavePlatform { get { throw null; } set { } } public System.Uri IdentityServiceUri { get { throw null; } } public System.Collections.Generic.IList MemberIdentityCertificates { get { throw null; } } public int? NodeCount { get { throw null; } set { } } diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/api/Azure.ResourceManager.ConfidentialLedger.netstandard2.0.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/api/Azure.ResourceManager.ConfidentialLedger.netstandard2.0.cs index 9e9b0508882b..7303199035a7 100644 --- a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/api/Azure.ResourceManager.ConfidentialLedger.netstandard2.0.cs +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/api/Azure.ResourceManager.ConfidentialLedger.netstandard2.0.cs @@ -176,18 +176,36 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ApplicationType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ApplicationType(string value) { throw null; } + public static Azure.ResourceManager.ConfidentialLedger.Models.ApplicationType CodeTransparency { get { throw null; } } + public static Azure.ResourceManager.ConfidentialLedger.Models.ApplicationType ConfidentialLedger { get { throw null; } } + public bool Equals(Azure.ResourceManager.ConfidentialLedger.Models.ApplicationType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ConfidentialLedger.Models.ApplicationType left, Azure.ResourceManager.ConfidentialLedger.Models.ApplicationType right) { throw null; } + public static implicit operator Azure.ResourceManager.ConfidentialLedger.Models.ApplicationType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ConfidentialLedger.Models.ApplicationType left, Azure.ResourceManager.ConfidentialLedger.Models.ApplicationType right) { throw null; } + public override string ToString() { throw null; } + } public static partial class ArmConfidentialLedgerModelFactory { public static Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerBackupContent ConfidentialLedgerBackupContent(string restoreRegion = null, System.Uri uri = null) { throw null; } public static Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerBackupResult ConfidentialLedgerBackupResult(string message = null) { throw null; } public static Azure.ResourceManager.ConfidentialLedger.ConfidentialLedgerData ConfidentialLedgerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerProperties properties = null) { throw null; } public static Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerNameAvailabilityResult ConfidentialLedgerNameAvailabilityResult(bool? isNameAvailable = default(bool?), Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerNameUnavailableReason? reason = default(Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerNameUnavailableReason?), string message = null) { throw null; } - public static Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerProperties ConfidentialLedgerProperties(string ledgerName = null, System.Uri ledgerUri = null, System.Uri identityServiceUri = null, string ledgerInternalNamespace = null, Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerRunningState? runningState = default(Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerRunningState?), Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerType? ledgerType = default(Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerType?), Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerProvisioningState? provisioningState = default(Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerProvisioningState?), Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerSku? ledgerSku = default(Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerSku?), System.Collections.Generic.IEnumerable aadBasedSecurityPrincipals = null, System.Collections.Generic.IEnumerable certBasedSecurityPrincipals = null) { throw null; } + public static Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerProperties ConfidentialLedgerProperties(string ledgerName = null, System.Uri ledgerUri = null, System.Uri identityServiceUri = null, string ledgerInternalNamespace = null, Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerRunningState? runningState = default(Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerRunningState?), Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerType? ledgerType = default(Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerType?), Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerProvisioningState? provisioningState = default(Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerProvisioningState?), Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerSku? ledgerSku = default(Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerSku?), System.Collections.Generic.IEnumerable aadBasedSecurityPrincipals = null, System.Collections.Generic.IEnumerable certBasedSecurityPrincipals = null, string hostLevel = null, int? maxBodySizeInMb = default(int?), string subjectName = null, int? nodeCount = default(int?), string writeLBAddressPrefix = null, int? workerThreads = default(int?), Azure.ResourceManager.ConfidentialLedger.Models.EnclavePlatform? enclavePlatform = default(Azure.ResourceManager.ConfidentialLedger.Models.EnclavePlatform?), Azure.ResourceManager.ConfidentialLedger.Models.ApplicationType? applicationType = default(Azure.ResourceManager.ConfidentialLedger.Models.ApplicationType?)) { throw null; } public static Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerRestoreResult ConfidentialLedgerRestoreResult(string message = null) { throw null; } public static Azure.ResourceManager.ConfidentialLedger.Models.ManagedCcfBackupContent ManagedCcfBackupContent(string restoreRegion = null, System.Uri uri = null) { throw null; } public static Azure.ResourceManager.ConfidentialLedger.Models.ManagedCcfBackupResult ManagedCcfBackupResult(string message = null) { throw null; } public static Azure.ResourceManager.ConfidentialLedger.ManagedCcfData ManagedCcfData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ConfidentialLedger.Models.ManagedCcfProperties properties = null) { throw null; } - public static Azure.ResourceManager.ConfidentialLedger.Models.ManagedCcfProperties ManagedCcfProperties(string appName = null, System.Uri appUri = null, System.Uri identityServiceUri = null, System.Collections.Generic.IEnumerable memberIdentityCertificates = null, Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerDeploymentType deploymentType = null, Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerRunningState? runningState = default(Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerRunningState?), Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerProvisioningState? provisioningState = default(Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerProvisioningState?), int? nodeCount = default(int?)) { throw null; } + public static Azure.ResourceManager.ConfidentialLedger.Models.ManagedCcfProperties ManagedCcfProperties(string appName = null, System.Uri appUri = null, System.Uri identityServiceUri = null, System.Collections.Generic.IEnumerable memberIdentityCertificates = null, Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerDeploymentType deploymentType = null, Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerRunningState? runningState = default(Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerRunningState?), Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerProvisioningState? provisioningState = default(Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerProvisioningState?), int? nodeCount = default(int?), Azure.ResourceManager.ConfidentialLedger.Models.EnclavePlatform? enclavePlatform = default(Azure.ResourceManager.ConfidentialLedger.Models.EnclavePlatform?)) { throw null; } public static Azure.ResourceManager.ConfidentialLedger.Models.ManagedCcfRestoreResult ManagedCcfRestoreResult(string message = null) { throw null; } } public partial class CertBasedSecurityPrincipal : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel @@ -315,15 +333,23 @@ public partial class ConfidentialLedgerProperties : System.ClientModel.Primitive { public ConfidentialLedgerProperties() { } public System.Collections.Generic.IList AadBasedSecurityPrincipals { get { throw null; } } + public Azure.ResourceManager.ConfidentialLedger.Models.ApplicationType? ApplicationType { get { throw null; } set { } } public System.Collections.Generic.IList CertBasedSecurityPrincipals { get { throw null; } } + public Azure.ResourceManager.ConfidentialLedger.Models.EnclavePlatform? EnclavePlatform { get { throw null; } set { } } + public string HostLevel { get { throw null; } set { } } public System.Uri IdentityServiceUri { get { throw null; } } public string LedgerInternalNamespace { get { throw null; } } public string LedgerName { get { throw null; } } public Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerSku? LedgerSku { get { throw null; } set { } } public Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerType? LedgerType { get { throw null; } set { } } public System.Uri LedgerUri { get { throw null; } } + public int? MaxBodySizeInMb { get { throw null; } set { } } + public int? NodeCount { get { throw null; } set { } } public Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerRunningState? RunningState { get { throw null; } set { } } + public string SubjectName { get { throw null; } set { } } + public int? WorkerThreads { get { throw null; } set { } } + public string WriteLBAddressPrefix { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -456,6 +482,24 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerType left, Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerType right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct EnclavePlatform : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EnclavePlatform(string value) { throw null; } + public static Azure.ResourceManager.ConfidentialLedger.Models.EnclavePlatform AmdSevSnp { get { throw null; } } + public static Azure.ResourceManager.ConfidentialLedger.Models.EnclavePlatform IntelSgx { get { throw null; } } + public bool Equals(Azure.ResourceManager.ConfidentialLedger.Models.EnclavePlatform other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ConfidentialLedger.Models.EnclavePlatform left, Azure.ResourceManager.ConfidentialLedger.Models.EnclavePlatform right) { throw null; } + public static implicit operator Azure.ResourceManager.ConfidentialLedger.Models.EnclavePlatform (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ConfidentialLedger.Models.EnclavePlatform left, Azure.ResourceManager.ConfidentialLedger.Models.EnclavePlatform right) { throw null; } + public override string ToString() { throw null; } + } public partial class ManagedCcfBackupContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ManagedCcfBackupContent(System.Uri uri) { } @@ -485,6 +529,7 @@ public ManagedCcfProperties() { } public string AppName { get { throw null; } } public System.Uri AppUri { get { throw null; } } public Azure.ResourceManager.ConfidentialLedger.Models.ConfidentialLedgerDeploymentType DeploymentType { get { throw null; } set { } } + public Azure.ResourceManager.ConfidentialLedger.Models.EnclavePlatform? EnclavePlatform { get { throw null; } set { } } public System.Uri IdentityServiceUri { get { throw null; } } public System.Collections.Generic.IList MemberIdentityCertificates { get { throw null; } } public int? NodeCount { get { throw null; } set { } } diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/samples/Generated/Samples/Sample_ConfidentialLedgerCollection.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/samples/Generated/Samples/Sample_ConfidentialLedgerCollection.cs index c3e416c70302..0c5e4fd65873 100644 --- a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/samples/Generated/Samples/Sample_ConfidentialLedgerCollection.cs +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/samples/Generated/Samples/Sample_ConfidentialLedgerCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_ConfidentialLedgerCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_ConfidentialLedgerCreate() { - // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ConfidentialLedger_Create.json + // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2024-09-19-preview/examples/ConfidentialLedger_Create.json // this example is just showing the usage of "Ledger_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,6 +58,12 @@ public async Task CreateOrUpdate_ConfidentialLedgerCreate() Cert = "-----BEGIN CERTIFICATE-----MIIBsjCCATigAwIBAgIUZWIbyG79TniQLd2UxJuU74tqrKcwCgYIKoZIzj0EAwMwEDEOMAwGA1UEAwwFdXNlcjAwHhcNMjEwMzE2MTgwNjExWhcNMjIwMzE2MTgwNjExWjAQMQ4wDAYDVQQDDAV1c2VyMDB2MBAGByqGSM49AgEGBSuBBAAiA2IABBiWSo/j8EFit7aUMm5lF+lUmCu+IgfnpFD+7QMgLKtxRJ3aGSqgS/GpqcYVGddnODtSarNE/HyGKUFUolLPQ5ybHcouUk0kyfA7XMeSoUA4lBz63Wha8wmXo+NdBRo39qNTMFEwHQYDVR0OBBYEFPtuhrwgGjDFHeUUT4nGsXaZn69KMB8GA1UdIwQYMBaAFPtuhrwgGjDFHeUUT4nGsXaZn69KMA8GA1UdEwEB/wQFMAMBAf8wCgYIKoZIzj0EAwMDaAAwZQIxAOnozm2CyqRwSSQLls5r+mUHRGRyXHXwYtM4Dcst/VEZdmS9fqvHRCHbjUlO/+HNfgIwMWZ4FmsjD3wnPxONOm9YdVn/PRD7SsPRPbOjwBiE4EBGaHDsLjYAGDSGi7NJnSkA-----END CERTIFICATE-----", LedgerRoleName = ConfidentialLedgerRoleName.Reader, }}, + HostLevel = "Info", + MaxBodySizeInMb = 1, + SubjectName = "CN=CCF Node", + NodeCount = 3, + WriteLBAddressPrefix = "write", + WorkerThreads = 0, }, Tags = { @@ -78,7 +84,7 @@ public async Task CreateOrUpdate_ConfidentialLedgerCreate() [Ignore("Only validating compilation of examples")] public async Task Get_ConfidentialLedgerGet() { - // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ConfidentialLedger_Get.json + // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2024-09-19-preview/examples/ConfidentialLedger_Get.json // this example is just showing the usage of "Ledger_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -111,7 +117,7 @@ public async Task Get_ConfidentialLedgerGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_ConfidentialLedgerList() { - // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ConfidentialLedger_List.json + // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2024-09-19-preview/examples/ConfidentialLedger_List.json // this example is just showing the usage of "Ledger_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -146,7 +152,7 @@ public async Task GetAll_ConfidentialLedgerList() [Ignore("Only validating compilation of examples")] public async Task Exists_ConfidentialLedgerGet() { - // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ConfidentialLedger_Get.json + // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2024-09-19-preview/examples/ConfidentialLedger_Get.json // this example is just showing the usage of "Ledger_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -175,7 +181,7 @@ public async Task Exists_ConfidentialLedgerGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_ConfidentialLedgerGet() { - // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ConfidentialLedger_Get.json + // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2024-09-19-preview/examples/ConfidentialLedger_Get.json // this example is just showing the usage of "Ledger_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/samples/Generated/Samples/Sample_ConfidentialLedgerResource.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/samples/Generated/Samples/Sample_ConfidentialLedgerResource.cs index 4b9bc3a0289e..bcf557c79066 100644 --- a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/samples/Generated/Samples/Sample_ConfidentialLedgerResource.cs +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/samples/Generated/Samples/Sample_ConfidentialLedgerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ConfidentialLedgerResource [Ignore("Only validating compilation of examples")] public async Task Get_ConfidentialLedgerGet() { - // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ConfidentialLedger_Get.json + // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2024-09-19-preview/examples/ConfidentialLedger_Get.json // this example is just showing the usage of "Ledger_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_ConfidentialLedgerGet() [Ignore("Only validating compilation of examples")] public async Task Delete_ConfidentialLedgerDelete() { - // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ConfidentialLedger_Delete.json + // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2024-09-19-preview/examples/ConfidentialLedger_Delete.json // this example is just showing the usage of "Ledger_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,7 +76,7 @@ public async Task Delete_ConfidentialLedgerDelete() [Ignore("Only validating compilation of examples")] public async Task Update_ConfidentialLedgerUpdate() { - // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ConfidentialLedger_Update.json + // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2024-09-19-preview/examples/ConfidentialLedger_Update.json // this example is just showing the usage of "Ledger_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +130,7 @@ public async Task Update_ConfidentialLedgerUpdate() [Ignore("Only validating compilation of examples")] public async Task Backup_ConfidentialLedgerBackup() { - // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ConfidentialLedger_Backup.json + // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2024-09-19-preview/examples/ConfidentialLedger_Backup.json // this example is just showing the usage of "Ledger_Backup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -161,7 +161,7 @@ public async Task Backup_ConfidentialLedgerBackup() [Ignore("Only validating compilation of examples")] public async Task Restore_ConfidentialLedgerRestore() { - // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ConfidentialLedger_Restore.json + // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2024-09-19-preview/examples/ConfidentialLedger_Restore.json // this example is just showing the usage of "Ledger_Restore" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/samples/Generated/Samples/Sample_ManagedCcfCollection.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/samples/Generated/Samples/Sample_ManagedCcfCollection.cs index c488825f0e69..5885ba40bbab 100644 --- a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/samples/Generated/Samples/Sample_ManagedCcfCollection.cs +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/samples/Generated/Samples/Sample_ManagedCcfCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_ManagedCcfCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_ManagedCCFCreate() { - // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ManagedCCF_Create.json + // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2024-09-19-preview/examples/ManagedCCF_Create.json // this example is just showing the usage of "ManagedCCF_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task CreateOrUpdate_ManagedCCFCreate() [Ignore("Only validating compilation of examples")] public async Task Get_ManagedCCFGet() { - // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ManagedCCF_Get.json + // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2024-09-19-preview/examples/ManagedCCF_Get.json // this example is just showing the usage of "ManagedCCF_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -113,7 +113,7 @@ public async Task Get_ManagedCCFGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_ManagedCCFList() { - // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ManagedCCF_List.json + // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2024-09-19-preview/examples/ManagedCCF_List.json // this example is just showing the usage of "ManagedCCF_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -148,7 +148,7 @@ public async Task GetAll_ManagedCCFList() [Ignore("Only validating compilation of examples")] public async Task Exists_ManagedCCFGet() { - // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ManagedCCF_Get.json + // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2024-09-19-preview/examples/ManagedCCF_Get.json // this example is just showing the usage of "ManagedCCF_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -177,7 +177,7 @@ public async Task Exists_ManagedCCFGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_ManagedCCFGet() { - // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ManagedCCF_Get.json + // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2024-09-19-preview/examples/ManagedCCF_Get.json // this example is just showing the usage of "ManagedCCF_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/samples/Generated/Samples/Sample_ManagedCcfResource.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/samples/Generated/Samples/Sample_ManagedCcfResource.cs index 274bca6edf58..fdd2d7473457 100644 --- a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/samples/Generated/Samples/Sample_ManagedCcfResource.cs +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/samples/Generated/Samples/Sample_ManagedCcfResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ManagedCcfResource [Ignore("Only validating compilation of examples")] public async Task Get_ManagedCCFGet() { - // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ManagedCCF_Get.json + // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2024-09-19-preview/examples/ManagedCCF_Get.json // this example is just showing the usage of "ManagedCCF_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_ManagedCCFGet() [Ignore("Only validating compilation of examples")] public async Task Delete_ConfidentialLedgerDelete() { - // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ManagedCCF_Delete.json + // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2024-09-19-preview/examples/ManagedCCF_Delete.json // this example is just showing the usage of "ManagedCCF_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,7 +76,7 @@ public async Task Delete_ConfidentialLedgerDelete() [Ignore("Only validating compilation of examples")] public async Task Update_ManagedCCFUpdate() { - // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ManagedCCF_Update.json + // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2024-09-19-preview/examples/ManagedCCF_Update.json // this example is just showing the usage of "ManagedCCF_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -122,7 +122,7 @@ public async Task Update_ManagedCCFUpdate() [Ignore("Only validating compilation of examples")] public async Task Backup_ManagedCCFBackup() { - // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ManagedCCF_Backup.json + // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2024-09-19-preview/examples/ManagedCCF_Backup.json // this example is just showing the usage of "ManagedCCF_Backup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -153,7 +153,7 @@ public async Task Backup_ManagedCCFBackup() [Ignore("Only validating compilation of examples")] public async Task Restore_ManagedCCFRestore() { - // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ManagedCCF_Restore.json + // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2024-09-19-preview/examples/ManagedCCF_Restore.json // this example is just showing the usage of "ManagedCCF_Restore" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 6b2797b339fd..c148a5968473 100644 --- a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -21,7 +21,7 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task CheckConfidentialLedgerNameAvailability_CheckNameAvailability() { - // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/CheckNameAvailability.json + // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2024-09-19-preview/examples/CheckNameAvailability.json // this example is just showing the usage of "CheckNameAvailability" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task CheckConfidentialLedgerNameAvailability_CheckNameAvailability( [Ignore("Only validating compilation of examples")] public async Task GetConfidentialLedgers_ConfidentialLedgerListBySub() { - // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ConfidentialLedger_ListBySub.json + // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2024-09-19-preview/examples/ConfidentialLedger_ListBySub.json // this example is just showing the usage of "Ledger_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -81,7 +81,7 @@ public async Task GetConfidentialLedgers_ConfidentialLedgerListBySub() [Ignore("Only validating compilation of examples")] public async Task GetManagedCcfs_ManagedCCFListBySub() { - // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ManagedCCF_ListBySub.json + // Generated from example definition: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2024-09-19-preview/examples/ManagedCCF_ListBySub.json // this example is just showing the usage of "ManagedCCF_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/ArmConfidentialLedgerModelFactory.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/ArmConfidentialLedgerModelFactory.cs index 9ec195f1f3ce..df37b7249bcf 100644 --- a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/ArmConfidentialLedgerModelFactory.cs +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/ArmConfidentialLedgerModelFactory.cs @@ -61,8 +61,16 @@ public static ConfidentialLedgerData ConfidentialLedgerData(ResourceIdentifier i /// SKU associated with the ledger. /// Array of all AAD based Security Principals. /// Array of all cert based Security Principals. + /// CCF Property for the logging level for the untrusted host: Trace, Debug, Info, Fail, Fatal. + /// CCF Property for the maximum size of the http request body: 1MB, 5MB, 10MB. + /// CCF Property for the subject name to include in the node certificate. Default: CN=CCF Node. + /// Number of CCF nodes in the ACC Ledger. + /// Prefix for the write load balancer. Example: write. + /// Number of additional threads processing incoming client requests in the enclave (modify with care!). + /// Enclave platform of the Confidential Ledger. + /// Application type of the Confidential Ledger. /// A new instance for mocking. - public static ConfidentialLedgerProperties ConfidentialLedgerProperties(string ledgerName = null, Uri ledgerUri = null, Uri identityServiceUri = null, string ledgerInternalNamespace = null, ConfidentialLedgerRunningState? runningState = null, ConfidentialLedgerType? ledgerType = null, ConfidentialLedgerProvisioningState? provisioningState = null, ConfidentialLedgerSku? ledgerSku = null, IEnumerable aadBasedSecurityPrincipals = null, IEnumerable certBasedSecurityPrincipals = null) + public static ConfidentialLedgerProperties ConfidentialLedgerProperties(string ledgerName = null, Uri ledgerUri = null, Uri identityServiceUri = null, string ledgerInternalNamespace = null, ConfidentialLedgerRunningState? runningState = null, ConfidentialLedgerType? ledgerType = null, ConfidentialLedgerProvisioningState? provisioningState = null, ConfidentialLedgerSku? ledgerSku = null, IEnumerable aadBasedSecurityPrincipals = null, IEnumerable certBasedSecurityPrincipals = null, string hostLevel = null, int? maxBodySizeInMb = null, string subjectName = null, int? nodeCount = null, string writeLBAddressPrefix = null, int? workerThreads = null, EnclavePlatform? enclavePlatform = null, ApplicationType? applicationType = null) { aadBasedSecurityPrincipals ??= new List(); certBasedSecurityPrincipals ??= new List(); @@ -78,6 +86,14 @@ public static ConfidentialLedgerProperties ConfidentialLedgerProperties(string l ledgerSku, aadBasedSecurityPrincipals?.ToList(), certBasedSecurityPrincipals?.ToList(), + hostLevel, + maxBodySizeInMb, + subjectName, + nodeCount, + writeLBAddressPrefix, + workerThreads, + enclavePlatform, + applicationType, serializedAdditionalRawData: null); } @@ -139,8 +155,9 @@ public static ManagedCcfData ManagedCcfData(ResourceIdentifier id = null, string /// Object representing RunningState for Managed CCF. /// Provisioning state of Managed CCF Resource. /// Number of CCF nodes in the Managed CCF. + /// Enclave platform of Managed CCF. /// A new instance for mocking. - public static ManagedCcfProperties ManagedCcfProperties(string appName = null, Uri appUri = null, Uri identityServiceUri = null, IEnumerable memberIdentityCertificates = null, ConfidentialLedgerDeploymentType deploymentType = null, ConfidentialLedgerRunningState? runningState = null, ConfidentialLedgerProvisioningState? provisioningState = null, int? nodeCount = null) + public static ManagedCcfProperties ManagedCcfProperties(string appName = null, Uri appUri = null, Uri identityServiceUri = null, IEnumerable memberIdentityCertificates = null, ConfidentialLedgerDeploymentType deploymentType = null, ConfidentialLedgerRunningState? runningState = null, ConfidentialLedgerProvisioningState? provisioningState = null, int? nodeCount = null, EnclavePlatform? enclavePlatform = null) { memberIdentityCertificates ??= new List(); @@ -153,6 +170,7 @@ public static ManagedCcfProperties ManagedCcfProperties(string appName = null, U runningState, provisioningState, nodeCount, + enclavePlatform, serializedAdditionalRawData: null); } diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/ConfidentialLedgerCollection.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/ConfidentialLedgerCollection.cs index 317b1aaa3d52..ba41351c1536 100644 --- a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/ConfidentialLedgerCollection.cs +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/ConfidentialLedgerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpda /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string ledgerName, Cance /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -284,7 +284,7 @@ public virtual AsyncPageable GetAllAsync(string filt /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -315,7 +315,7 @@ public virtual Pageable GetAll(string filter = null, /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -358,7 +358,7 @@ public virtual async Task> ExistsAsync(string ledgerName, Cancell /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -401,7 +401,7 @@ public virtual Response Exists(string ledgerName, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -446,7 +446,7 @@ public virtual async Task> GetIfExi /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/ConfidentialLedgerResource.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/ConfidentialLedgerResource.cs index 3b6ee2d65a97..f6b6d7a39ae7 100644 --- a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/ConfidentialLedgerResource.cs +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/ConfidentialLedgerResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(Cancell /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> UpdateAsync( /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(WaitUntil waitUnt /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -405,7 +405,7 @@ public virtual async Task> BackupAs /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -451,7 +451,7 @@ public virtual ArmOperation Backup(WaitUntil wai /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -497,7 +497,7 @@ public virtual async Task> Restore /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -543,7 +543,7 @@ public virtual ArmOperation Restore(WaitUntil w /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -605,7 +605,7 @@ public virtual async Task> AddTagAsync(stri /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -667,7 +667,7 @@ public virtual Response AddTag(string key, string va /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -724,7 +724,7 @@ public virtual async Task> SetTagsAsync(IDi /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -781,7 +781,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -841,7 +841,7 @@ public virtual async Task> RemoveTagAsync(s /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/ConfidentialLedgerExtensions.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/ConfidentialLedgerExtensions.cs index 23b085619ace..69b4907f7d02 100644 --- a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/ConfidentialLedgerExtensions.cs +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/ConfidentialLedgerExtensions.cs @@ -101,7 +101,7 @@ public static ConfidentialLedgerCollection GetConfidentialLedgers(this ResourceG /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -139,7 +139,7 @@ public static async Task> GetConfidentialLe /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -194,7 +194,7 @@ public static ManagedCcfCollection GetManagedCcfs(this ResourceGroupResource res /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -232,7 +232,7 @@ public static async Task> GetManagedCcfAsync(this R /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -270,7 +270,7 @@ public static Response GetManagedCcf(this ResourceGroupResou /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// @@ -302,7 +302,7 @@ public static async Task> Che /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// @@ -334,7 +334,7 @@ public static Response CheckConfidenti /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -371,7 +371,7 @@ public static AsyncPageable GetConfidentialLedgersAs /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -408,7 +408,7 @@ public static Pageable GetConfidentialLedgers(this S /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -445,7 +445,7 @@ public static AsyncPageable GetManagedCcfsAsync(this Subscri /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/MockableConfidentialLedgerResourceGroupResource.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/MockableConfidentialLedgerResourceGroupResource.cs index f4df77ab4170..31a2b928177c 100644 --- a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/MockableConfidentialLedgerResourceGroupResource.cs +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/MockableConfidentialLedgerResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual ConfidentialLedgerCollection GetConfidentialLedgers() /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetConfidentialL /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -122,7 +122,7 @@ public virtual ManagedCcfCollection GetManagedCcfs() /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -153,7 +153,7 @@ public virtual async Task> GetManagedCcfAsync(strin /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/MockableConfidentialLedgerSubscriptionResource.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/MockableConfidentialLedgerSubscriptionResource.cs index 47d3cd0683bf..28b52a62288c 100644 --- a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/MockableConfidentialLedgerSubscriptionResource.cs +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/MockableConfidentialLedgerSubscriptionResource.cs @@ -63,7 +63,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// @@ -101,7 +101,7 @@ public virtual async Task> Ch /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// @@ -139,7 +139,7 @@ public virtual Response CheckConfident /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -170,7 +170,7 @@ public virtual AsyncPageable GetConfidentialLedgersA /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -201,7 +201,7 @@ public virtual Pageable GetConfidentialLedgers(strin /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -232,7 +232,7 @@ public virtual AsyncPageable GetManagedCcfsAsync(string filt /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/ManagedCcfCollection.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/ManagedCcfCollection.cs index 265f17f07412..c004e59fe22c 100644 --- a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/ManagedCcfCollection.cs +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/ManagedCcfCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsync( /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUnt /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string appName, /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string appName, CancellationToke /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -284,7 +284,7 @@ public virtual AsyncPageable GetAllAsync(string filter = nul /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -315,7 +315,7 @@ public virtual Pageable GetAll(string filter = null, Cancell /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -358,7 +358,7 @@ public virtual async Task> ExistsAsync(string appName, Cancellati /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -401,7 +401,7 @@ public virtual Response Exists(string appName, CancellationToken cancellat /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -446,7 +446,7 @@ public virtual async Task> GetIfExistsAsync /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/ManagedCcfResource.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/ManagedCcfResource.cs index 8f762c602260..0e3244296cd9 100644 --- a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/ManagedCcfResource.cs +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/ManagedCcfResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(CancellationTok /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancellationTo /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> UpdateAsync(WaitUnti /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, Mana /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -405,7 +405,7 @@ public virtual async Task> BackupAsync(Wait /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -451,7 +451,7 @@ public virtual ArmOperation Backup(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -497,7 +497,7 @@ public virtual async Task> RestoreAsync(Wa /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -543,7 +543,7 @@ public virtual ArmOperation Restore(WaitUntil waitUntil /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -605,7 +605,7 @@ public virtual async Task> AddTagAsync(string key, /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -667,7 +667,7 @@ public virtual Response AddTag(string key, string value, Can /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -724,7 +724,7 @@ public virtual async Task> SetTagsAsync(IDictionary /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -781,7 +781,7 @@ public virtual Response SetTags(IDictionary /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource @@ -841,7 +841,7 @@ public virtual async Task> RemoveTagAsync(string ke /// /// /// Default Api Version - /// 2023-06-28-preview + /// 2024-09-19-preview /// /// /// Resource diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Models/ApplicationType.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Models/ApplicationType.cs new file mode 100644 index 000000000000..55fa3e3fc39e --- /dev/null +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Models/ApplicationType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ConfidentialLedger.Models +{ + /// Object representing the application type of the Confidential Ledger. Defaults to ConfidentialLedger. + public readonly partial struct ApplicationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ApplicationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ConfidentialLedgerValue = "ConfidentialLedger"; + private const string CodeTransparencyValue = "CodeTransparency"; + + /// ConfidentialLedger. + public static ApplicationType ConfidentialLedger { get; } = new ApplicationType(ConfidentialLedgerValue); + /// CodeTransparency. + public static ApplicationType CodeTransparency { get; } = new ApplicationType(CodeTransparencyValue); + /// Determines if two values are the same. + public static bool operator ==(ApplicationType left, ApplicationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ApplicationType left, ApplicationType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ApplicationType(string value) => new ApplicationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ApplicationType other && Equals(other); + /// + public bool Equals(ApplicationType 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/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Models/ConfidentialLedgerProperties.Serialization.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Models/ConfidentialLedgerProperties.Serialization.cs index ef3a379e3239..29f9b22537d8 100644 --- a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Models/ConfidentialLedgerProperties.Serialization.cs +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Models/ConfidentialLedgerProperties.Serialization.cs @@ -94,6 +94,46 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndArray(); } + if (Optional.IsDefined(HostLevel)) + { + writer.WritePropertyName("hostLevel"u8); + writer.WriteStringValue(HostLevel); + } + if (Optional.IsDefined(MaxBodySizeInMb)) + { + writer.WritePropertyName("maxBodySizeInMb"u8); + writer.WriteNumberValue(MaxBodySizeInMb.Value); + } + if (Optional.IsDefined(SubjectName)) + { + writer.WritePropertyName("subjectName"u8); + writer.WriteStringValue(SubjectName); + } + if (Optional.IsDefined(NodeCount)) + { + writer.WritePropertyName("nodeCount"u8); + writer.WriteNumberValue(NodeCount.Value); + } + if (Optional.IsDefined(WriteLBAddressPrefix)) + { + writer.WritePropertyName("writeLBAddressPrefix"u8); + writer.WriteStringValue(WriteLBAddressPrefix); + } + if (Optional.IsDefined(WorkerThreads)) + { + writer.WritePropertyName("workerThreads"u8); + writer.WriteNumberValue(WorkerThreads.Value); + } + if (Optional.IsDefined(EnclavePlatform)) + { + writer.WritePropertyName("enclavePlatform"u8); + writer.WriteStringValue(EnclavePlatform.Value.ToString()); + } + if (Optional.IsDefined(ApplicationType)) + { + writer.WritePropertyName("applicationType"u8); + writer.WriteStringValue(ApplicationType.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -141,6 +181,14 @@ internal static ConfidentialLedgerProperties DeserializeConfidentialLedgerProper ConfidentialLedgerSku? ledgerSku = default; IList aadBasedSecurityPrincipals = default; IList certBasedSecurityPrincipals = default; + string hostLevel = default; + int? maxBodySizeInMb = default; + string subjectName = default; + int? nodeCount = default; + string writeLBAddressPrefix = default; + int? workerThreads = default; + EnclavePlatform? enclavePlatform = default; + ApplicationType? applicationType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -237,6 +285,66 @@ internal static ConfidentialLedgerProperties DeserializeConfidentialLedgerProper certBasedSecurityPrincipals = array; continue; } + if (property.NameEquals("hostLevel"u8)) + { + hostLevel = property.Value.GetString(); + continue; + } + if (property.NameEquals("maxBodySizeInMb"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxBodySizeInMb = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("subjectName"u8)) + { + subjectName = property.Value.GetString(); + continue; + } + if (property.NameEquals("nodeCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nodeCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("writeLBAddressPrefix"u8)) + { + writeLBAddressPrefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("workerThreads"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + workerThreads = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("enclavePlatform"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enclavePlatform = new EnclavePlatform(property.Value.GetString()); + continue; + } + if (property.NameEquals("applicationType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + applicationType = new ApplicationType(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -254,6 +362,14 @@ internal static ConfidentialLedgerProperties DeserializeConfidentialLedgerProper ledgerSku, aadBasedSecurityPrincipals ?? new ChangeTrackingList(), certBasedSecurityPrincipals ?? new ChangeTrackingList(), + hostLevel, + maxBodySizeInMb, + subjectName, + nodeCount, + writeLBAddressPrefix, + workerThreads, + enclavePlatform, + applicationType, serializedAdditionalRawData); } diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Models/ConfidentialLedgerProperties.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Models/ConfidentialLedgerProperties.cs index 927956754f61..3502ba6810b5 100644 --- a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Models/ConfidentialLedgerProperties.cs +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Models/ConfidentialLedgerProperties.cs @@ -63,8 +63,16 @@ public ConfidentialLedgerProperties() /// SKU associated with the ledger. /// Array of all AAD based Security Principals. /// Array of all cert based Security Principals. + /// CCF Property for the logging level for the untrusted host: Trace, Debug, Info, Fail, Fatal. + /// CCF Property for the maximum size of the http request body: 1MB, 5MB, 10MB. + /// CCF Property for the subject name to include in the node certificate. Default: CN=CCF Node. + /// Number of CCF nodes in the ACC Ledger. + /// Prefix for the write load balancer. Example: write. + /// Number of additional threads processing incoming client requests in the enclave (modify with care!). + /// Enclave platform of the Confidential Ledger. + /// Application type of the Confidential Ledger. /// Keeps track of any properties unknown to the library. - internal ConfidentialLedgerProperties(string ledgerName, Uri ledgerUri, Uri identityServiceUri, string ledgerInternalNamespace, ConfidentialLedgerRunningState? runningState, ConfidentialLedgerType? ledgerType, ConfidentialLedgerProvisioningState? provisioningState, ConfidentialLedgerSku? ledgerSku, IList aadBasedSecurityPrincipals, IList certBasedSecurityPrincipals, IDictionary serializedAdditionalRawData) + internal ConfidentialLedgerProperties(string ledgerName, Uri ledgerUri, Uri identityServiceUri, string ledgerInternalNamespace, ConfidentialLedgerRunningState? runningState, ConfidentialLedgerType? ledgerType, ConfidentialLedgerProvisioningState? provisioningState, ConfidentialLedgerSku? ledgerSku, IList aadBasedSecurityPrincipals, IList certBasedSecurityPrincipals, string hostLevel, int? maxBodySizeInMb, string subjectName, int? nodeCount, string writeLBAddressPrefix, int? workerThreads, EnclavePlatform? enclavePlatform, ApplicationType? applicationType, IDictionary serializedAdditionalRawData) { LedgerName = ledgerName; LedgerUri = ledgerUri; @@ -76,6 +84,14 @@ internal ConfidentialLedgerProperties(string ledgerName, Uri ledgerUri, Uri iden LedgerSku = ledgerSku; AadBasedSecurityPrincipals = aadBasedSecurityPrincipals; CertBasedSecurityPrincipals = certBasedSecurityPrincipals; + HostLevel = hostLevel; + MaxBodySizeInMb = maxBodySizeInMb; + SubjectName = subjectName; + NodeCount = nodeCount; + WriteLBAddressPrefix = writeLBAddressPrefix; + WorkerThreads = workerThreads; + EnclavePlatform = enclavePlatform; + ApplicationType = applicationType; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -99,5 +115,21 @@ internal ConfidentialLedgerProperties(string ledgerName, Uri ledgerUri, Uri iden public IList AadBasedSecurityPrincipals { get; } /// Array of all cert based Security Principals. public IList CertBasedSecurityPrincipals { get; } + /// CCF Property for the logging level for the untrusted host: Trace, Debug, Info, Fail, Fatal. + public string HostLevel { get; set; } + /// CCF Property for the maximum size of the http request body: 1MB, 5MB, 10MB. + public int? MaxBodySizeInMb { get; set; } + /// CCF Property for the subject name to include in the node certificate. Default: CN=CCF Node. + public string SubjectName { get; set; } + /// Number of CCF nodes in the ACC Ledger. + public int? NodeCount { get; set; } + /// Prefix for the write load balancer. Example: write. + public string WriteLBAddressPrefix { get; set; } + /// Number of additional threads processing incoming client requests in the enclave (modify with care!). + public int? WorkerThreads { get; set; } + /// Enclave platform of the Confidential Ledger. + public EnclavePlatform? EnclavePlatform { get; set; } + /// Application type of the Confidential Ledger. + public ApplicationType? ApplicationType { get; set; } } } diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Models/EnclavePlatform.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Models/EnclavePlatform.cs new file mode 100644 index 000000000000..e3b444961de7 --- /dev/null +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Models/EnclavePlatform.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ConfidentialLedger.Models +{ + /// Object representing the enclave platform for the Confidential Ledger application. Defaults to IntelSgx. + public readonly partial struct EnclavePlatform : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public EnclavePlatform(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string IntelSgxValue = "IntelSgx"; + private const string AmdSevSnpValue = "AmdSevSnp"; + + /// IntelSgx. + public static EnclavePlatform IntelSgx { get; } = new EnclavePlatform(IntelSgxValue); + /// AmdSevSnp. + public static EnclavePlatform AmdSevSnp { get; } = new EnclavePlatform(AmdSevSnpValue); + /// Determines if two values are the same. + public static bool operator ==(EnclavePlatform left, EnclavePlatform right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EnclavePlatform left, EnclavePlatform right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator EnclavePlatform(string value) => new EnclavePlatform(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EnclavePlatform other && Equals(other); + /// + public bool Equals(EnclavePlatform 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/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Models/ManagedCcfProperties.Serialization.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Models/ManagedCcfProperties.Serialization.cs index b68acc90966c..f7132b71a5f4 100644 --- a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Models/ManagedCcfProperties.Serialization.cs +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Models/ManagedCcfProperties.Serialization.cs @@ -79,6 +79,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("nodeCount"u8); writer.WriteNumberValue(NodeCount.Value); } + if (Optional.IsDefined(EnclavePlatform)) + { + writer.WritePropertyName("enclavePlatform"u8); + writer.WriteStringValue(EnclavePlatform.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -124,6 +129,7 @@ internal static ManagedCcfProperties DeserializeManagedCcfProperties(JsonElement ConfidentialLedgerRunningState? runningState = default; ConfidentialLedgerProvisioningState? provisioningState = default; int? nodeCount = default; + EnclavePlatform? enclavePlatform = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -201,6 +207,15 @@ internal static ManagedCcfProperties DeserializeManagedCcfProperties(JsonElement nodeCount = property.Value.GetInt32(); continue; } + if (property.NameEquals("enclavePlatform"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enclavePlatform = new EnclavePlatform(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -216,6 +231,7 @@ internal static ManagedCcfProperties DeserializeManagedCcfProperties(JsonElement runningState, provisioningState, nodeCount, + enclavePlatform, serializedAdditionalRawData); } diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Models/ManagedCcfProperties.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Models/ManagedCcfProperties.cs index 9c25d16e4b1e..b6c81246ce48 100644 --- a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Models/ManagedCcfProperties.cs +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Models/ManagedCcfProperties.cs @@ -60,8 +60,9 @@ public ManagedCcfProperties() /// Object representing RunningState for Managed CCF. /// Provisioning state of Managed CCF Resource. /// Number of CCF nodes in the Managed CCF. + /// Enclave platform of Managed CCF. /// Keeps track of any properties unknown to the library. - internal ManagedCcfProperties(string appName, Uri appUri, Uri identityServiceUri, IList memberIdentityCertificates, ConfidentialLedgerDeploymentType deploymentType, ConfidentialLedgerRunningState? runningState, ConfidentialLedgerProvisioningState? provisioningState, int? nodeCount, IDictionary serializedAdditionalRawData) + internal ManagedCcfProperties(string appName, Uri appUri, Uri identityServiceUri, IList memberIdentityCertificates, ConfidentialLedgerDeploymentType deploymentType, ConfidentialLedgerRunningState? runningState, ConfidentialLedgerProvisioningState? provisioningState, int? nodeCount, EnclavePlatform? enclavePlatform, IDictionary serializedAdditionalRawData) { AppName = appName; AppUri = appUri; @@ -71,6 +72,7 @@ internal ManagedCcfProperties(string appName, Uri appUri, Uri identityServiceUri RunningState = runningState; ProvisioningState = provisioningState; NodeCount = nodeCount; + EnclavePlatform = enclavePlatform; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -90,5 +92,7 @@ internal ManagedCcfProperties(string appName, Uri appUri, Uri identityServiceUri public ConfidentialLedgerProvisioningState? ProvisioningState { get; } /// Number of CCF nodes in the Managed CCF. public int? NodeCount { get; set; } + /// Enclave platform of Managed CCF. + public EnclavePlatform? EnclavePlatform { get; set; } } } diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/RestOperations/ConfidentialLedgerRestOperations.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/RestOperations/ConfidentialLedgerRestOperations.cs index 00c080670000..2a699cb713ef 100644 --- a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/RestOperations/ConfidentialLedgerRestOperations.cs +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/RestOperations/ConfidentialLedgerRestOperations.cs @@ -32,7 +32,7 @@ public ConfidentialLedgerRestOperations(HttpPipeline pipeline, string applicatio { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-28-preview"; + _apiVersion = apiVersion ?? "2024-09-19-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/RestOperations/LedgerRestOperations.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/RestOperations/LedgerRestOperations.cs index 77fdc3545528..3c7aaa1151f7 100644 --- a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/RestOperations/LedgerRestOperations.cs +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/RestOperations/LedgerRestOperations.cs @@ -32,7 +32,7 @@ public LedgerRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-28-preview"; + _apiVersion = apiVersion ?? "2024-09-19-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/RestOperations/ManagedCCFRestOperations.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/RestOperations/ManagedCCFRestOperations.cs index 4d6a66526eb1..d68577337985 100644 --- a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/RestOperations/ManagedCCFRestOperations.cs +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/RestOperations/ManagedCCFRestOperations.cs @@ -32,7 +32,7 @@ public ManagedCCFRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-06-28-preview"; + _apiVersion = apiVersion ?? "2024-09-19-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/autorest.md b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/autorest.md index 7b6d4536b199..ae02b3528f71 100644 --- a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/autorest.md +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: ConfidentialLedger namespace: Azure.ResourceManager.ConfidentialLedger -require: https://github.com/Azure/azure-rest-api-specs/blob/de1bc645b4c91e6cb3fddb5588c102ca050dd4da/specification/confidentialledger/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/confidentialledger/resource-manager/readme.md #tag: package-preview-2023-06 output-folder: $(this-folder)/Generated clear-output-folder: true diff --git a/sdk/confidentialledger/ci.mgmt.yml b/sdk/confidentialledger/ci.mgmt.yml index 7343d843f2ee..12db09ffb264 100644 --- a/sdk/confidentialledger/ci.mgmt.yml +++ b/sdk/confidentialledger/ci.mgmt.yml @@ -1,5 +1,6 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -12,6 +13,114 @@ pr: - sdk/confidentialledger/ci.mgmt.yml - sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/confidentialledger/ci.mgmt.yml + - sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/confidentialledger/ci.mgmt.yml + - sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/confidentialledger/ci.mgmt.yml + - sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/confidentialledger/ci.mgmt.yml + - sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/confidentialledger/ci.mgmt.yml + - sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/confidentialledger/ci.mgmt.yml + - sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/confidentialledger/ci.mgmt.yml + - sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/confidentialledger/ci.mgmt.yml + - sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/confidentialledger/ci.mgmt.yml + - sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/confluent/ci.mgmt.yml b/sdk/confluent/ci.mgmt.yml index 12d37aa41bd2..5acb51892225 100644 --- a/sdk/confluent/ci.mgmt.yml +++ b/sdk/confluent/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/confluent/ci.mgmt.yml - sdk/confluent/Azure.ResourceManager.Confluent/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/confluent/ci.mgmt.yml + - sdk/confluent/Azure.ResourceManager.Confluent/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/confluent/ci.mgmt.yml + - sdk/confluent/Azure.ResourceManager.Confluent/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/confluent/ci.mgmt.yml + - sdk/confluent/Azure.ResourceManager.Confluent/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/confluent/ci.mgmt.yml + - sdk/confluent/Azure.ResourceManager.Confluent/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/confluent/ci.mgmt.yml + - sdk/confluent/Azure.ResourceManager.Confluent/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/confluent/ci.mgmt.yml + - sdk/confluent/Azure.ResourceManager.Confluent/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/confluent/ci.mgmt.yml + - sdk/confluent/Azure.ResourceManager.Confluent/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/confluent/ci.mgmt.yml + - sdk/confluent/Azure.ResourceManager.Confluent/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/confluent/ci.mgmt.yml + - sdk/confluent/Azure.ResourceManager.Confluent/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/connectedvmwarevsphere/ci.mgmt.yml b/sdk/connectedvmwarevsphere/ci.mgmt.yml index a9d0db85cf82..befcd8e42112 100644 --- a/sdk/connectedvmwarevsphere/ci.mgmt.yml +++ b/sdk/connectedvmwarevsphere/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/connectedvmwarevsphere/ci.mgmt.yml - sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/connectedvmwarevsphere/ci.mgmt.yml + - sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/connectedvmwarevsphere/ci.mgmt.yml + - sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/connectedvmwarevsphere/ci.mgmt.yml + - sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/connectedvmwarevsphere/ci.mgmt.yml + - sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/connectedvmwarevsphere/ci.mgmt.yml + - sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/connectedvmwarevsphere/ci.mgmt.yml + - sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/connectedvmwarevsphere/ci.mgmt.yml + - sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/connectedvmwarevsphere/ci.mgmt.yml + - sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/connectedvmwarevsphere/ci.mgmt.yml + - sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/consumption/ci.mgmt.yml b/sdk/consumption/ci.mgmt.yml index 6b0ebe2b2fa7..87ce1d9394aa 100644 --- a/sdk/consumption/ci.mgmt.yml +++ b/sdk/consumption/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/consumption/ci.mgmt.yml - sdk/consumption/Azure.ResourceManager.Consumption/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/consumption/ci.mgmt.yml + - sdk/consumption/Azure.ResourceManager.Consumption/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/consumption/ci.mgmt.yml + - sdk/consumption/Azure.ResourceManager.Consumption/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/consumption/ci.mgmt.yml + - sdk/consumption/Azure.ResourceManager.Consumption/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/consumption/ci.mgmt.yml + - sdk/consumption/Azure.ResourceManager.Consumption/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/consumption/ci.mgmt.yml + - sdk/consumption/Azure.ResourceManager.Consumption/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/consumption/ci.mgmt.yml + - sdk/consumption/Azure.ResourceManager.Consumption/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/consumption/ci.mgmt.yml + - sdk/consumption/Azure.ResourceManager.Consumption/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/consumption/ci.mgmt.yml + - sdk/consumption/Azure.ResourceManager.Consumption/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/consumption/ci.mgmt.yml + - sdk/consumption/Azure.ResourceManager.Consumption/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/containerapps/ci.mgmt.yml b/sdk/containerapps/ci.mgmt.yml index 7715d499fa59..d45a7dc756f7 100644 --- a/sdk/containerapps/ci.mgmt.yml +++ b/sdk/containerapps/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/containerapps/ci.mgmt.yml - sdk/containerapps/Azure.ResourceManager.AppContainers/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerapps/ci.mgmt.yml + - sdk/containerapps/Azure.ResourceManager.AppContainers/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerapps/ci.mgmt.yml + - sdk/containerapps/Azure.ResourceManager.AppContainers/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerapps/ci.mgmt.yml + - sdk/containerapps/Azure.ResourceManager.AppContainers/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerapps/ci.mgmt.yml + - sdk/containerapps/Azure.ResourceManager.AppContainers/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerapps/ci.mgmt.yml + - sdk/containerapps/Azure.ResourceManager.AppContainers/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerapps/ci.mgmt.yml + - sdk/containerapps/Azure.ResourceManager.AppContainers/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerapps/ci.mgmt.yml + - sdk/containerapps/Azure.ResourceManager.AppContainers/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerapps/ci.mgmt.yml + - sdk/containerapps/Azure.ResourceManager.AppContainers/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerapps/ci.mgmt.yml + - sdk/containerapps/Azure.ResourceManager.AppContainers/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/containerinstance/ci.mgmt.yml b/sdk/containerinstance/ci.mgmt.yml index 0b4d90bf6d1c..06c94426bc79 100644 --- a/sdk/containerinstance/ci.mgmt.yml +++ b/sdk/containerinstance/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/containerinstance/ci.mgmt.yml - sdk/containerinstance/Azure.ResourceManager.ContainerInstance/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerinstance/ci.mgmt.yml + - sdk/containerinstance/Azure.ResourceManager.ContainerInstance/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerinstance/ci.mgmt.yml + - sdk/containerinstance/Azure.ResourceManager.ContainerInstance/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerinstance/ci.mgmt.yml + - sdk/containerinstance/Azure.ResourceManager.ContainerInstance/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerinstance/ci.mgmt.yml + - sdk/containerinstance/Azure.ResourceManager.ContainerInstance/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerinstance/ci.mgmt.yml + - sdk/containerinstance/Azure.ResourceManager.ContainerInstance/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerinstance/ci.mgmt.yml + - sdk/containerinstance/Azure.ResourceManager.ContainerInstance/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerinstance/ci.mgmt.yml + - sdk/containerinstance/Azure.ResourceManager.ContainerInstance/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerinstance/ci.mgmt.yml + - sdk/containerinstance/Azure.ResourceManager.ContainerInstance/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerinstance/ci.mgmt.yml + - sdk/containerinstance/Azure.ResourceManager.ContainerInstance/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/containerorchestratorruntime/ci.mgmt.yml b/sdk/containerorchestratorruntime/ci.mgmt.yml index 0a036386143b..11805df292f8 100644 --- a/sdk/containerorchestratorruntime/ci.mgmt.yml +++ b/sdk/containerorchestratorruntime/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/containerorchestratorruntime/ci.mgmt.yml - sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerorchestratorruntime/ci.mgmt.yml + - sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerorchestratorruntime/ci.mgmt.yml + - sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerorchestratorruntime/ci.mgmt.yml + - sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerorchestratorruntime/ci.mgmt.yml + - sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerorchestratorruntime/ci.mgmt.yml + - sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerorchestratorruntime/ci.mgmt.yml + - sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerorchestratorruntime/ci.mgmt.yml + - sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerorchestratorruntime/ci.mgmt.yml + - sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerorchestratorruntime/ci.mgmt.yml + - sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/containerregistry/ci.mgmt.yml b/sdk/containerregistry/ci.mgmt.yml index e3f0cfb5bfa5..fb2089f8eee5 100644 --- a/sdk/containerregistry/ci.mgmt.yml +++ b/sdk/containerregistry/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/containerregistry/ci.mgmt.yml - sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerregistry/ci.mgmt.yml + - sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerregistry/ci.mgmt.yml + - sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerregistry/ci.mgmt.yml + - sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerregistry/ci.mgmt.yml + - sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerregistry/ci.mgmt.yml + - sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerregistry/ci.mgmt.yml + - sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerregistry/ci.mgmt.yml + - sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerregistry/ci.mgmt.yml + - sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerregistry/ci.mgmt.yml + - sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolSnapshotCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolSnapshotCollection.cs index 5863b1521d9f..6307465d6781 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolSnapshotCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolSnapshotCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_AgentPoolSnapshotCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateUpdateSnapshot() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsCreate.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/SnapshotsCreate.json // this example is just showing the usage of "Snapshots_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -63,7 +63,7 @@ public async Task CreateOrUpdate_CreateUpdateSnapshot() [Ignore("Only validating compilation of examples")] public async Task Get_GetSnapshot() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/SnapshotsGet.json // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task Get_GetSnapshot() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListSnapshotsByResourceGroup() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsListByResourceGroup.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/SnapshotsListByResourceGroup.json // this example is just showing the usage of "Snapshots_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -131,7 +131,7 @@ public async Task GetAll_ListSnapshotsByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_GetSnapshot() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/SnapshotsGet.json // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -160,7 +160,7 @@ public async Task Exists_GetSnapshot() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetSnapshot() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/SnapshotsGet.json // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolSnapshotResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolSnapshotResource.cs index 18f0d6f5f8fc..334a51210cce 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolSnapshotResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolSnapshotResource.cs @@ -20,7 +20,7 @@ public partial class Sample_AgentPoolSnapshotResource [Ignore("Only validating compilation of examples")] public async Task Get_GetSnapshot() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/SnapshotsGet.json // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_GetSnapshot() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteSnapshot() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsDelete.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/SnapshotsDelete.json // this example is just showing the usage of "Snapshots_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,7 +76,7 @@ public async Task Delete_DeleteSnapshot() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateSnapshotTags() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsUpdateTags.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/SnapshotsUpdateTags.json // this example is just showing the usage of "Snapshots_UpdateTags" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolUpgradeProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolUpgradeProfileResource.cs index 16685e88b2e2..76ec91d16eb3 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolUpgradeProfileResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_AgentPoolUpgradeProfileResource.cs @@ -19,7 +19,7 @@ public partial class Sample_AgentPoolUpgradeProfileResource [Ignore("Only validating compilation of examples")] public async Task Get_GetUpgradeProfileForAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsGetUpgradeProfile.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsGetUpgradeProfile.json // this example is just showing the usage of "AgentPools_GetUpgradeProfile" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceAgentPoolCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceAgentPoolCollection.cs index d89556d52e00..44f8e60e02f8 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceAgentPoolCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceAgentPoolCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerServiceAgentPoolCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAgentPoolUsingAnAgentPoolSnapshot() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Snapshot.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_Snapshot.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -64,7 +64,7 @@ public async Task CreateOrUpdate_CreateAgentPoolUsingAnAgentPoolSnapshot() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAgentPoolWithCapacityReservationGroup() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_CRG.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_CRG.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -107,7 +107,7 @@ public async Task CreateOrUpdate_CreateAgentPoolWithCapacityReservationGroup() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAgentPoolWithDedicatedHostGroup() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_DedicatedHostGroup.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_DedicatedHostGroup.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -150,7 +150,7 @@ public async Task CreateOrUpdate_CreateAgentPoolWithDedicatedHostGroup() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAgentPoolWithEncryptionAtHostEnabled() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -193,7 +193,7 @@ public async Task CreateOrUpdate_CreateAgentPoolWithEncryptionAtHostEnabled() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAgentPoolWithEphemeralOSDisk() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Ephemeral.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_Ephemeral.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -237,7 +237,7 @@ public async Task CreateOrUpdate_CreateAgentPoolWithEphemeralOSDisk() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAgentPoolWithFIPSEnabledOS() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_EnableFIPS.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_EnableFIPS.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -280,7 +280,7 @@ public async Task CreateOrUpdate_CreateAgentPoolWithFIPSEnabledOS() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAgentPoolWithGPUMIG() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_GPUMIG.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_GPUMIG.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -347,7 +347,7 @@ public async Task CreateOrUpdate_CreateAgentPoolWithGPUMIG() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAgentPoolWithKrustletAndTheWASIRuntime() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_WasmWasi.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_WasmWasi.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -392,7 +392,7 @@ public async Task CreateOrUpdate_CreateAgentPoolWithKrustletAndTheWASIRuntime() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAgentPoolWithKubeletConfigAndLinuxOSConfig() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_CustomNodeConfig.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_CustomNodeConfig.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -458,7 +458,7 @@ public async Task CreateOrUpdate_CreateAgentPoolWithKubeletConfigAndLinuxOSConfi [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAgentPoolWithOSSKU() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_OSSKU.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_OSSKU.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -525,7 +525,7 @@ public async Task CreateOrUpdate_CreateAgentPoolWithOSSKU() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAgentPoolWithPPG() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_PPG.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_PPG.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -568,7 +568,7 @@ public async Task CreateOrUpdate_CreateAgentPoolWithPPG() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAgentPoolWithUltraSSDEnabled() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_EnableUltraSSD.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_EnableUltraSSD.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -611,7 +611,7 @@ public async Task CreateOrUpdate_CreateAgentPoolWithUltraSSDEnabled() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAgentPoolWithWindowsOSSKU() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_WindowsOSSKU.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_WindowsOSSKU.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -654,7 +654,7 @@ public async Task CreateOrUpdate_CreateAgentPoolWithWindowsOSSKU() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateSpotAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Spot.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_Spot.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -703,11 +703,55 @@ public async Task CreateOrUpdate_CreateSpotAgentPool() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateWindowsAgentPoolWithDisablingOutboundNAT() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_WindowsDisableOutboundNAT.json + // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerServiceManagedClusterResource created on azure + // for more information of creating ContainerServiceManagedClusterResource, please refer to the document of ContainerServiceManagedClusterResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string resourceName = "clustername1"; + ResourceIdentifier containerServiceManagedClusterResourceId = ContainerServiceManagedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); + ContainerServiceManagedClusterResource containerServiceManagedCluster = client.GetContainerServiceManagedClusterResource(containerServiceManagedClusterResourceId); + + // get the collection of this ContainerServiceAgentPoolResource + ContainerServiceAgentPoolCollection collection = containerServiceManagedCluster.GetContainerServiceAgentPools(); + + // invoke the operation + string agentPoolName = "wnp2"; + ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData + { + Count = 3, + VmSize = "Standard_D4s_v3", + OSType = ContainerServiceOSType.Windows, + OSSku = ContainerServiceOSSku.Windows2022, + OrchestratorVersion = "1.23.8", + DisableOutboundNat = true, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, agentPoolName, data); + ContainerServiceAgentPoolResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerServiceAgentPoolData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateUpdateAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Update.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_Update.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -761,7 +805,7 @@ public async Task CreateOrUpdate_CreateUpdateAgentPool() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_StartAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPools_Start.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPools_Start.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -800,7 +844,7 @@ public async Task CreateOrUpdate_StartAgentPool() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_StopAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPools_Stop.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPools_Stop.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -839,7 +883,7 @@ public async Task CreateOrUpdate_StopAgentPool() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_UpdateAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPools_Update.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPools_Update.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -887,7 +931,7 @@ public async Task CreateOrUpdate_UpdateAgentPool() [Ignore("Only validating compilation of examples")] public async Task Get_GetAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsGet.json // this example is just showing the usage of "AgentPools_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -921,7 +965,7 @@ public async Task Get_GetAgentPool() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListAgentPoolsByManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsList.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsList.json // this example is just showing the usage of "AgentPools_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -957,7 +1001,7 @@ public async Task GetAll_ListAgentPoolsByManagedCluster() [Ignore("Only validating compilation of examples")] public async Task Exists_GetAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsGet.json // this example is just showing the usage of "AgentPools_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -987,7 +1031,7 @@ public async Task Exists_GetAgentPool() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsGet.json // this example is just showing the usage of "AgentPools_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceAgentPoolResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceAgentPoolResource.cs index 8f449f069239..d55b630fe1e0 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceAgentPoolResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceAgentPoolResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerServiceAgentPoolResource [Ignore("Only validating compilation of examples")] public async Task Get_GetAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsGet.json // this example is just showing the usage of "AgentPools_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_GetAgentPool() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsDelete.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsDelete.json // this example is just showing the usage of "AgentPools_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_DeleteAgentPool() [Ignore("Only validating compilation of examples")] public async Task Update_CreateAgentPoolUsingAnAgentPoolSnapshot() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Snapshot.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_Snapshot.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -119,7 +119,7 @@ public async Task Update_CreateAgentPoolUsingAnAgentPoolSnapshot() [Ignore("Only validating compilation of examples")] public async Task Update_CreateAgentPoolWithCapacityReservationGroup() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_CRG.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_CRG.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -159,7 +159,7 @@ public async Task Update_CreateAgentPoolWithCapacityReservationGroup() [Ignore("Only validating compilation of examples")] public async Task Update_CreateAgentPoolWithDedicatedHostGroup() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_DedicatedHostGroup.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_DedicatedHostGroup.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -199,7 +199,7 @@ public async Task Update_CreateAgentPoolWithDedicatedHostGroup() [Ignore("Only validating compilation of examples")] public async Task Update_CreateAgentPoolWithEncryptionAtHostEnabled() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -239,7 +239,7 @@ public async Task Update_CreateAgentPoolWithEncryptionAtHostEnabled() [Ignore("Only validating compilation of examples")] public async Task Update_CreateAgentPoolWithEphemeralOSDisk() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Ephemeral.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_Ephemeral.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -280,7 +280,7 @@ public async Task Update_CreateAgentPoolWithEphemeralOSDisk() [Ignore("Only validating compilation of examples")] public async Task Update_CreateAgentPoolWithFIPSEnabledOS() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_EnableFIPS.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_EnableFIPS.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -320,7 +320,7 @@ public async Task Update_CreateAgentPoolWithFIPSEnabledOS() [Ignore("Only validating compilation of examples")] public async Task Update_CreateAgentPoolWithGPUMIG() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_GPUMIG.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_GPUMIG.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -384,7 +384,7 @@ public async Task Update_CreateAgentPoolWithGPUMIG() [Ignore("Only validating compilation of examples")] public async Task Update_CreateAgentPoolWithKrustletAndTheWASIRuntime() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_WasmWasi.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_WasmWasi.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -426,7 +426,7 @@ public async Task Update_CreateAgentPoolWithKrustletAndTheWASIRuntime() [Ignore("Only validating compilation of examples")] public async Task Update_CreateAgentPoolWithKubeletConfigAndLinuxOSConfig() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_CustomNodeConfig.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_CustomNodeConfig.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -489,7 +489,7 @@ public async Task Update_CreateAgentPoolWithKubeletConfigAndLinuxOSConfig() [Ignore("Only validating compilation of examples")] public async Task Update_CreateAgentPoolWithOSSKU() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_OSSKU.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_OSSKU.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -553,7 +553,7 @@ public async Task Update_CreateAgentPoolWithOSSKU() [Ignore("Only validating compilation of examples")] public async Task Update_CreateAgentPoolWithPPG() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_PPG.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_PPG.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -593,7 +593,7 @@ public async Task Update_CreateAgentPoolWithPPG() [Ignore("Only validating compilation of examples")] public async Task Update_CreateAgentPoolWithUltraSSDEnabled() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_EnableUltraSSD.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_EnableUltraSSD.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -633,7 +633,7 @@ public async Task Update_CreateAgentPoolWithUltraSSDEnabled() [Ignore("Only validating compilation of examples")] public async Task Update_CreateAgentPoolWithWindowsOSSKU() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_WindowsOSSKU.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_WindowsOSSKU.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -673,7 +673,7 @@ public async Task Update_CreateAgentPoolWithWindowsOSSKU() [Ignore("Only validating compilation of examples")] public async Task Update_CreateSpotAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Spot.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_Spot.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -719,11 +719,52 @@ public async Task Update_CreateSpotAgentPool() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreateWindowsAgentPoolWithDisablingOutboundNAT() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_WindowsDisableOutboundNAT.json + // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerServiceAgentPoolResource created on azure + // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string resourceName = "clustername1"; + string agentPoolName = "wnp2"; + ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); + ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); + + // invoke the operation + ContainerServiceAgentPoolData data = new ContainerServiceAgentPoolData + { + Count = 3, + VmSize = "Standard_D4s_v3", + OSType = ContainerServiceOSType.Windows, + OSSku = ContainerServiceOSSku.Windows2022, + OrchestratorVersion = "1.23.8", + DisableOutboundNat = true, + }; + ArmOperation lro = await containerServiceAgentPool.UpdateAsync(WaitUntil.Completed, data); + ContainerServiceAgentPoolResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerServiceAgentPoolData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task Update_CreateUpdateAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsCreate_Update.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsCreate_Update.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -774,7 +815,7 @@ public async Task Update_CreateUpdateAgentPool() [Ignore("Only validating compilation of examples")] public async Task Update_StartAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPools_Start.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPools_Start.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -810,7 +851,7 @@ public async Task Update_StartAgentPool() [Ignore("Only validating compilation of examples")] public async Task Update_StopAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPools_Stop.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPools_Stop.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -846,7 +887,7 @@ public async Task Update_StopAgentPool() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPools_Update.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPools_Update.json // this example is just showing the usage of "AgentPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -891,7 +932,7 @@ public async Task Update_UpdateAgentPool() [Ignore("Only validating compilation of examples")] public async Task AbortLatestOperation_AbortOperationOnAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsAbortOperation.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsAbortOperation.json // this example is just showing the usage of "AgentPools_AbortLatestOperation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -914,11 +955,39 @@ public async Task AbortLatestOperation_AbortOperationOnAgentPool() Console.WriteLine("Succeeded"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task DeleteMachines_DeleteSpecificMachinesInAnAgentPool() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsDeleteMachines.json + // this example is just showing the usage of "AgentPools_DeleteMachines" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerServiceAgentPoolResource created on azure + // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string resourceName = "clustername1"; + string agentPoolName = "agentpool1"; + ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); + ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); + + // invoke the operation + AgentPoolDeleteMachinesParameter machines = new AgentPoolDeleteMachinesParameter(new string[] { "aks-nodepool1-42263519-vmss00000a", "aks-nodepool1-42263519-vmss00000b" }); + await containerServiceAgentPool.DeleteMachinesAsync(WaitUntil.Completed, machines); + + Console.WriteLine("Succeeded"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task UpgradeNodeImageVersion_UpgradeAgentPoolNodeImageVersion() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsUpgradeNodeImageVersion.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsUpgradeNodeImageVersion.json // this example is just showing the usage of "AgentPools_UpgradeNodeImageVersion" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceMaintenanceConfigurationCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceMaintenanceConfigurationCollection.cs index 6c6340f77ea6..b938c2280838 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceMaintenanceConfigurationCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceMaintenanceConfigurationCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerServiceMaintenanceConfigurationCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateUpdateMaintenanceConfiguration() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsCreate_Update.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/MaintenanceConfigurationsCreate_Update.json // this example is just showing the usage of "MaintenanceConfigurations_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -68,7 +68,7 @@ public async Task CreateOrUpdate_CreateUpdateMaintenanceConfiguration() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateUpdateMaintenanceConfigurationWithMaintenanceWindow() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsCreate_Update_MaintenanceWindow.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/MaintenanceConfigurationsCreate_Update_MaintenanceWindow.json // this example is just showing the usage of "MaintenanceConfigurations_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -115,7 +115,7 @@ public async Task CreateOrUpdate_CreateUpdateMaintenanceConfigurationWithMainten [Ignore("Only validating compilation of examples")] public async Task Get_GetMaintenanceConfiguration() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/MaintenanceConfigurationsGet.json // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -149,7 +149,7 @@ public async Task Get_GetMaintenanceConfiguration() [Ignore("Only validating compilation of examples")] public async Task Get_GetMaintenanceConfigurationConfiguredWithMaintenanceWindow() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -183,7 +183,7 @@ public async Task Get_GetMaintenanceConfigurationConfiguredWithMaintenanceWindow [Ignore("Only validating compilation of examples")] public async Task GetAll_ListMaintenanceConfigurationsByManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsList.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/MaintenanceConfigurationsList.json // this example is just showing the usage of "MaintenanceConfigurations_ListByManagedCluster" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -219,7 +219,7 @@ public async Task GetAll_ListMaintenanceConfigurationsByManagedCluster() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListMaintenanceConfigurationsConfiguredWithMaintenanceWindowByManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsList_MaintenanceWindow.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/MaintenanceConfigurationsList_MaintenanceWindow.json // this example is just showing the usage of "MaintenanceConfigurations_ListByManagedCluster" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -255,7 +255,7 @@ public async Task GetAll_ListMaintenanceConfigurationsConfiguredWithMaintenanceW [Ignore("Only validating compilation of examples")] public async Task Exists_GetMaintenanceConfiguration() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/MaintenanceConfigurationsGet.json // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -285,7 +285,7 @@ public async Task Exists_GetMaintenanceConfiguration() [Ignore("Only validating compilation of examples")] public async Task Exists_GetMaintenanceConfigurationConfiguredWithMaintenanceWindow() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -315,7 +315,7 @@ public async Task Exists_GetMaintenanceConfigurationConfiguredWithMaintenanceWin [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetMaintenanceConfiguration() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/MaintenanceConfigurationsGet.json // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -357,7 +357,7 @@ public async Task GetIfExists_GetMaintenanceConfiguration() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetMaintenanceConfigurationConfiguredWithMaintenanceWindow() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceMaintenanceConfigurationResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceMaintenanceConfigurationResource.cs index bacc1890041f..2de35be16c80 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceMaintenanceConfigurationResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceMaintenanceConfigurationResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerServiceMaintenanceConfigurationResource [Ignore("Only validating compilation of examples")] public async Task Get_GetMaintenanceConfiguration() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/MaintenanceConfigurationsGet.json // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_GetMaintenanceConfiguration() [Ignore("Only validating compilation of examples")] public async Task Get_GetMaintenanceConfigurationConfiguredWithMaintenanceWindow() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Get_GetMaintenanceConfigurationConfiguredWithMaintenanceWindow [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteMaintenanceConfiguration() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsDelete.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/MaintenanceConfigurationsDelete.json // this example is just showing the usage of "MaintenanceConfigurations_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -109,7 +109,7 @@ public async Task Delete_DeleteMaintenanceConfiguration() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteMaintenanceConfigurationForNodeOSUpgrade() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsDelete_MaintenanceWindow.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/MaintenanceConfigurationsDelete_MaintenanceWindow.json // this example is just showing the usage of "MaintenanceConfigurations_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -136,7 +136,7 @@ public async Task Delete_DeleteMaintenanceConfigurationForNodeOSUpgrade() [Ignore("Only validating compilation of examples")] public async Task Update_CreateUpdateMaintenanceConfiguration() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsCreate_Update.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/MaintenanceConfigurationsCreate_Update.json // this example is just showing the usage of "MaintenanceConfigurations_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -181,7 +181,7 @@ public async Task Update_CreateUpdateMaintenanceConfiguration() [Ignore("Only validating compilation of examples")] public async Task Update_CreateUpdateMaintenanceConfigurationWithMaintenanceWindow() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/MaintenanceConfigurationsCreate_Update_MaintenanceWindow.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/MaintenanceConfigurationsCreate_Update_MaintenanceWindow.json // this example is just showing the usage of "MaintenanceConfigurations_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceManagedClusterCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceManagedClusterCollection.cs index 76550907a7de..dda58f17e8c0 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceManagedClusterCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceManagedClusterCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_ContainerServiceManagedClusterCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterUsingAnAgentPoolSnapshot() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_Snapshot.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersCreate_Snapshot.json // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -115,7 +115,7 @@ public async Task CreateOrUpdate_CreateManagedClusterUsingAnAgentPoolSnapshot() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithAKSManagedNATGatewayAsOutboundType() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_ManagedNATGateway.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersCreate_ManagedNATGateway.json // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -203,7 +203,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithAKSManagedNATGatewayAsO [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithAzureKeyVaultSecretsProviderAddon() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_AzureKeyvaultSecretsProvider.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersCreate_AzureKeyvaultSecretsProvider.json // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -304,7 +304,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithAzureKeyVaultSecretsPro [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithCapacityReservationGroup() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_CRG.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersCreate_CRG.json // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -396,7 +396,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithCapacityReservationGrou [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithDedicatedHostGroup() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_DedicatedHostGroup.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersCreate_DedicatedHostGroup.json // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -487,7 +487,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithDedicatedHostGroup() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithEncryptionAtHostEnabled() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_EnableEncryptionAtHost.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersCreate_EnableEncryptionAtHost.json // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -579,7 +579,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithEncryptionAtHostEnabled [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithFIPSEnabledOS() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_EnabledFIPS.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersCreate_EnabledFIPS.json // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -671,7 +671,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithFIPSEnabledOS() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithGPUMIG() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_GPUMIG.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersCreate_GPUMIG.json // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -770,7 +770,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithGPUMIG() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithHTTPProxyConfigured() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_HTTPProxy.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersCreate_HTTPProxy.json // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -868,7 +868,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithHTTPProxyConfigured() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithLongTermSupport() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_Premium.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersCreate_Premium.json // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -964,7 +964,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithLongTermSupport() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithNodePublicIPPrefix() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_NodePublicIPPrefix.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersCreate_NodePublicIPPrefix.json // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1056,7 +1056,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithNodePublicIPPrefix() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithOSSKU() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_OSSKU.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersCreate_OSSKU.json // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1155,7 +1155,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithOSSKU() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithPPG() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_PPG.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersCreate_PPG.json // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1247,7 +1247,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithPPG() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithPodIdentityEnabled() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_PodIdentity.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersCreate_PodIdentity.json // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1343,7 +1343,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithPodIdentityEnabled() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithRunCommandDisabled() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_DisableRunCommand.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersCreate_DisableRunCommand.json // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1438,7 +1438,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithRunCommandDisabled() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithSecurityProfileConfigured() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_SecurityProfile.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersCreate_SecurityProfile.json // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1521,7 +1521,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithSecurityProfileConfigur [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithUltraSSDEnabled() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_EnableUltraSSD.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersCreate_EnableUltraSSD.json // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1609,11 +1609,90 @@ public async Task CreateOrUpdate_CreateManagedClusterWithUltraSSDEnabled() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateManagedClusterWithWebAppRoutingIngressProfileConfigured() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersCreate_IngressProfile_WebAppRouting.json + // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ContainerServiceManagedClusterResource + ContainerServiceManagedClusterCollection collection = resourceGroupResource.GetContainerServiceManagedClusters(); + + // invoke the operation + string resourceName = "clustername1"; + ContainerServiceManagedClusterData data = new ContainerServiceManagedClusterData(new AzureLocation("location1")) + { + Sku = new ManagedClusterSku + { + Name = new ManagedClusterSkuName("Basic"), + Tier = ManagedClusterSkuTier.Free, + }, + KubernetesVersion = "", + DnsPrefix = "dnsprefix1", + AgentPoolProfiles = {new ManagedClusterAgentPoolProfile("nodepool1") +{ +Count = 3, +VmSize = "Standard_DS2_v2", +OSType = ContainerServiceOSType.Linux, +AgentPoolType = AgentPoolType.VirtualMachineScaleSets, +Mode = AgentPoolMode.System, +EnableNodePublicIP = true, +}}, + LinuxProfile = new ContainerServiceLinuxProfile("azureuser", new ContainerServiceSshConfiguration(new ContainerServiceSshPublicKey[] + { +new ContainerServiceSshPublicKey("keydata") + })), + NetworkProfile = new ContainerServiceNetworkProfile + { + OutboundType = ContainerServiceOutboundType.LoadBalancer, + LoadBalancerSku = ContainerServiceLoadBalancerSku.Standard, + LoadBalancerProfile = new ManagedClusterLoadBalancerProfile + { + ManagedOutboundIPs = new ManagedClusterLoadBalancerProfileManagedOutboundIPs + { + Count = 2, + }, + }, + }, + IngressWebAppRouting = new ManagedClusterIngressProfileWebAppRouting + { + Enabled = true, + DnsZoneResourceIds = { new ResourceIdentifier("/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/Microsoft.Network/dnszones/DNS_ZONE_NAME") }, + }, + Tags = +{ +["archv2"] = "", +["tier"] = "production" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); + ContainerServiceManagedClusterResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerServiceManagedClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedClusterWithUserAssignedNATGatewayAsOutboundType() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_UserAssignedNATGateway.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersCreate_UserAssignedNATGateway.json // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1697,7 +1776,7 @@ public async Task CreateOrUpdate_CreateManagedClusterWithUserAssignedNATGatewayA [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedPrivateClusterWithPublicFQDNSpecified() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1793,7 +1872,7 @@ public async Task CreateOrUpdate_CreateManagedPrivateClusterWithPublicFQDNSpecif [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateManagedPrivateClusterWithFqdnSubdomainSpecified() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1889,7 +1968,7 @@ public async Task CreateOrUpdate_CreateManagedPrivateClusterWithFqdnSubdomainSpe [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateUpdateAADManagedClusterWithEnableAzureRBAC() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1986,7 +2065,7 @@ public async Task CreateOrUpdate_CreateUpdateAADManagedClusterWithEnableAzureRBA [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateUpdateManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_Update.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersCreate_Update.json // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2097,7 +2176,7 @@ public async Task CreateOrUpdate_CreateUpdateManagedCluster() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateUpdateManagedClusterWithAzureServiceMesh() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_AzureServiceMesh.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersCreate_AzureServiceMesh.json // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2185,13 +2264,7 @@ public async Task CreateOrUpdate_CreateUpdateManagedClusterWithAzureServiceMesh( Components = new IstioComponents { IngressGateways = { new IstioIngressGateway(IstioIngressGatewayMode.Internal, true) }, - EgressGateways = {new IstioEgressGateway(true) -{ -NodeSelector = -{ -["istio"] = "egress" -}, -}}, + EgressGateways = { new IstioEgressGateway(true) }, }, CertificateAuthorityPlugin = new IstioPluginCertificateAuthority { @@ -2223,7 +2296,7 @@ public async Task CreateOrUpdate_CreateUpdateManagedClusterWithAzureServiceMesh( [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateUpdateManagedClusterWithEnableAHUB() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_UpdateWithAHUB.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersCreate_UpdateWithAHUB.json // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2324,7 +2397,7 @@ public async Task CreateOrUpdate_CreateUpdateManagedClusterWithEnableAHUB() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateUpdateManagedClusterWithWindowsGMSAEnabled() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_UpdateWindowsGmsa.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersCreate_UpdateWindowsGmsa.json // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2428,7 +2501,7 @@ public async Task CreateOrUpdate_CreateUpdateManagedClusterWithWindowsGMSAEnable [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateUpdateManagedClusterWithDualStackNetworking() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersCreate_DualStackNetworking.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersCreate_DualStackNetworking.json // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2535,7 +2608,7 @@ public async Task CreateOrUpdate_CreateUpdateManagedClusterWithDualStackNetworki [Ignore("Only validating compilation of examples")] public async Task Get_GetManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersGet.json // this example is just showing the usage of "ManagedClusters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2568,7 +2641,7 @@ public async Task Get_GetManagedCluster() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetManagedClustersByResourceGroup() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersListByResourceGroup.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersListByResourceGroup.json // this example is just showing the usage of "ManagedClusters_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2603,7 +2676,7 @@ public async Task GetAll_GetManagedClustersByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_GetManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersGet.json // this example is just showing the usage of "ManagedClusters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2632,7 +2705,7 @@ public async Task Exists_GetManagedCluster() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersGet.json // this example is just showing the usage of "ManagedClusters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceManagedClusterResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceManagedClusterResource.cs index 6d601b6ae0e4..c558ec779e63 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceManagedClusterResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceManagedClusterResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerServiceManagedClusterResource [Ignore("Only validating compilation of examples")] public async Task Get_GetManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersGet.json // this example is just showing the usage of "ManagedClusters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_GetManagedCluster() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersDelete.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersDelete.json // this example is just showing the usage of "ManagedClusters_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,7 +76,7 @@ public async Task Delete_DeleteManagedCluster() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateManagedClusterTags() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersUpdateTags.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersUpdateTags.json // this example is just showing the usage of "ManagedClusters_UpdateTags" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -115,7 +115,7 @@ public async Task Update_UpdateManagedClusterTags() [Ignore("Only validating compilation of examples")] public async Task GetAccessProfile_GetManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGetAccessProfile.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersGetAccessProfile.json // this example is just showing the usage of "ManagedClusters_GetAccessProfile" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -142,7 +142,7 @@ public async Task GetAccessProfile_GetManagedCluster() [Ignore("Only validating compilation of examples")] public async Task GetClusterAdminCredentials_GetManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersListClusterAdminCredentials.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersListClusterAdminCredentials.json // this example is just showing the usage of "ManagedClusters_ListClusterAdminCredentials" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -168,7 +168,7 @@ public async Task GetClusterAdminCredentials_GetManagedCluster() [Ignore("Only validating compilation of examples")] public async Task GetClusterUserCredentials_GetManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersListClusterUserCredentials.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersListClusterUserCredentials.json // this example is just showing the usage of "ManagedClusters_ListClusterUserCredentials" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -194,7 +194,7 @@ public async Task GetClusterUserCredentials_GetManagedCluster() [Ignore("Only validating compilation of examples")] public async Task GetClusterMonitoringUserCredentials_GetManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersListClusterMonitoringUserCredentials.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersListClusterMonitoringUserCredentials.json // this example is just showing the usage of "ManagedClusters_ListClusterMonitoringUserCredentials" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -220,7 +220,7 @@ public async Task GetClusterMonitoringUserCredentials_GetManagedCluster() [Ignore("Only validating compilation of examples")] public async Task ResetServicePrincipalProfile_ResetServicePrincipalProfile() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersResetServicePrincipalProfile.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersResetServicePrincipalProfile.json // this example is just showing the usage of "ManagedClusters_ResetServicePrincipalProfile" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -250,7 +250,7 @@ public async Task ResetServicePrincipalProfile_ResetServicePrincipalProfile() [Ignore("Only validating compilation of examples")] public async Task ResetAadProfile_ResetAADProfile() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersResetAADProfile.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersResetAADProfile.json // this example is just showing the usage of "ManagedClusters_ResetAadProfile" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -283,7 +283,7 @@ public async Task ResetAadProfile_ResetAADProfile() [Ignore("Only validating compilation of examples")] public async Task RotateClusterCertificates_RotateClusterCertificates() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersRotateClusterCertificates.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersRotateClusterCertificates.json // this example is just showing the usage of "ManagedClusters_RotateClusterCertificates" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -309,7 +309,7 @@ public async Task RotateClusterCertificates_RotateClusterCertificates() [Ignore("Only validating compilation of examples")] public async Task AbortLatestOperation_AbortOperationOnManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersAbortOperation.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersAbortOperation.json // this example is just showing the usage of "ManagedClusters_AbortLatestOperation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -335,7 +335,7 @@ public async Task AbortLatestOperation_AbortOperationOnManagedCluster() [Ignore("Only validating compilation of examples")] public async Task RotateServiceAccountSigningKeys_RotateClusterServiceAccountSigningKeys() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersRotateServiceAccountSigningKeys.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersRotateServiceAccountSigningKeys.json // this example is just showing the usage of "ManagedClusters_RotateServiceAccountSigningKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -361,7 +361,7 @@ public async Task RotateServiceAccountSigningKeys_RotateClusterServiceAccountSig [Ignore("Only validating compilation of examples")] public async Task Stop_StopManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersStop.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersStop.json // this example is just showing the usage of "ManagedClusters_Stop" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -387,7 +387,7 @@ public async Task Stop_StopManagedCluster() [Ignore("Only validating compilation of examples")] public async Task Start_StartManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersStart.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersStart.json // this example is just showing the usage of "ManagedClusters_Start" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -413,7 +413,7 @@ public async Task Start_StartManagedCluster() [Ignore("Only validating compilation of examples")] public async Task RunCommand_SubmitNewCommand() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/RunCommandRequest.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/RunCommandRequest.json // this example is just showing the usage of "ManagedClusters_RunCommand" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -445,7 +445,7 @@ public async Task RunCommand_SubmitNewCommand() [Ignore("Only validating compilation of examples")] public async Task GetCommandResult_CommandFailedResult() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/RunCommandResultFailed.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/RunCommandResultFailed.json // this example is just showing the usage of "ManagedClusters_GetCommandResult" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -472,7 +472,7 @@ public async Task GetCommandResult_CommandFailedResult() [Ignore("Only validating compilation of examples")] public async Task GetCommandResult_CommandSucceedResult() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/RunCommandResultSucceed.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/RunCommandResultSucceed.json // this example is just showing the usage of "ManagedClusters_GetCommandResult" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -499,7 +499,7 @@ public async Task GetCommandResult_CommandSucceedResult() [Ignore("Only validating compilation of examples")] public async Task GetOutboundNetworkDependenciesEndpoints_ListOutboundNetworkDependenciesEndpointsByManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/OutboundNetworkDependenciesEndpointsList.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/OutboundNetworkDependenciesEndpointsList.json // this example is just showing the usage of "ManagedClusters_ListOutboundNetworkDependenciesEndpoints" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -528,7 +528,7 @@ public async Task GetOutboundNetworkDependenciesEndpoints_ListOutboundNetworkDep [Ignore("Only validating compilation of examples")] public async Task GetAvailableAgentPoolVersions_GetAvailableVersionsForAgentPool() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/AgentPoolsGetAgentPoolAvailableVersions.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/AgentPoolsGetAgentPoolAvailableVersions.json // this example is just showing the usage of "AgentPools_GetAvailableAgentPoolVersions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -554,7 +554,7 @@ public async Task GetAvailableAgentPoolVersions_GetAvailableVersionsForAgentPool [Ignore("Only validating compilation of examples")] public async Task GetPrivateLinkResources_ListPrivateLinkResourcesByManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateLinkResourcesList.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/PrivateLinkResourcesList.json // this example is just showing the usage of "PrivateLinkResources_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -583,7 +583,7 @@ public async Task GetPrivateLinkResources_ListPrivateLinkResourcesByManagedClust [Ignore("Only validating compilation of examples")] public async Task ResolvePrivateLinkServiceId_ResolveThePrivateLinkServiceIDForManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ResolvePrivateLinkServiceId.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ResolvePrivateLinkServiceId.json // this example is just showing the usage of "ResolvePrivateLinkServiceId_Post" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServicePrivateEndpointConnectionCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServicePrivateEndpointConnectionCollection.cs index c86354e22e27..06e84a33d1e4 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServicePrivateEndpointConnectionCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServicePrivateEndpointConnectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerServicePrivateEndpointConnectionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_UpdatePrivateEndpointConnection() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsUpdate.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/PrivateEndpointConnectionsUpdate.json // this example is just showing the usage of "PrivateEndpointConnections_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -62,7 +62,7 @@ public async Task CreateOrUpdate_UpdatePrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Get_GetPrivateEndpointConnection() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/PrivateEndpointConnectionsGet.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task Get_GetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListPrivateEndpointConnectionsByManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsList.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/PrivateEndpointConnectionsList.json // this example is just showing the usage of "PrivateEndpointConnections_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -132,7 +132,7 @@ public async Task GetAll_ListPrivateEndpointConnectionsByManagedCluster() [Ignore("Only validating compilation of examples")] public async Task Exists_GetPrivateEndpointConnection() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/PrivateEndpointConnectionsGet.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -162,7 +162,7 @@ public async Task Exists_GetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetPrivateEndpointConnection() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/PrivateEndpointConnectionsGet.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServicePrivateEndpointConnectionResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServicePrivateEndpointConnectionResource.cs index 9e5acc67aca0..0785167d4804 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServicePrivateEndpointConnectionResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServicePrivateEndpointConnectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerServicePrivateEndpointConnectionResource [Ignore("Only validating compilation of examples")] public async Task Get_GetPrivateEndpointConnection() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsGet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/PrivateEndpointConnectionsGet.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_GetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Delete_DeletePrivateEndpointConnection() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsDelete.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/PrivateEndpointConnectionsDelete.json // this example is just showing the usage of "PrivateEndpointConnections_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_DeletePrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Update_UpdatePrivateEndpointConnection() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/PrivateEndpointConnectionsUpdate.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/PrivateEndpointConnectionsUpdate.json // this example is just showing the usage of "PrivateEndpointConnections_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceTrustedAccessRoleBindingCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceTrustedAccessRoleBindingCollection.cs index 0b58e1ae96a7..ca0b5046d317 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceTrustedAccessRoleBindingCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceTrustedAccessRoleBindingCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerServiceTrustedAccessRoleBindingCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateATrustedAccessRoleBinding() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_CreateOrUpdate.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/TrustedAccessRoleBindings_CreateOrUpdate.json // this example is just showing the usage of "TrustedAccessRoleBindings_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task CreateOrUpdate_CreateOrUpdateATrustedAccessRoleBinding() [Ignore("Only validating compilation of examples")] public async Task Get_GetATrustedAccessRoleBinding() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/TrustedAccessRoleBindings_Get.json // this example is just showing the usage of "TrustedAccessRoleBindings_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task Get_GetATrustedAccessRoleBinding() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListTrustedAccessRoleBindings() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_List.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/TrustedAccessRoleBindings_List.json // this example is just showing the usage of "TrustedAccessRoleBindings_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -125,7 +125,7 @@ public async Task GetAll_ListTrustedAccessRoleBindings() [Ignore("Only validating compilation of examples")] public async Task Exists_GetATrustedAccessRoleBinding() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/TrustedAccessRoleBindings_Get.json // this example is just showing the usage of "TrustedAccessRoleBindings_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -155,7 +155,7 @@ public async Task Exists_GetATrustedAccessRoleBinding() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetATrustedAccessRoleBinding() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/TrustedAccessRoleBindings_Get.json // this example is just showing the usage of "TrustedAccessRoleBindings_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceTrustedAccessRoleBindingResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceTrustedAccessRoleBindingResource.cs index 6d9666b3d4c5..2fe5392aa063 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceTrustedAccessRoleBindingResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ContainerServiceTrustedAccessRoleBindingResource.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerServiceTrustedAccessRoleBindingResource [Ignore("Only validating compilation of examples")] public async Task Get_GetATrustedAccessRoleBinding() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/TrustedAccessRoleBindings_Get.json // this example is just showing the usage of "TrustedAccessRoleBindings_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_GetATrustedAccessRoleBinding() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteATrustedAccessRoleBinding() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_Delete.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/TrustedAccessRoleBindings_Delete.json // this example is just showing the usage of "TrustedAccessRoleBindings_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -77,7 +77,7 @@ public async Task Delete_DeleteATrustedAccessRoleBinding() [Ignore("Only validating compilation of examples")] public async Task Update_CreateOrUpdateATrustedAccessRoleBinding() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoleBindings_CreateOrUpdate.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/TrustedAccessRoleBindings_CreateOrUpdate.json // this example is just showing the usage of "TrustedAccessRoleBindings_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MachineCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MachineCollection.cs new file mode 100644 index 000000000000..7507d39d2864 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MachineCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerService.Samples +{ + public partial class Sample_MachineCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetAMachineInAnAgentPoolsByManagedCluster() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/MachineGet.json + // this example is just showing the usage of "Machines_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerServiceAgentPoolResource created on azure + // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource + string subscriptionId = "26fe00f8-9173-4872-9134-bb1d2e00343a"; + string resourceGroupName = "rg1"; + string resourceName = "clustername1"; + string agentPoolName = "agentpool1"; + ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); + ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); + + // get the collection of this MachineResource + MachineCollection collection = containerServiceAgentPool.GetMachines(); + + // invoke the operation + string machineName = "aks-nodepool1-42263519-vmss00000t"; + MachineResource result = await collection.GetAsync(machineName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListMachinesInAnAgentpoolByManagedCluster() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/MachineList.json + // this example is just showing the usage of "Machines_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerServiceAgentPoolResource created on azure + // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource + string subscriptionId = "26fe00f8-9173-4872-9134-bb1d2e00343a"; + string resourceGroupName = "rg1"; + string resourceName = "clustername1"; + string agentPoolName = "agentpool1"; + ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); + ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); + + // get the collection of this MachineResource + MachineCollection collection = containerServiceAgentPool.GetMachines(); + + // invoke the operation and iterate over the result + await foreach (MachineResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetAMachineInAnAgentPoolsByManagedCluster() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/MachineGet.json + // this example is just showing the usage of "Machines_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerServiceAgentPoolResource created on azure + // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource + string subscriptionId = "26fe00f8-9173-4872-9134-bb1d2e00343a"; + string resourceGroupName = "rg1"; + string resourceName = "clustername1"; + string agentPoolName = "agentpool1"; + ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); + ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); + + // get the collection of this MachineResource + MachineCollection collection = containerServiceAgentPool.GetMachines(); + + // invoke the operation + string machineName = "aks-nodepool1-42263519-vmss00000t"; + bool result = await collection.ExistsAsync(machineName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetAMachineInAnAgentPoolsByManagedCluster() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/MachineGet.json + // this example is just showing the usage of "Machines_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerServiceAgentPoolResource created on azure + // for more information of creating ContainerServiceAgentPoolResource, please refer to the document of ContainerServiceAgentPoolResource + string subscriptionId = "26fe00f8-9173-4872-9134-bb1d2e00343a"; + string resourceGroupName = "rg1"; + string resourceName = "clustername1"; + string agentPoolName = "agentpool1"; + ResourceIdentifier containerServiceAgentPoolResourceId = ContainerServiceAgentPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName); + ContainerServiceAgentPoolResource containerServiceAgentPool = client.GetContainerServiceAgentPoolResource(containerServiceAgentPoolResourceId); + + // get the collection of this MachineResource + MachineCollection collection = containerServiceAgentPool.GetMachines(); + + // invoke the operation + string machineName = "aks-nodepool1-42263519-vmss00000t"; + NullableResponse response = await collection.GetIfExistsAsync(machineName); + MachineResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MachineResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MachineResource.cs new file mode 100644 index 000000000000..5508624f2fa4 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MachineResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.ContainerService.Samples +{ + public partial class Sample_MachineResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetAMachineInAnAgentPoolsByManagedCluster() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/MachineGet.json + // this example is just showing the usage of "Machines_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineResource created on azure + // for more information of creating MachineResource, please refer to the document of MachineResource + string subscriptionId = "26fe00f8-9173-4872-9134-bb1d2e00343a"; + string resourceGroupName = "rg1"; + string resourceName = "clustername1"; + string agentPoolName = "agentpool1"; + string machineName = "aks-nodepool1-42263519-vmss00000t"; + ResourceIdentifier machineResourceId = MachineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, agentPoolName, machineName); + MachineResource machine = client.GetMachineResource(machineResourceId); + + // invoke the operation + MachineResource result = await machine.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ManagedClusterUpgradeProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ManagedClusterUpgradeProfileResource.cs index 0481cdaf7948..a2b045ac581c 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ManagedClusterUpgradeProfileResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_ManagedClusterUpgradeProfileResource.cs @@ -19,7 +19,7 @@ public partial class Sample_ManagedClusterUpgradeProfileResource [Ignore("Only validating compilation of examples")] public async Task Get_GetUpgradeProfileForManagedCluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGetUpgradeProfile.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersGetUpgradeProfile.json // this example is just showing the usage of "ManagedClusters_GetUpgradeProfile" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshRevisionProfileCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshRevisionProfileCollection.cs index a12ea79e1106..1837370ed061 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshRevisionProfileCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshRevisionProfileCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MeshRevisionProfileCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetAMeshRevisionProfileForAMeshMode() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshRevisionProfile.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersGet_MeshRevisionProfile.json // this example is just showing the usage of "ManagedClusters_GetMeshRevisionProfile" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_GetAMeshRevisionProfileForAMeshMode() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListMeshRevisionProfilesInALocation() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersList_MeshRevisionProfiles.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersList_MeshRevisionProfiles.json // this example is just showing the usage of "ManagedClusters_ListMeshRevisionProfiles" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +88,7 @@ public async Task GetAll_ListMeshRevisionProfilesInALocation() [Ignore("Only validating compilation of examples")] public async Task Exists_GetAMeshRevisionProfileForAMeshMode() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshRevisionProfile.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersGet_MeshRevisionProfile.json // this example is just showing the usage of "ManagedClusters_GetMeshRevisionProfile" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -117,7 +117,7 @@ public async Task Exists_GetAMeshRevisionProfileForAMeshMode() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAMeshRevisionProfileForAMeshMode() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshRevisionProfile.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersGet_MeshRevisionProfile.json // this example is just showing the usage of "ManagedClusters_GetMeshRevisionProfile" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshRevisionProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshRevisionProfileResource.cs index 8e0938d5a73e..de792f750980 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshRevisionProfileResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshRevisionProfileResource.cs @@ -19,7 +19,7 @@ public partial class Sample_MeshRevisionProfileResource [Ignore("Only validating compilation of examples")] public async Task Get_GetAMeshRevisionProfileForAMeshMode() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshRevisionProfile.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersGet_MeshRevisionProfile.json // this example is just showing the usage of "ManagedClusters_GetMeshRevisionProfile" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshUpgradeProfileCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshUpgradeProfileCollection.cs index 53dc0a0a6d5c..7bc2e7d141ac 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshUpgradeProfileCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshUpgradeProfileCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_MeshUpgradeProfileCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetsVersionCompatibilityAndUpgradeProfileForAServiceMeshInACluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshUpgradeProfile.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersGet_MeshUpgradeProfile.json // this example is just showing the usage of "ManagedClusters_GetMeshUpgradeProfile" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_GetsVersionCompatibilityAndUpgradeProfileForAServiceMeshIn [Ignore("Only validating compilation of examples")] public async Task GetAll_ListsVersionCompatibilityAndUpgradeProfileForAllServiceMeshesInACluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersList_MeshUpgradeProfiles.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersList_MeshUpgradeProfiles.json // this example is just showing the usage of "ManagedClusters_ListMeshUpgradeProfiles" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task GetAll_ListsVersionCompatibilityAndUpgradeProfileForAllService [Ignore("Only validating compilation of examples")] public async Task Exists_GetsVersionCompatibilityAndUpgradeProfileForAServiceMeshInACluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshUpgradeProfile.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersGet_MeshUpgradeProfile.json // this example is just showing the usage of "ManagedClusters_GetMeshUpgradeProfile" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -119,7 +119,7 @@ public async Task Exists_GetsVersionCompatibilityAndUpgradeProfileForAServiceMes [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsVersionCompatibilityAndUpgradeProfileForAServiceMeshInACluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshUpgradeProfile.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersGet_MeshUpgradeProfile.json // this example is just showing the usage of "ManagedClusters_GetMeshUpgradeProfile" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshUpgradeProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshUpgradeProfileResource.cs index d2e1b5438892..51df303aef4c 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshUpgradeProfileResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_MeshUpgradeProfileResource.cs @@ -19,7 +19,7 @@ public partial class Sample_MeshUpgradeProfileResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsVersionCompatibilityAndUpgradeProfileForAServiceMeshInACluster() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersGet_MeshUpgradeProfile.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersGet_MeshUpgradeProfile.json // this example is just showing the usage of "ManagedClusters_GetMeshUpgradeProfile" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index d4e1e40228ea..d9ea57b6105d 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -21,7 +21,7 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task GetKubernetesVersionsManagedCluster_ListKubernetesVersions() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/KubernetesVersions_List.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/KubernetesVersions_List.json // this example is just showing the usage of "ManagedClusters_ListKubernetesVersions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -46,7 +46,7 @@ public async Task GetKubernetesVersionsManagedCluster_ListKubernetesVersions() [Ignore("Only validating compilation of examples")] public async Task GetContainerServiceManagedClusters_ListManagedClusters() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/ManagedClustersList.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersList.json // this example is just showing the usage of "ManagedClusters_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -77,7 +77,7 @@ public async Task GetContainerServiceManagedClusters_ListManagedClusters() [Ignore("Only validating compilation of examples")] public async Task GetAgentPoolSnapshots_ListSnapshots() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/SnapshotsList.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/SnapshotsList.json // this example is just showing the usage of "Snapshots_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -108,7 +108,7 @@ public async Task GetAgentPoolSnapshots_ListSnapshots() [Ignore("Only validating compilation of examples")] public async Task GetTrustedAccessRoles_ListTrustedAccessRoles() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-10-01/examples/TrustedAccessRoles_List.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/TrustedAccessRoles_List.json // this example is just showing the usage of "TrustedAccessRoles_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotCollection.cs index 327b8b63ae23..157f67d855de 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> CreateOrUpdat /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsync(string r /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string resourceName, Canc /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -287,7 +287,7 @@ public virtual AsyncPageable GetAllAsync(Cancellation /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual Pageable GetAll(CancellationToken canc /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string resourceName, Cance /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string resourceName, CancellationToken canc /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task> GetIfExis /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.cs index 6045d3413e5b..6e9d82aa9c90 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(Cancella /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancell /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -271,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> UpdateAsync(Conta /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual Response Update(ContainerServiceTagsOb /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -417,7 +417,7 @@ public virtual async Task> AddTagAsync(strin /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -479,7 +479,7 @@ public virtual Response AddTag(string key, string val /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -536,7 +536,7 @@ public virtual async Task> SetTagsAsync(IDic /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -593,7 +593,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -653,7 +653,7 @@ public virtual async Task> RemoveTagAsync(st /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.cs index 9c357b37cb3d..9672a7835abc 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Ca /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ArmContainerServiceModelFactory.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ArmContainerServiceModelFactory.cs index d8ce03a6d98a..904488997849 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ArmContainerServiceModelFactory.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ArmContainerServiceModelFactory.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Net; using Azure.Core; @@ -18,35 +19,6 @@ namespace Azure.ResourceManager.ContainerService.Models /// Model factory for models. public static partial class ArmContainerServiceModelFactory { - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The list of OS options. - /// A new instance for mocking. - public static OSOptionProfileData OSOptionProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable osOptionPropertyList = null) - { - osOptionPropertyList ??= new List(); - - return new OSOptionProfileData( - id, - name, - resourceType, - systemData, - osOptionPropertyList?.ToList(), - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The OS type. - /// Whether the image is FIPS-enabled. - /// A new instance for mocking. - public static ContainerServiceOSOptionProperty ContainerServiceOSOptionProperty(string osType = null, bool enableFipsImage = default) - { - return new ContainerServiceOSOptionProperty(osType, enableFipsImage, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// Array of AKS supported Kubernetes versions. /// A new instance for mocking. @@ -60,15 +32,22 @@ public static KubernetesVersionListResult KubernetesVersionListResult(IEnumerabl /// Initializes a new instance of . /// major.minor version of Kubernetes release. /// Capabilities on this Kubernetes version. + /// Whether this version is default. /// Whether this version is in preview mode. /// Patch versions of Kubernetes release. /// A new instance for mocking. - public static KubernetesVersion KubernetesVersion(string version = null, IEnumerable capabilitiesSupportPlan = null, bool? isPreview = null, IReadOnlyDictionary patchVersions = null) + public static KubernetesVersion KubernetesVersion(string version = null, IEnumerable capabilitiesSupportPlan = null, bool? isDefault = null, bool? isPreview = null, IReadOnlyDictionary patchVersions = null) { capabilitiesSupportPlan ??= new List(); patchVersions ??= new Dictionary(); - return new KubernetesVersion(version, capabilitiesSupportPlan != null ? new KubernetesVersionCapabilities(capabilitiesSupportPlan?.ToList(), serializedAdditionalRawData: null) : null, isPreview, patchVersions, serializedAdditionalRawData: null); + return new KubernetesVersion( + version, + capabilitiesSupportPlan != null ? new KubernetesVersionCapabilities(capabilitiesSupportPlan?.ToList(), serializedAdditionalRawData: null) : null, + isDefault, + isPreview, + patchVersions, + serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -88,6 +67,7 @@ public static KubernetesPatchVersion KubernetesPatchVersion(IEnumerable /// The systemData. /// The tags. /// The location. + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency per the normal etag convention. /// The managed cluster SKU. /// The extended location of the Virtual Machine. /// The identity of the managed cluster, if configured. @@ -109,6 +89,7 @@ public static KubernetesPatchVersion KubernetesPatchVersion(IEnumerable /// See [use AAD pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod identity integration. /// The OIDC issuer profile of the Managed Cluster. /// The name of the resource group containing agent pool nodes. + /// Profile of the node resource group configuration. /// Whether to enable Kubernetes Role-Based Access Control. /// The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'. /// (DEPRECATED) Whether to enable Kubernetes pod security policy (preview). PodSecurityPolicy was deprecated in Kubernetes v1.21, and removed from Kubernetes in v1.25. Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp. @@ -119,19 +100,21 @@ public static KubernetesPatchVersion KubernetesPatchVersion(IEnumerable /// Parameters to be applied to the cluster-autoscaler when enabled. /// The access profile for managed cluster API server. /// This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. - /// Identities associated with the cluster. + /// The user identity associated with the managed cluster. This identity will be used by the kubelet. Only one user assigned identity is allowed. The only accepted key is "kubeletidentity", with value of "resourceId": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}". /// Private link resources associated with the cluster. /// If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details see [disable local accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview). /// Configurations for provisioning the cluster with HTTP proxy servers. /// Security profile for the managed cluster. /// Storage profile for the managed cluster. + /// Ingress profile for the managed cluster. /// Allow or deny public network access for AKS. /// Workload Auto-scaler profile for the managed cluster. /// Azure Monitor addon profiles for monitoring the managed cluster. /// Service mesh profile for a managed cluster. /// The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds (i.e: create, delete, create sequence). + /// Optional cluster metrics configuration. /// A new instance for mocking. - public static ContainerServiceManagedClusterData ContainerServiceManagedClusterData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedClusterSku sku = null, ExtendedLocation extendedLocation = null, ManagedClusterIdentity clusterIdentity = null, string provisioningState = null, ContainerServiceStateCode? powerStateCode = null, int? maxAgentPools = null, string kubernetesVersion = null, string currentKubernetesVersion = null, string dnsPrefix = null, string fqdnSubdomain = null, string fqdn = null, string privateFqdn = null, string azurePortalFqdn = null, IEnumerable agentPoolProfiles = null, ContainerServiceLinuxProfile linuxProfile = null, ManagedClusterWindowsProfile windowsProfile = null, ManagedClusterServicePrincipalProfile servicePrincipalProfile = null, IDictionary addonProfiles = null, ManagedClusterPodIdentityProfile podIdentityProfile = null, ManagedClusterOidcIssuerProfile oidcIssuerProfile = null, string nodeResourceGroup = null, bool? enableRbac = null, KubernetesSupportPlan? supportPlan = null, bool? enablePodSecurityPolicy = null, ContainerServiceNetworkProfile networkProfile = null, ManagedClusterAadProfile aadProfile = null, ManagedClusterAutoUpgradeProfile autoUpgradeProfile = null, UpgradeOverrideSettings upgradeOverrideSettings = null, ManagedClusterAutoScalerProfile autoScalerProfile = null, ManagedClusterApiServerAccessProfile apiServerAccessProfile = null, ResourceIdentifier diskEncryptionSetId = null, IDictionary identityProfile = null, IEnumerable privateLinkResources = null, bool? disableLocalAccounts = null, ManagedClusterHttpProxyConfig httpProxyConfig = null, ManagedClusterSecurityProfile securityProfile = null, ManagedClusterStorageProfile storageProfile = null, ContainerServicePublicNetworkAccess? publicNetworkAccess = null, ManagedClusterWorkloadAutoScalerProfile workloadAutoScalerProfile = null, ManagedClusterMonitorProfileMetrics azureMonitorMetrics = null, ServiceMeshProfile serviceMeshProfile = null, ResourceIdentifier resourceId = null) + public static ContainerServiceManagedClusterData ContainerServiceManagedClusterData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ETag? etag = null, ManagedClusterSku sku = null, ExtendedLocation extendedLocation = null, ManagedClusterIdentity clusterIdentity = null, string provisioningState = null, ContainerServiceStateCode? powerStateCode = null, int? maxAgentPools = null, string kubernetesVersion = null, string currentKubernetesVersion = null, string dnsPrefix = null, string fqdnSubdomain = null, string fqdn = null, string privateFqdn = null, string azurePortalFqdn = null, IEnumerable agentPoolProfiles = null, ContainerServiceLinuxProfile linuxProfile = null, ManagedClusterWindowsProfile windowsProfile = null, ManagedClusterServicePrincipalProfile servicePrincipalProfile = null, IDictionary addonProfiles = null, ManagedClusterPodIdentityProfile podIdentityProfile = null, ManagedClusterOidcIssuerProfile oidcIssuerProfile = null, string nodeResourceGroup = null, RestrictionLevel? nodeResourceGroupRestrictionLevel = null, bool? enableRbac = null, KubernetesSupportPlan? supportPlan = null, bool? enablePodSecurityPolicy = null, ContainerServiceNetworkProfile networkProfile = null, ManagedClusterAadProfile aadProfile = null, ManagedClusterAutoUpgradeProfile autoUpgradeProfile = null, UpgradeOverrideSettings upgradeOverrideSettings = null, ManagedClusterAutoScalerProfile autoScalerProfile = null, ManagedClusterApiServerAccessProfile apiServerAccessProfile = null, ResourceIdentifier diskEncryptionSetId = null, IDictionary identityProfile = null, IEnumerable privateLinkResources = null, bool? disableLocalAccounts = null, ManagedClusterHttpProxyConfig httpProxyConfig = null, ManagedClusterSecurityProfile securityProfile = null, ManagedClusterStorageProfile storageProfile = null, ManagedClusterIngressProfileWebAppRouting ingressWebAppRouting = null, ContainerServicePublicNetworkAccess? publicNetworkAccess = null, ManagedClusterWorkloadAutoScalerProfile workloadAutoScalerProfile = null, ManagedClusterMonitorProfileMetrics azureMonitorMetrics = null, ServiceMeshProfile serviceMeshProfile = null, ResourceIdentifier resourceId = null, bool? costAnalysisEnabled = null) { tags ??= new Dictionary(); agentPoolProfiles ??= new List(); @@ -146,6 +129,7 @@ public static ContainerServiceManagedClusterData ContainerServiceManagedClusterD systemData, tags, location, + etag, sku, extendedLocation, clusterIdentity, @@ -167,6 +151,7 @@ public static ContainerServiceManagedClusterData ContainerServiceManagedClusterD podIdentityProfile, oidcIssuerProfile, nodeResourceGroup, + nodeResourceGroupRestrictionLevel != null ? new ManagedClusterNodeResourceGroupProfile(nodeResourceGroupRestrictionLevel, serializedAdditionalRawData: null) : null, enableRbac, supportPlan, enablePodSecurityPolicy, @@ -183,15 +168,18 @@ public static ContainerServiceManagedClusterData ContainerServiceManagedClusterD httpProxyConfig, securityProfile, storageProfile, + ingressWebAppRouting != null ? new ManagedClusterIngressProfile(ingressWebAppRouting, serializedAdditionalRawData: null) : null, publicNetworkAccess, workloadAutoScalerProfile, azureMonitorMetrics != null ? new ManagedClusterAzureMonitorProfile(azureMonitorMetrics, serializedAdditionalRawData: null) : null, serviceMeshProfile, resourceId, + costAnalysisEnabled != null ? new ManagedClusterMetricsProfile(new ManagedClusterCostAnalysis(costAnalysisEnabled, serializedAdditionalRawData: null), serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null); } /// Initializes a new instance of . + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency per the normal etag convention. /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. @@ -235,9 +223,11 @@ public static ContainerServiceManagedClusterData ContainerServiceManagedClusterD /// AKS will associate the specified agent pool with the Capacity Reservation Group. /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). /// Network-related settings of an agent pool. + /// The Windows agent pool's specific profile. + /// The security settings of an agent pool. /// Windows agent pool names must be 6 characters or less. /// A new instance for mocking. - public static ManagedClusterAgentPoolProfile ManagedClusterAgentPoolProfile(int? count = null, string vmSize = null, int? osDiskSizeInGB = null, ContainerServiceOSDiskType? osDiskType = null, KubeletDiskType? kubeletDiskType = null, WorkloadRuntime? workloadRuntime = null, ResourceIdentifier vnetSubnetId = null, ResourceIdentifier podSubnetId = null, int? maxPods = null, ContainerServiceOSType? osType = null, ContainerServiceOSSku? osSku = null, int? maxCount = null, int? minCount = null, bool? enableAutoScaling = null, ScaleDownMode? scaleDownMode = null, AgentPoolType? agentPoolType = null, AgentPoolMode? mode = null, string orchestratorVersion = null, string currentOrchestratorVersion = null, string nodeImageVersion = null, AgentPoolUpgradeSettings upgradeSettings = null, string provisioningState = null, ContainerServiceStateCode? powerStateCode = null, IEnumerable availabilityZones = null, bool? enableNodePublicIP = null, ResourceIdentifier nodePublicIPPrefixId = null, ScaleSetPriority? scaleSetPriority = null, ScaleSetEvictionPolicy? scaleSetEvictionPolicy = null, float? spotMaxPrice = null, IDictionary tags = null, IDictionary nodeLabels = null, IEnumerable nodeTaints = null, ResourceIdentifier proximityPlacementGroupId = null, KubeletConfig kubeletConfig = null, LinuxOSConfig linuxOSConfig = null, bool? enableEncryptionAtHost = null, bool? enableUltraSsd = null, bool? enableFips = null, GpuInstanceProfile? gpuInstanceProfile = null, ResourceIdentifier creationDataSourceResourceId = null, ResourceIdentifier capacityReservationGroupId = null, ResourceIdentifier hostGroupId = null, AgentPoolNetworkProfile networkProfile = null, string name = null) + public static ManagedClusterAgentPoolProfile ManagedClusterAgentPoolProfile(ETag? etag = null, int? count = null, string vmSize = null, int? osDiskSizeInGB = null, ContainerServiceOSDiskType? osDiskType = null, KubeletDiskType? kubeletDiskType = null, WorkloadRuntime? workloadRuntime = null, ResourceIdentifier vnetSubnetId = null, ResourceIdentifier podSubnetId = null, int? maxPods = null, ContainerServiceOSType? osType = null, ContainerServiceOSSku? osSku = null, int? maxCount = null, int? minCount = null, bool? enableAutoScaling = null, ScaleDownMode? scaleDownMode = null, AgentPoolType? agentPoolType = null, AgentPoolMode? mode = null, string orchestratorVersion = null, string currentOrchestratorVersion = null, string nodeImageVersion = null, AgentPoolUpgradeSettings upgradeSettings = null, string provisioningState = null, ContainerServiceStateCode? powerStateCode = null, IEnumerable availabilityZones = null, bool? enableNodePublicIP = null, ResourceIdentifier nodePublicIPPrefixId = null, ScaleSetPriority? scaleSetPriority = null, ScaleSetEvictionPolicy? scaleSetEvictionPolicy = null, float? spotMaxPrice = null, IDictionary tags = null, IDictionary nodeLabels = null, IEnumerable nodeTaints = null, ResourceIdentifier proximityPlacementGroupId = null, KubeletConfig kubeletConfig = null, LinuxOSConfig linuxOSConfig = null, bool? enableEncryptionAtHost = null, bool? enableUltraSsd = null, bool? enableFips = null, GpuInstanceProfile? gpuInstanceProfile = null, ResourceIdentifier creationDataSourceResourceId = null, ResourceIdentifier capacityReservationGroupId = null, ResourceIdentifier hostGroupId = null, AgentPoolNetworkProfile networkProfile = null, bool? disableOutboundNat = null, AgentPoolSecurityProfile securityProfile = null, string name = null) { availabilityZones ??= new List(); tags ??= new Dictionary(); @@ -245,6 +235,7 @@ public static ManagedClusterAgentPoolProfile ManagedClusterAgentPoolProfile(int? nodeTaints ??= new List(); return new ManagedClusterAgentPoolProfile( + etag, count, vmSize, osDiskSizeInGB, @@ -288,11 +279,14 @@ public static ManagedClusterAgentPoolProfile ManagedClusterAgentPoolProfile(int? capacityReservationGroupId, hostGroupId, networkProfile, + disableOutboundNat != null ? new AgentPoolWindowsProfile(disableOutboundNat, serializedAdditionalRawData: null) : null, + securityProfile, serializedAdditionalRawData: null, name); } /// Initializes a new instance of . + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency per the normal etag convention. /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. @@ -336,8 +330,10 @@ public static ManagedClusterAgentPoolProfile ManagedClusterAgentPoolProfile(int? /// AKS will associate the specified agent pool with the Capacity Reservation Group. /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). /// Network-related settings of an agent pool. + /// The Windows agent pool's specific profile. + /// The security settings of an agent pool. /// A new instance for mocking. - public static ManagedClusterAgentPoolProfileProperties ManagedClusterAgentPoolProfileProperties(int? count = null, string vmSize = null, int? osDiskSizeInGB = null, ContainerServiceOSDiskType? osDiskType = null, KubeletDiskType? kubeletDiskType = null, WorkloadRuntime? workloadRuntime = null, ResourceIdentifier vnetSubnetId = null, ResourceIdentifier podSubnetId = null, int? maxPods = null, ContainerServiceOSType? osType = null, ContainerServiceOSSku? osSku = null, int? maxCount = null, int? minCount = null, bool? enableAutoScaling = null, ScaleDownMode? scaleDownMode = null, AgentPoolType? agentPoolType = null, AgentPoolMode? mode = null, string orchestratorVersion = null, string currentOrchestratorVersion = null, string nodeImageVersion = null, AgentPoolUpgradeSettings upgradeSettings = null, string provisioningState = null, ContainerServiceStateCode? powerStateCode = null, IEnumerable availabilityZones = null, bool? enableNodePublicIP = null, ResourceIdentifier nodePublicIPPrefixId = null, ScaleSetPriority? scaleSetPriority = null, ScaleSetEvictionPolicy? scaleSetEvictionPolicy = null, float? spotMaxPrice = null, IDictionary tags = null, IDictionary nodeLabels = null, IEnumerable nodeTaints = null, ResourceIdentifier proximityPlacementGroupId = null, KubeletConfig kubeletConfig = null, LinuxOSConfig linuxOSConfig = null, bool? enableEncryptionAtHost = null, bool? enableUltraSsd = null, bool? enableFips = null, GpuInstanceProfile? gpuInstanceProfile = null, ResourceIdentifier creationDataSourceResourceId = null, ResourceIdentifier capacityReservationGroupId = null, ResourceIdentifier hostGroupId = null, AgentPoolNetworkProfile networkProfile = null) + public static ManagedClusterAgentPoolProfileProperties ManagedClusterAgentPoolProfileProperties(ETag? etag = null, int? count = null, string vmSize = null, int? osDiskSizeInGB = null, ContainerServiceOSDiskType? osDiskType = null, KubeletDiskType? kubeletDiskType = null, WorkloadRuntime? workloadRuntime = null, ResourceIdentifier vnetSubnetId = null, ResourceIdentifier podSubnetId = null, int? maxPods = null, ContainerServiceOSType? osType = null, ContainerServiceOSSku? osSku = null, int? maxCount = null, int? minCount = null, bool? enableAutoScaling = null, ScaleDownMode? scaleDownMode = null, AgentPoolType? agentPoolType = null, AgentPoolMode? mode = null, string orchestratorVersion = null, string currentOrchestratorVersion = null, string nodeImageVersion = null, AgentPoolUpgradeSettings upgradeSettings = null, string provisioningState = null, ContainerServiceStateCode? powerStateCode = null, IEnumerable availabilityZones = null, bool? enableNodePublicIP = null, ResourceIdentifier nodePublicIPPrefixId = null, ScaleSetPriority? scaleSetPriority = null, ScaleSetEvictionPolicy? scaleSetEvictionPolicy = null, float? spotMaxPrice = null, IDictionary tags = null, IDictionary nodeLabels = null, IEnumerable nodeTaints = null, ResourceIdentifier proximityPlacementGroupId = null, KubeletConfig kubeletConfig = null, LinuxOSConfig linuxOSConfig = null, bool? enableEncryptionAtHost = null, bool? enableUltraSsd = null, bool? enableFips = null, GpuInstanceProfile? gpuInstanceProfile = null, ResourceIdentifier creationDataSourceResourceId = null, ResourceIdentifier capacityReservationGroupId = null, ResourceIdentifier hostGroupId = null, AgentPoolNetworkProfile networkProfile = null, bool? disableOutboundNat = null, AgentPoolSecurityProfile securityProfile = null) { availabilityZones ??= new List(); tags ??= new Dictionary(); @@ -345,6 +341,7 @@ public static ManagedClusterAgentPoolProfileProperties ManagedClusterAgentPoolPr nodeTaints ??= new List(); return new ManagedClusterAgentPoolProfileProperties( + etag, count, vmSize, osDiskSizeInGB, @@ -388,6 +385,8 @@ public static ManagedClusterAgentPoolProfileProperties ManagedClusterAgentPoolPr capacityReservationGroupId, hostGroupId, networkProfile, + disableOutboundNat != null ? new AgentPoolWindowsProfile(disableOutboundNat, serializedAdditionalRawData: null) : null, + securityProfile, serializedAdditionalRawData: null); } @@ -454,6 +453,18 @@ public static ContainerServicePrivateLinkResourceData ContainerServicePrivateLin serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// Whether to enable the Application Routing add-on. + /// Resource IDs of the DNS zones to be associated with the Application Routing add-on. Used only when Application Routing add-on is enabled. Public and private DNS zones can be in different resource groups, but all public DNS zones must be in the same resource group and all private DNS zones must be in the same resource group. + /// Managed identity of the Application Routing add-on. This is the identity that should be granted permissions, for example, to manage the associated Azure DNS resource and get certificates from Azure Key Vault. See [this overview of the add-on](https://learn.microsoft.com/en-us/azure/aks/web-app-routing?tabs=with-osm) for more instructions. + /// A new instance for mocking. + public static ManagedClusterIngressProfileWebAppRouting ManagedClusterIngressProfileWebAppRouting(bool? enabled = null, IEnumerable dnsZoneResourceIds = null, ContainerServiceUserAssignedIdentity identity = null) + { + dnsZoneResourceIds ??= new List(); + + return new ManagedClusterIngressProfileWebAppRouting(enabled, dnsZoneResourceIds?.ToList(), identity, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -571,6 +582,7 @@ public static ContainerServiceMaintenanceConfigurationData ContainerServiceMaint /// The name. /// The resourceType. /// The systemData. + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency per the normal etag convention. /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. @@ -614,8 +626,10 @@ public static ContainerServiceMaintenanceConfigurationData ContainerServiceMaint /// AKS will associate the specified agent pool with the Capacity Reservation Group. /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). /// Network-related settings of an agent pool. + /// The Windows agent pool's specific profile. + /// The security settings of an agent pool. /// A new instance for mocking. - public static ContainerServiceAgentPoolData ContainerServiceAgentPoolData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, int? count = null, string vmSize = null, int? osDiskSizeInGB = null, ContainerServiceOSDiskType? osDiskType = null, KubeletDiskType? kubeletDiskType = null, WorkloadRuntime? workloadRuntime = null, ResourceIdentifier vnetSubnetId = null, ResourceIdentifier podSubnetId = null, int? maxPods = null, ContainerServiceOSType? osType = null, ContainerServiceOSSku? osSku = null, int? maxCount = null, int? minCount = null, bool? enableAutoScaling = null, ScaleDownMode? scaleDownMode = null, AgentPoolType? typePropertiesType = null, AgentPoolMode? mode = null, string orchestratorVersion = null, string currentOrchestratorVersion = null, string nodeImageVersion = null, AgentPoolUpgradeSettings upgradeSettings = null, string provisioningState = null, ContainerServiceStateCode? powerStateCode = null, IEnumerable availabilityZones = null, bool? enableNodePublicIP = null, ResourceIdentifier nodePublicIPPrefixId = null, ScaleSetPriority? scaleSetPriority = null, ScaleSetEvictionPolicy? scaleSetEvictionPolicy = null, float? spotMaxPrice = null, IDictionary tags = null, IDictionary nodeLabels = null, IEnumerable nodeTaints = null, ResourceIdentifier proximityPlacementGroupId = null, KubeletConfig kubeletConfig = null, LinuxOSConfig linuxOSConfig = null, bool? enableEncryptionAtHost = null, bool? enableUltraSsd = null, bool? enableFips = null, GpuInstanceProfile? gpuInstanceProfile = null, ResourceIdentifier creationDataSourceResourceId = null, ResourceIdentifier capacityReservationGroupId = null, ResourceIdentifier hostGroupId = null, AgentPoolNetworkProfile networkProfile = null) + public static ContainerServiceAgentPoolData ContainerServiceAgentPoolData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ETag? etag = null, int? count = null, string vmSize = null, int? osDiskSizeInGB = null, ContainerServiceOSDiskType? osDiskType = null, KubeletDiskType? kubeletDiskType = null, WorkloadRuntime? workloadRuntime = null, ResourceIdentifier vnetSubnetId = null, ResourceIdentifier podSubnetId = null, int? maxPods = null, ContainerServiceOSType? osType = null, ContainerServiceOSSku? osSku = null, int? maxCount = null, int? minCount = null, bool? enableAutoScaling = null, ScaleDownMode? scaleDownMode = null, AgentPoolType? typePropertiesType = null, AgentPoolMode? mode = null, string orchestratorVersion = null, string currentOrchestratorVersion = null, string nodeImageVersion = null, AgentPoolUpgradeSettings upgradeSettings = null, string provisioningState = null, ContainerServiceStateCode? powerStateCode = null, IEnumerable availabilityZones = null, bool? enableNodePublicIP = null, ResourceIdentifier nodePublicIPPrefixId = null, ScaleSetPriority? scaleSetPriority = null, ScaleSetEvictionPolicy? scaleSetEvictionPolicy = null, float? spotMaxPrice = null, IDictionary tags = null, IDictionary nodeLabels = null, IEnumerable nodeTaints = null, ResourceIdentifier proximityPlacementGroupId = null, KubeletConfig kubeletConfig = null, LinuxOSConfig linuxOSConfig = null, bool? enableEncryptionAtHost = null, bool? enableUltraSsd = null, bool? enableFips = null, GpuInstanceProfile? gpuInstanceProfile = null, ResourceIdentifier creationDataSourceResourceId = null, ResourceIdentifier capacityReservationGroupId = null, ResourceIdentifier hostGroupId = null, AgentPoolNetworkProfile networkProfile = null, bool? disableOutboundNat = null, AgentPoolSecurityProfile securityProfile = null) { availabilityZones ??= new List(); tags ??= new Dictionary(); @@ -627,6 +641,7 @@ public static ContainerServiceAgentPoolData ContainerServiceAgentPoolData(Resour name, resourceType, systemData, + etag, count, vmSize, osDiskSizeInGB, @@ -670,6 +685,8 @@ public static ContainerServiceAgentPoolData ContainerServiceAgentPoolData(Resour capacityReservationGroupId, hostGroupId, networkProfile, + disableOutboundNat != null ? new AgentPoolWindowsProfile(disableOutboundNat, serializedAdditionalRawData: null) : null, + securityProfile, serializedAdditionalRawData: null); } @@ -960,5 +977,269 @@ public static ContainerServiceTrustedAccessRoleRule ContainerServiceTrustedAcces nonResourceUrls?.ToList(), serializedAdditionalRawData: null); } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The properties of the machine. + /// A new instance for mocking. + public static MachineData MachineData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineProperties properties = null) + { + return new MachineData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// network properties of the machine. + /// Azure resource id of the machine. It can be used to GET underlying VM Instance. + /// A new instance for mocking. + public static MachineProperties MachineProperties(IEnumerable networkIPAddresses = null, ResourceIdentifier resourceId = null) + { + networkIPAddresses ??= new List(); + + return new MachineProperties(networkIPAddresses != null ? new MachineNetworkProperties(networkIPAddresses?.ToList(), serializedAdditionalRawData: null) : null, resourceId, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// To determine if address belongs IPv4 or IPv6 family. + /// IPv4 or IPv6 address of the machine. + /// A new instance for mocking. + public static MachineIPAddress MachineIPAddress(IPFamily? family = null, string ip = null) + { + return new MachineIPAddress(family, ip, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// major.minor version of Kubernetes release. + /// Capabilities on this Kubernetes version. + /// Whether this version is in preview mode. + /// Patch versions of Kubernetes release. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static KubernetesVersion KubernetesVersion(string version, IEnumerable capabilitiesSupportPlan, bool? isPreview, IReadOnlyDictionary patchVersions) + { + return KubernetesVersion(version: version, capabilitiesSupportPlan: capabilitiesSupportPlan, isDefault: default, isPreview: isPreview, patchVersions: patchVersions); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The managed cluster SKU. + /// The extended location of the Virtual Machine. + /// The identity of the managed cluster, if configured. + /// The current provisioning state. + /// The Power State of the cluster. + /// The max number of agent pools for the managed cluster. + /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) for more details. + /// If kubernetesVersion was a fully specified version <major.minor.patch>, this field will be exactly equal to it. If kubernetesVersion was <major.minor>, this field will contain the full <major.minor.patch> version being used. + /// This cannot be updated once the Managed Cluster has been created. + /// This cannot be updated once the Managed Cluster has been created. + /// The FQDN of the master pool. + /// The FQDN of private cluster. + /// The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. This special FQDN supports CORS, allowing the Azure Portal to function properly. + /// The agent pool properties. + /// The profile for Linux VMs in the Managed Cluster. + /// The profile for Windows VMs in the Managed Cluster. + /// Information about a service principal identity for the cluster to use for manipulating Azure APIs. + /// The profile of managed cluster add-on. + /// See [use AAD pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod identity integration. + /// The OIDC issuer profile of the Managed Cluster. + /// The name of the resource group containing agent pool nodes. + /// Whether to enable Kubernetes Role-Based Access Control. + /// The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'. + /// (DEPRECATED) Whether to enable Kubernetes pod security policy (preview). PodSecurityPolicy was deprecated in Kubernetes v1.21, and removed from Kubernetes in v1.25. Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp. + /// The network configuration profile. + /// The Azure Active Directory configuration. + /// The auto upgrade configuration. + /// Settings for upgrading a cluster. + /// Parameters to be applied to the cluster-autoscaler when enabled. + /// The access profile for managed cluster API server. + /// This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. + /// Identities associated with the cluster. + /// Private link resources associated with the cluster. + /// If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details see [disable local accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview). + /// Configurations for provisioning the cluster with HTTP proxy servers. + /// Security profile for the managed cluster. + /// Storage profile for the managed cluster. + /// Allow or deny public network access for AKS. + /// Workload Auto-scaler profile for the managed cluster. + /// Azure Monitor addon profiles for monitoring the managed cluster. + /// Service mesh profile for a managed cluster. + /// The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds (i.e: create, delete, create sequence). + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ContainerServiceManagedClusterData ContainerServiceManagedClusterData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedClusterSku sku, ExtendedLocation extendedLocation, ManagedClusterIdentity clusterIdentity, string provisioningState, ContainerServiceStateCode? powerStateCode, int? maxAgentPools, string kubernetesVersion, string currentKubernetesVersion, string dnsPrefix, string fqdnSubdomain, string fqdn, string privateFqdn, string azurePortalFqdn, IEnumerable agentPoolProfiles, ContainerServiceLinuxProfile linuxProfile, ManagedClusterWindowsProfile windowsProfile, ManagedClusterServicePrincipalProfile servicePrincipalProfile, IDictionary addonProfiles, ManagedClusterPodIdentityProfile podIdentityProfile, ManagedClusterOidcIssuerProfile oidcIssuerProfile, string nodeResourceGroup, bool? enableRbac, KubernetesSupportPlan? supportPlan, bool? enablePodSecurityPolicy, ContainerServiceNetworkProfile networkProfile, ManagedClusterAadProfile aadProfile, ManagedClusterAutoUpgradeProfile autoUpgradeProfile, UpgradeOverrideSettings upgradeOverrideSettings, ManagedClusterAutoScalerProfile autoScalerProfile, ManagedClusterApiServerAccessProfile apiServerAccessProfile, ResourceIdentifier diskEncryptionSetId, IDictionary identityProfile, IEnumerable privateLinkResources, bool? disableLocalAccounts, ManagedClusterHttpProxyConfig httpProxyConfig, ManagedClusterSecurityProfile securityProfile, ManagedClusterStorageProfile storageProfile, ContainerServicePublicNetworkAccess? publicNetworkAccess, ManagedClusterWorkloadAutoScalerProfile workloadAutoScalerProfile, ManagedClusterMonitorProfileMetrics azureMonitorMetrics, ServiceMeshProfile serviceMeshProfile, ResourceIdentifier resourceId) + { + return ContainerServiceManagedClusterData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, etag: default, sku: sku, extendedLocation: extendedLocation, clusterIdentity: clusterIdentity, provisioningState: provisioningState, powerStateCode: powerStateCode, maxAgentPools: maxAgentPools, kubernetesVersion: kubernetesVersion, currentKubernetesVersion: currentKubernetesVersion, dnsPrefix: dnsPrefix, fqdnSubdomain: fqdnSubdomain, fqdn: fqdn, privateFqdn: privateFqdn, azurePortalFqdn: azurePortalFqdn, agentPoolProfiles: agentPoolProfiles, linuxProfile: linuxProfile, windowsProfile: windowsProfile, servicePrincipalProfile: servicePrincipalProfile, addonProfiles: addonProfiles, podIdentityProfile: podIdentityProfile, oidcIssuerProfile: oidcIssuerProfile, nodeResourceGroup: nodeResourceGroup, nodeResourceGroupRestrictionLevel: default, enableRbac: enableRbac, supportPlan: supportPlan, enablePodSecurityPolicy: enablePodSecurityPolicy, networkProfile: networkProfile, aadProfile: aadProfile, autoUpgradeProfile: autoUpgradeProfile, upgradeOverrideSettings: upgradeOverrideSettings, autoScalerProfile: autoScalerProfile, apiServerAccessProfile: apiServerAccessProfile, diskEncryptionSetId: diskEncryptionSetId, identityProfile: identityProfile, privateLinkResources: privateLinkResources, disableLocalAccounts: disableLocalAccounts, httpProxyConfig: httpProxyConfig, securityProfile: securityProfile, storageProfile: storageProfile, ingressWebAppRouting: default, publicNetworkAccess: publicNetworkAccess, workloadAutoScalerProfile: workloadAutoScalerProfile, azureMonitorMetrics: azureMonitorMetrics, serviceMeshProfile: serviceMeshProfile, resourceId: resourceId, costAnalysisEnabled: default); + } + + /// Initializes a new instance of . + /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. + /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). + /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. + /// Determines the type of workload a node can run. + /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + /// The maximum number of pods that can run on a node. + /// The operating system type. The default is Linux. + /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. + /// The maximum number of nodes for auto-scaling. + /// The minimum number of nodes for auto-scaling. + /// Whether to enable auto-scaler. + /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. + /// The type of Agent Pool. + /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. + /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). + /// If orchestratorVersion is a fully specified version <major.minor.patch>, this field will be exactly equal to it. If orchestratorVersion is <major.minor>, this field will contain the full <major.minor.patch> version being used. + /// The version of node image. + /// Settings for upgrading the agentpool. + /// The current deployment or provisioning state. + /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. + /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false. + /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. + /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. + /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing). + /// The tags to be persisted on the agent pool virtual machine scale set. + /// The node labels to be persisted across all nodes in agent pool. + /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. + /// The ID for Proximity Placement Group. + /// The Kubelet configuration on the agent pool nodes. + /// The OS configuration of Linux agent nodes. + /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. + /// Whether to enable UltraSSD. + /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. + /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. + /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. + /// AKS will associate the specified agent pool with the Capacity Reservation Group. + /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). + /// Network-related settings of an agent pool. + /// Windows agent pool names must be 6 characters or less. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ManagedClusterAgentPoolProfile ManagedClusterAgentPoolProfile(int? count, string vmSize, int? osDiskSizeInGB, ContainerServiceOSDiskType? osDiskType, KubeletDiskType? kubeletDiskType, WorkloadRuntime? workloadRuntime, ResourceIdentifier vnetSubnetId, ResourceIdentifier podSubnetId, int? maxPods, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, int? maxCount, int? minCount, bool? enableAutoScaling, ScaleDownMode? scaleDownMode, AgentPoolType? agentPoolType, AgentPoolMode? mode, string orchestratorVersion, string currentOrchestratorVersion, string nodeImageVersion, AgentPoolUpgradeSettings upgradeSettings, string provisioningState, ContainerServiceStateCode? powerStateCode, IEnumerable availabilityZones, bool? enableNodePublicIP, ResourceIdentifier nodePublicIPPrefixId, ScaleSetPriority? scaleSetPriority, ScaleSetEvictionPolicy? scaleSetEvictionPolicy, float? spotMaxPrice, IDictionary tags, IDictionary nodeLabels, IEnumerable nodeTaints, ResourceIdentifier proximityPlacementGroupId, KubeletConfig kubeletConfig, LinuxOSConfig linuxOSConfig, bool? enableEncryptionAtHost, bool? enableUltraSsd, bool? enableFips, GpuInstanceProfile? gpuInstanceProfile, ResourceIdentifier creationDataSourceResourceId, ResourceIdentifier capacityReservationGroupId, ResourceIdentifier hostGroupId, AgentPoolNetworkProfile networkProfile, string name) + { + return ManagedClusterAgentPoolProfile(etag: default, count: count, vmSize: vmSize, osDiskSizeInGB: osDiskSizeInGB, osDiskType: osDiskType, kubeletDiskType: kubeletDiskType, workloadRuntime: workloadRuntime, vnetSubnetId: vnetSubnetId, podSubnetId: podSubnetId, maxPods: maxPods, osType: osType, osSku: osSku, maxCount: maxCount, minCount: minCount, enableAutoScaling: enableAutoScaling, scaleDownMode: scaleDownMode, agentPoolType: agentPoolType, mode: mode, orchestratorVersion: orchestratorVersion, currentOrchestratorVersion: currentOrchestratorVersion, nodeImageVersion: nodeImageVersion, upgradeSettings: upgradeSettings, provisioningState: provisioningState, powerStateCode: powerStateCode, availabilityZones: availabilityZones, enableNodePublicIP: enableNodePublicIP, nodePublicIPPrefixId: nodePublicIPPrefixId, scaleSetPriority: scaleSetPriority, scaleSetEvictionPolicy: scaleSetEvictionPolicy, spotMaxPrice: spotMaxPrice, tags: tags, nodeLabels: nodeLabels, nodeTaints: nodeTaints, proximityPlacementGroupId: proximityPlacementGroupId, kubeletConfig: kubeletConfig, linuxOSConfig: linuxOSConfig, enableEncryptionAtHost: enableEncryptionAtHost, enableUltraSsd: enableUltraSsd, enableFips: enableFips, gpuInstanceProfile: gpuInstanceProfile, creationDataSourceResourceId: creationDataSourceResourceId, capacityReservationGroupId: capacityReservationGroupId, hostGroupId: hostGroupId, networkProfile: networkProfile, disableOutboundNat: default, securityProfile: default, name: name); + } + + /// Initializes a new instance of . + /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. + /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). + /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. + /// Determines the type of workload a node can run. + /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + /// The maximum number of pods that can run on a node. + /// The operating system type. The default is Linux. + /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. + /// The maximum number of nodes for auto-scaling. + /// The minimum number of nodes for auto-scaling. + /// Whether to enable auto-scaler. + /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. + /// The type of Agent Pool. + /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. + /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). + /// If orchestratorVersion is a fully specified version <major.minor.patch>, this field will be exactly equal to it. If orchestratorVersion is <major.minor>, this field will contain the full <major.minor.patch> version being used. + /// The version of node image. + /// Settings for upgrading the agentpool. + /// The current deployment or provisioning state. + /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. + /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false. + /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. + /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. + /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing). + /// The tags to be persisted on the agent pool virtual machine scale set. + /// The node labels to be persisted across all nodes in agent pool. + /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. + /// The ID for Proximity Placement Group. + /// The Kubelet configuration on the agent pool nodes. + /// The OS configuration of Linux agent nodes. + /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. + /// Whether to enable UltraSSD. + /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. + /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. + /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. + /// AKS will associate the specified agent pool with the Capacity Reservation Group. + /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). + /// Network-related settings of an agent pool. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ManagedClusterAgentPoolProfileProperties ManagedClusterAgentPoolProfileProperties(int? count, string vmSize, int? osDiskSizeInGB, ContainerServiceOSDiskType? osDiskType, KubeletDiskType? kubeletDiskType, WorkloadRuntime? workloadRuntime, ResourceIdentifier vnetSubnetId, ResourceIdentifier podSubnetId, int? maxPods, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, int? maxCount, int? minCount, bool? enableAutoScaling, ScaleDownMode? scaleDownMode, AgentPoolType? agentPoolType, AgentPoolMode? mode, string orchestratorVersion, string currentOrchestratorVersion, string nodeImageVersion, AgentPoolUpgradeSettings upgradeSettings, string provisioningState, ContainerServiceStateCode? powerStateCode, IEnumerable availabilityZones, bool? enableNodePublicIP, ResourceIdentifier nodePublicIPPrefixId, ScaleSetPriority? scaleSetPriority, ScaleSetEvictionPolicy? scaleSetEvictionPolicy, float? spotMaxPrice, IDictionary tags, IDictionary nodeLabels, IEnumerable nodeTaints, ResourceIdentifier proximityPlacementGroupId, KubeletConfig kubeletConfig, LinuxOSConfig linuxOSConfig, bool? enableEncryptionAtHost, bool? enableUltraSsd, bool? enableFips, GpuInstanceProfile? gpuInstanceProfile, ResourceIdentifier creationDataSourceResourceId, ResourceIdentifier capacityReservationGroupId, ResourceIdentifier hostGroupId, AgentPoolNetworkProfile networkProfile) + { + return ManagedClusterAgentPoolProfileProperties(etag: default, count: count, vmSize: vmSize, osDiskSizeInGB: osDiskSizeInGB, osDiskType: osDiskType, kubeletDiskType: kubeletDiskType, workloadRuntime: workloadRuntime, vnetSubnetId: vnetSubnetId, podSubnetId: podSubnetId, maxPods: maxPods, osType: osType, osSku: osSku, maxCount: maxCount, minCount: minCount, enableAutoScaling: enableAutoScaling, scaleDownMode: scaleDownMode, agentPoolType: agentPoolType, mode: mode, orchestratorVersion: orchestratorVersion, currentOrchestratorVersion: currentOrchestratorVersion, nodeImageVersion: nodeImageVersion, upgradeSettings: upgradeSettings, provisioningState: provisioningState, powerStateCode: powerStateCode, availabilityZones: availabilityZones, enableNodePublicIP: enableNodePublicIP, nodePublicIPPrefixId: nodePublicIPPrefixId, scaleSetPriority: scaleSetPriority, scaleSetEvictionPolicy: scaleSetEvictionPolicy, spotMaxPrice: spotMaxPrice, tags: tags, nodeLabels: nodeLabels, nodeTaints: nodeTaints, proximityPlacementGroupId: proximityPlacementGroupId, kubeletConfig: kubeletConfig, linuxOSConfig: linuxOSConfig, enableEncryptionAtHost: enableEncryptionAtHost, enableUltraSsd: enableUltraSsd, enableFips: enableFips, gpuInstanceProfile: gpuInstanceProfile, creationDataSourceResourceId: creationDataSourceResourceId, capacityReservationGroupId: capacityReservationGroupId, hostGroupId: hostGroupId, networkProfile: networkProfile, disableOutboundNat: default, securityProfile: default); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. + /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). + /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. + /// Determines the type of workload a node can run. + /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + /// The maximum number of pods that can run on a node. + /// The operating system type. The default is Linux. + /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows. + /// The maximum number of nodes for auto-scaling. + /// The minimum number of nodes for auto-scaling. + /// Whether to enable auto-scaler. + /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. + /// The type of Agent Pool. + /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools. + /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). + /// If orchestratorVersion is a fully specified version <major.minor.patch>, this field will be exactly equal to it. If orchestratorVersion is <major.minor>, this field will contain the full <major.minor.patch> version being used. + /// The version of node image. + /// Settings for upgrading the agentpool. + /// The current deployment or provisioning state. + /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. + /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false. + /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. + /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. + /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing). + /// The tags to be persisted on the agent pool virtual machine scale set. + /// The node labels to be persisted across all nodes in agent pool. + /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. + /// The ID for Proximity Placement Group. + /// The Kubelet configuration on the agent pool nodes. + /// The OS configuration of Linux agent nodes. + /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption. + /// Whether to enable UltraSSD. + /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. + /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. + /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. + /// AKS will associate the specified agent pool with the Capacity Reservation Group. + /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). + /// Network-related settings of an agent pool. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ContainerServiceAgentPoolData ContainerServiceAgentPoolData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, int? count, string vmSize, int? osDiskSizeInGB, ContainerServiceOSDiskType? osDiskType, KubeletDiskType? kubeletDiskType, WorkloadRuntime? workloadRuntime, ResourceIdentifier vnetSubnetId, ResourceIdentifier podSubnetId, int? maxPods, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, int? maxCount, int? minCount, bool? enableAutoScaling, ScaleDownMode? scaleDownMode, AgentPoolType? typePropertiesType, AgentPoolMode? mode, string orchestratorVersion, string currentOrchestratorVersion, string nodeImageVersion, AgentPoolUpgradeSettings upgradeSettings, string provisioningState, ContainerServiceStateCode? powerStateCode, IEnumerable availabilityZones, bool? enableNodePublicIP, ResourceIdentifier nodePublicIPPrefixId, ScaleSetPriority? scaleSetPriority, ScaleSetEvictionPolicy? scaleSetEvictionPolicy, float? spotMaxPrice, IDictionary tags, IDictionary nodeLabels, IEnumerable nodeTaints, ResourceIdentifier proximityPlacementGroupId, KubeletConfig kubeletConfig, LinuxOSConfig linuxOSConfig, bool? enableEncryptionAtHost, bool? enableUltraSsd, bool? enableFips, GpuInstanceProfile? gpuInstanceProfile, ResourceIdentifier creationDataSourceResourceId, ResourceIdentifier capacityReservationGroupId, ResourceIdentifier hostGroupId, AgentPoolNetworkProfile networkProfile) + { + return ContainerServiceAgentPoolData(id: id, name: name, resourceType: resourceType, systemData: systemData, etag: default, count: count, vmSize: vmSize, osDiskSizeInGB: osDiskSizeInGB, osDiskType: osDiskType, kubeletDiskType: kubeletDiskType, workloadRuntime: workloadRuntime, vnetSubnetId: vnetSubnetId, podSubnetId: podSubnetId, maxPods: maxPods, osType: osType, osSku: osSku, maxCount: maxCount, minCount: minCount, enableAutoScaling: enableAutoScaling, scaleDownMode: scaleDownMode, typePropertiesType: typePropertiesType, mode: mode, orchestratorVersion: orchestratorVersion, currentOrchestratorVersion: currentOrchestratorVersion, nodeImageVersion: nodeImageVersion, upgradeSettings: upgradeSettings, provisioningState: provisioningState, powerStateCode: powerStateCode, availabilityZones: availabilityZones, enableNodePublicIP: enableNodePublicIP, nodePublicIPPrefixId: nodePublicIPPrefixId, scaleSetPriority: scaleSetPriority, scaleSetEvictionPolicy: scaleSetEvictionPolicy, spotMaxPrice: spotMaxPrice, tags: tags, nodeLabels: nodeLabels, nodeTaints: nodeTaints, proximityPlacementGroupId: proximityPlacementGroupId, kubeletConfig: kubeletConfig, linuxOSConfig: linuxOSConfig, enableEncryptionAtHost: enableEncryptionAtHost, enableUltraSsd: enableUltraSsd, enableFips: enableFips, gpuInstanceProfile: gpuInstanceProfile, creationDataSourceResourceId: creationDataSourceResourceId, capacityReservationGroupId: capacityReservationGroupId, hostGroupId: hostGroupId, networkProfile: networkProfile, disableOutboundNat: default, securityProfile: default); + } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolCollection.cs index 88b66a8d18dd..76de428eb2d9 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -75,10 +75,12 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The name of the agent pool. /// The agent pool to create or update. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string agentPoolName, ContainerServiceAgentPoolData data, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string agentPoolName, ContainerServiceAgentPoolData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); Argument.AssertNotNull(data, nameof(data)); @@ -87,8 +89,8 @@ public virtual async Task> Creat scope.Start(); try { - var response = await _containerServiceAgentPoolAgentPoolsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(new ContainerServiceAgentPoolOperationSource(Client), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data).Request, response, OperationFinalStateVia.Location); + var response = await _containerServiceAgentPoolAgentPoolsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(new ContainerServiceAgentPoolOperationSource(Client), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -113,7 +115,7 @@ public virtual async Task> Creat /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -124,10 +126,12 @@ public virtual async Task> Creat /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The name of the agent pool. /// The agent pool to create or update. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string agentPoolName, ContainerServiceAgentPoolData data, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string agentPoolName, ContainerServiceAgentPoolData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); Argument.AssertNotNull(data, nameof(data)); @@ -136,8 +140,8 @@ public virtual ArmOperation CreateOrUpdate(Wa scope.Start(); try { - var response = _containerServiceAgentPoolAgentPoolsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data, cancellationToken); - var operation = new ContainerServiceArmOperation(new ContainerServiceAgentPoolOperationSource(Client), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data).Request, response, OperationFinalStateVia.Location); + var response = _containerServiceAgentPoolAgentPoolsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(new ContainerServiceAgentPoolOperationSource(Client), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -162,7 +166,7 @@ public virtual ArmOperation CreateOrUpdate(Wa /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -207,7 +211,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -252,7 +256,7 @@ public virtual Response Get(string agentPoolN /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -282,7 +286,7 @@ public virtual AsyncPageable GetAllAsync(Canc /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -312,7 +316,7 @@ public virtual Pageable GetAll(CancellationTo /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -355,7 +359,7 @@ public virtual async Task> ExistsAsync(string agentPoolName, Canc /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -398,7 +402,7 @@ public virtual Response Exists(string agentPoolName, CancellationToken can /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -443,7 +447,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.Serialization.cs index 39cdecd5e1e7..28447091743a 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.Serialization.cs @@ -41,6 +41,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"u8); + writer.WriteStringValue(ETag.Value.ToString()); + } if (Optional.IsDefined(Count)) { writer.WritePropertyName("count"u8); @@ -278,6 +283,16 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("networkProfile"u8); writer.WriteObjectValue(NetworkProfile, options); } + if (Optional.IsDefined(WindowsProfile)) + { + writer.WritePropertyName("windowsProfile"u8); + writer.WriteObjectValue(WindowsProfile, options); + } + if (Optional.IsDefined(SecurityProfile)) + { + writer.WritePropertyName("securityProfile"u8); + writer.WriteObjectValue(SecurityProfile, options); + } writer.WriteEndObject(); } @@ -305,6 +320,7 @@ internal static ContainerServiceAgentPoolData DeserializeContainerServiceAgentPo string name = default; ResourceType type = default; SystemData systemData = default; + ETag? etag = default; int? count = default; string vmSize = default; int? osDiskSizeGB = default; @@ -348,6 +364,8 @@ internal static ContainerServiceAgentPoolData DeserializeContainerServiceAgentPo ResourceIdentifier capacityReservationGroupId = default; ResourceIdentifier hostGroupId = default; AgentPoolNetworkProfile networkProfile = default; + AgentPoolWindowsProfile windowsProfile = default; + AgentPoolSecurityProfile securityProfile = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -385,6 +403,15 @@ internal static ContainerServiceAgentPoolData DeserializeContainerServiceAgentPo } foreach (var property0 in property.Value.EnumerateObject()) { + if (property0.NameEquals("eTag"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + etag = new ETag(property0.Value.GetString()); + continue; + } if (property0.NameEquals("count"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -772,6 +799,24 @@ internal static ContainerServiceAgentPoolData DeserializeContainerServiceAgentPo networkProfile = AgentPoolNetworkProfile.DeserializeAgentPoolNetworkProfile(property0.Value, options); continue; } + if (property0.NameEquals("windowsProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + windowsProfile = AgentPoolWindowsProfile.DeserializeAgentPoolWindowsProfile(property0.Value, options); + continue; + } + if (property0.NameEquals("securityProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securityProfile = AgentPoolSecurityProfile.DeserializeAgentPoolSecurityProfile(property0.Value, options); + continue; + } } continue; } @@ -786,6 +831,7 @@ internal static ContainerServiceAgentPoolData DeserializeContainerServiceAgentPo name, type, systemData, + etag, count, vmSize, osDiskSizeGB, @@ -829,6 +875,8 @@ internal static ContainerServiceAgentPoolData DeserializeContainerServiceAgentPo capacityReservationGroupId, hostGroupId, networkProfile, + windowsProfile, + securityProfile, serializedAdditionalRawData); } @@ -898,6 +946,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.Append(" properties:"); builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ETag), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" eTag: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ETag)) + { + builder.Append(" eTag: "); + builder.AppendLine($"'{ETag.Value.ToString()}'"); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Count), out propertyOverride); if (hasPropertyOverride) { @@ -1684,6 +1747,41 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("DisableOutboundNat", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" windowsProfile: "); + builder.AppendLine("{"); + builder.AppendLine(" windowsProfile: {"); + builder.Append(" disableOutboundNat: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(WindowsProfile)) + { + builder.Append(" windowsProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, WindowsProfile, options, 4, false, " windowsProfile: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SecurityProfile), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" securityProfile: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SecurityProfile)) + { + builder.Append(" securityProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, SecurityProfile, options, 4, false, " securityProfile: "); + } + } + builder.AppendLine(" }"); builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.cs index d21fe3381f1a..1388538f2447 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.cs @@ -65,6 +65,7 @@ public ContainerServiceAgentPoolData() /// The name. /// The resourceType. /// The systemData. + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency per the normal etag convention. /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. @@ -108,9 +109,12 @@ public ContainerServiceAgentPoolData() /// AKS will associate the specified agent pool with the Capacity Reservation Group. /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). /// Network-related settings of an agent pool. + /// The Windows agent pool's specific profile. + /// The security settings of an agent pool. /// Keeps track of any properties unknown to the library. - internal ContainerServiceAgentPoolData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, int? count, string vmSize, int? osDiskSizeInGB, ContainerServiceOSDiskType? osDiskType, KubeletDiskType? kubeletDiskType, WorkloadRuntime? workloadRuntime, ResourceIdentifier vnetSubnetId, ResourceIdentifier podSubnetId, int? maxPods, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, int? maxCount, int? minCount, bool? enableAutoScaling, ScaleDownMode? scaleDownMode, AgentPoolType? typePropertiesType, AgentPoolMode? mode, string orchestratorVersion, string currentOrchestratorVersion, string nodeImageVersion, AgentPoolUpgradeSettings upgradeSettings, string provisioningState, ContainerServicePowerState powerState, IList availabilityZones, bool? enableNodePublicIP, ResourceIdentifier nodePublicIPPrefixId, ScaleSetPriority? scaleSetPriority, ScaleSetEvictionPolicy? scaleSetEvictionPolicy, float? spotMaxPrice, IDictionary tags, IDictionary nodeLabels, IList nodeTaints, ResourceIdentifier proximityPlacementGroupId, KubeletConfig kubeletConfig, LinuxOSConfig linuxOSConfig, bool? enableEncryptionAtHost, bool? enableUltraSsd, bool? enableFips, GpuInstanceProfile? gpuInstanceProfile, ContainerServiceCreationData creationData, ResourceIdentifier capacityReservationGroupId, ResourceIdentifier hostGroupId, AgentPoolNetworkProfile networkProfile, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ContainerServiceAgentPoolData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ETag? etag, int? count, string vmSize, int? osDiskSizeInGB, ContainerServiceOSDiskType? osDiskType, KubeletDiskType? kubeletDiskType, WorkloadRuntime? workloadRuntime, ResourceIdentifier vnetSubnetId, ResourceIdentifier podSubnetId, int? maxPods, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, int? maxCount, int? minCount, bool? enableAutoScaling, ScaleDownMode? scaleDownMode, AgentPoolType? typePropertiesType, AgentPoolMode? mode, string orchestratorVersion, string currentOrchestratorVersion, string nodeImageVersion, AgentPoolUpgradeSettings upgradeSettings, string provisioningState, ContainerServicePowerState powerState, IList availabilityZones, bool? enableNodePublicIP, ResourceIdentifier nodePublicIPPrefixId, ScaleSetPriority? scaleSetPriority, ScaleSetEvictionPolicy? scaleSetEvictionPolicy, float? spotMaxPrice, IDictionary tags, IDictionary nodeLabels, IList nodeTaints, ResourceIdentifier proximityPlacementGroupId, KubeletConfig kubeletConfig, LinuxOSConfig linuxOSConfig, bool? enableEncryptionAtHost, bool? enableUltraSsd, bool? enableFips, GpuInstanceProfile? gpuInstanceProfile, ContainerServiceCreationData creationData, ResourceIdentifier capacityReservationGroupId, ResourceIdentifier hostGroupId, AgentPoolNetworkProfile networkProfile, AgentPoolWindowsProfile windowsProfile, AgentPoolSecurityProfile securityProfile, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { + ETag = etag; Count = count; VmSize = vmSize; OSDiskSizeInGB = osDiskSizeInGB; @@ -154,9 +158,14 @@ internal ContainerServiceAgentPoolData(ResourceIdentifier id, string name, Resou CapacityReservationGroupId = capacityReservationGroupId; HostGroupId = hostGroupId; NetworkProfile = networkProfile; + WindowsProfile = windowsProfile; + SecurityProfile = securityProfile; _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency per the normal etag convention. + [WirePath("properties.eTag")] + public ETag? ETag { get; } /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. [WirePath("properties.count")] public int? Count { get; set; } @@ -310,5 +319,23 @@ public ResourceIdentifier CreationDataSourceResourceId /// Network-related settings of an agent pool. [WirePath("properties.networkProfile")] public AgentPoolNetworkProfile NetworkProfile { get; set; } + /// The Windows agent pool's specific profile. + internal AgentPoolWindowsProfile WindowsProfile { get; set; } + /// The default value is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows agent pool does not have node public IP enabled. + [WirePath("properties.windowsProfile.disableOutboundNat")] + public bool? DisableOutboundNat + { + get => WindowsProfile is null ? default : WindowsProfile.DisableOutboundNat; + set + { + if (WindowsProfile is null) + WindowsProfile = new AgentPoolWindowsProfile(); + WindowsProfile.DisableOutboundNat = value; + } + } + + /// The security settings of an agent pool. + [WirePath("properties.securityProfile")] + public AgentPoolSecurityProfile SecurityProfile { get; set; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolResource.cs index e3ed5337ca43..ddadb941f82e 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolResource.cs @@ -12,6 +12,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerService.Models; namespace Azure.ResourceManager.ContainerService { @@ -96,6 +97,75 @@ public virtual AgentPoolUpgradeProfileResource GetAgentPoolUpgradeProfile() return new AgentPoolUpgradeProfileResource(Client, Id.AppendChildResource("upgradeProfiles", "default")); } + /// Gets a collection of MachineResources in the ContainerServiceAgentPool. + /// An object representing collection of MachineResources and their operations over a MachineResource. + public virtual MachineCollection GetMachines() + { + return GetCachedClient(client => new MachineCollection(client, Id)); + } + + /// + /// Get a specific machine in the specified agent pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName} + /// + /// + /// Operation Id + /// Machines_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// host name of the machine. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMachineAsync(string machineName, CancellationToken cancellationToken = default) + { + return await GetMachines().GetAsync(machineName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a specific machine in the specified agent pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName} + /// + /// + /// Operation Id + /// Machines_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// host name of the machine. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMachine(string machineName, CancellationToken cancellationToken = default) + { + return GetMachines().Get(machineName, cancellationToken); + } + /// /// Gets the specified managed cluster agent pool. /// @@ -109,7 +179,7 @@ public virtual AgentPoolUpgradeProfileResource GetAgentPoolUpgradeProfile() /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -149,7 +219,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -189,7 +259,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -198,15 +268,17 @@ public virtual Response Get(CancellationToken /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual async Task DeleteAsync(WaitUntil waitUntil, bool? ignorePodDisruptionBudget = null, string ifMatch = null, CancellationToken cancellationToken = default) { using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.Delete"); scope.Start(); try { - var response = await _containerServiceAgentPoolAgentPoolsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(_containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _containerServiceAgentPoolAgentPoolsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ignorePodDisruptionBudget, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(_containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ignorePodDisruptionBudget, ifMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -231,7 +303,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -240,15 +312,17 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual ArmOperation Delete(WaitUntil waitUntil, bool? ignorePodDisruptionBudget = null, string ifMatch = null, CancellationToken cancellationToken = default) { using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.Delete"); scope.Start(); try { - var response = _containerServiceAgentPoolAgentPoolsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerServiceArmOperation(_containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _containerServiceAgentPoolAgentPoolsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ignorePodDisruptionBudget, ifMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(_containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ignorePodDisruptionBudget, ifMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -273,7 +347,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -283,9 +357,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The agent pool to create or update. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerServiceAgentPoolData data, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerServiceAgentPoolData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); @@ -293,8 +369,8 @@ public virtual async Task> Updat scope.Start(); try { - var response = await _containerServiceAgentPoolAgentPoolsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(new ContainerServiceAgentPoolOperationSource(Client), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = await _containerServiceAgentPoolAgentPoolsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(new ContainerServiceAgentPoolOperationSource(Client), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -319,7 +395,7 @@ public virtual async Task> Updat /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -329,9 +405,11 @@ public virtual async Task> Updat /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The agent pool to create or update. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, ContainerServiceAgentPoolData data, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, ContainerServiceAgentPoolData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); @@ -339,8 +417,8 @@ public virtual ArmOperation Update(WaitUntil scope.Start(); try { - var response = _containerServiceAgentPoolAgentPoolsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new ContainerServiceArmOperation(new ContainerServiceAgentPoolOperationSource(Client), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = _containerServiceAgentPoolAgentPoolsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(new ContainerServiceAgentPoolOperationSource(Client), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -365,7 +443,7 @@ public virtual ArmOperation Update(WaitUntil /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -407,7 +485,7 @@ public virtual async Task AbortLatestOperationAsync(WaitUntil wait /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -436,6 +514,98 @@ public virtual ArmOperation AbortLatestOperation(WaitUntil waitUntil, Cancellati } } + /// + /// Deletes specific machines in an agent pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/deleteMachines + /// + /// + /// Operation Id + /// AgentPools_DeleteMachines + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// A list of machines from the agent pool to be deleted. + /// The cancellation token to use. + /// is null. + public virtual async Task DeleteMachinesAsync(WaitUntil waitUntil, AgentPoolDeleteMachinesParameter machines, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(machines, nameof(machines)); + + using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.DeleteMachines"); + scope.Start(); + try + { + var response = await _containerServiceAgentPoolAgentPoolsRestClient.DeleteMachinesAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, machines, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(_containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateDeleteMachinesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, machines).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes specific machines in an agent pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/deleteMachines + /// + /// + /// Operation Id + /// AgentPools_DeleteMachines + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// A list of machines from the agent pool to be deleted. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation DeleteMachines(WaitUntil waitUntil, AgentPoolDeleteMachinesParameter machines, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(machines, nameof(machines)); + + using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.DeleteMachines"); + scope.Start(); + try + { + var response = _containerServiceAgentPoolAgentPoolsRestClient.DeleteMachines(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, machines, cancellationToken); + var operation = new ContainerServiceArmOperation(_containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateDeleteMachinesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, machines).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade /// @@ -449,7 +619,7 @@ public virtual ArmOperation AbortLatestOperation(WaitUntil waitUntil, Cancellati /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -491,7 +661,7 @@ public virtual async Task UpgradeNodeImageVersionAsync(WaitUntil w /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -533,7 +703,7 @@ public virtual ArmOperation UpgradeNodeImageVersion(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -590,7 +760,7 @@ public virtual async Task> AddTagAsy /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -647,7 +817,7 @@ public virtual Response AddTag(string key, st /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -703,7 +873,7 @@ public virtual async Task> SetTagsAs /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -759,7 +929,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -814,7 +984,7 @@ public virtual async Task> RemoveTag /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationCollection.cs index f608a529017b..8b98cdba226a 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation Cr /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(st /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable G /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable GetAll /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string configName, Cancell /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string configName, CancellationToken cancel /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -447,7 +447,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationResource.cs index f1463e991c78..3f11d036eb3e 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Ca /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterCollection.cs index a05f8d6c2d6d..6592576114ab 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -76,10 +76,12 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The name of the managed cluster resource. /// The managed cluster to create or update. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string resourceName, ContainerServiceManagedClusterData data, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string resourceName, ContainerServiceManagedClusterData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); Argument.AssertNotNull(data, nameof(data)); @@ -88,8 +90,8 @@ public virtual async Task> scope.Start(); try { - var response = await _containerServiceManagedClusterManagedClustersRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(new ContainerServiceManagedClusterOperationSource(Client), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data).Request, response, OperationFinalStateVia.Location); + var response = await _containerServiceManagedClusterManagedClustersRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(new ContainerServiceManagedClusterOperationSource(Client), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -114,7 +116,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -125,10 +127,12 @@ public virtual async Task> /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The name of the managed cluster resource. /// The managed cluster to create or update. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string resourceName, ContainerServiceManagedClusterData data, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string resourceName, ContainerServiceManagedClusterData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); Argument.AssertNotNull(data, nameof(data)); @@ -137,8 +141,8 @@ public virtual ArmOperation CreateOrUpda scope.Start(); try { - var response = _containerServiceManagedClusterManagedClustersRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data, cancellationToken); - var operation = new ContainerServiceArmOperation(new ContainerServiceManagedClusterOperationSource(Client), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data).Request, response, OperationFinalStateVia.Location); + var response = _containerServiceManagedClusterManagedClustersRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(new ContainerServiceManagedClusterOperationSource(Client), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -163,7 +167,7 @@ public virtual ArmOperation CreateOrUpda /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -208,7 +212,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -253,7 +257,7 @@ public virtual Response Get(string resou /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -283,7 +287,7 @@ public virtual AsyncPageable GetAllAsync /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -313,7 +317,7 @@ public virtual Pageable GetAll(Cancellat /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -356,7 +360,7 @@ public virtual async Task> ExistsAsync(string resourceName, Cance /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -399,7 +403,7 @@ public virtual Response Exists(string resourceName, CancellationToken canc /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -444,7 +448,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.Serialization.cs index c9542e97356d..d5606bdcf21d 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.Serialization.cs @@ -40,6 +40,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"u8); + writer.WriteStringValue(ETag.Value.ToString()); + } if (Optional.IsDefined(Sku)) { writer.WritePropertyName("sku"u8); @@ -158,6 +163,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("nodeResourceGroup"u8); writer.WriteStringValue(NodeResourceGroup); } + if (Optional.IsDefined(NodeResourceGroupProfile)) + { + writer.WritePropertyName("nodeResourceGroupProfile"u8); + writer.WriteObjectValue(NodeResourceGroupProfile, options); + } if (Optional.IsDefined(EnableRbac)) { writer.WritePropertyName("enableRBAC"u8); @@ -249,6 +259,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("storageProfile"u8); writer.WriteObjectValue(StorageProfile, options); } + if (Optional.IsDefined(IngressProfile)) + { + writer.WritePropertyName("ingressProfile"u8); + writer.WriteObjectValue(IngressProfile, options); + } if (Optional.IsDefined(PublicNetworkAccess)) { writer.WritePropertyName("publicNetworkAccess"u8); @@ -274,6 +289,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("resourceUID"u8); writer.WriteStringValue(ResourceId); } + if (Optional.IsDefined(MetricsProfile)) + { + writer.WritePropertyName("metricsProfile"u8); + writer.WriteObjectValue(MetricsProfile, options); + } writer.WriteEndObject(); } @@ -297,6 +317,7 @@ internal static ContainerServiceManagedClusterData DeserializeContainerServiceMa { return null; } + ETag? etag = default; ManagedClusterSku sku = default; ExtendedLocation extendedLocation = default; ManagedClusterIdentity identity = default; @@ -324,6 +345,7 @@ internal static ContainerServiceManagedClusterData DeserializeContainerServiceMa ManagedClusterPodIdentityProfile podIdentityProfile = default; ManagedClusterOidcIssuerProfile oidcIssuerProfile = default; string nodeResourceGroup = default; + ManagedClusterNodeResourceGroupProfile nodeResourceGroupProfile = default; bool? enableRBAC = default; KubernetesSupportPlan? supportPlan = default; bool? enablePodSecurityPolicy = default; @@ -340,15 +362,26 @@ internal static ContainerServiceManagedClusterData DeserializeContainerServiceMa ManagedClusterHttpProxyConfig httpProxyConfig = default; ManagedClusterSecurityProfile securityProfile = default; ManagedClusterStorageProfile storageProfile = default; + ManagedClusterIngressProfile ingressProfile = default; ContainerServicePublicNetworkAccess? publicNetworkAccess = default; ManagedClusterWorkloadAutoScalerProfile workloadAutoScalerProfile = default; ManagedClusterAzureMonitorProfile azureMonitorProfile = default; ServiceMeshProfile serviceMeshProfile = default; ResourceIdentifier resourceUID = default; + ManagedClusterMetricsProfile metricsProfile = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("eTag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + etag = new ETag(property.Value.GetString()); + continue; + } if (property.NameEquals("sku"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -564,6 +597,15 @@ internal static ContainerServiceManagedClusterData DeserializeContainerServiceMa nodeResourceGroup = property0.Value.GetString(); continue; } + if (property0.NameEquals("nodeResourceGroupProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nodeResourceGroupProfile = ManagedClusterNodeResourceGroupProfile.DeserializeManagedClusterNodeResourceGroupProfile(property0.Value, options); + continue; + } if (property0.NameEquals("enableRBAC"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -718,6 +760,15 @@ internal static ContainerServiceManagedClusterData DeserializeContainerServiceMa storageProfile = ManagedClusterStorageProfile.DeserializeManagedClusterStorageProfile(property0.Value, options); continue; } + if (property0.NameEquals("ingressProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ingressProfile = ManagedClusterIngressProfile.DeserializeManagedClusterIngressProfile(property0.Value, options); + continue; + } if (property0.NameEquals("publicNetworkAccess"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -763,6 +814,15 @@ internal static ContainerServiceManagedClusterData DeserializeContainerServiceMa resourceUID = new ResourceIdentifier(property0.Value.GetString()); continue; } + if (property0.NameEquals("metricsProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + metricsProfile = ManagedClusterMetricsProfile.DeserializeManagedClusterMetricsProfile(property0.Value, options); + continue; + } } continue; } @@ -779,6 +839,7 @@ internal static ContainerServiceManagedClusterData DeserializeContainerServiceMa systemData, tags ?? new ChangeTrackingDictionary(), location, + etag, sku, extendedLocation, identity, @@ -800,6 +861,7 @@ internal static ContainerServiceManagedClusterData DeserializeContainerServiceMa podIdentityProfile, oidcIssuerProfile, nodeResourceGroup, + nodeResourceGroupProfile, enableRBAC, supportPlan, enablePodSecurityPolicy, @@ -816,11 +878,13 @@ internal static ContainerServiceManagedClusterData DeserializeContainerServiceMa httpProxyConfig, securityProfile, storageProfile, + ingressProfile, publicNetworkAccess, workloadAutoScalerProfile, azureMonitorProfile, serviceMeshProfile, resourceUID, + metricsProfile, serializedAdditionalRawData); } @@ -907,6 +971,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ETag), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" eTag: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ETag)) + { + builder.Append(" eTag: "); + builder.AppendLine($"'{ETag.Value.ToString()}'"); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Sku), out propertyOverride); if (hasPropertyOverride) { @@ -1348,6 +1427,26 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("NodeResourceGroupRestrictionLevel", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nodeResourceGroupProfile: "); + builder.AppendLine("{"); + builder.AppendLine(" nodeResourceGroupProfile: {"); + builder.Append(" restrictionLevel: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(NodeResourceGroupProfile)) + { + builder.Append(" nodeResourceGroupProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, NodeResourceGroupProfile, options, 4, false, " nodeResourceGroupProfile: "); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableRbac), out propertyOverride); if (hasPropertyOverride) { @@ -1613,6 +1712,26 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("IngressWebAppRouting", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" ingressProfile: "); + builder.AppendLine("{"); + builder.AppendLine(" ingressProfile: {"); + builder.Append(" webAppRouting: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(IngressProfile)) + { + builder.Append(" ingressProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, IngressProfile, options, 4, false, " ingressProfile: "); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PublicNetworkAccess), out propertyOverride); if (hasPropertyOverride) { @@ -1693,6 +1812,28 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("CostAnalysisEnabled", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" metricsProfile: "); + builder.AppendLine("{"); + builder.AppendLine(" metricsProfile: {"); + builder.AppendLine(" costAnalysis: {"); + builder.Append(" enabled: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(MetricsProfile)) + { + builder.Append(" metricsProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, MetricsProfile, options, 4, false, " metricsProfile: "); + } + } + builder.AppendLine(" }"); builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.cs index 9d7696707b56..5795c57376be 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.cs @@ -69,6 +69,7 @@ public ContainerServiceManagedClusterData(AzureLocation location) : base(locatio /// The systemData. /// The tags. /// The location. + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency per the normal etag convention. /// The managed cluster SKU. /// The extended location of the Virtual Machine. /// The identity of the managed cluster, if configured. @@ -90,6 +91,7 @@ public ContainerServiceManagedClusterData(AzureLocation location) : base(locatio /// See [use AAD pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod identity integration. /// The OIDC issuer profile of the Managed Cluster. /// The name of the resource group containing agent pool nodes. + /// Profile of the node resource group configuration. /// Whether to enable Kubernetes Role-Based Access Control. /// The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'. /// (DEPRECATED) Whether to enable Kubernetes pod security policy (preview). PodSecurityPolicy was deprecated in Kubernetes v1.21, and removed from Kubernetes in v1.25. Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp. @@ -100,20 +102,23 @@ public ContainerServiceManagedClusterData(AzureLocation location) : base(locatio /// Parameters to be applied to the cluster-autoscaler when enabled. /// The access profile for managed cluster API server. /// This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. - /// Identities associated with the cluster. + /// The user identity associated with the managed cluster. This identity will be used by the kubelet. Only one user assigned identity is allowed. The only accepted key is "kubeletidentity", with value of "resourceId": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}". /// Private link resources associated with the cluster. /// If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details see [disable local accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview). /// Configurations for provisioning the cluster with HTTP proxy servers. /// Security profile for the managed cluster. /// Storage profile for the managed cluster. + /// Ingress profile for the managed cluster. /// Allow or deny public network access for AKS. /// Workload Auto-scaler profile for the managed cluster. /// Azure Monitor addon profiles for monitoring the managed cluster. /// Service mesh profile for a managed cluster. /// The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds (i.e: create, delete, create sequence). + /// Optional cluster metrics configuration. /// Keeps track of any properties unknown to the library. - internal ContainerServiceManagedClusterData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedClusterSku sku, ExtendedLocation extendedLocation, ManagedClusterIdentity clusterIdentity, string provisioningState, ContainerServicePowerState powerState, int? maxAgentPools, string kubernetesVersion, string currentKubernetesVersion, string dnsPrefix, string fqdnSubdomain, string fqdn, string privateFqdn, string azurePortalFqdn, IList agentPoolProfiles, ContainerServiceLinuxProfile linuxProfile, ManagedClusterWindowsProfile windowsProfile, ManagedClusterServicePrincipalProfile servicePrincipalProfile, IDictionary addonProfiles, ManagedClusterPodIdentityProfile podIdentityProfile, ManagedClusterOidcIssuerProfile oidcIssuerProfile, string nodeResourceGroup, bool? enableRbac, KubernetesSupportPlan? supportPlan, bool? enablePodSecurityPolicy, ContainerServiceNetworkProfile networkProfile, ManagedClusterAadProfile aadProfile, ManagedClusterAutoUpgradeProfile autoUpgradeProfile, ClusterUpgradeSettings upgradeSettings, ManagedClusterAutoScalerProfile autoScalerProfile, ManagedClusterApiServerAccessProfile apiServerAccessProfile, ResourceIdentifier diskEncryptionSetId, IDictionary identityProfile, IList privateLinkResources, bool? disableLocalAccounts, ManagedClusterHttpProxyConfig httpProxyConfig, ManagedClusterSecurityProfile securityProfile, ManagedClusterStorageProfile storageProfile, ContainerServicePublicNetworkAccess? publicNetworkAccess, ManagedClusterWorkloadAutoScalerProfile workloadAutoScalerProfile, ManagedClusterAzureMonitorProfile azureMonitorProfile, ServiceMeshProfile serviceMeshProfile, ResourceIdentifier resourceId, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal ContainerServiceManagedClusterData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ETag? etag, ManagedClusterSku sku, ExtendedLocation extendedLocation, ManagedClusterIdentity clusterIdentity, string provisioningState, ContainerServicePowerState powerState, int? maxAgentPools, string kubernetesVersion, string currentKubernetesVersion, string dnsPrefix, string fqdnSubdomain, string fqdn, string privateFqdn, string azurePortalFqdn, IList agentPoolProfiles, ContainerServiceLinuxProfile linuxProfile, ManagedClusterWindowsProfile windowsProfile, ManagedClusterServicePrincipalProfile servicePrincipalProfile, IDictionary addonProfiles, ManagedClusterPodIdentityProfile podIdentityProfile, ManagedClusterOidcIssuerProfile oidcIssuerProfile, string nodeResourceGroup, ManagedClusterNodeResourceGroupProfile nodeResourceGroupProfile, bool? enableRbac, KubernetesSupportPlan? supportPlan, bool? enablePodSecurityPolicy, ContainerServiceNetworkProfile networkProfile, ManagedClusterAadProfile aadProfile, ManagedClusterAutoUpgradeProfile autoUpgradeProfile, ClusterUpgradeSettings upgradeSettings, ManagedClusterAutoScalerProfile autoScalerProfile, ManagedClusterApiServerAccessProfile apiServerAccessProfile, ResourceIdentifier diskEncryptionSetId, IDictionary identityProfile, IList privateLinkResources, bool? disableLocalAccounts, ManagedClusterHttpProxyConfig httpProxyConfig, ManagedClusterSecurityProfile securityProfile, ManagedClusterStorageProfile storageProfile, ManagedClusterIngressProfile ingressProfile, ContainerServicePublicNetworkAccess? publicNetworkAccess, ManagedClusterWorkloadAutoScalerProfile workloadAutoScalerProfile, ManagedClusterAzureMonitorProfile azureMonitorProfile, ServiceMeshProfile serviceMeshProfile, ResourceIdentifier resourceId, ManagedClusterMetricsProfile metricsProfile, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { + ETag = etag; Sku = sku; ExtendedLocation = extendedLocation; ClusterIdentity = clusterIdentity; @@ -135,6 +140,7 @@ internal ContainerServiceManagedClusterData(ResourceIdentifier id, string name, PodIdentityProfile = podIdentityProfile; OidcIssuerProfile = oidcIssuerProfile; NodeResourceGroup = nodeResourceGroup; + NodeResourceGroupProfile = nodeResourceGroupProfile; EnableRbac = enableRbac; SupportPlan = supportPlan; EnablePodSecurityPolicy = enablePodSecurityPolicy; @@ -151,11 +157,13 @@ internal ContainerServiceManagedClusterData(ResourceIdentifier id, string name, HttpProxyConfig = httpProxyConfig; SecurityProfile = securityProfile; StorageProfile = storageProfile; + IngressProfile = ingressProfile; PublicNetworkAccess = publicNetworkAccess; WorkloadAutoScalerProfile = workloadAutoScalerProfile; AzureMonitorProfile = azureMonitorProfile; ServiceMeshProfile = serviceMeshProfile; ResourceId = resourceId; + MetricsProfile = metricsProfile; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -164,6 +172,9 @@ internal ContainerServiceManagedClusterData() { } + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency per the normal etag convention. + [WirePath("eTag")] + public ETag? ETag { get; } /// The managed cluster SKU. [WirePath("sku")] public ManagedClusterSku Sku { get; set; } @@ -233,6 +244,21 @@ public ContainerServiceStateCode? PowerStateCode /// The name of the resource group containing agent pool nodes. [WirePath("properties.nodeResourceGroup")] public string NodeResourceGroup { get; set; } + /// Profile of the node resource group configuration. + internal ManagedClusterNodeResourceGroupProfile NodeResourceGroupProfile { get; set; } + /// The restriction level applied to the cluster's node resource group. If not specified, the default is 'Unrestricted'. + [WirePath("properties.nodeResourceGroupProfile.restrictionLevel")] + public RestrictionLevel? NodeResourceGroupRestrictionLevel + { + get => NodeResourceGroupProfile is null ? default : NodeResourceGroupProfile.RestrictionLevel; + set + { + if (NodeResourceGroupProfile is null) + NodeResourceGroupProfile = new ManagedClusterNodeResourceGroupProfile(); + NodeResourceGroupProfile.RestrictionLevel = value; + } + } + /// Whether to enable Kubernetes Role-Based Access Control. [WirePath("properties.enableRBAC")] public bool? EnableRbac { get; set; } @@ -275,7 +301,7 @@ public UpgradeOverrideSettings UpgradeOverrideSettings /// This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. [WirePath("properties.diskEncryptionSetID")] public ResourceIdentifier DiskEncryptionSetId { get; set; } - /// Identities associated with the cluster. + /// The user identity associated with the managed cluster. This identity will be used by the kubelet. Only one user assigned identity is allowed. The only accepted key is "kubeletidentity", with value of "resourceId": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}". [WirePath("properties.identityProfile")] public IDictionary IdentityProfile { get; } /// Private link resources associated with the cluster. @@ -293,6 +319,21 @@ public UpgradeOverrideSettings UpgradeOverrideSettings /// Storage profile for the managed cluster. [WirePath("properties.storageProfile")] public ManagedClusterStorageProfile StorageProfile { get; set; } + /// Ingress profile for the managed cluster. + internal ManagedClusterIngressProfile IngressProfile { get; set; } + /// App Routing settings for the ingress profile. You can find an overview and onboarding guide for this feature at https://learn.microsoft.com/en-us/azure/aks/app-routing?tabs=default%2Cdeploy-app-default. + [WirePath("properties.ingressProfile.webAppRouting")] + public ManagedClusterIngressProfileWebAppRouting IngressWebAppRouting + { + get => IngressProfile is null ? default : IngressProfile.WebAppRouting; + set + { + if (IngressProfile is null) + IngressProfile = new ManagedClusterIngressProfile(); + IngressProfile.WebAppRouting = value; + } + } + /// Allow or deny public network access for AKS. [WirePath("properties.publicNetworkAccess")] public ContainerServicePublicNetworkAccess? PublicNetworkAccess { get; set; } @@ -320,5 +361,19 @@ public ManagedClusterMonitorProfileMetrics AzureMonitorMetrics /// The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds (i.e: create, delete, create sequence). [WirePath("properties.resourceUID")] public ResourceIdentifier ResourceId { get; } + /// Optional cluster metrics configuration. + internal ManagedClusterMetricsProfile MetricsProfile { get; set; } + /// The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes Namespace and Deployment details to the Cost Analysis views in the Azure portal. If not specified, the default is false. For more information see aka.ms/aks/docs/cost-analysis. + [WirePath("properties.metricsProfile.costAnalysis.enabled")] + public bool? CostAnalysisEnabled + { + get => MetricsProfile is null ? default : MetricsProfile.CostAnalysisEnabled; + set + { + if (MetricsProfile is null) + MetricsProfile = new ManagedClusterMetricsProfile(); + MetricsProfile.CostAnalysisEnabled = value; + } + } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterResource.cs index e9761b7a74dd..9b8dcffdc402 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterResource.cs @@ -130,7 +130,7 @@ public virtual MeshUpgradeProfileCollection GetMeshUpgradeProfiles() /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -161,7 +161,7 @@ public virtual async Task> GetMeshUpgradePr /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -199,7 +199,7 @@ public virtual ContainerServiceMaintenanceConfigurationCollection GetContainerSe /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -230,7 +230,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -268,7 +268,7 @@ public virtual ContainerServiceAgentPoolCollection GetContainerServiceAgentPools /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -299,7 +299,7 @@ public virtual async Task> GetContai /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -337,7 +337,7 @@ public virtual ContainerServicePrivateEndpointConnectionCollection GetContainerS /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -368,7 +368,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -406,7 +406,7 @@ public virtual ContainerServiceTrustedAccessRoleBindingCollection GetContainerSe /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -437,7 +437,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -468,7 +468,7 @@ public virtual Response GetCon /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -508,7 +508,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -535,6 +535,92 @@ public virtual Response Get(Cancellation } } + /// + /// Deletes a managed cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} + /// + /// + /// Operation Id + /// ManagedClusters_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.Delete"); + scope.Start(); + try + { + var response = await _containerServiceManagedClusterManagedClustersRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a managed cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} + /// + /// + /// Operation Id + /// ManagedClusters_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.Delete"); + scope.Start(); + try + { + var response = _containerServiceManagedClusterManagedClustersRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(_containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Updates tags on a managed cluster. /// @@ -548,7 +634,7 @@ public virtual Response Get(Cancellation /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -558,9 +644,10 @@ public virtual Response Get(Cancellation /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// Parameters supplied to the Update Managed Cluster Tags operation. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerServiceTagsObject containerServiceTagsObject, string ifMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject)); @@ -568,8 +655,8 @@ public virtual async Task> scope.Start(); try { - var response = await _containerServiceManagedClusterManagedClustersRestClient.UpdateTagsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceArmOperation(new ContainerServiceManagedClusterOperationSource(Client), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateUpdateTagsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject).Request, response, OperationFinalStateVia.Location); + var response = await _containerServiceManagedClusterManagedClustersRestClient.UpdateTagsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceArmOperation(new ContainerServiceManagedClusterOperationSource(Client), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateUpdateTagsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject, ifMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -594,7 +681,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -604,9 +691,10 @@ public virtual async Task> /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// Parameters supplied to the Update Managed Cluster Tags operation. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, ContainerServiceTagsObject containerServiceTagsObject, string ifMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject)); @@ -614,8 +702,8 @@ public virtual ArmOperation Update(WaitU scope.Start(); try { - var response = _containerServiceManagedClusterManagedClustersRestClient.UpdateTags(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject, cancellationToken); - var operation = new ContainerServiceArmOperation(new ContainerServiceManagedClusterOperationSource(Client), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateUpdateTagsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject).Request, response, OperationFinalStateVia.Location); + var response = _containerServiceManagedClusterManagedClustersRestClient.UpdateTags(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject, ifMatch, cancellationToken); + var operation = new ContainerServiceArmOperation(new ContainerServiceManagedClusterOperationSource(Client), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateUpdateTagsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject, ifMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -640,7 +728,7 @@ public virtual ArmOperation Update(WaitU /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// @@ -679,7 +767,7 @@ public virtual async Task> GetAccessProfil /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// @@ -718,7 +806,7 @@ public virtual Response GetAccessProfile(string rol /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -757,7 +845,7 @@ public virtual async Task> GetClusterAdminCr /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -796,7 +884,7 @@ public virtual Response GetClusterAdminCredentials(st /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -836,7 +924,7 @@ public virtual async Task> GetClusterUserCre /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -876,7 +964,7 @@ public virtual Response GetClusterUserCredentials(str /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -915,7 +1003,7 @@ public virtual async Task> GetClusterMonitor /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -954,7 +1042,7 @@ public virtual Response GetClusterMonitoringUserCrede /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -1000,7 +1088,7 @@ public virtual async Task ResetServicePrincipalProfileAsync(WaitUn /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -1046,7 +1134,7 @@ public virtual ArmOperation ResetServicePrincipalProfile(WaitUntil waitUntil, Ma /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -1092,7 +1180,7 @@ public virtual async Task ResetAadProfileAsync(WaitUntil waitUntil /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -1138,7 +1226,7 @@ public virtual ArmOperation ResetAadProfile(WaitUntil waitUntil, ManagedClusterA /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -1180,7 +1268,7 @@ public virtual async Task RotateClusterCertificatesAsync(WaitUntil /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -1222,7 +1310,7 @@ public virtual ArmOperation RotateClusterCertificates(WaitUntil waitUntil, Cance /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -1264,7 +1352,7 @@ public virtual async Task AbortLatestOperationAsync(WaitUntil wait /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -1306,7 +1394,7 @@ public virtual ArmOperation AbortLatestOperation(WaitUntil waitUntil, Cancellati /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -1348,7 +1436,7 @@ public virtual async Task RotateServiceAccountSigningKeysAsync(Wai /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -1390,7 +1478,7 @@ public virtual ArmOperation RotateServiceAccountSigningKeys(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -1432,7 +1520,7 @@ public virtual async Task StopAsync(WaitUntil waitUntil, Cancellat /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -1474,7 +1562,7 @@ public virtual ArmOperation Stop(WaitUntil waitUntil, CancellationToken cancella /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -1516,7 +1604,7 @@ public virtual async Task StartAsync(WaitUntil waitUntil, Cancella /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -1558,7 +1646,7 @@ public virtual ArmOperation Start(WaitUntil waitUntil, CancellationToken cancell /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -1604,7 +1692,7 @@ public virtual async Task> RunComma /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -1650,7 +1738,7 @@ public virtual ArmOperation RunCommand(WaitUntil /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// @@ -1689,7 +1777,7 @@ public virtual async Task> GetCommandRe /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// @@ -1728,7 +1816,7 @@ public virtual Response GetCommandResult(string /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -1758,7 +1846,7 @@ public virtual AsyncPageable GetOut /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -1788,7 +1876,7 @@ public virtual Pageable GetOutbound /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// @@ -1822,7 +1910,7 @@ public virtual async Task> GetAvailableAgen /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// @@ -1856,7 +1944,7 @@ public virtual Response GetAvailableAgentPoolVersion /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// @@ -1881,7 +1969,7 @@ public virtual AsyncPageable GetPrivate /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// @@ -1906,7 +1994,7 @@ public virtual Pageable GetPrivateLinkR /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// @@ -1944,7 +2032,7 @@ public virtual async Task> Res /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// @@ -1982,7 +2070,7 @@ public virtual Response ResolvePrivateL /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -2044,7 +2132,7 @@ public virtual async Task> AddT /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -2106,7 +2194,7 @@ public virtual Response AddTag(string ke /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -2163,7 +2251,7 @@ public virtual async Task> SetT /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -2220,7 +2308,7 @@ public virtual Response SetTags(IDiction /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -2280,7 +2368,7 @@ public virtual async Task> Remo /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionCollection.cs index e42d1a48311f..9216c8d86970 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation C /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(s /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual Pageable GetAl /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -357,7 +357,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -400,7 +400,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -445,7 +445,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionResource.cs index 56db01f3bb7c..9bbcce082ff9 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServicePrivateEndpointConnectionResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(C /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingCollection.cs index 53b1a5b4fea4..157e54967a2a 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation Cr /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(st /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable G /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string trustedAccessRoleBi /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string trustedAccessRoleBindingName, Cancel /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingResource.cs index c31d699ddd30..95d0436173e4 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceTrustedAccessRoleBindingResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Ca /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceExtensions.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceExtensions.cs index 9d4c114d8c6b..3002da6fb09e 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceExtensions.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceExtensions.cs @@ -33,25 +33,6 @@ private static MockableContainerServiceSubscriptionResource GetMockableContainer return resource.GetCachedClient(client => new MockableContainerServiceSubscriptionResource(client, resource.Id)); } - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static OSOptionProfileResource GetOSOptionProfileResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableContainerServiceArmClient(client).GetOSOptionProfileResource(id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -242,6 +223,25 @@ public static ContainerServiceTrustedAccessRoleBindingResource GetContainerServi return GetMockableContainerServiceArmClient(client).GetContainerServiceTrustedAccessRoleBindingResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MachineResource GetMachineResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerServiceArmClient(client).GetMachineResource(id); + } + /// /// Gets a collection of ContainerServiceManagedClusterResources in the ResourceGroupResource. /// @@ -272,7 +272,7 @@ public static ContainerServiceManagedClusterCollection GetContainerServiceManage /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -310,7 +310,7 @@ public static async Task> GetCo /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -365,7 +365,7 @@ public static AgentPoolSnapshotCollection GetAgentPoolSnapshots(this ResourceGro /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -403,7 +403,7 @@ public static async Task> GetAgentPoolSnapsh /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -459,7 +459,7 @@ public static MeshRevisionProfileCollection GetMeshRevisionProfiles(this Subscri /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -498,7 +498,7 @@ public static async Task> GetMeshRevisionP /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -537,7 +537,7 @@ public static Response GetMeshRevisionProfile(this /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// @@ -569,7 +569,7 @@ public static async Task> GetKubernetesVer /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// @@ -601,7 +601,7 @@ public static Response GetKubernetesVersionsManaged /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -637,7 +637,7 @@ public static AsyncPageable GetContainer /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -673,7 +673,7 @@ public static Pageable GetContainerServi /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -709,7 +709,7 @@ public static AsyncPageable GetAgentPoolSnapshotsAsyn /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -745,7 +745,7 @@ public static Pageable GetAgentPoolSnapshots(this Sub /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// @@ -778,7 +778,7 @@ public static AsyncPageable GetTrustedAccessR /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceArmClient.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceArmClient.cs index 480506346597..c0488cd604fa 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceArmClient.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceArmClient.cs @@ -34,18 +34,6 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual OSOptionProfileResource GetOSOptionProfileResource(ResourceIdentifier id) - { - OSOptionProfileResource.ValidateResourceId(id); - return new OSOptionProfileResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -165,5 +153,17 @@ public virtual ContainerServiceTrustedAccessRoleBindingResource GetContainerServ ContainerServiceTrustedAccessRoleBindingResource.ValidateResourceId(id); return new ContainerServiceTrustedAccessRoleBindingResource(Client, id); } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MachineResource GetMachineResource(ResourceIdentifier id) + { + MachineResource.ValidateResourceId(id); + return new MachineResource(Client, id); + } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceResourceGroupResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceResourceGroupResource.cs index c0fa202bd1ae..979b42813c2e 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceResourceGroupResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual ContainerServiceManagedClusterCollection GetContainerServiceManag /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetC /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -122,7 +122,7 @@ public virtual AgentPoolSnapshotCollection GetAgentPoolSnapshots() /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -153,7 +153,7 @@ public virtual async Task> GetAgentPoolSnaps /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceSubscriptionResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceSubscriptionResource.cs index fadc63f13095..c0dc914584a8 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceSubscriptionResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/MockableContainerServiceSubscriptionResource.cs @@ -75,7 +75,7 @@ public virtual MeshRevisionProfileCollection GetMeshRevisionProfiles(AzureLocati /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -107,7 +107,7 @@ public virtual async Task> GetMeshRevision /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -139,7 +139,7 @@ public virtual Response GetMeshRevisionProfile(Azur /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// @@ -174,7 +174,7 @@ public virtual async Task> GetKubernetesVe /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// @@ -209,7 +209,7 @@ public virtual Response GetKubernetesVersionsManage /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -239,7 +239,7 @@ public virtual AsyncPageable GetContaine /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual Pageable GetContainerServ /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -299,7 +299,7 @@ public virtual AsyncPageable GetAgentPoolSnapshotsAsy /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -329,7 +329,7 @@ public virtual Pageable GetAgentPoolSnapshots(Cancell /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// @@ -356,7 +356,7 @@ public virtual AsyncPageable GetTrustedAccess /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineCollection.cs new file mode 100644 index 000000000000..1d8591ee1d79 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineCollection.cs @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerService +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMachines method from an instance of . + /// + public partial class MachineCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _machineClientDiagnostics; + private readonly MachinesRestOperations _machineRestClient; + + /// Initializes a new instance of the class for mocking. + protected MachineCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal MachineCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _machineClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", MachineResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MachineResource.ResourceType, out string machineApiVersion); + _machineRestClient = new MachinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, machineApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerServiceAgentPoolResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerServiceAgentPoolResource.ResourceType), nameof(id)); + } + + /// + /// Get a specific machine in the specified agent pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName} + /// + /// + /// Operation Id + /// Machines_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// host name of the machine. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string machineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var scope = _machineClientDiagnostics.CreateScope("MachineCollection.Get"); + scope.Start(); + try + { + var response = await _machineRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, machineName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a specific machine in the specified agent pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName} + /// + /// + /// Operation Id + /// Machines_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// host name of the machine. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string machineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var scope = _machineClientDiagnostics.CreateScope("MachineCollection.Get"); + scope.Start(); + try + { + var response = _machineRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, machineName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a list of machines in the specified agent pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines + /// + /// + /// Operation Id + /// Machines_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineResource(Client, MachineData.DeserializeMachineData(e)), _machineClientDiagnostics, Pipeline, "MachineCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets a list of machines in the specified agent pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines + /// + /// + /// Operation Id + /// Machines_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineResource(Client, MachineData.DeserializeMachineData(e)), _machineClientDiagnostics, Pipeline, "MachineCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName} + /// + /// + /// Operation Id + /// Machines_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// host name of the machine. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string machineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var scope = _machineClientDiagnostics.CreateScope("MachineCollection.Exists"); + scope.Start(); + try + { + var response = await _machineRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, machineName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName} + /// + /// + /// Operation Id + /// Machines_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// host name of the machine. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string machineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var scope = _machineClientDiagnostics.CreateScope("MachineCollection.Exists"); + scope.Start(); + try + { + var response = _machineRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, machineName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName} + /// + /// + /// Operation Id + /// Machines_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// host name of the machine. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string machineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var scope = _machineClientDiagnostics.CreateScope("MachineCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _machineRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, machineName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName} + /// + /// + /// Operation Id + /// Machines_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// host name of the machine. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string machineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var scope = _machineClientDiagnostics.CreateScope("MachineCollection.GetIfExists"); + scope.Start(); + try + { + var response = _machineRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, machineName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileData.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineData.Serialization.cs similarity index 64% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileData.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineData.Serialization.cs index c2dc2b9eb88a..7a291d732eb2 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileData.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineData.Serialization.cs @@ -8,7 +8,6 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; -using System.Linq; using System.Text; using System.Text.Json; using Azure.Core; @@ -17,11 +16,11 @@ namespace Azure.ResourceManager.ContainerService { - public partial class OSOptionProfileData : IUtf8JsonSerializable, IJsonModel + public partial class MachineData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -32,38 +31,33 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri /// 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(OSOptionProfileData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(MachineData)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("osOptionPropertyList"u8); - writer.WriteStartArray(); - foreach (var item in OSOptionPropertyList) + if (options.Format != "W" && Optional.IsDefined(Properties)) { - writer.WriteObjectValue(item, options); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); } - writer.WriteEndArray(); - writer.WriteEndObject(); } - OSOptionProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + MachineData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(OSOptionProfileData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(MachineData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeOSOptionProfileData(document.RootElement, options); + return DeserializeMachineData(document.RootElement, options); } - internal static OSOptionProfileData DeserializeOSOptionProfileData(JsonElement element, ModelReaderWriterOptions options = null) + internal static MachineData DeserializeMachineData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -71,15 +65,24 @@ internal static OSOptionProfileData DeserializeOSOptionProfileData(JsonElement e { return null; } + MachineProperties properties = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - IReadOnlyList osOptionPropertyList = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = MachineProperties.DeserializeMachineProperties(property.Value, options); + continue; + } if (property.NameEquals("id"u8)) { id = new ResourceIdentifier(property.Value.GetString()); @@ -104,40 +107,18 @@ internal static OSOptionProfileData DeserializeOSOptionProfileData(JsonElement e systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); continue; } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("osOptionPropertyList"u8)) - { - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(ContainerServiceOSOptionProperty.DeserializeContainerServiceOSOptionProperty(item, options)); - } - osOptionPropertyList = array; - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new OSOptionProfileData( + return new MachineData( id, name, type, systemData, - osOptionPropertyList, + properties, serializedAdditionalRawData); } @@ -175,69 +156,58 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Properties), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" id: "); + builder.Append(" properties: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(Id)) + if (Optional.IsDefined(Properties)) { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); + builder.Append(" properties: "); + BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" systemData: "); + builder.Append(" id: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(SystemData)) + if (Optional.IsDefined(Id)) { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); } } - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OSOptionPropertyList), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" osOptionPropertyList: "); + builder.Append(" systemData: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsCollectionDefined(OSOptionPropertyList)) + if (Optional.IsDefined(SystemData)) { - if (OSOptionPropertyList.Any()) - { - builder.Append(" osOptionPropertyList: "); - builder.AppendLine("["); - foreach (var item in OSOptionPropertyList) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " osOptionPropertyList: "); - } - builder.AppendLine(" ]"); - } + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); } } - builder.AppendLine(" }"); builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -246,26 +216,26 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(OSOptionProfileData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(MachineData)} does not support writing '{options.Format}' format."); } } - OSOptionProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + MachineData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeOSOptionProfileData(document.RootElement, options); + return DeserializeMachineData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(OSOptionProfileData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(MachineData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineData.cs similarity index 57% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileData.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineData.cs index 5fd0ccff4ad6..e9e90ff8d6d6 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileData.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineData.cs @@ -7,7 +7,6 @@ using System; using System.Collections.Generic; -using System.Linq; using Azure.Core; using Azure.ResourceManager.ContainerService.Models; using Azure.ResourceManager.Models; @@ -15,10 +14,10 @@ namespace Azure.ResourceManager.ContainerService { /// - /// A class representing the OSOptionProfile data model. - /// The OS option profile. + /// A class representing the Machine data model. + /// A machine. Contains details about the underlying virtual machine. A machine may be visible here but not in kubectl get nodes; if so it may be because the machine has not been registered with the Kubernetes API Server yet. /// - public partial class OSOptionProfileData : ResourceData + public partial class MachineData : ResourceData { /// /// Keeps track of any properties unknown to the library. @@ -52,36 +51,26 @@ public partial class OSOptionProfileData : ResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The list of OS options. - /// is null. - internal OSOptionProfileData(IEnumerable osOptionPropertyList) + /// Initializes a new instance of . + public MachineData() { - Argument.AssertNotNull(osOptionPropertyList, nameof(osOptionPropertyList)); - - OSOptionPropertyList = osOptionPropertyList.ToList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// The list of OS options. + /// The properties of the machine. /// Keeps track of any properties unknown to the library. - internal OSOptionProfileData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IReadOnlyList osOptionPropertyList, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal MachineData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MachineProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { - OSOptionPropertyList = osOptionPropertyList; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal OSOptionProfileData() - { - } - - /// The list of OS options. - [WirePath("properties.osOptionPropertyList")] - public IReadOnlyList OSOptionPropertyList { get; } + /// The properties of the machine. + [WirePath("properties")] + public MachineProperties Properties { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineResource.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineResource.Serialization.cs new file mode 100644 index 000000000000..53a1eacdb245 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ContainerService +{ + public partial class MachineResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MachineData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + MachineData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineResource.cs similarity index 51% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileResource.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineResource.cs index bd4c8e6a8bb9..13e899b20376 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MachineResource.cs @@ -11,56 +11,58 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; -using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.ContainerService { /// - /// A Class representing an OSOptionProfile along with the instance operations that can be performed on it. - /// If you have a you can construct an - /// from an instance of using the GetOSOptionProfileResource method. - /// Otherwise you can get one from its parent resource using the GetOSOptionProfile method. + /// A Class representing a Machine along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMachineResource method. + /// Otherwise you can get one from its parent resource using the GetMachine method. /// - public partial class OSOptionProfileResource : ArmResource + public partial class MachineResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The subscriptionId. - /// The location. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, AzureLocation location) + /// The resourceGroupName. + /// The resourceName. + /// The agentPoolName. + /// The machineName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, string machineName) { - var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default"; + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName}"; return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _osOptionProfileManagedClustersClientDiagnostics; - private readonly ManagedClustersRestOperations _osOptionProfileManagedClustersRestClient; - private readonly OSOptionProfileData _data; + private readonly ClientDiagnostics _machineClientDiagnostics; + private readonly MachinesRestOperations _machineRestClient; + private readonly MachineData _data; /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ContainerService/locations/osOptions"; + public static readonly ResourceType ResourceType = "Microsoft.ContainerService/managedClusters/agentPools/machines"; - /// Initializes a new instance of the class for mocking. - protected OSOptionProfileResource() + /// Initializes a new instance of the class for mocking. + protected MachineResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The resource that is the target of operations. - internal OSOptionProfileResource(ArmClient client, OSOptionProfileData data) : this(client, data.Id) + internal MachineResource(ArmClient client, MachineData data) : this(client, data.Id) { HasData = true; _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. - internal OSOptionProfileResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal MachineResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _osOptionProfileManagedClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string osOptionProfileManagedClustersApiVersion); - _osOptionProfileManagedClustersRestClient = new ManagedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, osOptionProfileManagedClustersApiVersion); + _machineClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string machineApiVersion); + _machineRestClient = new MachinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, machineApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -71,7 +73,7 @@ internal OSOptionProfileResource(ArmClient client, ResourceIdentifier id) : base /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual OSOptionProfileData Data + public virtual MachineData Data { get { @@ -88,38 +90,37 @@ internal static void ValidateResourceId(ResourceIdentifier id) } /// - /// Gets supported OS options in the specified subscription. + /// Get a specific machine in the specified agent pool. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName} /// /// /// Operation Id - /// ManagedClusters_GetOSOptions + /// Machines_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource - /// + /// /// /// /// - /// The resource type for which the OS options needs to be returned. /// The cancellation token to use. - public virtual async Task> GetAsync(ResourceType? resourceType = null, CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _osOptionProfileManagedClustersClientDiagnostics.CreateScope("OSOptionProfileResource.Get"); + using var scope = _machineClientDiagnostics.CreateScope("MachineResource.Get"); scope.Start(); try { - var response = await _osOptionProfileManagedClustersRestClient.GetOSOptionsAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), resourceType, cancellationToken).ConfigureAwait(false); + var response = await _machineRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new OSOptionProfileResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new MachineResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -129,38 +130,37 @@ public virtual async Task> GetAsync(ResourceTy } /// - /// Gets supported OS options in the specified subscription. + /// Get a specific machine in the specified agent pool. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName} /// /// /// Operation Id - /// ManagedClusters_GetOSOptions + /// Machines_Get /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource - /// + /// /// /// /// - /// The resource type for which the OS options needs to be returned. /// The cancellation token to use. - public virtual Response Get(ResourceType? resourceType = null, CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _osOptionProfileManagedClustersClientDiagnostics.CreateScope("OSOptionProfileResource.Get"); + using var scope = _machineClientDiagnostics.CreateScope("MachineResource.Get"); scope.Start(); try { - var response = _osOptionProfileManagedClustersRestClient.GetOSOptions(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), resourceType, cancellationToken); + var response = _machineRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new OSOptionProfileResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new MachineResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileResource.cs index ae15f4b29f21..84dab692cecc 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ManagedClusterUpgradeProfileResource.cs @@ -100,7 +100,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -140,7 +140,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileCollection.cs index 73f52e619891..6d12fdb6b04e 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileCollection.cs @@ -68,7 +68,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -158,7 +158,7 @@ public virtual Response Get(string mode, Cancellati /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -188,7 +188,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -218,7 +218,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -261,7 +261,7 @@ public virtual async Task> ExistsAsync(string mode, CancellationT /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -304,7 +304,7 @@ public virtual Response Exists(string mode, CancellationToken cancellation /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -349,7 +349,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileResource.cs index 349a3898fb10..96724b432d22 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshRevisionProfileResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cancel /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileCollection.cs index c9c2c819a366..f03be43694ed 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileCollection.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string mode, Cancellatio /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual AsyncPageable GetAllAsync(Cancellatio /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual Pageable GetAll(CancellationToken can /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -257,7 +257,7 @@ public virtual async Task> ExistsAsync(string mode, CancellationT /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -300,7 +300,7 @@ public virtual Response Exists(string mode, CancellationToken cancellation /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -345,7 +345,7 @@ public virtual async Task> GetIfExi /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileResource.cs index 84cce4083213..ed3f729a71e3 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/MeshUpgradeProfileResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cancell /// /// /// Default Api Version - /// 2023-10-01 + /// 2024-09-01 /// /// /// Resource diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworking.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworking.Serialization.cs new file mode 100644 index 000000000000..9b222bff32e2 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworking.Serialization.cs @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + public partial class AdvancedNetworking : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AdvancedNetworking)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled.Value); + } + if (Optional.IsDefined(Observability)) + { + writer.WritePropertyName("observability"u8); + writer.WriteObjectValue(Observability, options); + } + if (Optional.IsDefined(Security)) + { + writer.WritePropertyName("security"u8); + writer.WriteObjectValue(Security, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AdvancedNetworking IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AdvancedNetworking)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAdvancedNetworking(document.RootElement, options); + } + + internal static AdvancedNetworking DeserializeAdvancedNetworking(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enabled = default; + AdvancedNetworkingObservability observability = default; + AdvancedNetworkingSecurity security = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("observability"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + observability = AdvancedNetworkingObservability.DeserializeAdvancedNetworkingObservability(property.Value, options); + continue; + } + if (property.NameEquals("security"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + security = AdvancedNetworkingSecurity.DeserializeAdvancedNetworkingSecurity(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AdvancedNetworking(enabled, observability, security, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Enabled), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enabled: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Enabled)) + { + builder.Append(" enabled: "); + var boolValue = Enabled.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("ObservabilityEnabled", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" observability: "); + builder.AppendLine("{"); + builder.Append(" enabled: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Observability)) + { + builder.Append(" observability: "); + BicepSerializationHelpers.AppendChildObject(builder, Observability, options, 2, false, " observability: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("SecurityEnabled", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" security: "); + builder.AppendLine("{"); + builder.Append(" enabled: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Security)) + { + builder.Append(" security: "); + BicepSerializationHelpers.AppendChildObject(builder, Security, options, 2, false, " security: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(AdvancedNetworking)} does not support writing '{options.Format}' format."); + } + } + + AdvancedNetworking IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAdvancedNetworking(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AdvancedNetworking)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworking.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworking.cs new file mode 100644 index 000000000000..0b5ddf543d3b --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworking.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// Advanced Networking profile for enabling observability and security feature suite on a cluster. For more information see aka.ms/aksadvancednetworking. + public partial class AdvancedNetworking + { + /// + /// 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; + + /// Initializes a new instance of . + public AdvancedNetworking() + { + } + + /// Initializes a new instance of . + /// Indicates the enablement of Advanced Networking functionalities of observability and security on AKS clusters. When this is set to true, all observability and security features will be set to enabled unless explicitly disabled. If not specified, the default is false. + /// Observability profile to enable advanced network metrics and flow logs with historical contexts. + /// Security profile to enable security features on cilium based cluster. + /// Keeps track of any properties unknown to the library. + internal AdvancedNetworking(bool? enabled, AdvancedNetworkingObservability observability, AdvancedNetworkingSecurity security, IDictionary serializedAdditionalRawData) + { + Enabled = enabled; + Observability = observability; + Security = security; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Indicates the enablement of Advanced Networking functionalities of observability and security on AKS clusters. When this is set to true, all observability and security features will be set to enabled unless explicitly disabled. If not specified, the default is false. + [WirePath("enabled")] + public bool? Enabled { get; set; } + /// Observability profile to enable advanced network metrics and flow logs with historical contexts. + internal AdvancedNetworkingObservability Observability { get; set; } + /// Indicates the enablement of Advanced Networking observability functionalities on clusters. + [WirePath("observability.enabled")] + public bool? ObservabilityEnabled + { + get => Observability is null ? default : Observability.Enabled; + set + { + if (Observability is null) + Observability = new AdvancedNetworkingObservability(); + Observability.Enabled = value; + } + } + + /// Security profile to enable security features on cilium based cluster. + internal AdvancedNetworkingSecurity Security { get; set; } + /// This feature allows user to configure network policy based on DNS (FQDN) names. It can be enabled only on cilium based clusters. If not specified, the default is false. + [WirePath("security.enabled")] + public bool? SecurityEnabled + { + get => Security is null ? default : Security.Enabled; + set + { + if (Security is null) + Security = new AdvancedNetworkingSecurity(); + Security.Enabled = value; + } + } + } +} diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/AccessPolicyAssignmentPropertiesUser.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworkingObservability.Serialization.cs similarity index 59% rename from sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/AccessPolicyAssignmentPropertiesUser.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworkingObservability.Serialization.cs index 3ce19c3df7d3..ed3e028a0133 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/AccessPolicyAssignmentPropertiesUser.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworkingObservability.Serialization.cs @@ -12,13 +12,13 @@ using System.Text.Json; using Azure.Core; -namespace Azure.ResourceManager.RedisEnterprise.Models +namespace Azure.ResourceManager.ContainerService.Models { - internal partial class AccessPolicyAssignmentPropertiesUser : IUtf8JsonSerializable, IJsonModel + internal partial class AdvancedNetworkingObservability : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -29,16 +29,16 @@ 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AccessPolicyAssignmentPropertiesUser)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(AdvancedNetworkingObservability)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ObjectId)) + if (Optional.IsDefined(Enabled)) { - writer.WritePropertyName("objectId"u8); - writer.WriteStringValue(ObjectId.Value); + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled.Value); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -57,19 +57,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AccessPolicyAssignmentPropertiesUser IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AdvancedNetworkingObservability IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AccessPolicyAssignmentPropertiesUser)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(AdvancedNetworkingObservability)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAccessPolicyAssignmentPropertiesUser(document.RootElement, options); + return DeserializeAdvancedNetworkingObservability(document.RootElement, options); } - internal static AccessPolicyAssignmentPropertiesUser DeserializeAccessPolicyAssignmentPropertiesUser(JsonElement element, ModelReaderWriterOptions options = null) + internal static AdvancedNetworkingObservability DeserializeAdvancedNetworkingObservability(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -77,18 +77,18 @@ internal static AccessPolicyAssignmentPropertiesUser DeserializeAccessPolicyAssi { return null; } - Guid? objectId = default; + bool? enabled = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("objectId"u8)) + if (property.NameEquals("enabled"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - objectId = property.Value.GetGuid(); + enabled = property.Value.GetBoolean(); continue; } if (options.Format != "W") @@ -97,7 +97,7 @@ internal static AccessPolicyAssignmentPropertiesUser DeserializeAccessPolicyAssi } } serializedAdditionalRawData = rawDataDictionary; - return new AccessPolicyAssignmentPropertiesUser(objectId, serializedAdditionalRawData); + return new AdvancedNetworkingObservability(enabled, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -111,18 +111,19 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.AppendLine("{"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ObjectId), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Enabled), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" objectId: "); + builder.Append(" enabled: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(ObjectId)) + if (Optional.IsDefined(Enabled)) { - builder.Append(" objectId: "); - builder.AppendLine($"'{ObjectId.Value.ToString()}'"); + builder.Append(" enabled: "); + var boolValue = Enabled.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); } } @@ -130,9 +131,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -141,26 +142,26 @@ BinaryData IPersistableModel.Write(ModelRe case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(AccessPolicyAssignmentPropertiesUser)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(AdvancedNetworkingObservability)} does not support writing '{options.Format}' format."); } } - AccessPolicyAssignmentPropertiesUser IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + AdvancedNetworkingObservability IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAccessPolicyAssignmentPropertiesUser(document.RootElement, options); + return DeserializeAdvancedNetworkingObservability(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AccessPolicyAssignmentPropertiesUser)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(AdvancedNetworkingObservability)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/AccessPolicyAssignmentPropertiesUser.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworkingObservability.cs similarity index 69% rename from sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/AccessPolicyAssignmentPropertiesUser.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworkingObservability.cs index 6495b3828528..0a21cd603df1 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/AccessPolicyAssignmentPropertiesUser.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworkingObservability.cs @@ -8,10 +8,10 @@ using System; using System.Collections.Generic; -namespace Azure.ResourceManager.RedisEnterprise.Models +namespace Azure.ResourceManager.ContainerService.Models { - /// The user associated with the access policy. - internal partial class AccessPolicyAssignmentPropertiesUser + /// Observability profile to enable advanced network metrics and flow logs with historical contexts. + internal partial class AdvancedNetworkingObservability { /// /// Keeps track of any properties unknown to the library. @@ -45,22 +45,22 @@ internal partial class AccessPolicyAssignmentPropertiesUser /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public AccessPolicyAssignmentPropertiesUser() + /// Initializes a new instance of . + public AdvancedNetworkingObservability() { } - /// Initializes a new instance of . - /// The object ID of the user. + /// Initializes a new instance of . + /// Indicates the enablement of Advanced Networking observability functionalities on clusters. /// Keeps track of any properties unknown to the library. - internal AccessPolicyAssignmentPropertiesUser(Guid? objectId, IDictionary serializedAdditionalRawData) + internal AdvancedNetworkingObservability(bool? enabled, IDictionary serializedAdditionalRawData) { - ObjectId = objectId; + Enabled = enabled; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The object ID of the user. - [WirePath("objectId")] - public Guid? ObjectId { get; set; } + /// Indicates the enablement of Advanced Networking observability functionalities on clusters. + [WirePath("enabled")] + public bool? Enabled { get; set; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworkingSecurity.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworkingSecurity.Serialization.cs new file mode 100644 index 000000000000..9fd32b73d5e5 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworkingSecurity.Serialization.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + internal partial class AdvancedNetworkingSecurity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AdvancedNetworkingSecurity)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AdvancedNetworkingSecurity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AdvancedNetworkingSecurity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAdvancedNetworkingSecurity(document.RootElement, options); + } + + internal static AdvancedNetworkingSecurity DeserializeAdvancedNetworkingSecurity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AdvancedNetworkingSecurity(enabled, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Enabled), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enabled: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Enabled)) + { + builder.Append(" enabled: "); + var boolValue = Enabled.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(AdvancedNetworkingSecurity)} does not support writing '{options.Format}' format."); + } + } + + AdvancedNetworkingSecurity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAdvancedNetworkingSecurity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AdvancedNetworkingSecurity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworkingSecurity.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworkingSecurity.cs new file mode 100644 index 000000000000..aba4e57922b4 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AdvancedNetworkingSecurity.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// Security profile to enable security features on cilium based cluster. + internal partial class AdvancedNetworkingSecurity + { + /// + /// 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; + + /// Initializes a new instance of . + public AdvancedNetworkingSecurity() + { + } + + /// Initializes a new instance of . + /// This feature allows user to configure network policy based on DNS (FQDN) names. It can be enabled only on cilium based clusters. If not specified, the default is false. + /// Keeps track of any properties unknown to the library. + internal AdvancedNetworkingSecurity(bool? enabled, IDictionary serializedAdditionalRawData) + { + Enabled = enabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// This feature allows user to configure network policy based on DNS (FQDN) names. It can be enabled only on cilium based clusters. If not specified, the default is false. + [WirePath("enabled")] + public bool? Enabled { get; set; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolDeleteMachinesParameter.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolDeleteMachinesParameter.Serialization.cs new file mode 100644 index 000000000000..d59dc3250de7 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolDeleteMachinesParameter.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + public partial class AgentPoolDeleteMachinesParameter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AgentPoolDeleteMachinesParameter)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("machineNames"u8); + writer.WriteStartArray(); + foreach (var item in MachineNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AgentPoolDeleteMachinesParameter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AgentPoolDeleteMachinesParameter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAgentPoolDeleteMachinesParameter(document.RootElement, options); + } + + internal static AgentPoolDeleteMachinesParameter DeserializeAgentPoolDeleteMachinesParameter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList machineNames = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("machineNames"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + machineNames = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AgentPoolDeleteMachinesParameter(machineNames, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AgentPoolDeleteMachinesParameter)} does not support writing '{options.Format}' format."); + } + } + + AgentPoolDeleteMachinesParameter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAgentPoolDeleteMachinesParameter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AgentPoolDeleteMachinesParameter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolDeleteMachinesParameter.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolDeleteMachinesParameter.cs new file mode 100644 index 000000000000..8a2f8c563cac --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolDeleteMachinesParameter.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// Specifies a list of machine names from the agent pool to be deleted. + public partial class AgentPoolDeleteMachinesParameter + { + /// + /// 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; + + /// Initializes a new instance of . + /// The agent pool machine names. + /// is null. + public AgentPoolDeleteMachinesParameter(IEnumerable machineNames) + { + Argument.AssertNotNull(machineNames, nameof(machineNames)); + + MachineNames = machineNames.ToList(); + } + + /// Initializes a new instance of . + /// The agent pool machine names. + /// Keeps track of any properties unknown to the library. + internal AgentPoolDeleteMachinesParameter(IList machineNames, IDictionary serializedAdditionalRawData) + { + MachineNames = machineNames; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AgentPoolDeleteMachinesParameter() + { + } + + /// The agent pool machine names. + [WirePath("machineNames")] + public IList MachineNames { get; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSecurityProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSecurityProfile.Serialization.cs new file mode 100644 index 000000000000..65412e813e19 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSecurityProfile.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + public partial class AgentPoolSecurityProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AgentPoolSecurityProfile)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(EnableVtpm)) + { + writer.WritePropertyName("enableVTPM"u8); + writer.WriteBooleanValue(EnableVtpm.Value); + } + if (Optional.IsDefined(EnableSecureBoot)) + { + writer.WritePropertyName("enableSecureBoot"u8); + writer.WriteBooleanValue(EnableSecureBoot.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AgentPoolSecurityProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AgentPoolSecurityProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAgentPoolSecurityProfile(document.RootElement, options); + } + + internal static AgentPoolSecurityProfile DeserializeAgentPoolSecurityProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enableVTPM = default; + bool? enableSecureBoot = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enableVTPM"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableVTPM = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enableSecureBoot"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableSecureBoot = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AgentPoolSecurityProfile(enableVTPM, enableSecureBoot, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableVtpm), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enableVTPM: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(EnableVtpm)) + { + builder.Append(" enableVTPM: "); + var boolValue = EnableVtpm.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableSecureBoot), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enableSecureBoot: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(EnableSecureBoot)) + { + builder.Append(" enableSecureBoot: "); + var boolValue = EnableSecureBoot.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(AgentPoolSecurityProfile)} does not support writing '{options.Format}' format."); + } + } + + AgentPoolSecurityProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAgentPoolSecurityProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AgentPoolSecurityProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSecurityProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSecurityProfile.cs new file mode 100644 index 000000000000..058d79bbaef3 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolSecurityProfile.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// The security settings of an agent pool. + public partial class AgentPoolSecurityProfile + { + /// + /// 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; + + /// Initializes a new instance of . + public AgentPoolSecurityProfile() + { + } + + /// Initializes a new instance of . + /// vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the node. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + /// Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + /// Keeps track of any properties unknown to the library. + internal AgentPoolSecurityProfile(bool? enableVtpm, bool? enableSecureBoot, IDictionary serializedAdditionalRawData) + { + EnableVtpm = enableVtpm; + EnableSecureBoot = enableSecureBoot; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the node. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + [WirePath("enableVTPM")] + public bool? EnableVtpm { get; set; } + /// Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + [WirePath("enableSecureBoot")] + public bool? EnableSecureBoot { get; set; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.Serialization.cs index aec1ab565325..ae5dab94c4b9 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.Serialization.cs @@ -45,6 +45,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("drainTimeoutInMinutes"u8); writer.WriteNumberValue(DrainTimeoutInMinutes.Value); } + if (Optional.IsDefined(NodeSoakDurationInMinutes)) + { + writer.WritePropertyName("nodeSoakDurationInMinutes"u8); + writer.WriteNumberValue(NodeSoakDurationInMinutes.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -84,6 +89,7 @@ internal static AgentPoolUpgradeSettings DeserializeAgentPoolUpgradeSettings(Jso } string maxSurge = default; int? drainTimeoutInMinutes = default; + int? nodeSoakDurationInMinutes = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -102,13 +108,22 @@ internal static AgentPoolUpgradeSettings DeserializeAgentPoolUpgradeSettings(Jso drainTimeoutInMinutes = property.Value.GetInt32(); continue; } + if (property.NameEquals("nodeSoakDurationInMinutes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nodeSoakDurationInMinutes = property.Value.GetInt32(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new AgentPoolUpgradeSettings(maxSurge, drainTimeoutInMinutes, serializedAdditionalRawData); + return new AgentPoolUpgradeSettings(maxSurge, drainTimeoutInMinutes, nodeSoakDurationInMinutes, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -160,6 +175,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NodeSoakDurationInMinutes), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nodeSoakDurationInMinutes: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NodeSoakDurationInMinutes)) + { + builder.Append(" nodeSoakDurationInMinutes: "); + builder.AppendLine($"{NodeSoakDurationInMinutes.Value}"); + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.cs index a57cb99ed6af..ee1acfa33829 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolUpgradeSettings.cs @@ -53,11 +53,13 @@ public AgentPoolUpgradeSettings() /// Initializes a new instance of . /// This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. /// The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is 30 minutes. + /// The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. If not specified, the default is 0 minutes. /// Keeps track of any properties unknown to the library. - internal AgentPoolUpgradeSettings(string maxSurge, int? drainTimeoutInMinutes, IDictionary serializedAdditionalRawData) + internal AgentPoolUpgradeSettings(string maxSurge, int? drainTimeoutInMinutes, int? nodeSoakDurationInMinutes, IDictionary serializedAdditionalRawData) { MaxSurge = maxSurge; DrainTimeoutInMinutes = drainTimeoutInMinutes; + NodeSoakDurationInMinutes = nodeSoakDurationInMinutes; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -67,5 +69,8 @@ internal AgentPoolUpgradeSettings(string maxSurge, int? drainTimeoutInMinutes, I /// The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is 30 minutes. [WirePath("drainTimeoutInMinutes")] public int? DrainTimeoutInMinutes { get; set; } + /// The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. If not specified, the default is 0 minutes. + [WirePath("nodeSoakDurationInMinutes")] + public int? NodeSoakDurationInMinutes { get; set; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolWindowsProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolWindowsProfile.Serialization.cs new file mode 100644 index 000000000000..767891d52ca0 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolWindowsProfile.Serialization.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + internal partial class AgentPoolWindowsProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AgentPoolWindowsProfile)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DisableOutboundNat)) + { + writer.WritePropertyName("disableOutboundNat"u8); + writer.WriteBooleanValue(DisableOutboundNat.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AgentPoolWindowsProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AgentPoolWindowsProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAgentPoolWindowsProfile(document.RootElement, options); + } + + internal static AgentPoolWindowsProfile DeserializeAgentPoolWindowsProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? disableOutboundNat = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("disableOutboundNat"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + disableOutboundNat = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AgentPoolWindowsProfile(disableOutboundNat, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DisableOutboundNat), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" disableOutboundNat: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DisableOutboundNat)) + { + builder.Append(" disableOutboundNat: "); + var boolValue = DisableOutboundNat.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(AgentPoolWindowsProfile)} does not support writing '{options.Format}' format."); + } + } + + AgentPoolWindowsProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAgentPoolWindowsProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AgentPoolWindowsProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolWindowsProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolWindowsProfile.cs new file mode 100644 index 000000000000..f22bc75ada64 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/AgentPoolWindowsProfile.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// The Windows agent pool's specific profile. + internal partial class AgentPoolWindowsProfile + { + /// + /// 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; + + /// Initializes a new instance of . + public AgentPoolWindowsProfile() + { + } + + /// Initializes a new instance of . + /// The default value is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows agent pool does not have node public IP enabled. + /// Keeps track of any properties unknown to the library. + internal AgentPoolWindowsProfile(bool? disableOutboundNat, IDictionary serializedAdditionalRawData) + { + DisableOutboundNat = disableOutboundNat; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The default value is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows agent pool does not have node public IP enabled. + [WirePath("disableOutboundNat")] + public bool? DisableOutboundNat { get; set; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPolicy.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPolicy.cs index 1c5d4ee4d4a2..def12ed901ee 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPolicy.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkPolicy.cs @@ -22,10 +22,13 @@ public ContainerServiceNetworkPolicy(string value) _value = value ?? throw new ArgumentNullException(nameof(value)); } + private const string NoneValue = "none"; private const string CalicoValue = "calico"; private const string AzureValue = "azure"; private const string CiliumValue = "cilium"; + /// Network policies will not be enforced. This is the default value when NetworkPolicy is not specified. + public static ContainerServiceNetworkPolicy None { get; } = new ContainerServiceNetworkPolicy(NoneValue); /// Use Calico network policies. See [differences between Azure and Calico policies](https://docs.microsoft.com/azure/aks/use-network-policies#differences-between-azure-and-calico-policies-and-their-capabilities) for more information. public static ContainerServiceNetworkPolicy Calico { get; } = new ContainerServiceNetworkPolicy(CalicoValue); /// Use Azure network policies. See [differences between Azure and Calico policies](https://docs.microsoft.com/azure/aks/use-network-policies#differences-between-azure-and-calico-policies-and-their-capabilities) for more information. diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.Serialization.cs index 9c13ae4250df..74e478aa45bb 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.Serialization.cs @@ -61,6 +61,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("networkDataplane"u8); writer.WriteStringValue(NetworkDataplane.Value.ToString()); } + if (Optional.IsDefined(AdvancedNetworking)) + { + writer.WritePropertyName("advancedNetworking"u8); + writer.WriteObjectValue(AdvancedNetworking, options); + } if (Optional.IsDefined(PodCidr)) { writer.WritePropertyName("podCidr"u8); @@ -168,6 +173,7 @@ internal static ContainerServiceNetworkProfile DeserializeContainerServiceNetwor ContainerServiceNetworkPolicy? networkPolicy = default; ContainerServiceNetworkMode? networkMode = default; NetworkDataplane? networkDataplane = default; + AdvancedNetworking advancedNetworking = default; string podCidr = default; string serviceCidr = default; string dnsServiceIP = default; @@ -227,6 +233,15 @@ internal static ContainerServiceNetworkProfile DeserializeContainerServiceNetwor networkDataplane = new NetworkDataplane(property.Value.GetString()); continue; } + if (property.NameEquals("advancedNetworking"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + advancedNetworking = AdvancedNetworking.DeserializeAdvancedNetworking(property.Value, options); + continue; + } if (property.NameEquals("podCidr"u8)) { podCidr = property.Value.GetString(); @@ -332,6 +347,7 @@ internal static ContainerServiceNetworkProfile DeserializeContainerServiceNetwor networkPolicy, networkMode, networkDataplane, + advancedNetworking, podCidr, serviceCidr, dnsServiceIP, @@ -431,6 +447,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AdvancedNetworking), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" advancedNetworking: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AdvancedNetworking)) + { + builder.Append(" advancedNetworking: "); + BicepSerializationHelpers.AppendChildObject(builder, AdvancedNetworking, options, 2, false, " advancedNetworking: "); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PodCidr), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs index 81d5eb5c1e36..ca25b5e02ba0 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs @@ -59,6 +59,7 @@ public ContainerServiceNetworkProfile() /// Network policy used for building the Kubernetes network. /// This cannot be specified if networkPlugin is anything other than 'azure'. /// Network dataplane used in the Kubernetes cluster. + /// Advanced Networking profile for enabling observability and security feature suite on a cluster. For more information see aka.ms/aksadvancednetworking. /// A CIDR notation IP range from which to assign pod IPs when kubenet is used. /// A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. /// An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. @@ -70,13 +71,14 @@ public ContainerServiceNetworkProfile() /// One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. They must not overlap with any Subnet IP ranges. /// IP families are used to determine single-stack or dual-stack clusters. For single-stack, the expected value is IPv4. For dual-stack, the expected values are IPv4 and IPv6. /// Keeps track of any properties unknown to the library. - internal ContainerServiceNetworkProfile(ContainerServiceNetworkPlugin? networkPlugin, ContainerServiceNetworkPluginMode? networkPluginMode, ContainerServiceNetworkPolicy? networkPolicy, ContainerServiceNetworkMode? networkMode, NetworkDataplane? networkDataplane, string podCidr, string serviceCidr, string dnsServiceIP, ContainerServiceOutboundType? outboundType, ContainerServiceLoadBalancerSku? loadBalancerSku, ManagedClusterLoadBalancerProfile loadBalancerProfile, ManagedClusterNatGatewayProfile natGatewayProfile, IList podCidrs, IList serviceCidrs, IList ipFamilies, IDictionary serializedAdditionalRawData) + internal ContainerServiceNetworkProfile(ContainerServiceNetworkPlugin? networkPlugin, ContainerServiceNetworkPluginMode? networkPluginMode, ContainerServiceNetworkPolicy? networkPolicy, ContainerServiceNetworkMode? networkMode, NetworkDataplane? networkDataplane, AdvancedNetworking advancedNetworking, string podCidr, string serviceCidr, string dnsServiceIP, ContainerServiceOutboundType? outboundType, ContainerServiceLoadBalancerSku? loadBalancerSku, ManagedClusterLoadBalancerProfile loadBalancerProfile, ManagedClusterNatGatewayProfile natGatewayProfile, IList podCidrs, IList serviceCidrs, IList ipFamilies, IDictionary serializedAdditionalRawData) { NetworkPlugin = networkPlugin; NetworkPluginMode = networkPluginMode; NetworkPolicy = networkPolicy; NetworkMode = networkMode; NetworkDataplane = networkDataplane; + AdvancedNetworking = advancedNetworking; PodCidr = podCidr; ServiceCidr = serviceCidr; DnsServiceIP = dnsServiceIP; @@ -105,6 +107,9 @@ internal ContainerServiceNetworkProfile(ContainerServiceNetworkPlugin? networkPl /// Network dataplane used in the Kubernetes cluster. [WirePath("networkDataplane")] public NetworkDataplane? NetworkDataplane { get; set; } + /// Advanced Networking profile for enabling observability and security feature suite on a cluster. For more information see aka.ms/aksadvancednetworking. + [WirePath("advancedNetworking")] + public AdvancedNetworking AdvancedNetworking { get; set; } /// A CIDR notation IP range from which to assign pod IPs when kubenet is used. [WirePath("podCidr")] public string PodCidr { get; set; } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.Serialization.cs index 02b819db69dc..404b9c3465a5 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.Serialization.cs @@ -8,7 +8,6 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; -using System.Linq; using System.Text; using System.Text.Json; using Azure.Core; @@ -38,17 +37,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("enabled"u8); writer.WriteBooleanValue(IsEnabled); - if (Optional.IsCollectionDefined(NodeSelector)) - { - writer.WritePropertyName("nodeSelector"u8); - writer.WriteStartObject(); - foreach (var item in NodeSelector) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -87,7 +75,6 @@ internal static IstioEgressGateway DeserializeIstioEgressGateway(JsonElement ele return null; } bool enabled = default; - IDictionary nodeSelector = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -97,27 +84,13 @@ internal static IstioEgressGateway DeserializeIstioEgressGateway(JsonElement ele enabled = property.Value.GetBoolean(); continue; } - if (property.NameEquals("nodeSelector"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()); - } - nodeSelector = dictionary; - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new IstioEgressGateway(enabled, nodeSelector ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + return new IstioEgressGateway(enabled, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -144,43 +117,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.AppendLine($"{boolValue}"); } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NodeSelector), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" nodeSelector: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(NodeSelector)) - { - if (NodeSelector.Any()) - { - builder.Append(" nodeSelector: "); - builder.AppendLine("{"); - foreach (var item in NodeSelector) - { - builder.Append($" '{item.Key}': "); - if (item.Value == null) - { - builder.Append("null"); - continue; - } - if (item.Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{item.Value}'''"); - } - else - { - builder.AppendLine($"'{item.Value}'"); - } - } - builder.AppendLine(" }"); - } - } - } - builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.cs index c58b696e03c7..a432004c3b86 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/IstioEgressGateway.cs @@ -50,17 +50,14 @@ public partial class IstioEgressGateway public IstioEgressGateway(bool isEnabled) { IsEnabled = isEnabled; - NodeSelector = new ChangeTrackingDictionary(); } /// Initializes a new instance of . /// Whether to enable the egress gateway. - /// NodeSelector for scheduling the egress gateway. /// Keeps track of any properties unknown to the library. - internal IstioEgressGateway(bool isEnabled, IDictionary nodeSelector, IDictionary serializedAdditionalRawData) + internal IstioEgressGateway(bool isEnabled, IDictionary serializedAdditionalRawData) { IsEnabled = isEnabled; - NodeSelector = nodeSelector; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -72,8 +69,5 @@ internal IstioEgressGateway() /// Whether to enable the egress gateway. [WirePath("enabled")] public bool IsEnabled { get; set; } - /// NodeSelector for scheduling the egress gateway. - [WirePath("nodeSelector")] - public IDictionary NodeSelector { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.Serialization.cs index 96b1eb4bbfca..cfa513f3d664 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.Serialization.cs @@ -46,6 +46,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("capabilities"u8); writer.WriteObjectValue(Capabilities, options); } + if (Optional.IsDefined(IsDefault)) + { + writer.WritePropertyName("isDefault"u8); + writer.WriteBooleanValue(IsDefault.Value); + } if (Optional.IsDefined(IsPreview)) { writer.WritePropertyName("isPreview"u8); @@ -101,6 +106,7 @@ internal static KubernetesVersion DeserializeKubernetesVersion(JsonElement eleme } string version = default; KubernetesVersionCapabilities capabilities = default; + bool? isDefault = default; bool? isPreview = default; IReadOnlyDictionary patchVersions = default; IDictionary serializedAdditionalRawData = default; @@ -121,6 +127,15 @@ internal static KubernetesVersion DeserializeKubernetesVersion(JsonElement eleme capabilities = KubernetesVersionCapabilities.DeserializeKubernetesVersionCapabilities(property.Value, options); continue; } + if (property.NameEquals("isDefault"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDefault = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("isPreview"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -150,7 +165,13 @@ internal static KubernetesVersion DeserializeKubernetesVersion(JsonElement eleme } } serializedAdditionalRawData = rawDataDictionary; - return new KubernetesVersion(version, capabilities, isPreview, patchVersions ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + return new KubernetesVersion( + version, + capabilities, + isDefault, + isPreview, + patchVersions ?? new ChangeTrackingDictionary(), + serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -205,6 +226,22 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsDefault), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" isDefault: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IsDefault)) + { + builder.Append(" isDefault: "); + var boolValue = IsDefault.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsPreview), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.cs index 1eedcc878d7c..b7a4c82e4848 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/KubernetesVersion.cs @@ -54,13 +54,15 @@ internal KubernetesVersion() /// Initializes a new instance of . /// major.minor version of Kubernetes release. /// Capabilities on this Kubernetes version. + /// Whether this version is default. /// Whether this version is in preview mode. /// Patch versions of Kubernetes release. /// Keeps track of any properties unknown to the library. - internal KubernetesVersion(string version, KubernetesVersionCapabilities capabilities, bool? isPreview, IReadOnlyDictionary patchVersions, IDictionary serializedAdditionalRawData) + internal KubernetesVersion(string version, KubernetesVersionCapabilities capabilities, bool? isDefault, bool? isPreview, IReadOnlyDictionary patchVersions, IDictionary serializedAdditionalRawData) { Version = version; Capabilities = capabilities; + IsDefault = isDefault; IsPreview = isPreview; PatchVersions = patchVersions; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -78,6 +80,9 @@ public IReadOnlyList CapabilitiesSupportPlan get => Capabilities?.SupportPlan; } + /// Whether this version is default. + [WirePath("isDefault")] + public bool? IsDefault { get; } /// Whether this version is in preview mode. [WirePath("isPreview")] public bool? IsPreview { get; } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSOptionProperty.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineIPAddress.Serialization.cs similarity index 57% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSOptionProperty.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineIPAddress.Serialization.cs index 8843dd9a5ffa..abd3acb95c8a 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSOptionProperty.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineIPAddress.Serialization.cs @@ -14,11 +14,11 @@ namespace Azure.ResourceManager.ContainerService.Models { - public partial class ContainerServiceOSOptionProperty : IUtf8JsonSerializable, IJsonModel + public partial class MachineIPAddress : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -29,16 +29,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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceOSOptionProperty)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(MachineIPAddress)} does not support writing '{format}' format."); } - writer.WritePropertyName("os-type"u8); - writer.WriteStringValue(OSType); - writer.WritePropertyName("enable-fips-image"u8); - writer.WriteBooleanValue(EnableFipsImage); + if (options.Format != "W" && Optional.IsDefined(Family)) + { + writer.WritePropertyName("family"u8); + writer.WriteStringValue(Family.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(IP)) + { + writer.WritePropertyName("ip"u8); + writer.WriteStringValue(IP); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -56,19 +62,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ContainerServiceOSOptionProperty IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + MachineIPAddress IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ContainerServiceOSOptionProperty)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(MachineIPAddress)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContainerServiceOSOptionProperty(document.RootElement, options); + return DeserializeMachineIPAddress(document.RootElement, options); } - internal static ContainerServiceOSOptionProperty DeserializeContainerServiceOSOptionProperty(JsonElement element, ModelReaderWriterOptions options = null) + internal static MachineIPAddress DeserializeMachineIPAddress(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -76,20 +82,24 @@ internal static ContainerServiceOSOptionProperty DeserializeContainerServiceOSOp { return null; } - string osType = default; - bool enableFipsImage = default; + IPFamily? family = default; + string ip = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("os-type"u8)) + if (property.NameEquals("family"u8)) { - osType = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + family = new IPFamily(property.Value.GetString()); continue; } - if (property.NameEquals("enable-fips-image"u8)) + if (property.NameEquals("ip"u8)) { - enableFipsImage = property.Value.GetBoolean(); + ip = property.Value.GetString(); continue; } if (options.Format != "W") @@ -98,7 +108,7 @@ internal static ContainerServiceOSOptionProperty DeserializeContainerServiceOSOp } } serializedAdditionalRawData = rawDataDictionary; - return new ContainerServiceOSOptionProperty(osType, enableFipsImage, serializedAdditionalRawData); + return new MachineIPAddress(family, ip, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -112,49 +122,51 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.AppendLine("{"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OSType), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Family), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" os-type: "); + builder.Append(" family: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(OSType)) + if (Optional.IsDefined(Family)) { - builder.Append(" os-type: "); - if (OSType.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{OSType}'''"); - } - else - { - builder.AppendLine($"'{OSType}'"); - } + builder.Append(" family: "); + builder.AppendLine($"'{Family.Value.ToString()}'"); } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableFipsImage), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IP), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" enable-fips-image: "); + builder.Append(" ip: "); builder.AppendLine(propertyOverride); } else { - builder.Append(" enable-fips-image: "); - var boolValue = EnableFipsImage == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); + if (Optional.IsDefined(IP)) + { + builder.Append(" ip: "); + if (IP.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{IP}'''"); + } + else + { + builder.AppendLine($"'{IP}'"); + } + } } builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -163,26 +175,26 @@ BinaryData IPersistableModel.Write(ModelReader case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(ContainerServiceOSOptionProperty)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(MachineIPAddress)} does not support writing '{options.Format}' format."); } } - ContainerServiceOSOptionProperty IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + MachineIPAddress IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContainerServiceOSOptionProperty(document.RootElement, options); + return DeserializeMachineIPAddress(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ContainerServiceOSOptionProperty)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(MachineIPAddress)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineIPAddress.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineIPAddress.cs new file mode 100644 index 000000000000..a23d7fb7aa6a --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineIPAddress.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// The machine IP address details. + public partial class MachineIPAddress + { + /// + /// 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; + + /// Initializes a new instance of . + internal MachineIPAddress() + { + } + + /// Initializes a new instance of . + /// To determine if address belongs IPv4 or IPv6 family. + /// IPv4 or IPv6 address of the machine. + /// Keeps track of any properties unknown to the library. + internal MachineIPAddress(IPFamily? family, string ip, IDictionary serializedAdditionalRawData) + { + Family = family; + IP = ip; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// To determine if address belongs IPv4 or IPv6 family. + [WirePath("family")] + public IPFamily? Family { get; } + /// IPv4 or IPv6 address of the machine. + [WirePath("ip")] + public string IP { get; } + } +} diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/AccessPolicyAssignmentList.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineListResult.Serialization.cs similarity index 68% rename from sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/AccessPolicyAssignmentList.Serialization.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineListResult.Serialization.cs index b54aa8084cf1..c0e170dc6090 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/AccessPolicyAssignmentList.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineListResult.Serialization.cs @@ -13,13 +13,13 @@ using System.Text.Json; using Azure.Core; -namespace Azure.ResourceManager.RedisEnterprise.Models +namespace Azure.ResourceManager.ContainerService.Models { - internal partial class AccessPolicyAssignmentList : IUtf8JsonSerializable, IJsonModel + internal partial class MachineListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -30,12 +30,17 @@ 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AccessPolicyAssignmentList)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(MachineListResult)} does not support writing '{format}' format."); } + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -46,11 +51,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndArray(); } - if (options.Format != "W" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -68,19 +68,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AccessPolicyAssignmentList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + MachineListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AccessPolicyAssignmentList)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(MachineListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAccessPolicyAssignmentList(document.RootElement, options); + return DeserializeMachineListResult(document.RootElement, options); } - internal static AccessPolicyAssignmentList DeserializeAccessPolicyAssignmentList(JsonElement element, ModelReaderWriterOptions options = null) + internal static MachineListResult DeserializeMachineListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -88,38 +88,42 @@ internal static AccessPolicyAssignmentList DeserializeAccessPolicyAssignmentList { return null; } - IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; + IReadOnlyList value = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } if (property.NameEquals("value"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(AccessPolicyAssignmentData.DeserializeAccessPolicyAssignmentData(item, options)); + array.Add(MachineData.DeserializeMachineData(item, options)); } value = array; continue; } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new AccessPolicyAssignmentList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new MachineListResult(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -133,6 +137,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.AppendLine("{"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + builder.AppendLine($"'{NextLink.AbsoluteUri}'"); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); if (hasPropertyOverride) { @@ -156,36 +175,13 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" nextLink: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(NextLink)) - { - builder.Append(" nextLink: "); - if (NextLink.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{NextLink}'''"); - } - else - { - builder.AppendLine($"'{NextLink}'"); - } - } - } - builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -194,26 +190,26 @@ BinaryData IPersistableModel.Write(ModelReaderWriter case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(AccessPolicyAssignmentList)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(MachineListResult)} does not support writing '{options.Format}' format."); } } - AccessPolicyAssignmentList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + MachineListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAccessPolicyAssignmentList(document.RootElement, options); + return DeserializeMachineListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AccessPolicyAssignmentList)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(MachineListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineListResult.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineListResult.cs new file mode 100644 index 000000000000..4f59799019c5 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// The response from the List Machines operation. + internal partial class MachineListResult + { + /// + /// 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; + + /// Initializes a new instance of . + internal MachineListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The URL to get the next set of machine results. + /// The list of Machines in cluster. + /// Keeps track of any properties unknown to the library. + internal MachineListResult(Uri nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + NextLink = nextLink; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The URL to get the next set of machine results. + public Uri NextLink { get; } + /// The list of Machines in cluster. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineNetworkProperties.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineNetworkProperties.Serialization.cs new file mode 100644 index 000000000000..2581056b1ff4 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineNetworkProperties.Serialization.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + internal partial class MachineNetworkProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(MachineNetworkProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsCollectionDefined(IPAddresses)) + { + writer.WritePropertyName("ipAddresses"u8); + writer.WriteStartArray(); + foreach (var item in IPAddresses) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MachineNetworkProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MachineNetworkProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMachineNetworkProperties(document.RootElement, options); + } + + internal static MachineNetworkProperties DeserializeMachineNetworkProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList ipAddresses = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ipAddresses"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MachineIPAddress.DeserializeMachineIPAddress(item, options)); + } + ipAddresses = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MachineNetworkProperties(ipAddresses ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IPAddresses), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" ipAddresses: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(IPAddresses)) + { + if (IPAddresses.Any()) + { + builder.Append(" ipAddresses: "); + builder.AppendLine("["); + foreach (var item in IPAddresses) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " ipAddresses: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(MachineNetworkProperties)} does not support writing '{options.Format}' format."); + } + } + + MachineNetworkProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMachineNetworkProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MachineNetworkProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErrorDetail.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineNetworkProperties.cs similarity index 70% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErrorDetail.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineNetworkProperties.cs index 4db19c083c43..1e7ac382e543 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErrorDetail.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineNetworkProperties.cs @@ -8,10 +8,10 @@ using System; using System.Collections.Generic; -namespace Azure.Messaging.EventGrid.SystemEvents +namespace Azure.ResourceManager.ContainerService.Models { - /// Details of JobOutput errors. - public partial class MediaJobErrorDetail + /// network properties of the machine. + internal partial class MachineNetworkProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,25 +45,23 @@ public partial class MediaJobErrorDetail /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal MediaJobErrorDetail() + /// Initializes a new instance of . + internal MachineNetworkProperties() { + IPAddresses = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// Code describing the error detail. - /// A human-readable representation of the error. + /// Initializes a new instance of . + /// IPv4, IPv6 addresses of the machine. /// Keeps track of any properties unknown to the library. - internal MediaJobErrorDetail(string code, string message, IDictionary serializedAdditionalRawData) + internal MachineNetworkProperties(IReadOnlyList ipAddresses, IDictionary serializedAdditionalRawData) { - Code = code; - Message = message; + IPAddresses = ipAddresses; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Code describing the error detail. - public string Code { get; } - /// A human-readable representation of the error. - public string Message { get; } + /// IPv4, IPv6 addresses of the machine. + [WirePath("ipAddresses")] + public IReadOnlyList IPAddresses { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineProperties.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineProperties.Serialization.cs new file mode 100644 index 000000000000..888a3ca764f9 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineProperties.Serialization.cs @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + public partial class MachineProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(MachineProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Network)) + { + writer.WritePropertyName("network"u8); + writer.WriteObjectValue(Network, options); + } + if (options.Format != "W" && Optional.IsDefined(ResourceId)) + { + writer.WritePropertyName("resourceId"u8); + writer.WriteStringValue(ResourceId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MachineProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MachineProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMachineProperties(document.RootElement, options); + } + + internal static MachineProperties DeserializeMachineProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MachineNetworkProperties network = default; + ResourceIdentifier resourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("network"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + network = MachineNetworkProperties.DeserializeMachineNetworkProperties(property.Value, options); + continue; + } + if (property.NameEquals("resourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MachineProperties(network, resourceId, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("NetworkIPAddresses", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" network: "); + builder.AppendLine("{"); + builder.Append(" ipAddresses: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Network)) + { + builder.Append(" network: "); + BicepSerializationHelpers.AppendChildObject(builder, Network, options, 2, false, " network: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ResourceId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" resourceId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ResourceId)) + { + builder.Append(" resourceId: "); + builder.AppendLine($"'{ResourceId.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(MachineProperties)} does not support writing '{options.Format}' format."); + } + } + + MachineProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMachineProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MachineProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventEncoderConnectedEventData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineProperties.cs similarity index 56% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventEncoderConnectedEventData.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineProperties.cs index ae72ea53ee7d..2015203bd683 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventEncoderConnectedEventData.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/MachineProperties.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using Azure.Core; -namespace Azure.Messaging.EventGrid.SystemEvents +namespace Azure.ResourceManager.ContainerService.Models { - /// Encoder connect event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventEncoderConnected event. - public partial class MediaLiveEventEncoderConnectedEventData + /// The properties of the machine. + public partial class MachineProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,33 +46,33 @@ public partial class MediaLiveEventEncoderConnectedEventData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal MediaLiveEventEncoderConnectedEventData() + /// Initializes a new instance of . + internal MachineProperties() { } - /// Initializes a new instance of . - /// Gets the ingest URL provided by the live event. - /// Gets the stream Id. - /// Gets the remote IP. - /// Gets the remote port. + /// Initializes a new instance of . + /// network properties of the machine. + /// Azure resource id of the machine. It can be used to GET underlying VM Instance. /// Keeps track of any properties unknown to the library. - internal MediaLiveEventEncoderConnectedEventData(string ingestUrl, string streamId, string encoderIp, string encoderPort, IDictionary serializedAdditionalRawData) + internal MachineProperties(MachineNetworkProperties network, ResourceIdentifier resourceId, IDictionary serializedAdditionalRawData) { - IngestUrl = ingestUrl; - StreamId = streamId; - EncoderIp = encoderIp; - EncoderPort = encoderPort; + Network = network; + ResourceId = resourceId; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets the ingest URL provided by the live event. - public string IngestUrl { get; } - /// Gets the stream Id. - public string StreamId { get; } - /// Gets the remote IP. - public string EncoderIp { get; } - /// Gets the remote port. - public string EncoderPort { get; } + /// network properties of the machine. + internal MachineNetworkProperties Network { get; } + /// IPv4, IPv6 addresses of the machine. + [WirePath("network.ipAddresses")] + public IReadOnlyList NetworkIPAddresses + { + get => Network?.IPAddresses; + } + + /// Azure resource id of the machine. It can be used to GET underlying VM Instance. + [WirePath("resourceId")] + public ResourceIdentifier ResourceId { get; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.Serialization.cs index 5f75761cd221..c0798dc13a11 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.Serialization.cs @@ -62,6 +62,7 @@ internal static ManagedClusterAgentPoolProfile DeserializeManagedClusterAgentPoo return null; } string name = default; + ETag? etag = default; int? count = default; string vmSize = default; int? osDiskSizeGB = default; @@ -105,6 +106,8 @@ internal static ManagedClusterAgentPoolProfile DeserializeManagedClusterAgentPoo ResourceIdentifier capacityReservationGroupId = default; ResourceIdentifier hostGroupId = default; AgentPoolNetworkProfile networkProfile = default; + AgentPoolWindowsProfile windowsProfile = default; + AgentPoolSecurityProfile securityProfile = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -114,6 +117,15 @@ internal static ManagedClusterAgentPoolProfile DeserializeManagedClusterAgentPoo name = property.Value.GetString(); continue; } + if (property.NameEquals("eTag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + etag = new ETag(property.Value.GetString()); + continue; + } if (property.NameEquals("count"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -501,6 +513,24 @@ internal static ManagedClusterAgentPoolProfile DeserializeManagedClusterAgentPoo networkProfile = AgentPoolNetworkProfile.DeserializeAgentPoolNetworkProfile(property.Value, options); continue; } + if (property.NameEquals("windowsProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + windowsProfile = AgentPoolWindowsProfile.DeserializeAgentPoolWindowsProfile(property.Value, options); + continue; + } + if (property.NameEquals("securityProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securityProfile = AgentPoolSecurityProfile.DeserializeAgentPoolSecurityProfile(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -508,6 +538,7 @@ internal static ManagedClusterAgentPoolProfile DeserializeManagedClusterAgentPoo } serializedAdditionalRawData = rawDataDictionary; return new ManagedClusterAgentPoolProfile( + etag, count, vmSize, osDiskSizeGB, @@ -551,6 +582,8 @@ internal static ManagedClusterAgentPoolProfile DeserializeManagedClusterAgentPoo capacityReservationGroupId, hostGroupId, networkProfile, + windowsProfile, + securityProfile, serializedAdditionalRawData, name); } @@ -589,6 +622,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ETag), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" eTag: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ETag)) + { + builder.Append(" eTag: "); + builder.AppendLine($"'{ETag.Value.ToString()}'"); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Count), out propertyOverride); if (hasPropertyOverride) { @@ -1371,6 +1419,39 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("DisableOutboundNat", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" windowsProfile: "); + builder.AppendLine("{"); + builder.Append(" disableOutboundNat: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(WindowsProfile)) + { + builder.Append(" windowsProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, WindowsProfile, options, 2, false, " windowsProfile: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SecurityProfile), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" securityProfile: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SecurityProfile)) + { + builder.Append(" securityProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, SecurityProfile, options, 2, false, " securityProfile: "); + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs index 5814a5f2d5a7..9f946126074a 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs @@ -25,6 +25,7 @@ public ManagedClusterAgentPoolProfile(string name) } /// Initializes a new instance of . + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency per the normal etag convention. /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. @@ -68,9 +69,11 @@ public ManagedClusterAgentPoolProfile(string name) /// AKS will associate the specified agent pool with the Capacity Reservation Group. /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). /// Network-related settings of an agent pool. + /// The Windows agent pool's specific profile. + /// The security settings of an agent pool. /// Keeps track of any properties unknown to the library. /// Windows agent pool names must be 6 characters or less. - internal ManagedClusterAgentPoolProfile(int? count, string vmSize, int? osDiskSizeInGB, ContainerServiceOSDiskType? osDiskType, KubeletDiskType? kubeletDiskType, WorkloadRuntime? workloadRuntime, ResourceIdentifier vnetSubnetId, ResourceIdentifier podSubnetId, int? maxPods, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, int? maxCount, int? minCount, bool? enableAutoScaling, ScaleDownMode? scaleDownMode, AgentPoolType? agentPoolType, AgentPoolMode? mode, string orchestratorVersion, string currentOrchestratorVersion, string nodeImageVersion, AgentPoolUpgradeSettings upgradeSettings, string provisioningState, ContainerServicePowerState powerState, IList availabilityZones, bool? enableNodePublicIP, ResourceIdentifier nodePublicIPPrefixId, ScaleSetPriority? scaleSetPriority, ScaleSetEvictionPolicy? scaleSetEvictionPolicy, float? spotMaxPrice, IDictionary tags, IDictionary nodeLabels, IList nodeTaints, ResourceIdentifier proximityPlacementGroupId, KubeletConfig kubeletConfig, LinuxOSConfig linuxOSConfig, bool? enableEncryptionAtHost, bool? enableUltraSsd, bool? enableFips, GpuInstanceProfile? gpuInstanceProfile, ContainerServiceCreationData creationData, ResourceIdentifier capacityReservationGroupId, ResourceIdentifier hostGroupId, AgentPoolNetworkProfile networkProfile, IDictionary serializedAdditionalRawData, string name) : base(count, vmSize, osDiskSizeInGB, osDiskType, kubeletDiskType, workloadRuntime, vnetSubnetId, podSubnetId, maxPods, osType, osSku, maxCount, minCount, enableAutoScaling, scaleDownMode, agentPoolType, mode, orchestratorVersion, currentOrchestratorVersion, nodeImageVersion, upgradeSettings, provisioningState, powerState, availabilityZones, enableNodePublicIP, nodePublicIPPrefixId, scaleSetPriority, scaleSetEvictionPolicy, spotMaxPrice, tags, nodeLabels, nodeTaints, proximityPlacementGroupId, kubeletConfig, linuxOSConfig, enableEncryptionAtHost, enableUltraSsd, enableFips, gpuInstanceProfile, creationData, capacityReservationGroupId, hostGroupId, networkProfile, serializedAdditionalRawData) + internal ManagedClusterAgentPoolProfile(ETag? etag, int? count, string vmSize, int? osDiskSizeInGB, ContainerServiceOSDiskType? osDiskType, KubeletDiskType? kubeletDiskType, WorkloadRuntime? workloadRuntime, ResourceIdentifier vnetSubnetId, ResourceIdentifier podSubnetId, int? maxPods, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, int? maxCount, int? minCount, bool? enableAutoScaling, ScaleDownMode? scaleDownMode, AgentPoolType? agentPoolType, AgentPoolMode? mode, string orchestratorVersion, string currentOrchestratorVersion, string nodeImageVersion, AgentPoolUpgradeSettings upgradeSettings, string provisioningState, ContainerServicePowerState powerState, IList availabilityZones, bool? enableNodePublicIP, ResourceIdentifier nodePublicIPPrefixId, ScaleSetPriority? scaleSetPriority, ScaleSetEvictionPolicy? scaleSetEvictionPolicy, float? spotMaxPrice, IDictionary tags, IDictionary nodeLabels, IList nodeTaints, ResourceIdentifier proximityPlacementGroupId, KubeletConfig kubeletConfig, LinuxOSConfig linuxOSConfig, bool? enableEncryptionAtHost, bool? enableUltraSsd, bool? enableFips, GpuInstanceProfile? gpuInstanceProfile, ContainerServiceCreationData creationData, ResourceIdentifier capacityReservationGroupId, ResourceIdentifier hostGroupId, AgentPoolNetworkProfile networkProfile, AgentPoolWindowsProfile windowsProfile, AgentPoolSecurityProfile securityProfile, IDictionary serializedAdditionalRawData, string name) : base(etag, count, vmSize, osDiskSizeInGB, osDiskType, kubeletDiskType, workloadRuntime, vnetSubnetId, podSubnetId, maxPods, osType, osSku, maxCount, minCount, enableAutoScaling, scaleDownMode, agentPoolType, mode, orchestratorVersion, currentOrchestratorVersion, nodeImageVersion, upgradeSettings, provisioningState, powerState, availabilityZones, enableNodePublicIP, nodePublicIPPrefixId, scaleSetPriority, scaleSetEvictionPolicy, spotMaxPrice, tags, nodeLabels, nodeTaints, proximityPlacementGroupId, kubeletConfig, linuxOSConfig, enableEncryptionAtHost, enableUltraSsd, enableFips, gpuInstanceProfile, creationData, capacityReservationGroupId, hostGroupId, networkProfile, windowsProfile, securityProfile, serializedAdditionalRawData) { Name = name; } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.Serialization.cs index 82c6710a7248..4181b0283554 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.Serialization.cs @@ -36,6 +36,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ManagedClusterAgentPoolProfileProperties)} does not support writing '{format}' format."); } + if (options.Format != "W" && Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"u8); + writer.WriteStringValue(ETag.Value.ToString()); + } if (Optional.IsDefined(Count)) { writer.WritePropertyName("count"u8); @@ -273,6 +278,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("networkProfile"u8); writer.WriteObjectValue(NetworkProfile, options); } + if (Optional.IsDefined(WindowsProfile)) + { + writer.WritePropertyName("windowsProfile"u8); + writer.WriteObjectValue(WindowsProfile, options); + } + if (Optional.IsDefined(SecurityProfile)) + { + writer.WritePropertyName("securityProfile"u8); + writer.WriteObjectValue(SecurityProfile, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -310,6 +325,7 @@ internal static ManagedClusterAgentPoolProfileProperties DeserializeManagedClust { return null; } + ETag? etag = default; int? count = default; string vmSize = default; int? osDiskSizeGB = default; @@ -353,10 +369,21 @@ internal static ManagedClusterAgentPoolProfileProperties DeserializeManagedClust ResourceIdentifier capacityReservationGroupId = default; ResourceIdentifier hostGroupId = default; AgentPoolNetworkProfile networkProfile = default; + AgentPoolWindowsProfile windowsProfile = default; + AgentPoolSecurityProfile securityProfile = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("eTag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + etag = new ETag(property.Value.GetString()); + continue; + } if (property.NameEquals("count"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -744,6 +771,24 @@ internal static ManagedClusterAgentPoolProfileProperties DeserializeManagedClust networkProfile = AgentPoolNetworkProfile.DeserializeAgentPoolNetworkProfile(property.Value, options); continue; } + if (property.NameEquals("windowsProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + windowsProfile = AgentPoolWindowsProfile.DeserializeAgentPoolWindowsProfile(property.Value, options); + continue; + } + if (property.NameEquals("securityProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securityProfile = AgentPoolSecurityProfile.DeserializeAgentPoolSecurityProfile(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -751,6 +796,7 @@ internal static ManagedClusterAgentPoolProfileProperties DeserializeManagedClust } serializedAdditionalRawData = rawDataDictionary; return new ManagedClusterAgentPoolProfileProperties( + etag, count, vmSize, osDiskSizeGB, @@ -794,6 +840,8 @@ internal static ManagedClusterAgentPoolProfileProperties DeserializeManagedClust capacityReservationGroupId, hostGroupId, networkProfile, + windowsProfile, + securityProfile, serializedAdditionalRawData); } @@ -808,6 +856,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.AppendLine("{"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ETag), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" eTag: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ETag)) + { + builder.Append(" eTag: "); + builder.AppendLine($"'{ETag.Value.ToString()}'"); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Count), out propertyOverride); if (hasPropertyOverride) { @@ -1590,6 +1653,39 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("DisableOutboundNat", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" windowsProfile: "); + builder.AppendLine("{"); + builder.Append(" disableOutboundNat: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(WindowsProfile)) + { + builder.Append(" windowsProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, WindowsProfile, options, 2, false, " windowsProfile: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SecurityProfile), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" securityProfile: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SecurityProfile)) + { + builder.Append(" securityProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, SecurityProfile, options, 2, false, " securityProfile: "); + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs index b23edbb4a140..f8e3592349b3 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs @@ -56,6 +56,7 @@ public ManagedClusterAgentPoolProfileProperties() } /// Initializes a new instance of . + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency per the normal etag convention. /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. @@ -99,9 +100,12 @@ public ManagedClusterAgentPoolProfileProperties() /// AKS will associate the specified agent pool with the Capacity Reservation Group. /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). /// Network-related settings of an agent pool. + /// The Windows agent pool's specific profile. + /// The security settings of an agent pool. /// Keeps track of any properties unknown to the library. - internal ManagedClusterAgentPoolProfileProperties(int? count, string vmSize, int? osDiskSizeInGB, ContainerServiceOSDiskType? osDiskType, KubeletDiskType? kubeletDiskType, WorkloadRuntime? workloadRuntime, ResourceIdentifier vnetSubnetId, ResourceIdentifier podSubnetId, int? maxPods, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, int? maxCount, int? minCount, bool? enableAutoScaling, ScaleDownMode? scaleDownMode, AgentPoolType? agentPoolType, AgentPoolMode? mode, string orchestratorVersion, string currentOrchestratorVersion, string nodeImageVersion, AgentPoolUpgradeSettings upgradeSettings, string provisioningState, ContainerServicePowerState powerState, IList availabilityZones, bool? enableNodePublicIP, ResourceIdentifier nodePublicIPPrefixId, ScaleSetPriority? scaleSetPriority, ScaleSetEvictionPolicy? scaleSetEvictionPolicy, float? spotMaxPrice, IDictionary tags, IDictionary nodeLabels, IList nodeTaints, ResourceIdentifier proximityPlacementGroupId, KubeletConfig kubeletConfig, LinuxOSConfig linuxOSConfig, bool? enableEncryptionAtHost, bool? enableUltraSsd, bool? enableFips, GpuInstanceProfile? gpuInstanceProfile, ContainerServiceCreationData creationData, ResourceIdentifier capacityReservationGroupId, ResourceIdentifier hostGroupId, AgentPoolNetworkProfile networkProfile, IDictionary serializedAdditionalRawData) + internal ManagedClusterAgentPoolProfileProperties(ETag? etag, int? count, string vmSize, int? osDiskSizeInGB, ContainerServiceOSDiskType? osDiskType, KubeletDiskType? kubeletDiskType, WorkloadRuntime? workloadRuntime, ResourceIdentifier vnetSubnetId, ResourceIdentifier podSubnetId, int? maxPods, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, int? maxCount, int? minCount, bool? enableAutoScaling, ScaleDownMode? scaleDownMode, AgentPoolType? agentPoolType, AgentPoolMode? mode, string orchestratorVersion, string currentOrchestratorVersion, string nodeImageVersion, AgentPoolUpgradeSettings upgradeSettings, string provisioningState, ContainerServicePowerState powerState, IList availabilityZones, bool? enableNodePublicIP, ResourceIdentifier nodePublicIPPrefixId, ScaleSetPriority? scaleSetPriority, ScaleSetEvictionPolicy? scaleSetEvictionPolicy, float? spotMaxPrice, IDictionary tags, IDictionary nodeLabels, IList nodeTaints, ResourceIdentifier proximityPlacementGroupId, KubeletConfig kubeletConfig, LinuxOSConfig linuxOSConfig, bool? enableEncryptionAtHost, bool? enableUltraSsd, bool? enableFips, GpuInstanceProfile? gpuInstanceProfile, ContainerServiceCreationData creationData, ResourceIdentifier capacityReservationGroupId, ResourceIdentifier hostGroupId, AgentPoolNetworkProfile networkProfile, AgentPoolWindowsProfile windowsProfile, AgentPoolSecurityProfile securityProfile, IDictionary serializedAdditionalRawData) { + ETag = etag; Count = count; VmSize = vmSize; OSDiskSizeInGB = osDiskSizeInGB; @@ -145,9 +149,14 @@ internal ManagedClusterAgentPoolProfileProperties(int? count, string vmSize, int CapacityReservationGroupId = capacityReservationGroupId; HostGroupId = hostGroupId; NetworkProfile = networkProfile; + WindowsProfile = windowsProfile; + SecurityProfile = securityProfile; _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency per the normal etag convention. + [WirePath("eTag")] + public ETag? ETag { get; } /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. [WirePath("count")] public int? Count { get; set; } @@ -301,5 +310,23 @@ public ResourceIdentifier CreationDataSourceResourceId /// Network-related settings of an agent pool. [WirePath("networkProfile")] public AgentPoolNetworkProfile NetworkProfile { get; set; } + /// The Windows agent pool's specific profile. + internal AgentPoolWindowsProfile WindowsProfile { get; set; } + /// The default value is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows agent pool does not have node public IP enabled. + [WirePath("windowsProfile.disableOutboundNat")] + public bool? DisableOutboundNat + { + get => WindowsProfile is null ? default : WindowsProfile.DisableOutboundNat; + set + { + if (WindowsProfile is null) + WindowsProfile = new AgentPoolWindowsProfile(); + WindowsProfile.DisableOutboundNat = value; + } + } + + /// The security settings of an agent pool. + [WirePath("securityProfile")] + public AgentPoolSecurityProfile SecurityProfile { get; set; } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.Serialization.cs index 81d43aabcb6c..52120125828f 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.Serialization.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.Serialization.cs @@ -40,6 +40,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("balance-similar-node-groups"u8); writer.WriteStringValue(BalanceSimilarNodeGroups); } + if (Optional.IsDefined(DaemonsetEvictionForEmptyNodes)) + { + writer.WritePropertyName("daemonset-eviction-for-empty-nodes"u8); + writer.WriteBooleanValue(DaemonsetEvictionForEmptyNodes.Value); + } + if (Optional.IsDefined(DaemonsetEvictionForOccupiedNodes)) + { + writer.WritePropertyName("daemonset-eviction-for-occupied-nodes"u8); + writer.WriteBooleanValue(DaemonsetEvictionForOccupiedNodes.Value); + } + if (Optional.IsDefined(IgnoreDaemonsetsUtilization)) + { + writer.WritePropertyName("ignore-daemonsets-utilization"u8); + writer.WriteBooleanValue(IgnoreDaemonsetsUtilization.Value); + } if (Optional.IsDefined(Expander)) { writer.WritePropertyName("expander"u8); @@ -158,6 +173,9 @@ internal static ManagedClusterAutoScalerProfile DeserializeManagedClusterAutoSca return null; } string balanceSimilarNodeGroups = default; + bool? daemonsetEvictionForEmptyNodes = default; + bool? daemonsetEvictionForOccupiedNodes = default; + bool? ignoreDaemonsetsUtilization = default; AutoScaleExpander? expander = default; string maxEmptyBulkDelete = default; string maxGracefulTerminationSec = default; @@ -183,6 +201,33 @@ internal static ManagedClusterAutoScalerProfile DeserializeManagedClusterAutoSca balanceSimilarNodeGroups = property.Value.GetString(); continue; } + if (property.NameEquals("daemonset-eviction-for-empty-nodes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + daemonsetEvictionForEmptyNodes = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("daemonset-eviction-for-occupied-nodes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + daemonsetEvictionForOccupiedNodes = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("ignore-daemonsets-utilization"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ignoreDaemonsetsUtilization = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("expander"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -275,6 +320,9 @@ internal static ManagedClusterAutoScalerProfile DeserializeManagedClusterAutoSca serializedAdditionalRawData = rawDataDictionary; return new ManagedClusterAutoScalerProfile( balanceSimilarNodeGroups, + daemonsetEvictionForEmptyNodes, + daemonsetEvictionForOccupiedNodes, + ignoreDaemonsetsUtilization, expander, maxEmptyBulkDelete, maxGracefulTerminationSec, @@ -328,6 +376,54 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DaemonsetEvictionForEmptyNodes), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" daemonset-eviction-for-empty-nodes: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DaemonsetEvictionForEmptyNodes)) + { + builder.Append(" daemonset-eviction-for-empty-nodes: "); + var boolValue = DaemonsetEvictionForEmptyNodes.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DaemonsetEvictionForOccupiedNodes), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" daemonset-eviction-for-occupied-nodes: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DaemonsetEvictionForOccupiedNodes)) + { + builder.Append(" daemonset-eviction-for-occupied-nodes: "); + var boolValue = DaemonsetEvictionForOccupiedNodes.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IgnoreDaemonsetsUtilization), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" ignore-daemonsets-utilization: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IgnoreDaemonsetsUtilization)) + { + builder.Append(" ignore-daemonsets-utilization: "); + var boolValue = IgnoreDaemonsetsUtilization.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Expander), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.cs index 4cd1ca0a37ba..f8ffaecf322d 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterAutoScalerProfile.cs @@ -52,6 +52,9 @@ public ManagedClusterAutoScalerProfile() /// Initializes a new instance of . /// Valid values are 'true' and 'false'. + /// If set to true, all daemonset pods on empty nodes will be evicted before deletion of the node. If the daemonset pod cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset pods are deleted or evicted. + /// If set to true, all daemonset pods on occupied nodes will be evicted before deletion of the node. If the daemonset pod cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset pods are deleted or evicted. + /// If set to true, the resources used by daemonset will be taken into account when making scaling down decisions. /// If not specified, the default is 'random'. See [expanders](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-expanders) for more information. /// The default is 10. /// The default is 600. @@ -69,9 +72,12 @@ public ManagedClusterAutoScalerProfile() /// The default is true. /// The default is true. /// Keeps track of any properties unknown to the library. - internal ManagedClusterAutoScalerProfile(string balanceSimilarNodeGroups, AutoScaleExpander? expander, string maxEmptyBulkDelete, string maxGracefulTerminationSec, string maxNodeProvisionTime, string maxTotalUnreadyPercentage, string newPodScaleUpDelay, string okTotalUnreadyCount, string scanIntervalInSeconds, string scaleDownDelayAfterAdd, string scaleDownDelayAfterDelete, string scaleDownDelayAfterFailure, string scaleDownUnneededTime, string scaleDownUnreadyTime, string scaleDownUtilizationThreshold, string skipNodesWithLocalStorage, string skipNodesWithSystemPods, IDictionary serializedAdditionalRawData) + internal ManagedClusterAutoScalerProfile(string balanceSimilarNodeGroups, bool? daemonsetEvictionForEmptyNodes, bool? daemonsetEvictionForOccupiedNodes, bool? ignoreDaemonsetsUtilization, AutoScaleExpander? expander, string maxEmptyBulkDelete, string maxGracefulTerminationSec, string maxNodeProvisionTime, string maxTotalUnreadyPercentage, string newPodScaleUpDelay, string okTotalUnreadyCount, string scanIntervalInSeconds, string scaleDownDelayAfterAdd, string scaleDownDelayAfterDelete, string scaleDownDelayAfterFailure, string scaleDownUnneededTime, string scaleDownUnreadyTime, string scaleDownUtilizationThreshold, string skipNodesWithLocalStorage, string skipNodesWithSystemPods, IDictionary serializedAdditionalRawData) { BalanceSimilarNodeGroups = balanceSimilarNodeGroups; + DaemonsetEvictionForEmptyNodes = daemonsetEvictionForEmptyNodes; + DaemonsetEvictionForOccupiedNodes = daemonsetEvictionForOccupiedNodes; + IgnoreDaemonsetsUtilization = ignoreDaemonsetsUtilization; Expander = expander; MaxEmptyBulkDelete = maxEmptyBulkDelete; MaxGracefulTerminationSec = maxGracefulTerminationSec; @@ -94,6 +100,15 @@ internal ManagedClusterAutoScalerProfile(string balanceSimilarNodeGroups, AutoSc /// Valid values are 'true' and 'false'. [WirePath("balance-similar-node-groups")] public string BalanceSimilarNodeGroups { get; set; } + /// If set to true, all daemonset pods on empty nodes will be evicted before deletion of the node. If the daemonset pod cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset pods are deleted or evicted. + [WirePath("daemonset-eviction-for-empty-nodes")] + public bool? DaemonsetEvictionForEmptyNodes { get; set; } + /// If set to true, all daemonset pods on occupied nodes will be evicted before deletion of the node. If the daemonset pod cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset pods are deleted or evicted. + [WirePath("daemonset-eviction-for-occupied-nodes")] + public bool? DaemonsetEvictionForOccupiedNodes { get; set; } + /// If set to true, the resources used by daemonset will be taken into account when making scaling down decisions. + [WirePath("ignore-daemonsets-utilization")] + public bool? IgnoreDaemonsetsUtilization { get; set; } /// If not specified, the default is 'random'. See [expanders](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-expanders) for more information. [WirePath("expander")] public AutoScaleExpander? Expander { get; set; } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCostAnalysis.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCostAnalysis.Serialization.cs new file mode 100644 index 000000000000..c2baa59cbf03 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCostAnalysis.Serialization.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + internal partial class ManagedClusterCostAnalysis : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedClusterCostAnalysis)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ManagedClusterCostAnalysis IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedClusterCostAnalysis)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedClusterCostAnalysis(document.RootElement, options); + } + + internal static ManagedClusterCostAnalysis DeserializeManagedClusterCostAnalysis(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedClusterCostAnalysis(enabled, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Enabled), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enabled: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Enabled)) + { + builder.Append(" enabled: "); + var boolValue = Enabled.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ManagedClusterCostAnalysis)} does not support writing '{options.Format}' format."); + } + } + + ManagedClusterCostAnalysis IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeManagedClusterCostAnalysis(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedClusterCostAnalysis)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCostAnalysis.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCostAnalysis.cs new file mode 100644 index 000000000000..63379cdd6fdf --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterCostAnalysis.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// The cost analysis configuration for the cluster. + internal partial class ManagedClusterCostAnalysis + { + /// + /// 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; + + /// Initializes a new instance of . + public ManagedClusterCostAnalysis() + { + } + + /// Initializes a new instance of . + /// The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes Namespace and Deployment details to the Cost Analysis views in the Azure portal. If not specified, the default is false. For more information see aka.ms/aks/docs/cost-analysis. + /// Keeps track of any properties unknown to the library. + internal ManagedClusterCostAnalysis(bool? enabled, IDictionary serializedAdditionalRawData) + { + Enabled = enabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes Namespace and Deployment details to the Cost Analysis views in the Azure portal. If not specified, the default is false. For more information see aka.ms/aks/docs/cost-analysis. + [WirePath("enabled")] + public bool? Enabled { get; set; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfile.Serialization.cs new file mode 100644 index 000000000000..4b27657829c4 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfile.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + internal partial class ManagedClusterIngressProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedClusterIngressProfile)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(WebAppRouting)) + { + writer.WritePropertyName("webAppRouting"u8); + writer.WriteObjectValue(WebAppRouting, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ManagedClusterIngressProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedClusterIngressProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedClusterIngressProfile(document.RootElement, options); + } + + internal static ManagedClusterIngressProfile DeserializeManagedClusterIngressProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ManagedClusterIngressProfileWebAppRouting webAppRouting = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("webAppRouting"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + webAppRouting = ManagedClusterIngressProfileWebAppRouting.DeserializeManagedClusterIngressProfileWebAppRouting(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedClusterIngressProfile(webAppRouting, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(WebAppRouting), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" webAppRouting: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(WebAppRouting)) + { + builder.Append(" webAppRouting: "); + BicepSerializationHelpers.AppendChildObject(builder, WebAppRouting, options, 2, false, " webAppRouting: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ManagedClusterIngressProfile)} does not support writing '{options.Format}' format."); + } + } + + ManagedClusterIngressProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeManagedClusterIngressProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedClusterIngressProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfile.cs new file mode 100644 index 000000000000..de760f817d65 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfile.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// Ingress profile for the container service cluster. + internal partial class ManagedClusterIngressProfile + { + /// + /// 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; + + /// Initializes a new instance of . + public ManagedClusterIngressProfile() + { + } + + /// Initializes a new instance of . + /// App Routing settings for the ingress profile. You can find an overview and onboarding guide for this feature at https://learn.microsoft.com/en-us/azure/aks/app-routing?tabs=default%2Cdeploy-app-default. + /// Keeps track of any properties unknown to the library. + internal ManagedClusterIngressProfile(ManagedClusterIngressProfileWebAppRouting webAppRouting, IDictionary serializedAdditionalRawData) + { + WebAppRouting = webAppRouting; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// App Routing settings for the ingress profile. You can find an overview and onboarding guide for this feature at https://learn.microsoft.com/en-us/azure/aks/app-routing?tabs=default%2Cdeploy-app-default. + [WirePath("webAppRouting")] + public ManagedClusterIngressProfileWebAppRouting WebAppRouting { get; set; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfileWebAppRouting.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfileWebAppRouting.Serialization.cs new file mode 100644 index 000000000000..705c36028f28 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfileWebAppRouting.Serialization.cs @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + public partial class ManagedClusterIngressProfileWebAppRouting : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedClusterIngressProfileWebAppRouting)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled.Value); + } + if (Optional.IsCollectionDefined(DnsZoneResourceIds)) + { + writer.WritePropertyName("dnsZoneResourceIds"u8); + writer.WriteStartArray(); + foreach (var item in DnsZoneResourceIds) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ManagedClusterIngressProfileWebAppRouting IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedClusterIngressProfileWebAppRouting)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedClusterIngressProfileWebAppRouting(document.RootElement, options); + } + + internal static ManagedClusterIngressProfileWebAppRouting DeserializeManagedClusterIngressProfileWebAppRouting(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enabled = default; + IList dnsZoneResourceIds = default; + ContainerServiceUserAssignedIdentity identity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("dnsZoneResourceIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(new ResourceIdentifier(item.GetString())); + } + } + dnsZoneResourceIds = array; + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = ContainerServiceUserAssignedIdentity.DeserializeContainerServiceUserAssignedIdentity(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedClusterIngressProfileWebAppRouting(enabled, dnsZoneResourceIds ?? new ChangeTrackingList(), identity, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Enabled), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enabled: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Enabled)) + { + builder.Append(" enabled: "); + var boolValue = Enabled.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DnsZoneResourceIds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" dnsZoneResourceIds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(DnsZoneResourceIds)) + { + if (DnsZoneResourceIds.Any()) + { + builder.Append(" dnsZoneResourceIds: "); + builder.AppendLine("["); + foreach (var item in DnsZoneResourceIds) + { + if (item == null) + { + builder.Append("null"); + continue; + } + builder.AppendLine($" '{item.ToString()}'"); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" identity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Identity)) + { + builder.Append(" identity: "); + BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ManagedClusterIngressProfileWebAppRouting)} does not support writing '{options.Format}' format."); + } + } + + ManagedClusterIngressProfileWebAppRouting IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeManagedClusterIngressProfileWebAppRouting(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedClusterIngressProfileWebAppRouting)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfileWebAppRouting.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfileWebAppRouting.cs new file mode 100644 index 000000000000..c042ea82a4e2 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterIngressProfileWebAppRouting.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// Application Routing add-on settings for the ingress profile. + public partial class ManagedClusterIngressProfileWebAppRouting + { + /// + /// 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; + + /// Initializes a new instance of . + public ManagedClusterIngressProfileWebAppRouting() + { + DnsZoneResourceIds = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Whether to enable the Application Routing add-on. + /// Resource IDs of the DNS zones to be associated with the Application Routing add-on. Used only when Application Routing add-on is enabled. Public and private DNS zones can be in different resource groups, but all public DNS zones must be in the same resource group and all private DNS zones must be in the same resource group. + /// Managed identity of the Application Routing add-on. This is the identity that should be granted permissions, for example, to manage the associated Azure DNS resource and get certificates from Azure Key Vault. See [this overview of the add-on](https://learn.microsoft.com/en-us/azure/aks/web-app-routing?tabs=with-osm) for more instructions. + /// Keeps track of any properties unknown to the library. + internal ManagedClusterIngressProfileWebAppRouting(bool? enabled, IList dnsZoneResourceIds, ContainerServiceUserAssignedIdentity identity, IDictionary serializedAdditionalRawData) + { + Enabled = enabled; + DnsZoneResourceIds = dnsZoneResourceIds; + Identity = identity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Whether to enable the Application Routing add-on. + [WirePath("enabled")] + public bool? Enabled { get; set; } + /// Resource IDs of the DNS zones to be associated with the Application Routing add-on. Used only when Application Routing add-on is enabled. Public and private DNS zones can be in different resource groups, but all public DNS zones must be in the same resource group and all private DNS zones must be in the same resource group. + [WirePath("dnsZoneResourceIds")] + public IList DnsZoneResourceIds { get; } + /// Managed identity of the Application Routing add-on. This is the identity that should be granted permissions, for example, to manage the associated Azure DNS resource and get certificates from Azure Key Vault. See [this overview of the add-on](https://learn.microsoft.com/en-us/azure/aks/web-app-routing?tabs=with-osm) for more instructions. + [WirePath("identity")] + public ContainerServiceUserAssignedIdentity Identity { get; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMetricsProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMetricsProfile.Serialization.cs new file mode 100644 index 000000000000..2d9502fa5fe8 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMetricsProfile.Serialization.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + internal partial class ManagedClusterMetricsProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedClusterMetricsProfile)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(CostAnalysis)) + { + writer.WritePropertyName("costAnalysis"u8); + writer.WriteObjectValue(CostAnalysis, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ManagedClusterMetricsProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedClusterMetricsProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedClusterMetricsProfile(document.RootElement, options); + } + + internal static ManagedClusterMetricsProfile DeserializeManagedClusterMetricsProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ManagedClusterCostAnalysis costAnalysis = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("costAnalysis"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + costAnalysis = ManagedClusterCostAnalysis.DeserializeManagedClusterCostAnalysis(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedClusterMetricsProfile(costAnalysis, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("CostAnalysisEnabled", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" costAnalysis: "); + builder.AppendLine("{"); + builder.Append(" enabled: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(CostAnalysis)) + { + builder.Append(" costAnalysis: "); + BicepSerializationHelpers.AppendChildObject(builder, CostAnalysis, options, 2, false, " costAnalysis: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ManagedClusterMetricsProfile)} does not support writing '{options.Format}' format."); + } + } + + ManagedClusterMetricsProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeManagedClusterMetricsProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedClusterMetricsProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMetricsProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMetricsProfile.cs new file mode 100644 index 000000000000..32d90c17d3ff --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterMetricsProfile.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// The metrics profile for the ManagedCluster. + internal partial class ManagedClusterMetricsProfile + { + /// + /// 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; + + /// Initializes a new instance of . + public ManagedClusterMetricsProfile() + { + } + + /// Initializes a new instance of . + /// The cost analysis configuration for the cluster. + /// Keeps track of any properties unknown to the library. + internal ManagedClusterMetricsProfile(ManagedClusterCostAnalysis costAnalysis, IDictionary serializedAdditionalRawData) + { + CostAnalysis = costAnalysis; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The cost analysis configuration for the cluster. + internal ManagedClusterCostAnalysis CostAnalysis { get; set; } + /// The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes Namespace and Deployment details to the Cost Analysis views in the Azure portal. If not specified, the default is false. For more information see aka.ms/aks/docs/cost-analysis. + [WirePath("costAnalysis.enabled")] + public bool? CostAnalysisEnabled + { + get => CostAnalysis is null ? default : CostAnalysis.Enabled; + set + { + if (CostAnalysis is null) + CostAnalysis = new ManagedClusterCostAnalysis(); + CostAnalysis.Enabled = value; + } + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeOSUpgradeChannel.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeOSUpgradeChannel.cs index 5fd9240d2cc8..662e9289216a 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeOSUpgradeChannel.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeOSUpgradeChannel.cs @@ -25,6 +25,7 @@ public ManagedClusterNodeOSUpgradeChannel(string value) private const string NoneValue = "None"; private const string UnmanagedValue = "Unmanaged"; private const string NodeImageValue = "NodeImage"; + private const string SecurityPatchValue = "SecurityPatch"; /// No attempt to update your machines OS will be made either by OS or by rolling VHDs. This means you are responsible for your security updates. public static ManagedClusterNodeOSUpgradeChannel None { get; } = new ManagedClusterNodeOSUpgradeChannel(NoneValue); @@ -32,6 +33,8 @@ public ManagedClusterNodeOSUpgradeChannel(string value) public static ManagedClusterNodeOSUpgradeChannel Unmanaged { get; } = new ManagedClusterNodeOSUpgradeChannel(UnmanagedValue); /// AKS will update the nodes with a newly patched VHD containing security fixes and bugfixes on a weekly cadence. With the VHD update machines will be rolling reimaged to that VHD following maintenance windows and surge settings. No extra VHD cost is incurred when choosing this option as AKS hosts the images. public static ManagedClusterNodeOSUpgradeChannel NodeImage { get; } = new ManagedClusterNodeOSUpgradeChannel(NodeImageValue); + /// AKS downloads and updates the nodes with tested security updates. These updates honor the maintenance window settings and produce a new VHD that is used on new nodes. On some occasions it's not possible to apply the updates in place, in such cases the existing nodes will also be re-imaged to the newly produced VHD in order to apply the changes. This option incurs an extra cost of hosting the new Security Patch VHDs in your resource group for just in time consumption. + public static ManagedClusterNodeOSUpgradeChannel SecurityPatch { get; } = new ManagedClusterNodeOSUpgradeChannel(SecurityPatchValue); /// Determines if two values are the same. public static bool operator ==(ManagedClusterNodeOSUpgradeChannel left, ManagedClusterNodeOSUpgradeChannel right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeResourceGroupProfile.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeResourceGroupProfile.Serialization.cs new file mode 100644 index 000000000000..f7568f4161d8 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeResourceGroupProfile.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerService.Models +{ + internal partial class ManagedClusterNodeResourceGroupProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedClusterNodeResourceGroupProfile)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(RestrictionLevel)) + { + writer.WritePropertyName("restrictionLevel"u8); + writer.WriteStringValue(RestrictionLevel.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ManagedClusterNodeResourceGroupProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedClusterNodeResourceGroupProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedClusterNodeResourceGroupProfile(document.RootElement, options); + } + + internal static ManagedClusterNodeResourceGroupProfile DeserializeManagedClusterNodeResourceGroupProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + RestrictionLevel? restrictionLevel = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("restrictionLevel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + restrictionLevel = new RestrictionLevel(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedClusterNodeResourceGroupProfile(restrictionLevel, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RestrictionLevel), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" restrictionLevel: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RestrictionLevel)) + { + builder.Append(" restrictionLevel: "); + builder.AppendLine($"'{RestrictionLevel.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ManagedClusterNodeResourceGroupProfile)} does not support writing '{options.Format}' format."); + } + } + + ManagedClusterNodeResourceGroupProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeManagedClusterNodeResourceGroupProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedClusterNodeResourceGroupProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeResourceGroupProfile.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeResourceGroupProfile.cs new file mode 100644 index 000000000000..c81245ee27f2 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ManagedClusterNodeResourceGroupProfile.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// Node resource group lockdown profile for a managed cluster. + internal partial class ManagedClusterNodeResourceGroupProfile + { + /// + /// 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; + + /// Initializes a new instance of . + public ManagedClusterNodeResourceGroupProfile() + { + } + + /// Initializes a new instance of . + /// The restriction level applied to the cluster's node resource group. If not specified, the default is 'Unrestricted'. + /// Keeps track of any properties unknown to the library. + internal ManagedClusterNodeResourceGroupProfile(RestrictionLevel? restrictionLevel, IDictionary serializedAdditionalRawData) + { + RestrictionLevel = restrictionLevel; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The restriction level applied to the cluster's node resource group. If not specified, the default is 'Unrestricted'. + [WirePath("restrictionLevel")] + public RestrictionLevel? RestrictionLevel { get; set; } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/RestrictionLevel.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/RestrictionLevel.cs new file mode 100644 index 000000000000..df1e65439664 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/RestrictionLevel.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerService.Models +{ + /// The restriction level applied to the cluster's node resource group. If not specified, the default is 'Unrestricted'. + public readonly partial struct RestrictionLevel : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public RestrictionLevel(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnrestrictedValue = "Unrestricted"; + private const string ReadOnlyValue = "ReadOnly"; + + /// All RBAC permissions are allowed on the managed node resource group. + public static RestrictionLevel Unrestricted { get; } = new RestrictionLevel(UnrestrictedValue); + /// Only */read RBAC permissions allowed on the managed node resource group. + public static RestrictionLevel ReadOnly { get; } = new RestrictionLevel(ReadOnlyValue); + /// Determines if two values are the same. + public static bool operator ==(RestrictionLevel left, RestrictionLevel right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RestrictionLevel left, RestrictionLevel right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator RestrictionLevel(string value) => new RestrictionLevel(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RestrictionLevel other && Equals(other); + /// + public bool Equals(RestrictionLevel 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/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileResource.Serialization.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileResource.Serialization.cs deleted file mode 100644 index 506123d852f4..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/OSOptionProfileResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.ContainerService -{ - public partial class OSOptionProfileResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - OSOptionProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - OSOptionProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/AgentPoolsRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/AgentPoolsRestOperations.cs index ed1c05c551de..96f55fe49cc1 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/AgentPoolsRestOperations.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/AgentPoolsRestOperations.cs @@ -32,7 +32,7 @@ public AgentPoolsRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01"; + _apiVersion = apiVersion ?? "2024-09-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -328,7 +328,7 @@ public Response Get(string subscriptionId, string } } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, ContainerServiceAgentPoolData data) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, ContainerServiceAgentPoolData data, string ifMatch, string ifNoneMatch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -344,7 +344,7 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, ContainerServiceAgentPoolData data) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, ContainerServiceAgentPoolData data, string ifMatch, string ifNoneMatch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -361,6 +361,14 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r uri.AppendPath(agentPoolName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + if (ifNoneMatch != null) + { + request.Headers.Add("If-None-Match", ifNoneMatch); + } request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); @@ -376,10 +384,12 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r /// The name of the managed cluster resource. /// The name of the agent pool. /// The agent pool to create or update. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, ContainerServiceAgentPoolData data, CancellationToken cancellationToken = default) + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, ContainerServiceAgentPoolData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -387,7 +397,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName, data, ifMatch, ifNoneMatch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -405,10 +415,12 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re /// The name of the managed cluster resource. /// The name of the agent pool. /// The agent pool to create or update. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, ContainerServiceAgentPoolData data, CancellationToken cancellationToken = default) + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, ContainerServiceAgentPoolData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -416,7 +428,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName, data, ifMatch, ifNoneMatch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -428,7 +440,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, bool? ignorePodDisruptionBudget, string ifMatch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -441,10 +453,14 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string uri.AppendPath("/agentPools/", false); uri.AppendPath(agentPoolName, true); uri.AppendQuery("api-version", _apiVersion, true); + if (ignorePodDisruptionBudget != null) + { + uri.AppendQuery("ignore-pod-disruption-budget", ignorePodDisruptionBudget.Value, true); + } return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, bool? ignorePodDisruptionBudget, string ifMatch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -460,7 +476,15 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath("/agentPools/", false); uri.AppendPath(agentPoolName, true); uri.AppendQuery("api-version", _apiVersion, true); + if (ignorePodDisruptionBudget != null) + { + uri.AppendQuery("ignore-pod-disruption-budget", ignorePodDisruptionBudget.Value, true); + } request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; @@ -471,17 +495,19 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG /// The name of the resource group. The name is case insensitive. /// The name of the managed cluster resource. /// The name of the agent pool. + /// ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, bool? ignorePodDisruptionBudget = null, string ifMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName, ignorePodDisruptionBudget, ifMatch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -498,17 +524,19 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr /// The name of the resource group. The name is case insensitive. /// The name of the managed cluster resource. /// The name of the agent pool. + /// ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, bool? ignorePodDisruptionBudget = null, string ifMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName, ignorePodDisruptionBudget, ifMatch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -626,6 +654,106 @@ public Response GetUpgradeProfile(string subscripti } } + internal RequestUriBuilder CreateDeleteMachinesRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, AgentPoolDeleteMachinesParameter machines) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/agentPools/", false); + uri.AppendPath(agentPoolName, true); + uri.AppendPath("/deleteMachines", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteMachinesRequest(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, AgentPoolDeleteMachinesParameter machines) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/agentPools/", false); + uri.AppendPath(agentPoolName, true); + uri.AppendPath("/deleteMachines", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(machines, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Deletes specific machines in an agent pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The name of the agent pool. + /// A list of machines from the agent pool to be deleted. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteMachinesAsync(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, AgentPoolDeleteMachinesParameter machines, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + Argument.AssertNotNull(machines, nameof(machines)); + + using var message = CreateDeleteMachinesRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName, machines); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes specific machines in an agent pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The name of the agent pool. + /// A list of machines from the agent pool to be deleted. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response DeleteMachines(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, AgentPoolDeleteMachinesParameter machines, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + Argument.AssertNotNull(machines, nameof(machines)); + + using var message = CreateDeleteMachinesRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName, machines); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateGetAvailableAgentPoolVersionsRequestUri(string subscriptionId, string resourceGroupName, string resourceName) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/MachinesRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/MachinesRestOperations.cs new file mode 100644 index 000000000000..2c639ced9b30 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/MachinesRestOperations.cs @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerService.Models; + +namespace Azure.ResourceManager.ContainerService +{ + internal partial class MachinesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of MachinesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public MachinesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/agentPools/", false); + uri.AppendPath(agentPoolName, true); + uri.AppendPath("/machines", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/agentPools/", false); + uri.AppendPath(agentPoolName, true); + uri.AppendPath("/machines", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets a list of machines in the specified agent pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The name of the agent pool. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MachineListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MachineListResult.DeserializeMachineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a list of machines in the specified agent pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The name of the agent pool. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MachineListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MachineListResult.DeserializeMachineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, string machineName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/agentPools/", false); + uri.AppendPath(agentPoolName, true); + uri.AppendPath("/machines/", false); + uri.AppendPath(machineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, string machineName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/managedClusters/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/agentPools/", false); + uri.AppendPath(agentPoolName, true); + uri.AppendPath("/machines/", false); + uri.AppendPath(machineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a specific machine in the specified agent pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The name of the agent pool. + /// host name of the machine. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, string machineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName, machineName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MachineData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MachineData.DeserializeMachineData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MachineData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a specific machine in the specified agent pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The name of the agent pool. + /// host name of the machine. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, string machineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, agentPoolName, machineName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MachineData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MachineData.DeserializeMachineData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MachineData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets a list of machines in the specified agent pool. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The name of the agent pool. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName, agentPoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MachineListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MachineListResult.DeserializeMachineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a list of machines in the specified agent pool. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The name of the agent pool. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName, agentPoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MachineListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MachineListResult.DeserializeMachineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/MaintenanceConfigurationsRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/MaintenanceConfigurationsRestOperations.cs index 2bde479507b1..fa2a96c5246e 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/MaintenanceConfigurationsRestOperations.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/MaintenanceConfigurationsRestOperations.cs @@ -32,7 +32,7 @@ public MaintenanceConfigurationsRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01"; + _apiVersion = apiVersion ?? "2024-09-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ManagedClustersRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ManagedClustersRestOperations.cs index 503359a3f987..4ca6a1fc86f9 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ManagedClustersRestOperations.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ManagedClustersRestOperations.cs @@ -32,108 +32,10 @@ public ManagedClustersRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01"; + _apiVersion = apiVersion ?? "2024-09-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateGetOSOptionsRequestUri(string subscriptionId, AzureLocation location, ResourceType? resourceType) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ContainerService/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/osOptions/default", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (resourceType != null) - { - uri.AppendQuery("resource-type", resourceType.Value, true); - } - return uri; - } - - internal HttpMessage CreateGetOSOptionsRequest(string subscriptionId, AzureLocation location, ResourceType? resourceType) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.ContainerService/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/osOptions/default", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (resourceType != null) - { - uri.AppendQuery("resource-type", resourceType.Value, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets supported OS options in the specified subscription. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The resource type for which the OS options needs to be returned. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> GetOSOptionsAsync(string subscriptionId, AzureLocation location, ResourceType? resourceType = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateGetOSOptionsRequest(subscriptionId, location, resourceType); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OSOptionProfileData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = OSOptionProfileData.DeserializeOSOptionProfileData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((OSOptionProfileData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets supported OS options in the specified subscription. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the Azure region. - /// The resource type for which the OS options needs to be returned. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response GetOSOptions(string subscriptionId, AzureLocation location, ResourceType? resourceType = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateGetOSOptionsRequest(subscriptionId, location, resourceType); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - OSOptionProfileData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = OSOptionProfileData.DeserializeOSOptionProfileData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((OSOptionProfileData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateListKubernetesVersionsRequestUri(string subscriptionId, AzureLocation location) { var uri = new RawRequestUriBuilder(); @@ -1000,7 +902,7 @@ public Response Get(string subscriptionId, s } } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceManagedClusterData data) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceManagedClusterData data, string ifMatch, string ifNoneMatch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1014,7 +916,7 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceManagedClusterData data) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceManagedClusterData data, string ifMatch, string ifNoneMatch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1029,6 +931,14 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r uri.AppendPath(resourceName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + if (ifNoneMatch != null) + { + request.Headers.Add("If-None-Match", ifNoneMatch); + } request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); @@ -1043,17 +953,19 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r /// The name of the resource group. The name is case insensitive. /// The name of the managed cluster resource. /// The managed cluster to create or update. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceManagedClusterData data, CancellationToken cancellationToken = default) + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceManagedClusterData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, data, ifMatch, ifNoneMatch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -1070,17 +982,19 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re /// The name of the resource group. The name is case insensitive. /// The name of the managed cluster resource. /// The managed cluster to create or update. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceManagedClusterData data, CancellationToken cancellationToken = default) + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceManagedClusterData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, data, ifMatch, ifNoneMatch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -1092,7 +1006,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateUpdateTagsRequestUri(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject) + internal RequestUriBuilder CreateUpdateTagsRequestUri(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject, string ifMatch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1106,7 +1020,7 @@ internal RequestUriBuilder CreateUpdateTagsRequestUri(string subscriptionId, str return uri; } - internal HttpMessage CreateUpdateTagsRequest(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject) + internal HttpMessage CreateUpdateTagsRequest(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject, string ifMatch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1121,6 +1035,10 @@ internal HttpMessage CreateUpdateTagsRequest(string subscriptionId, string resou uri.AppendPath(resourceName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); @@ -1135,17 +1053,18 @@ internal HttpMessage CreateUpdateTagsRequest(string subscriptionId, string resou /// The name of the resource group. The name is case insensitive. /// The name of the managed cluster resource. /// Parameters supplied to the Update Managed Cluster Tags operation. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateTagsAsync(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default) + public async Task UpdateTagsAsync(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject, string ifMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject)); - using var message = CreateUpdateTagsRequest(subscriptionId, resourceGroupName, resourceName, containerServiceTagsObject); + using var message = CreateUpdateTagsRequest(subscriptionId, resourceGroupName, resourceName, containerServiceTagsObject, ifMatch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -1161,17 +1080,18 @@ public async Task UpdateTagsAsync(string subscriptionId, string resour /// The name of the resource group. The name is case insensitive. /// The name of the managed cluster resource. /// Parameters supplied to the Update Managed Cluster Tags operation. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response UpdateTags(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default) + public Response UpdateTags(string subscriptionId, string resourceGroupName, string resourceName, ContainerServiceTagsObject containerServiceTagsObject, string ifMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject)); - using var message = CreateUpdateTagsRequest(subscriptionId, resourceGroupName, resourceName, containerServiceTagsObject); + using var message = CreateUpdateTagsRequest(subscriptionId, resourceGroupName, resourceName, containerServiceTagsObject, ifMatch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -1182,7 +1102,7 @@ public Response UpdateTags(string subscriptionId, string resourceGroupName, stri } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string resourceName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string ifMatch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1196,7 +1116,7 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName, string ifMatch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1211,6 +1131,10 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath(resourceName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; @@ -1220,16 +1144,17 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the managed cluster resource. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string resourceName, string ifMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, ifMatch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -1245,16 +1170,17 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the managed cluster resource. + /// The request should only proceed if an entity matches this string. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string resourceName, string ifMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, ifMatch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index 856fc34d8ad9..7fd1e5b4f602 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -32,7 +32,7 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01"; + _apiVersion = apiVersion ?? "2024-09-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs index 49dbd76496a9..0e17b0ab0b3d 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -32,7 +32,7 @@ public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01"; + _apiVersion = apiVersion ?? "2024-09-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ResolvePrivateLinkServiceIdRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ResolvePrivateLinkServiceIdRestOperations.cs index 079e3871afa5..40a7264834db 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ResolvePrivateLinkServiceIdRestOperations.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/ResolvePrivateLinkServiceIdRestOperations.cs @@ -32,7 +32,7 @@ public ResolvePrivateLinkServiceIdRestOperations(HttpPipeline pipeline, string a { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01"; + _apiVersion = apiVersion ?? "2024-09-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/SnapshotsRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/SnapshotsRestOperations.cs index 5bb4a6a7ea25..d47dc7e56793 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/SnapshotsRestOperations.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/SnapshotsRestOperations.cs @@ -32,7 +32,7 @@ public SnapshotsRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01"; + _apiVersion = apiVersion ?? "2024-09-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRoleBindingsRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRoleBindingsRestOperations.cs index c3e920e855a7..4fd759fba5f4 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRoleBindingsRestOperations.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRoleBindingsRestOperations.cs @@ -32,7 +32,7 @@ public TrustedAccessRoleBindingsRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01"; + _apiVersion = apiVersion ?? "2024-09-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRolesRestOperations.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRolesRestOperations.cs index 5132b6d8d9f1..15afd2d4873e 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRolesRestOperations.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/RestOperations/TrustedAccessRolesRestOperations.cs @@ -32,7 +32,7 @@ public TrustedAccessRolesRestOperations(HttpPipeline pipeline, string applicatio { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01"; + _apiVersion = apiVersion ?? "2024-09-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/autorest.md b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/autorest.md index c904c624099b..bb994b961d52 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/autorest.md +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: ContainerService namespace: Azure.ResourceManager.ContainerService -require: https://github.com/Azure/azure-rest-api-specs/blob/8e674dd2a88ae73868c6fa7593a0ba4371e45991/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md #tag: package-2023-10 output-folder: $(this-folder)/Generated clear-output-folder: true diff --git a/sdk/containerservice/ci.mgmt.yml b/sdk/containerservice/ci.mgmt.yml index 9eb58047b02e..bcc8a9034576 100644 --- a/sdk/containerservice/ci.mgmt.yml +++ b/sdk/containerservice/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/containerservice/ci.mgmt.yml - sdk/containerservice/Azure.ResourceManager.ContainerService/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerservice/ci.mgmt.yml + - sdk/containerservice/Azure.ResourceManager.ContainerService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerservice/ci.mgmt.yml + - sdk/containerservice/Azure.ResourceManager.ContainerService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerservice/ci.mgmt.yml + - sdk/containerservice/Azure.ResourceManager.ContainerService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerservice/ci.mgmt.yml + - sdk/containerservice/Azure.ResourceManager.ContainerService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerservice/ci.mgmt.yml + - sdk/containerservice/Azure.ResourceManager.ContainerService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerservice/ci.mgmt.yml + - sdk/containerservice/Azure.ResourceManager.ContainerService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerservice/ci.mgmt.yml + - sdk/containerservice/Azure.ResourceManager.ContainerService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerservice/ci.mgmt.yml + - sdk/containerservice/Azure.ResourceManager.ContainerService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerservice/ci.mgmt.yml + - sdk/containerservice/Azure.ResourceManager.ContainerService/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/cosmosdb/ci.mgmt.yml b/sdk/cosmosdb/ci.mgmt.yml index 1eab24b3bbf9..04401c833180 100644 --- a/sdk/cosmosdb/ci.mgmt.yml +++ b/sdk/cosmosdb/ci.mgmt.yml @@ -2,6 +2,7 @@ # This file is generated automatically and any changes will be lost. trigger: none + pr: branches: include: @@ -14,6 +15,114 @@ pr: - sdk/cosmosdb/ci.mgmt.yml - sdk/cosmosdb/Azure.ResourceManager.CosmosDB/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cosmosdb/ci.mgmt.yml + - sdk/cosmosdb/Azure.ResourceManager.CosmosDB/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cosmosdb/ci.mgmt.yml + - sdk/cosmosdb/Azure.ResourceManager.CosmosDB/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cosmosdb/ci.mgmt.yml + - sdk/cosmosdb/Azure.ResourceManager.CosmosDB/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cosmosdb/ci.mgmt.yml + - sdk/cosmosdb/Azure.ResourceManager.CosmosDB/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cosmosdb/ci.mgmt.yml + - sdk/cosmosdb/Azure.ResourceManager.CosmosDB/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cosmosdb/ci.mgmt.yml + - sdk/cosmosdb/Azure.ResourceManager.CosmosDB/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cosmosdb/ci.mgmt.yml + - sdk/cosmosdb/Azure.ResourceManager.CosmosDB/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cosmosdb/ci.mgmt.yml + - sdk/cosmosdb/Azure.ResourceManager.CosmosDB/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cosmosdb/ci.mgmt.yml + - sdk/cosmosdb/Azure.ResourceManager.CosmosDB/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/cosmosdbforpostgresql/ci.mgmt.yml b/sdk/cosmosdbforpostgresql/ci.mgmt.yml index ef6098c3999f..4fcf6118950b 100644 --- a/sdk/cosmosdbforpostgresql/ci.mgmt.yml +++ b/sdk/cosmosdbforpostgresql/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/cosmosdbforpostgresql/ci.mgmt.yml - sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cosmosdbforpostgresql/ci.mgmt.yml + - sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cosmosdbforpostgresql/ci.mgmt.yml + - sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cosmosdbforpostgresql/ci.mgmt.yml + - sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cosmosdbforpostgresql/ci.mgmt.yml + - sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cosmosdbforpostgresql/ci.mgmt.yml + - sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cosmosdbforpostgresql/ci.mgmt.yml + - sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cosmosdbforpostgresql/ci.mgmt.yml + - sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cosmosdbforpostgresql/ci.mgmt.yml + - sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cosmosdbforpostgresql/ci.mgmt.yml + - sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/costmanagement/ci.mgmt.yml b/sdk/costmanagement/ci.mgmt.yml index e59280ba6be2..f5d9c2d120c1 100644 --- a/sdk/costmanagement/ci.mgmt.yml +++ b/sdk/costmanagement/ci.mgmt.yml @@ -2,6 +2,7 @@ # This file is generated automatically and any changes will be lost. trigger: none + pr: branches: include: @@ -14,6 +15,114 @@ pr: - sdk/costmanagement/ci.mgmt.yml - sdk/costmanagement/Azure.ResourceManager.CostManagement/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/costmanagement/ci.mgmt.yml + - sdk/costmanagement/Azure.ResourceManager.CostManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/costmanagement/ci.mgmt.yml + - sdk/costmanagement/Azure.ResourceManager.CostManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/costmanagement/ci.mgmt.yml + - sdk/costmanagement/Azure.ResourceManager.CostManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/costmanagement/ci.mgmt.yml + - sdk/costmanagement/Azure.ResourceManager.CostManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/costmanagement/ci.mgmt.yml + - sdk/costmanagement/Azure.ResourceManager.CostManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/costmanagement/ci.mgmt.yml + - sdk/costmanagement/Azure.ResourceManager.CostManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/costmanagement/ci.mgmt.yml + - sdk/costmanagement/Azure.ResourceManager.CostManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/costmanagement/ci.mgmt.yml + - sdk/costmanagement/Azure.ResourceManager.CostManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/costmanagement/ci.mgmt.yml + - sdk/costmanagement/Azure.ResourceManager.CostManagement/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/customer-insights/ci.mgmt.yml b/sdk/customer-insights/ci.mgmt.yml index 124af418dcfa..e8594c47789c 100644 --- a/sdk/customer-insights/ci.mgmt.yml +++ b/sdk/customer-insights/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/customer-insights/ci.mgmt.yml - sdk/customer-insights/Azure.ResourceManager.CustomerInsights/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/customer-insights/ci.mgmt.yml + - sdk/customer-insights/Azure.ResourceManager.CustomerInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/customer-insights/ci.mgmt.yml + - sdk/customer-insights/Azure.ResourceManager.CustomerInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/customer-insights/ci.mgmt.yml + - sdk/customer-insights/Azure.ResourceManager.CustomerInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/customer-insights/ci.mgmt.yml + - sdk/customer-insights/Azure.ResourceManager.CustomerInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/customer-insights/ci.mgmt.yml + - sdk/customer-insights/Azure.ResourceManager.CustomerInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/customer-insights/ci.mgmt.yml + - sdk/customer-insights/Azure.ResourceManager.CustomerInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/customer-insights/ci.mgmt.yml + - sdk/customer-insights/Azure.ResourceManager.CustomerInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/customer-insights/ci.mgmt.yml + - sdk/customer-insights/Azure.ResourceManager.CustomerInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/customer-insights/ci.mgmt.yml + - sdk/customer-insights/Azure.ResourceManager.CustomerInsights/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/databox/ci.mgmt.yml b/sdk/databox/ci.mgmt.yml index edd63a701700..00d2188890a8 100644 --- a/sdk/databox/ci.mgmt.yml +++ b/sdk/databox/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/databox/ci.mgmt.yml - sdk/databox/Azure.ResourceManager.DataBox/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/databox/ci.mgmt.yml + - sdk/databox/Azure.ResourceManager.DataBox/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/databox/ci.mgmt.yml + - sdk/databox/Azure.ResourceManager.DataBox/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/databox/ci.mgmt.yml + - sdk/databox/Azure.ResourceManager.DataBox/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/databox/ci.mgmt.yml + - sdk/databox/Azure.ResourceManager.DataBox/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/databox/ci.mgmt.yml + - sdk/databox/Azure.ResourceManager.DataBox/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/databox/ci.mgmt.yml + - sdk/databox/Azure.ResourceManager.DataBox/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/databox/ci.mgmt.yml + - sdk/databox/Azure.ResourceManager.DataBox/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/databox/ci.mgmt.yml + - sdk/databox/Azure.ResourceManager.DataBox/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/databox/ci.mgmt.yml + - sdk/databox/Azure.ResourceManager.DataBox/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/databoxedge/ci.mgmt.yml b/sdk/databoxedge/ci.mgmt.yml index 29e3b1537c78..a2c25d3c7463 100644 --- a/sdk/databoxedge/ci.mgmt.yml +++ b/sdk/databoxedge/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/databoxedge/ci.mgmt.yml - sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/databoxedge/ci.mgmt.yml + - sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/databoxedge/ci.mgmt.yml + - sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/databoxedge/ci.mgmt.yml + - sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/databoxedge/ci.mgmt.yml + - sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/databoxedge/ci.mgmt.yml + - sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/databoxedge/ci.mgmt.yml + - sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/databoxedge/ci.mgmt.yml + - sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/databoxedge/ci.mgmt.yml + - sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/databoxedge/ci.mgmt.yml + - sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/datadog/ci.mgmt.yml b/sdk/datadog/ci.mgmt.yml index 9e9d6825d8b0..3887dc90fd26 100644 --- a/sdk/datadog/ci.mgmt.yml +++ b/sdk/datadog/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/datadog/ci.mgmt.yml - sdk/datadog/Azure.ResourceManager.Datadog/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datadog/ci.mgmt.yml + - sdk/datadog/Azure.ResourceManager.Datadog/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datadog/ci.mgmt.yml + - sdk/datadog/Azure.ResourceManager.Datadog/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datadog/ci.mgmt.yml + - sdk/datadog/Azure.ResourceManager.Datadog/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datadog/ci.mgmt.yml + - sdk/datadog/Azure.ResourceManager.Datadog/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datadog/ci.mgmt.yml + - sdk/datadog/Azure.ResourceManager.Datadog/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datadog/ci.mgmt.yml + - sdk/datadog/Azure.ResourceManager.Datadog/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datadog/ci.mgmt.yml + - sdk/datadog/Azure.ResourceManager.Datadog/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datadog/ci.mgmt.yml + - sdk/datadog/Azure.ResourceManager.Datadog/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datadog/ci.mgmt.yml + - sdk/datadog/Azure.ResourceManager.Datadog/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/datafactory/ci.mgmt.yml b/sdk/datafactory/ci.mgmt.yml index 85d246a5d4e7..df503e512164 100644 --- a/sdk/datafactory/ci.mgmt.yml +++ b/sdk/datafactory/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/datafactory/ci.mgmt.yml - sdk/datafactory/Azure.ResourceManager.DataFactory/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datafactory/ci.mgmt.yml + - sdk/datafactory/Azure.ResourceManager.DataFactory/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datafactory/ci.mgmt.yml + - sdk/datafactory/Azure.ResourceManager.DataFactory/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datafactory/ci.mgmt.yml + - sdk/datafactory/Azure.ResourceManager.DataFactory/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datafactory/ci.mgmt.yml + - sdk/datafactory/Azure.ResourceManager.DataFactory/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datafactory/ci.mgmt.yml + - sdk/datafactory/Azure.ResourceManager.DataFactory/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datafactory/ci.mgmt.yml + - sdk/datafactory/Azure.ResourceManager.DataFactory/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datafactory/ci.mgmt.yml + - sdk/datafactory/Azure.ResourceManager.DataFactory/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datafactory/ci.mgmt.yml + - sdk/datafactory/Azure.ResourceManager.DataFactory/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datafactory/ci.mgmt.yml + - sdk/datafactory/Azure.ResourceManager.DataFactory/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/datalake-analytics/ci.mgmt.yml b/sdk/datalake-analytics/ci.mgmt.yml index b8794cd18f9e..05aca7c13fc5 100644 --- a/sdk/datalake-analytics/ci.mgmt.yml +++ b/sdk/datalake-analytics/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/datalake-analytics/ci.mgmt.yml - sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datalake-analytics/ci.mgmt.yml + - sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datalake-analytics/ci.mgmt.yml + - sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datalake-analytics/ci.mgmt.yml + - sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datalake-analytics/ci.mgmt.yml + - sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datalake-analytics/ci.mgmt.yml + - sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datalake-analytics/ci.mgmt.yml + - sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datalake-analytics/ci.mgmt.yml + - sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datalake-analytics/ci.mgmt.yml + - sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datalake-analytics/ci.mgmt.yml + - sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/datalake-store/ci.mgmt.yml b/sdk/datalake-store/ci.mgmt.yml index 469839fd3024..15c0ecc798d2 100644 --- a/sdk/datalake-store/ci.mgmt.yml +++ b/sdk/datalake-store/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/datalake-store/ci.mgmt.yml - sdk/datalake-store/Azure.ResourceManager.DataLakeStore/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datalake-store/ci.mgmt.yml + - sdk/datalake-store/Azure.ResourceManager.DataLakeStore/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datalake-store/ci.mgmt.yml + - sdk/datalake-store/Azure.ResourceManager.DataLakeStore/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datalake-store/ci.mgmt.yml + - sdk/datalake-store/Azure.ResourceManager.DataLakeStore/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datalake-store/ci.mgmt.yml + - sdk/datalake-store/Azure.ResourceManager.DataLakeStore/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datalake-store/ci.mgmt.yml + - sdk/datalake-store/Azure.ResourceManager.DataLakeStore/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datalake-store/ci.mgmt.yml + - sdk/datalake-store/Azure.ResourceManager.DataLakeStore/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datalake-store/ci.mgmt.yml + - sdk/datalake-store/Azure.ResourceManager.DataLakeStore/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datalake-store/ci.mgmt.yml + - sdk/datalake-store/Azure.ResourceManager.DataLakeStore/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datalake-store/ci.mgmt.yml + - sdk/datalake-store/Azure.ResourceManager.DataLakeStore/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/datamigration/ci.mgmt.yml b/sdk/datamigration/ci.mgmt.yml index 1e64024fed17..d5a971f996b5 100644 --- a/sdk/datamigration/ci.mgmt.yml +++ b/sdk/datamigration/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/datamigration/ci.mgmt.yml - sdk/datamigration/Azure.ResourceManager.DataMigration/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datamigration/ci.mgmt.yml + - sdk/datamigration/Azure.ResourceManager.DataMigration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datamigration/ci.mgmt.yml + - sdk/datamigration/Azure.ResourceManager.DataMigration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datamigration/ci.mgmt.yml + - sdk/datamigration/Azure.ResourceManager.DataMigration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datamigration/ci.mgmt.yml + - sdk/datamigration/Azure.ResourceManager.DataMigration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datamigration/ci.mgmt.yml + - sdk/datamigration/Azure.ResourceManager.DataMigration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datamigration/ci.mgmt.yml + - sdk/datamigration/Azure.ResourceManager.DataMigration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datamigration/ci.mgmt.yml + - sdk/datamigration/Azure.ResourceManager.DataMigration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datamigration/ci.mgmt.yml + - sdk/datamigration/Azure.ResourceManager.DataMigration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datamigration/ci.mgmt.yml + - sdk/datamigration/Azure.ResourceManager.DataMigration/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/dataprotection/ci.mgmt.yml b/sdk/dataprotection/ci.mgmt.yml index 25637090aedb..788d06ca6618 100644 --- a/sdk/dataprotection/ci.mgmt.yml +++ b/sdk/dataprotection/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/dataprotection/ci.mgmt.yml - sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dataprotection/ci.mgmt.yml + - sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dataprotection/ci.mgmt.yml + - sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dataprotection/ci.mgmt.yml + - sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dataprotection/ci.mgmt.yml + - sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dataprotection/ci.mgmt.yml + - sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dataprotection/ci.mgmt.yml + - sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dataprotection/ci.mgmt.yml + - sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dataprotection/ci.mgmt.yml + - sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dataprotection/ci.mgmt.yml + - sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/datashare/ci.mgmt.yml b/sdk/datashare/ci.mgmt.yml index f6dd41e0f37f..706893b11a93 100644 --- a/sdk/datashare/ci.mgmt.yml +++ b/sdk/datashare/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/datashare/ci.mgmt.yml - sdk/datashare/Azure.ResourceManager.DataShare/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datashare/ci.mgmt.yml + - sdk/datashare/Azure.ResourceManager.DataShare/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datashare/ci.mgmt.yml + - sdk/datashare/Azure.ResourceManager.DataShare/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datashare/ci.mgmt.yml + - sdk/datashare/Azure.ResourceManager.DataShare/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datashare/ci.mgmt.yml + - sdk/datashare/Azure.ResourceManager.DataShare/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datashare/ci.mgmt.yml + - sdk/datashare/Azure.ResourceManager.DataShare/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datashare/ci.mgmt.yml + - sdk/datashare/Azure.ResourceManager.DataShare/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datashare/ci.mgmt.yml + - sdk/datashare/Azure.ResourceManager.DataShare/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datashare/ci.mgmt.yml + - sdk/datashare/Azure.ResourceManager.DataShare/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datashare/ci.mgmt.yml + - sdk/datashare/Azure.ResourceManager.DataShare/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/defendereasm/ci.mgmt.yml b/sdk/defendereasm/ci.mgmt.yml index dd90e5a46690..436f60825a28 100644 --- a/sdk/defendereasm/ci.mgmt.yml +++ b/sdk/defendereasm/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/defendereasm/ci.mgmt.yml - sdk/defendereasm/Azure.ResourceManager.DefenderEasm/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/defendereasm/ci.mgmt.yml + - sdk/defendereasm/Azure.ResourceManager.DefenderEasm/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/defendereasm/ci.mgmt.yml + - sdk/defendereasm/Azure.ResourceManager.DefenderEasm/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/defendereasm/ci.mgmt.yml + - sdk/defendereasm/Azure.ResourceManager.DefenderEasm/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/defendereasm/ci.mgmt.yml + - sdk/defendereasm/Azure.ResourceManager.DefenderEasm/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/defendereasm/ci.mgmt.yml + - sdk/defendereasm/Azure.ResourceManager.DefenderEasm/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/defendereasm/ci.mgmt.yml + - sdk/defendereasm/Azure.ResourceManager.DefenderEasm/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/defendereasm/ci.mgmt.yml + - sdk/defendereasm/Azure.ResourceManager.DefenderEasm/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/defendereasm/ci.mgmt.yml + - sdk/defendereasm/Azure.ResourceManager.DefenderEasm/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/defendereasm/ci.mgmt.yml + - sdk/defendereasm/Azure.ResourceManager.DefenderEasm/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/desktopvirtualization/ci.mgmt.yml b/sdk/desktopvirtualization/ci.mgmt.yml index 3d6f40025c77..7c4e3de5966c 100644 --- a/sdk/desktopvirtualization/ci.mgmt.yml +++ b/sdk/desktopvirtualization/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/desktopvirtualization/ci.mgmt.yml - sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/desktopvirtualization/ci.mgmt.yml + - sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/desktopvirtualization/ci.mgmt.yml + - sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/desktopvirtualization/ci.mgmt.yml + - sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/desktopvirtualization/ci.mgmt.yml + - sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/desktopvirtualization/ci.mgmt.yml + - sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/desktopvirtualization/ci.mgmt.yml + - sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/desktopvirtualization/ci.mgmt.yml + - sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/desktopvirtualization/ci.mgmt.yml + - sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/desktopvirtualization/ci.mgmt.yml + - sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/devcenter/ci.mgmt.yml b/sdk/devcenter/ci.mgmt.yml index 136d77bbba6d..cf9279880dc5 100644 --- a/sdk/devcenter/ci.mgmt.yml +++ b/sdk/devcenter/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/devcenter/ci.mgmt.yml - sdk/devcenter/Azure.ResourceManager.DevCenter/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devcenter/ci.mgmt.yml + - sdk/devcenter/Azure.ResourceManager.DevCenter/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devcenter/ci.mgmt.yml + - sdk/devcenter/Azure.ResourceManager.DevCenter/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devcenter/ci.mgmt.yml + - sdk/devcenter/Azure.ResourceManager.DevCenter/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devcenter/ci.mgmt.yml + - sdk/devcenter/Azure.ResourceManager.DevCenter/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devcenter/ci.mgmt.yml + - sdk/devcenter/Azure.ResourceManager.DevCenter/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devcenter/ci.mgmt.yml + - sdk/devcenter/Azure.ResourceManager.DevCenter/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devcenter/ci.mgmt.yml + - sdk/devcenter/Azure.ResourceManager.DevCenter/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devcenter/ci.mgmt.yml + - sdk/devcenter/Azure.ResourceManager.DevCenter/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devcenter/ci.mgmt.yml + - sdk/devcenter/Azure.ResourceManager.DevCenter/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/deviceprovisioningservices/ci.mgmt.yml b/sdk/deviceprovisioningservices/ci.mgmt.yml index f9c94973a324..73124033ac84 100644 --- a/sdk/deviceprovisioningservices/ci.mgmt.yml +++ b/sdk/deviceprovisioningservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/deviceprovisioningservices/ci.mgmt.yml - sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceprovisioningservices/ci.mgmt.yml + - sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceprovisioningservices/ci.mgmt.yml + - sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceprovisioningservices/ci.mgmt.yml + - sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceprovisioningservices/ci.mgmt.yml + - sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceprovisioningservices/ci.mgmt.yml + - sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceprovisioningservices/ci.mgmt.yml + - sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceprovisioningservices/ci.mgmt.yml + - sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceprovisioningservices/ci.mgmt.yml + - sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceprovisioningservices/ci.mgmt.yml + - sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/deviceregistry/ci.mgmt.yml b/sdk/deviceregistry/ci.mgmt.yml index 05fffe301114..bf7a4c483826 100644 --- a/sdk/deviceregistry/ci.mgmt.yml +++ b/sdk/deviceregistry/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/deviceregistry/ci.mgmt.yml - sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceregistry/ci.mgmt.yml + - sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceregistry/ci.mgmt.yml + - sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceregistry/ci.mgmt.yml + - sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceregistry/ci.mgmt.yml + - sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceregistry/ci.mgmt.yml + - sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceregistry/ci.mgmt.yml + - sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceregistry/ci.mgmt.yml + - sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceregistry/ci.mgmt.yml + - sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceregistry/ci.mgmt.yml + - sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/deviceupdate/ci.mgmt.yml b/sdk/deviceupdate/ci.mgmt.yml index c1315e462bb9..08503782b4cc 100644 --- a/sdk/deviceupdate/ci.mgmt.yml +++ b/sdk/deviceupdate/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/deviceupdate/ci.mgmt.yml - sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceupdate/ci.mgmt.yml + - sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceupdate/ci.mgmt.yml + - sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceupdate/ci.mgmt.yml + - sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceupdate/ci.mgmt.yml + - sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceupdate/ci.mgmt.yml + - sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceupdate/ci.mgmt.yml + - sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceupdate/ci.mgmt.yml + - sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceupdate/ci.mgmt.yml + - sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceupdate/ci.mgmt.yml + - sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/devopsinfrastructure/ci.mgmt.yml b/sdk/devopsinfrastructure/ci.mgmt.yml index 0f2db1225cf0..3062a58033dd 100644 --- a/sdk/devopsinfrastructure/ci.mgmt.yml +++ b/sdk/devopsinfrastructure/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/devopsinfrastructure/ci.mgmt.yml - sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devopsinfrastructure/ci.mgmt.yml + - sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devopsinfrastructure/ci.mgmt.yml + - sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devopsinfrastructure/ci.mgmt.yml + - sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devopsinfrastructure/ci.mgmt.yml + - sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devopsinfrastructure/ci.mgmt.yml + - sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devopsinfrastructure/ci.mgmt.yml + - sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devopsinfrastructure/ci.mgmt.yml + - sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devopsinfrastructure/ci.mgmt.yml + - sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devopsinfrastructure/ci.mgmt.yml + - sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/devspaces/ci.mgmt.yml b/sdk/devspaces/ci.mgmt.yml index b63234a64555..2378d245d236 100644 --- a/sdk/devspaces/ci.mgmt.yml +++ b/sdk/devspaces/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/devspaces/ci.mgmt.yml - sdk/devspaces/Azure.ResourceManager.DevSpaces/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devspaces/ci.mgmt.yml + - sdk/devspaces/Azure.ResourceManager.DevSpaces/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devspaces/ci.mgmt.yml + - sdk/devspaces/Azure.ResourceManager.DevSpaces/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devspaces/ci.mgmt.yml + - sdk/devspaces/Azure.ResourceManager.DevSpaces/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devspaces/ci.mgmt.yml + - sdk/devspaces/Azure.ResourceManager.DevSpaces/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devspaces/ci.mgmt.yml + - sdk/devspaces/Azure.ResourceManager.DevSpaces/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devspaces/ci.mgmt.yml + - sdk/devspaces/Azure.ResourceManager.DevSpaces/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devspaces/ci.mgmt.yml + - sdk/devspaces/Azure.ResourceManager.DevSpaces/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devspaces/ci.mgmt.yml + - sdk/devspaces/Azure.ResourceManager.DevSpaces/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devspaces/ci.mgmt.yml + - sdk/devspaces/Azure.ResourceManager.DevSpaces/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/devtestlabs/ci.mgmt.yml b/sdk/devtestlabs/ci.mgmt.yml index 1946409a6b75..acbf9cf58ce0 100644 --- a/sdk/devtestlabs/ci.mgmt.yml +++ b/sdk/devtestlabs/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/devtestlabs/ci.mgmt.yml - sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devtestlabs/ci.mgmt.yml + - sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devtestlabs/ci.mgmt.yml + - sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devtestlabs/ci.mgmt.yml + - sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devtestlabs/ci.mgmt.yml + - sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devtestlabs/ci.mgmt.yml + - sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devtestlabs/ci.mgmt.yml + - sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devtestlabs/ci.mgmt.yml + - sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devtestlabs/ci.mgmt.yml + - sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devtestlabs/ci.mgmt.yml + - sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/digitaltwins/ci.mgmt.yml b/sdk/digitaltwins/ci.mgmt.yml index a0e8233a36cf..e9ed22074aae 100644 --- a/sdk/digitaltwins/ci.mgmt.yml +++ b/sdk/digitaltwins/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/digitaltwins/ci.mgmt.yml - sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/digitaltwins/ci.mgmt.yml + - sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/digitaltwins/ci.mgmt.yml + - sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/digitaltwins/ci.mgmt.yml + - sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/digitaltwins/ci.mgmt.yml + - sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/digitaltwins/ci.mgmt.yml + - sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/digitaltwins/ci.mgmt.yml + - sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/digitaltwins/ci.mgmt.yml + - sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/digitaltwins/ci.mgmt.yml + - sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/digitaltwins/ci.mgmt.yml + - sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/dns/ci.mgmt.yml b/sdk/dns/ci.mgmt.yml index 8357809b4e6f..3e167ad0a3e1 100644 --- a/sdk/dns/ci.mgmt.yml +++ b/sdk/dns/ci.mgmt.yml @@ -2,6 +2,7 @@ # This file is generated automatically and any changes will be lost. trigger: none + pr: branches: include: @@ -14,6 +15,114 @@ pr: - sdk/dns/ci.mgmt.yml - sdk/dns/Azure.ResourceManager.Dns/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dns/ci.mgmt.yml + - sdk/dns/Azure.ResourceManager.Dns/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dns/ci.mgmt.yml + - sdk/dns/Azure.ResourceManager.Dns/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dns/ci.mgmt.yml + - sdk/dns/Azure.ResourceManager.Dns/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dns/ci.mgmt.yml + - sdk/dns/Azure.ResourceManager.Dns/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dns/ci.mgmt.yml + - sdk/dns/Azure.ResourceManager.Dns/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dns/ci.mgmt.yml + - sdk/dns/Azure.ResourceManager.Dns/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dns/ci.mgmt.yml + - sdk/dns/Azure.ResourceManager.Dns/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dns/ci.mgmt.yml + - sdk/dns/Azure.ResourceManager.Dns/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dns/ci.mgmt.yml + - sdk/dns/Azure.ResourceManager.Dns/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/dnsresolver/ci.mgmt.yml b/sdk/dnsresolver/ci.mgmt.yml index afa270cdc600..54f3e8fd3219 100644 --- a/sdk/dnsresolver/ci.mgmt.yml +++ b/sdk/dnsresolver/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/dnsresolver/ci.mgmt.yml - sdk/dnsresolver/Azure.ResourceManager.DnsResolver/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dnsresolver/ci.mgmt.yml + - sdk/dnsresolver/Azure.ResourceManager.DnsResolver/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dnsresolver/ci.mgmt.yml + - sdk/dnsresolver/Azure.ResourceManager.DnsResolver/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dnsresolver/ci.mgmt.yml + - sdk/dnsresolver/Azure.ResourceManager.DnsResolver/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dnsresolver/ci.mgmt.yml + - sdk/dnsresolver/Azure.ResourceManager.DnsResolver/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dnsresolver/ci.mgmt.yml + - sdk/dnsresolver/Azure.ResourceManager.DnsResolver/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dnsresolver/ci.mgmt.yml + - sdk/dnsresolver/Azure.ResourceManager.DnsResolver/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dnsresolver/ci.mgmt.yml + - sdk/dnsresolver/Azure.ResourceManager.DnsResolver/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dnsresolver/ci.mgmt.yml + - sdk/dnsresolver/Azure.ResourceManager.DnsResolver/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dnsresolver/ci.mgmt.yml + - sdk/dnsresolver/Azure.ResourceManager.DnsResolver/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/dynatrace/ci.mgmt.yml b/sdk/dynatrace/ci.mgmt.yml index f76bf3a316af..67b3dab2c477 100644 --- a/sdk/dynatrace/ci.mgmt.yml +++ b/sdk/dynatrace/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/dynatrace/ci.mgmt.yml - sdk/dynatrace/Azure.ResourceManager.Dynatrace/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dynatrace/ci.mgmt.yml + - sdk/dynatrace/Azure.ResourceManager.Dynatrace/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dynatrace/ci.mgmt.yml + - sdk/dynatrace/Azure.ResourceManager.Dynatrace/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dynatrace/ci.mgmt.yml + - sdk/dynatrace/Azure.ResourceManager.Dynatrace/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dynatrace/ci.mgmt.yml + - sdk/dynatrace/Azure.ResourceManager.Dynatrace/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dynatrace/ci.mgmt.yml + - sdk/dynatrace/Azure.ResourceManager.Dynatrace/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dynatrace/ci.mgmt.yml + - sdk/dynatrace/Azure.ResourceManager.Dynatrace/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dynatrace/ci.mgmt.yml + - sdk/dynatrace/Azure.ResourceManager.Dynatrace/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dynatrace/ci.mgmt.yml + - sdk/dynatrace/Azure.ResourceManager.Dynatrace/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dynatrace/ci.mgmt.yml + - sdk/dynatrace/Azure.ResourceManager.Dynatrace/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/edgeorder/ci.mgmt.yml b/sdk/edgeorder/ci.mgmt.yml index 4d1fbaa121f9..2cfa9968d60e 100644 --- a/sdk/edgeorder/ci.mgmt.yml +++ b/sdk/edgeorder/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/edgeorder/ci.mgmt.yml - sdk/edgeorder/Azure.ResourceManager.EdgeOrder/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/edgeorder/ci.mgmt.yml + - sdk/edgeorder/Azure.ResourceManager.EdgeOrder/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/edgeorder/ci.mgmt.yml + - sdk/edgeorder/Azure.ResourceManager.EdgeOrder/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/edgeorder/ci.mgmt.yml + - sdk/edgeorder/Azure.ResourceManager.EdgeOrder/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/edgeorder/ci.mgmt.yml + - sdk/edgeorder/Azure.ResourceManager.EdgeOrder/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/edgeorder/ci.mgmt.yml + - sdk/edgeorder/Azure.ResourceManager.EdgeOrder/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/edgeorder/ci.mgmt.yml + - sdk/edgeorder/Azure.ResourceManager.EdgeOrder/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/edgeorder/ci.mgmt.yml + - sdk/edgeorder/Azure.ResourceManager.EdgeOrder/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/edgeorder/ci.mgmt.yml + - sdk/edgeorder/Azure.ResourceManager.EdgeOrder/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/edgeorder/ci.mgmt.yml + - sdk/edgeorder/Azure.ResourceManager.EdgeOrder/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/edgezones/ci.mgmt.yml b/sdk/edgezones/ci.mgmt.yml index 9dc8d79aab30..f04249c5eda9 100644 --- a/sdk/edgezones/ci.mgmt.yml +++ b/sdk/edgezones/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/edgezones/ci.mgmt.yml - sdk/edgezones/Azure.ResourceManager.EdgeZones/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/edgezones/ci.mgmt.yml + - sdk/edgezones/Azure.ResourceManager.EdgeZones/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/edgezones/ci.mgmt.yml + - sdk/edgezones/Azure.ResourceManager.EdgeZones/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/edgezones/ci.mgmt.yml + - sdk/edgezones/Azure.ResourceManager.EdgeZones/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/edgezones/ci.mgmt.yml + - sdk/edgezones/Azure.ResourceManager.EdgeZones/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/edgezones/ci.mgmt.yml + - sdk/edgezones/Azure.ResourceManager.EdgeZones/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/edgezones/ci.mgmt.yml + - sdk/edgezones/Azure.ResourceManager.EdgeZones/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/edgezones/ci.mgmt.yml + - sdk/edgezones/Azure.ResourceManager.EdgeZones/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/edgezones/ci.mgmt.yml + - sdk/edgezones/Azure.ResourceManager.EdgeZones/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/edgezones/ci.mgmt.yml + - sdk/edgezones/Azure.ResourceManager.EdgeZones/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/elastic/ci.mgmt.yml b/sdk/elastic/ci.mgmt.yml index 76ecd8b3923d..906f93037ffd 100644 --- a/sdk/elastic/ci.mgmt.yml +++ b/sdk/elastic/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/elastic/ci.mgmt.yml - sdk/elastic/Azure.ResourceManager.Elastic/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/elastic/ci.mgmt.yml + - sdk/elastic/Azure.ResourceManager.Elastic/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/elastic/ci.mgmt.yml + - sdk/elastic/Azure.ResourceManager.Elastic/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/elastic/ci.mgmt.yml + - sdk/elastic/Azure.ResourceManager.Elastic/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/elastic/ci.mgmt.yml + - sdk/elastic/Azure.ResourceManager.Elastic/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/elastic/ci.mgmt.yml + - sdk/elastic/Azure.ResourceManager.Elastic/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/elastic/ci.mgmt.yml + - sdk/elastic/Azure.ResourceManager.Elastic/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/elastic/ci.mgmt.yml + - sdk/elastic/Azure.ResourceManager.Elastic/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/elastic/ci.mgmt.yml + - sdk/elastic/Azure.ResourceManager.Elastic/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/elastic/ci.mgmt.yml + - sdk/elastic/Azure.ResourceManager.Elastic/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/elasticsan/ci.mgmt.yml b/sdk/elasticsan/ci.mgmt.yml index 7e2bb35dde21..6f76ddafca27 100644 --- a/sdk/elasticsan/ci.mgmt.yml +++ b/sdk/elasticsan/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/elasticsan/ci.mgmt.yml - sdk/elasticsan/Azure.ResourceManager.ElasticSan/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/elasticsan/ci.mgmt.yml + - sdk/elasticsan/Azure.ResourceManager.ElasticSan/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/elasticsan/ci.mgmt.yml + - sdk/elasticsan/Azure.ResourceManager.ElasticSan/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/elasticsan/ci.mgmt.yml + - sdk/elasticsan/Azure.ResourceManager.ElasticSan/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/elasticsan/ci.mgmt.yml + - sdk/elasticsan/Azure.ResourceManager.ElasticSan/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/elasticsan/ci.mgmt.yml + - sdk/elasticsan/Azure.ResourceManager.ElasticSan/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/elasticsan/ci.mgmt.yml + - sdk/elasticsan/Azure.ResourceManager.ElasticSan/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/elasticsan/ci.mgmt.yml + - sdk/elasticsan/Azure.ResourceManager.ElasticSan/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/elasticsan/ci.mgmt.yml + - sdk/elasticsan/Azure.ResourceManager.ElasticSan/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/elasticsan/ci.mgmt.yml + - sdk/elasticsan/Azure.ResourceManager.ElasticSan/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: 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 5cffdf30386c..84a5c2a9d135 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 @@ -35,7 +35,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class AcsChatMessageDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatMessageDeletedEventData() { } - public System.DateTimeOffset DeleteTime { get { throw null; } } + public System.DateTimeOffset? DeleteTime { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -46,7 +46,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AcsChatMessageDeletedInThreadEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventInThreadBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatMessageDeletedInThreadEventData() { } - public System.DateTimeOffset DeleteTime { get { throw null; } } + public System.DateTimeOffset? DeleteTime { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -57,7 +57,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AcsChatMessageEditedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatMessageEditedEventData() { } - public System.DateTimeOffset EditTime { get { throw null; } } + public System.DateTimeOffset? EditTime { get { throw null; } } public string MessageBody { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -70,7 +70,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AcsChatMessageEditedInThreadEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventInThreadBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatMessageEditedInThreadEventData() { } - public System.DateTimeOffset EditTime { get { throw null; } } + public System.DateTimeOffset? EditTime { get { throw null; } } public string MessageBody { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -83,7 +83,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AcsChatMessageEventBaseProperties : Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatMessageEventBaseProperties() { } - public System.DateTimeOffset ComposeTime { get { throw null; } } + public System.DateTimeOffset? ComposeTime { get { throw null; } } public string MessageId { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel SenderCommunicationIdentifier { get { throw null; } } public string SenderDisplayName { get { throw null; } } @@ -99,7 +99,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AcsChatMessageEventInThreadBaseProperties : Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatMessageEventInThreadBaseProperties() { } - public System.DateTimeOffset ComposeTime { get { throw null; } } + public System.DateTimeOffset? ComposeTime { get { throw null; } } public string MessageId { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel SenderCommunicationIdentifier { get { throw null; } } public string SenderDisplayName { get { throw null; } } @@ -141,7 +141,7 @@ public partial class AcsChatParticipantAddedToThreadEventData : Azure.Messaging. internal AcsChatParticipantAddedToThreadEventData() { } 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; } } + public System.DateTimeOffset? Time { get { throw null; } } public long? Version { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -155,7 +155,7 @@ public partial class AcsChatParticipantAddedToThreadWithUserEventData : Azure.Me 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; } } + public System.DateTimeOffset? Time { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -168,7 +168,7 @@ public partial class AcsChatParticipantRemovedFromThreadEventData : Azure.Messag internal AcsChatParticipantRemovedFromThreadEventData() { } 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; } } + public System.DateTimeOffset? Time { get { throw null; } } public long? Version { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -182,7 +182,7 @@ public partial class AcsChatParticipantRemovedFromThreadWithUserEventData : Azur 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; } } + public System.DateTimeOffset? Time { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -222,7 +222,7 @@ 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; } } + public System.DateTimeOffset? DeleteTime { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -233,7 +233,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AcsChatThreadEventBaseProperties : Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatThreadEventBaseProperties() { } - public System.DateTimeOffset CreateTime { get { throw null; } } + public System.DateTimeOffset? CreateTime { get { throw null; } } public long? Version { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventBaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -245,7 +245,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AcsChatThreadEventInThreadBaseProperties : Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatThreadEventInThreadBaseProperties() { } - public System.DateTimeOffset CreateTime { get { throw null; } } + public System.DateTimeOffset? CreateTime { get { throw null; } } public long? Version { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventInThreadBaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -271,7 +271,7 @@ public partial class AcsChatThreadPropertiesUpdatedEventData : Azure.Messaging.E { internal AcsChatThreadPropertiesUpdatedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel EditedByCommunicationIdentifier { get { throw null; } } - public System.DateTimeOffset EditTime { get { throw null; } } + 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 void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -285,7 +285,7 @@ public partial class AcsChatThreadPropertiesUpdatedPerUserEventData : Azure.Mess { internal AcsChatThreadPropertiesUpdatedPerUserEventData() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel EditedByCommunicationIdentifier { get { throw null; } } - public System.DateTimeOffset EditTime { get { throw null; } } + 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 void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -299,7 +299,7 @@ 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; } } + public System.DateTimeOffset? DeleteTime { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -310,12 +310,12 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AcsEmailDeliveryReportReceivedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsEmailDeliveryReportReceivedEventData() { } - public System.DateTimeOffset DeliveryAttemptTimestamp { get { throw null; } } + public System.DateTimeOffset? DeliveryAttemptTimestamp { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatusDetails DeliveryStatusDetails { get { throw null; } } public string MessageId { get { throw null; } } public string Recipient { get { throw null; } } public string Sender { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus Status { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus? Status { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -359,12 +359,12 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class AcsEmailEngagementTrackingReportReceivedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsEmailEngagementTrackingReportReceivedEventData() { } - public Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement Engagement { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement? Engagement { get { throw null; } } public string EngagementContext { get { throw null; } } public string MessageId { get { throw null; } } public string Recipient { get { throw null; } } public string Sender { get { throw null; } } - public System.DateTimeOffset UserActionTimestamp { get { throw null; } } + public System.DateTimeOffset? UserActionTimestamp { get { throw null; } } public string UserAgent { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsEmailEngagementTrackingReportReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -393,6 +393,7 @@ internal AcsIncomingCallEventData() { } public Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallCustomContext CustomContext { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel FromCommunicationIdentifier { get { throw null; } } public string IncomingCallContext { get { throw null; } } + 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 void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -499,9 +500,9 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class AcsMessageDeliveryStatusUpdatedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsMessageDeliveryStatusUpdatedEventData() { } - public Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind ChannelKind { get { throw null; } } + 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; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus? Status { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -514,7 +515,7 @@ public partial class AcsMessageEventData : System.ClientModel.Primitives.IJsonMo internal AcsMessageEventData() { } public Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError Error { get { throw null; } } public string From { get { throw null; } } - public System.DateTimeOffset ReceivedTimestamp { get { throw null; } } + public System.DateTimeOffset? ReceivedTimestamp { get { throw null; } } public string To { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -540,7 +541,7 @@ public partial class AcsMessageInteractiveContent : System.ClientModel.Primitive 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; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind? ReplyKind { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -610,11 +611,11 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class AcsRecordingFileStatusUpdatedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsRecordingFileStatusUpdatedEventData() { } - public Azure.Messaging.EventGrid.SystemEvents.RecordingChannelType RecordingChannelKind { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.RecordingContentType RecordingContentType { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.RecordingChannelType? RecordingChannelKind { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.RecordingContentType? RecordingContentType { get { throw null; } } public long? RecordingDurationMs { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType RecordingFormatType { get { throw null; } } - public System.DateTimeOffset RecordingStartTime { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType? RecordingFormatType { get { throw null; } } + 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 void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -791,10 +792,10 @@ public partial class AcsRouterJobReceivedEventData : Azure.Messaging.EventGrid.S { internal AcsRouterJobReceivedEventData() { } public string ClassificationPolicyId { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus JobStatus { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus? JobStatus { get { throw null; } } public int? Priority { get { throw null; } } public System.Collections.Generic.IReadOnlyList RequestedWorkerSelectors { get { throw null; } } - public System.DateTimeOffset ScheduledOn { get { throw null; } } + public System.DateTimeOffset? ScheduledOn { get { throw null; } } public bool UnavailableForMatching { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -810,7 +811,7 @@ internal AcsRouterJobSchedulingFailedEventData() { } public System.Collections.Generic.IReadOnlyList ExpiredRequestedWorkerSelectors { get { throw null; } } public string FailureReason { get { throw null; } } public int? Priority { get { throw null; } } - public System.DateTimeOffset ScheduledOn { get { throw null; } } + public System.DateTimeOffset? ScheduledOn { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -864,7 +865,7 @@ internal AcsRouterJobWaitingForActivationEventData() { } public System.Collections.Generic.IReadOnlyList ExpiredAttachedWorkerSelectors { get { throw null; } } public System.Collections.Generic.IReadOnlyList ExpiredRequestedWorkerSelectors { get { throw null; } } public int? Priority { get { throw null; } } - public System.DateTimeOffset ScheduledOn { get { throw null; } } + public System.DateTimeOffset? ScheduledOn { get { throw null; } } public bool UnavailableForMatching { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobWaitingForActivationEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1019,11 +1020,11 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AcsRouterWorkerOfferIssuedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsRouterWorkerOfferIssuedEventData() { } - public System.DateTimeOffset ExpiresOn { get { throw null; } } + public System.DateTimeOffset? ExpiresOn { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary JobLabels { get { throw null; } } public int? JobPriority { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary JobTags { get { throw null; } } - public System.DateTimeOffset OfferedOn { get { throw null; } } + public System.DateTimeOffset? OfferedOn { get { throw null; } } public string OfferId { get { throw null; } } public string QueueId { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary WorkerLabels { get { throw null; } } @@ -1066,11 +1067,11 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class AcsRouterWorkerSelector : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsRouterWorkerSelector() { } - public System.DateTimeOffset ExpirationTime { get { throw null; } } + public System.DateTimeOffset? ExpirationTime { get { throw null; } } public string Key { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator LabelOperator { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator? LabelOperator { get { throw null; } } public System.BinaryData LabelValue { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState SelectorState { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState? SelectorState { get { throw null; } } public double TimeToLive { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelector System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1119,7 +1120,7 @@ public partial class AcsSmsDeliveryAttemptProperties : System.ClientModel.Primit internal AcsSmsDeliveryAttemptProperties() { } public int? SegmentsFailed { get { throw null; } } public int? SegmentsSucceeded { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -1133,7 +1134,7 @@ internal AcsSmsDeliveryReportReceivedEventData() { } public System.Collections.Generic.IReadOnlyList DeliveryAttempts { get { throw null; } } public string DeliveryStatus { get { throw null; } } public string DeliveryStatusDetails { get { throw null; } } - public System.DateTimeOffset ReceivedTimestamp { get { throw null; } } + public System.DateTimeOffset? ReceivedTimestamp { get { throw null; } } public string Tag { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryReportReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1159,7 +1160,7 @@ public partial class AcsSmsReceivedEventData : Azure.Messaging.EventGrid.SystemE { internal AcsSmsReceivedEventData() { } public string Message { get { throw null; } } - public System.DateTimeOffset ReceivedTimestamp { get { throw null; } } + public System.DateTimeOffset? ReceivedTimestamp { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -1606,7 +1607,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AppEventTypeDetail : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AppEventTypeDetail() { } - public Azure.Messaging.EventGrid.SystemEvents.AppAction Action { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AppAction? Action { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -1634,9 +1635,9 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class AppServicePlanEventTypeDetail : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { 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; } } + 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 void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -1848,7 +1849,7 @@ public partial class CommunicationIdentifierModel : System.ClientModel.Primitive { internal CommunicationIdentifierModel() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationUserIdentifierModel CommunicationUser { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModelKind Kind { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModelKind? Kind { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsAppIdentifierModel MicrosoftTeamsApp { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel MicrosoftTeamsUser { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel PhoneNumber { get { throw null; } } @@ -1899,7 +1900,7 @@ internal ContainerRegistryArtifactEventData() { } public string Id { get { throw null; } } public string Location { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget Target { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -1977,7 +1978,7 @@ internal ContainerRegistryEventData() { } public Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest Request { get { throw null; } } 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; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -2139,8 +2140,8 @@ public partial class DataBoxCopyCompletedEventData : System.ClientModel.Primitiv { 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; } } + public Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? StageName { get { throw null; } } + public System.DateTimeOffset? StageTime { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -2152,8 +2153,8 @@ public partial class DataBoxCopyStartedEventData : System.ClientModel.Primitives { 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; } } + public Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? StageName { get { throw null; } } + public System.DateTimeOffset? StageTime { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -2165,8 +2166,8 @@ public partial class DataBoxOrderCompletedEventData : System.ClientModel.Primiti { 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; } } + public Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? StageName { get { throw null; } } + public System.DateTimeOffset? StageTime { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -2312,155 +2313,155 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class EventGridMQTTClientCreatedOrUpdatedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class EventGridMqttClientCreatedOrUpdatedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal EventGridMQTTClientCreatedOrUpdatedEventData() { } + internal EventGridMqttClientCreatedOrUpdatedEventData() { } public System.Collections.Generic.IReadOnlyDictionary Attributes { get { throw null; } } - public System.DateTimeOffset CreatedOn { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState State { get { throw null; } } - public System.DateTimeOffset UpdatedOn { get { throw null; } } + 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 void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - 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; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(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; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class EventGridMQTTClientDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class EventGridMqttClientDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal EventGridMQTTClientDeletedEventData() { } + internal EventGridMqttClientDeletedEventData() { } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - 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; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(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; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct EventGridMQTTClientDisconnectionReason : System.IEquatable + public readonly partial struct EventGridMqttClientDisconnectionReason : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public EventGridMQTTClientDisconnectionReason(string value) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason ClientAuthenticationError { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason ClientAuthorizationError { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason ClientError { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason ClientInitiatedDisconnect { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason ConnectionLost { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason IpForbidden { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason QuotaExceeded { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason ServerError { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason ServerInitiatedDisconnect { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason SessionOverflow { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason SessionTakenOver { get { throw null; } } - public bool Equals(Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason other) { throw null; } + public EventGridMqttClientDisconnectionReason(string value) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ClientAuthenticationError { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ClientAuthorizationError { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ClientError { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ClientInitiatedDisconnect { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ConnectionLost { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason IpForbidden { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason QuotaExceeded { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ServerError { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ServerInitiatedDisconnect { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason SessionOverflow { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason SessionTakenOver { get { throw null; } } + public bool Equals(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] 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 bool operator !=(Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason left, Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason right) { 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 bool operator !=(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason left, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason right) { throw null; } public override string ToString() { throw null; } } - public partial class EventGridMQTTClientEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class EventGridMqttClientEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal EventGridMQTTClientEventData() { } + internal EventGridMqttClientEventData() { } public string ClientAuthenticationName { get { throw null; } } public string ClientName { get { throw null; } } public string NamespaceName { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - 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; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(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; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class EventGridMQTTClientSessionConnectedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class EventGridMqttClientSessionConnectedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal EventGridMQTTClientSessionConnectedEventData() { } + internal EventGridMqttClientSessionConnectedEventData() { } public string ClientSessionName { get { throw null; } } public long? SequenceNumber { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - 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; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(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; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class EventGridMQTTClientSessionDisconnectedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class EventGridMqttClientSessionDisconnectedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal EventGridMQTTClientSessionDisconnectedEventData() { } + internal EventGridMqttClientSessionDisconnectedEventData() { } public string ClientSessionName { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason DisconnectionReason { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason? DisconnectionReason { get { throw null; } } public long? SequenceNumber { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - 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; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(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; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct EventGridMQTTClientState : System.IEquatable + public readonly partial struct EventGridMqttClientState : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public EventGridMQTTClientState(string value) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState Disabled { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState Enabled { get { throw null; } } - public bool Equals(Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState other) { throw null; } + public EventGridMqttClientState(string value) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState Disabled { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState Enabled { get { throw null; } } + public bool Equals(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] 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 bool operator !=(Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState left, Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState right) { 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 bool operator !=(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState left, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState right) { throw null; } public override string ToString() { throw null; } } public static partial class EventGridSystemEventsModelFactory { public static Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties AcsChatEventBaseProperties(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties AcsChatEventInThreadBaseProperties(string transactionId = null, string threadId = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedEventData AcsChatMessageDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?), System.DateTimeOffset deleteTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedInThreadEventData AcsChatMessageDeletedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?), System.DateTimeOffset deleteTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEditedEventData AcsChatMessageEditedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.DateTimeOffset editTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEditedInThreadEventData AcsChatMessageEditedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.DateTimeOffset editTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventBaseProperties AcsChatMessageEventBaseProperties(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventInThreadBaseProperties AcsChatMessageEventInThreadBaseProperties(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageReceivedEventData AcsChatMessageReceivedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageReceivedInThreadEventData AcsChatMessageReceivedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadEventData AcsChatParticipantAddedToThreadEventData(string transactionId = null, string threadId = null, System.DateTimeOffset time = default(System.DateTimeOffset), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel addedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantAdded = null, long? version = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadWithUserEventData AcsChatParticipantAddedToThreadWithUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), System.DateTimeOffset time = default(System.DateTimeOffset), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel addedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantAdded = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadEventData AcsChatParticipantRemovedFromThreadEventData(string transactionId = null, string threadId = null, System.DateTimeOffset time = default(System.DateTimeOffset), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel removedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantRemoved = null, long? version = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadWithUserEventData AcsChatParticipantRemovedFromThreadWithUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), System.DateTimeOffset time = default(System.DateTimeOffset), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel removedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantRemoved = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadCreatedEventData AcsChatThreadCreatedEventData(string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel createdByCommunicationIdentifier = null, System.Collections.Generic.IReadOnlyDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IEnumerable participants = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadCreatedWithUserEventData AcsChatThreadCreatedWithUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel createdByCommunicationIdentifier = null, System.Collections.Generic.IReadOnlyDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IEnumerable participants = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadDeletedEventData AcsChatThreadDeletedEventData(string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel deletedByCommunicationIdentifier = null, System.DateTimeOffset deleteTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventBaseProperties AcsChatThreadEventBaseProperties(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventInThreadBaseProperties AcsChatThreadEventInThreadBaseProperties(string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedEventData AcsChatMessageDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?), System.DateTimeOffset? deleteTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedInThreadEventData AcsChatMessageDeletedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?), System.DateTimeOffset? deleteTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEditedEventData AcsChatMessageEditedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.DateTimeOffset? editTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEditedInThreadEventData AcsChatMessageEditedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.DateTimeOffset? editTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventBaseProperties AcsChatMessageEventBaseProperties(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventInThreadBaseProperties AcsChatMessageEventInThreadBaseProperties(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageReceivedEventData AcsChatMessageReceivedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageReceivedInThreadEventData AcsChatMessageReceivedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadEventData AcsChatParticipantAddedToThreadEventData(string transactionId = null, string threadId = null, System.DateTimeOffset? time = default(System.DateTimeOffset?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel addedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantAdded = null, long? version = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadWithUserEventData AcsChatParticipantAddedToThreadWithUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), System.DateTimeOffset? time = default(System.DateTimeOffset?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel addedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantAdded = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadEventData AcsChatParticipantRemovedFromThreadEventData(string transactionId = null, string threadId = null, System.DateTimeOffset? time = default(System.DateTimeOffset?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel removedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantRemoved = null, long? version = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadWithUserEventData AcsChatParticipantRemovedFromThreadWithUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), System.DateTimeOffset? time = default(System.DateTimeOffset?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel removedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantRemoved = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadCreatedEventData AcsChatThreadCreatedEventData(string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel createdByCommunicationIdentifier = null, System.Collections.Generic.IReadOnlyDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IEnumerable participants = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadCreatedWithUserEventData AcsChatThreadCreatedWithUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel createdByCommunicationIdentifier = null, System.Collections.Generic.IReadOnlyDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IEnumerable participants = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadDeletedEventData AcsChatThreadDeletedEventData(string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel deletedByCommunicationIdentifier = null, System.DateTimeOffset? deleteTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventBaseProperties AcsChatThreadEventBaseProperties(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventInThreadBaseProperties AcsChatThreadEventInThreadBaseProperties(string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties AcsChatThreadParticipantProperties(string displayName = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel participantCommunicationIdentifier = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadPropertiesUpdatedEventData AcsChatThreadPropertiesUpdatedEventData(string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel editedByCommunicationIdentifier = null, System.DateTimeOffset editTime = default(System.DateTimeOffset), System.Collections.Generic.IReadOnlyDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadPropertiesUpdatedPerUserEventData AcsChatThreadPropertiesUpdatedPerUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel editedByCommunicationIdentifier = null, System.DateTimeOffset editTime = default(System.DateTimeOffset), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IReadOnlyDictionary properties = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadWithUserDeletedEventData AcsChatThreadWithUserDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel deletedByCommunicationIdentifier = null, System.DateTimeOffset deleteTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportReceivedEventData AcsEmailDeliveryReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus status = default(Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus), Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatusDetails deliveryStatusDetails = null, System.DateTimeOffset deliveryAttemptTimestamp = default(System.DateTimeOffset)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadPropertiesUpdatedEventData AcsChatThreadPropertiesUpdatedEventData(string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel editedByCommunicationIdentifier = null, System.DateTimeOffset? editTime = default(System.DateTimeOffset?), System.Collections.Generic.IReadOnlyDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadPropertiesUpdatedPerUserEventData AcsChatThreadPropertiesUpdatedPerUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel editedByCommunicationIdentifier = null, System.DateTimeOffset? editTime = default(System.DateTimeOffset?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IReadOnlyDictionary properties = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadWithUserDeletedEventData AcsChatThreadWithUserDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel deletedByCommunicationIdentifier = null, System.DateTimeOffset? deleteTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportReceivedEventData AcsEmailDeliveryReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus? status = default(Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus?), Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatusDetails deliveryStatusDetails = null, System.DateTimeOffset? deliveryAttemptTimestamp = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatusDetails AcsEmailDeliveryReportStatusDetails(string statusMessage = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsEmailEngagementTrackingReportReceivedEventData AcsEmailEngagementTrackingReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, System.DateTimeOffset userActionTimestamp = default(System.DateTimeOffset), string engagementContext = null, string userAgent = null, Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement engagement = default(Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsEmailEngagementTrackingReportReceivedEventData AcsEmailEngagementTrackingReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, System.DateTimeOffset? userActionTimestamp = default(System.DateTimeOffset?), string engagementContext = null, string userAgent = null, Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement? engagement = default(Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallCustomContext AcsIncomingCallCustomContext(System.Collections.Generic.IReadOnlyDictionary sipHeaders = null, System.Collections.Generic.IReadOnlyDictionary voipHeaders = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallEventData AcsIncomingCallEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel toCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel fromCommunicationIdentifier = null, string serverCallId = null, string callerDisplayName = null, Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallCustomContext customContext = null, string incomingCallContext = null, string correlationId = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallEventData AcsIncomingCallEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel toCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel fromCommunicationIdentifier = null, string serverCallId = null, string callerDisplayName = null, Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallCustomContext customContext = null, string incomingCallContext = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel onBehalfOfCallee = null, string correlationId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageButtonContent AcsMessageButtonContent(string text = null, string payload = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError AcsMessageChannelEventError(string channelCode = null, string channelMessage = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageContext AcsMessageContext(string from = null, string messageId = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatusUpdatedEventData AcsMessageDeliveryStatusUpdatedEventData(string from = null, string to = null, System.DateTimeOffset receivedTimestamp = default(System.DateTimeOffset), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError error = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus status = default(Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind channelKind = default(Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData AcsMessageEventData(string from = null, string to = null, System.DateTimeOffset receivedTimestamp = default(System.DateTimeOffset), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError error = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatusUpdatedEventData AcsMessageDeliveryStatusUpdatedEventData(string from = null, string to = null, System.DateTimeOffset? receivedTimestamp = default(System.DateTimeOffset?), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError error = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus? status = default(Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus?), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind? channelKind = default(Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData AcsMessageEventData(string from = null, string to = null, System.DateTimeOffset? receivedTimestamp = default(System.DateTimeOffset?), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError error = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveButtonReplyContent AcsMessageInteractiveButtonReplyContent(string buttonId = null, string title = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveContent AcsMessageInteractiveContent(Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind replyKind = default(Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind), Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveButtonReplyContent buttonReply = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveListReplyContent listReply = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveContent AcsMessageInteractiveContent(Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind? replyKind = default(Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind?), Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveButtonReplyContent buttonReply = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveListReplyContent listReply = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveListReplyContent AcsMessageInteractiveListReplyContent(string listItemId = null, string title = null, string description = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageMediaContent AcsMessageMediaContent(string mimeType = null, string mediaId = null, string fileName = null, string caption = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageReceivedEventData AcsMessageReceivedEventData(string from = null, string to = null, System.DateTimeOffset receivedTimestamp = default(System.DateTimeOffset), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError error = null, string content = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind channelKind = default(Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind), Azure.Messaging.EventGrid.SystemEvents.AcsMessageMediaContent mediaContent = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageContext context = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageButtonContent button = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveContent interactiveContent = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageReceivedEventData AcsMessageReceivedEventData(string from = null, string to = null, System.DateTimeOffset? receivedTimestamp = default(System.DateTimeOffset?), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError error = null, string content = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind channelKind = default(Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind), Azure.Messaging.EventGrid.SystemEvents.AcsMessageMediaContent mediaContent = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageContext context = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageButtonContent button = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveContent interactiveContent = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRecordingChunkInfoProperties AcsRecordingChunkInfoProperties(string documentId = null, long? index = default(long?), string endReason = null, string metadataLocation = null, string contentLocation = null, string deleteLocation = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFileStatusUpdatedEventData AcsRecordingFileStatusUpdatedEventData(Azure.Messaging.EventGrid.SystemEvents.AcsRecordingStorageInfoProperties recordingStorageInfo = null, System.DateTimeOffset recordingStartTime = default(System.DateTimeOffset), long? recordingDurationMs = default(long?), Azure.Messaging.EventGrid.SystemEvents.RecordingContentType recordingContentType = default(Azure.Messaging.EventGrid.SystemEvents.RecordingContentType), Azure.Messaging.EventGrid.SystemEvents.RecordingChannelType recordingChannelKind = default(Azure.Messaging.EventGrid.SystemEvents.RecordingChannelType), Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType recordingFormatType = default(Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType), string sessionEndReason = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFileStatusUpdatedEventData AcsRecordingFileStatusUpdatedEventData(Azure.Messaging.EventGrid.SystemEvents.AcsRecordingStorageInfoProperties recordingStorageInfo = null, System.DateTimeOffset? recordingStartTime = default(System.DateTimeOffset?), long? recordingDurationMs = default(long?), Azure.Messaging.EventGrid.SystemEvents.RecordingContentType? recordingContentType = default(Azure.Messaging.EventGrid.SystemEvents.RecordingContentType?), Azure.Messaging.EventGrid.SystemEvents.RecordingChannelType? recordingChannelKind = default(Azure.Messaging.EventGrid.SystemEvents.RecordingChannelType?), Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType? recordingFormatType = default(Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType?), string sessionEndReason = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRecordingStorageInfoProperties AcsRecordingStorageInfoProperties(System.Collections.Generic.IEnumerable recordingChunks = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterChannelConfiguration AcsRouterChannelConfiguration(string channelId = null, int? capacityCostPerJob = default(int?), int? maxNumberOfJobs = default(int?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterCommunicationError AcsRouterCommunicationError(string code = null, string message = null, string target = null, Azure.Messaging.EventGrid.SystemEvents.AcsRouterCommunicationError innererror = null, System.Collections.Generic.IEnumerable details = null) { throw null; } @@ -2474,10 +2475,10 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobEventData AcsRouterJobEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobExceptionTriggeredEventData AcsRouterJobExceptionTriggeredEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, string ruleKey = null, string exceptionRuleId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobQueuedEventData AcsRouterJobQueuedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, int? priority = default(int?), System.Collections.Generic.IEnumerable attachedWorkerSelectors = null, System.Collections.Generic.IEnumerable requestedWorkerSelectors = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobReceivedEventData AcsRouterJobReceivedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus jobStatus = default(Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus), string classificationPolicyId = null, int? priority = default(int?), System.Collections.Generic.IEnumerable requestedWorkerSelectors = null, System.DateTimeOffset scheduledOn = default(System.DateTimeOffset), bool unavailableForMatching = false) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobSchedulingFailedEventData AcsRouterJobSchedulingFailedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, int? priority = default(int?), System.Collections.Generic.IEnumerable expiredAttachedWorkerSelectors = null, System.Collections.Generic.IEnumerable expiredRequestedWorkerSelectors = null, System.DateTimeOffset scheduledOn = default(System.DateTimeOffset), string failureReason = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobReceivedEventData AcsRouterJobReceivedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus? jobStatus = default(Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus?), string classificationPolicyId = null, int? priority = default(int?), System.Collections.Generic.IEnumerable requestedWorkerSelectors = null, System.DateTimeOffset? scheduledOn = default(System.DateTimeOffset?), bool unavailableForMatching = false) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobSchedulingFailedEventData AcsRouterJobSchedulingFailedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, int? priority = default(int?), System.Collections.Generic.IEnumerable expiredAttachedWorkerSelectors = null, System.Collections.Generic.IEnumerable expiredRequestedWorkerSelectors = null, System.DateTimeOffset? scheduledOn = default(System.DateTimeOffset?), string failureReason = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobUnassignedEventData AcsRouterJobUnassignedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, string assignmentId = null, string workerId = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobWaitingForActivationEventData AcsRouterJobWaitingForActivationEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, int? priority = default(int?), System.Collections.Generic.IEnumerable expiredAttachedWorkerSelectors = null, System.Collections.Generic.IEnumerable expiredRequestedWorkerSelectors = null, System.DateTimeOffset scheduledOn = default(System.DateTimeOffset), bool unavailableForMatching = false) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobWaitingForActivationEventData AcsRouterJobWaitingForActivationEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, int? priority = default(int?), System.Collections.Generic.IEnumerable expiredAttachedWorkerSelectors = null, System.Collections.Generic.IEnumerable expiredRequestedWorkerSelectors = null, System.DateTimeOffset? scheduledOn = default(System.DateTimeOffset?), bool unavailableForMatching = false) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobWorkerSelectorsExpiredEventData AcsRouterJobWorkerSelectorsExpiredEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, System.Collections.Generic.IEnumerable expiredRequestedWorkerSelectors = null, System.Collections.Generic.IEnumerable expiredAttachedWorkerSelectors = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterQueueDetails AcsRouterQueueDetails(string id = null, string name = null, System.Collections.Generic.IReadOnlyDictionary labels = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerDeletedEventData AcsRouterWorkerDeletedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null) { throw null; } @@ -2486,15 +2487,15 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.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 = default(int?), System.Collections.Generic.IReadOnlyDictionary workerLabels = null, 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.AcsRouterWorkerOfferDeclinedEventData AcsRouterWorkerOfferDeclinedEventData(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.AcsRouterWorkerOfferExpiredEventData AcsRouterWorkerOfferExpiredEventData(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.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.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 labelOperator = default(Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator), System.BinaryData labelValue = null, double timeToLive = 0, 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.AcsRouterWorkerSelector AcsRouterWorkerSelector(string key = null, Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator? labelOperator = default(Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator?), System.BinaryData labelValue = null, double timeToLive = 0, 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; } + 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; } public static Azure.Messaging.EventGrid.SystemEvents.AcsSmsEventBaseProperties AcsSmsEventBaseProperties(string messageId = null, string from = null, string to = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsSmsReceivedEventData AcsSmsReceivedEventData(string messageId = null, string from = null, string to = null, string message = null, System.DateTimeOffset receivedTimestamp = default(System.DateTimeOffset)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsSmsReceivedEventData AcsSmsReceivedEventData(string messageId = null, string from = null, string to = null, string message = null, System.DateTimeOffset? receivedTimestamp = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsUserDisconnectedEventData AcsUserDisconnectedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel userCommunicationIdentifier = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiDefinitionAddedEventData ApiCenterApiDefinitionAddedEventData(string title = null, string description = null, Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiSpecification specification = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiDefinitionUpdatedEventData ApiCenterApiDefinitionUpdatedEventData(string title = null, string description = null, Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiSpecification specification = null) { throw null; } @@ -2530,8 +2531,8 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotCreatedEventData AppConfigurationSnapshotCreatedEventData(string name = null, string etag = null, string syncToken = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData AppConfigurationSnapshotEventData(string name = null, string etag = null, string syncToken = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotModifiedEventData AppConfigurationSnapshotModifiedEventData(string name = null, string etag = null, string syncToken = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AppEventTypeDetail AppEventTypeDetail(Azure.Messaging.EventGrid.SystemEvents.AppAction action = default(Azure.Messaging.EventGrid.SystemEvents.AppAction)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AppServicePlanEventTypeDetail AppServicePlanEventTypeDetail(Azure.Messaging.EventGrid.SystemEvents.StampKind stampKind = default(Azure.Messaging.EventGrid.SystemEvents.StampKind), Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction action = default(Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction), Azure.Messaging.EventGrid.SystemEvents.AsyncStatus status = default(Azure.Messaging.EventGrid.SystemEvents.AsyncStatus)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AppEventTypeDetail AppEventTypeDetail(Azure.Messaging.EventGrid.SystemEvents.AppAction? action = default(Azure.Messaging.EventGrid.SystemEvents.AppAction?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AppServicePlanEventTypeDetail AppServicePlanEventTypeDetail(Azure.Messaging.EventGrid.SystemEvents.StampKind? stampKind = default(Azure.Messaging.EventGrid.SystemEvents.StampKind?), Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction? action = default(Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction?), Azure.Messaging.EventGrid.SystemEvents.AsyncStatus? status = default(Azure.Messaging.EventGrid.SystemEvents.AsyncStatus?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AvsClusterCreatedEventData AvsClusterCreatedEventData(string operationId = null, System.Collections.Generic.IEnumerable addedHostNames = null, System.Collections.Generic.IEnumerable removedHostNames = null, System.Collections.Generic.IEnumerable inMaintenanceHostNames = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AvsClusterDeletedEventData AvsClusterDeletedEventData(string operationId = null, System.Collections.Generic.IEnumerable addedHostNames = null, System.Collections.Generic.IEnumerable removedHostNames = null, System.Collections.Generic.IEnumerable inMaintenanceHostNames = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData AvsClusterEventData(string operationId = null, System.Collections.Generic.IEnumerable addedHostNames = null, System.Collections.Generic.IEnumerable removedHostNames = null, System.Collections.Generic.IEnumerable inMaintenanceHostNames = null) { throw null; } @@ -2547,20 +2548,20 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionFailedEventData AvsScriptExecutionFailedEventData(string operationId = null, string cmdletId = null, System.Collections.Generic.IEnumerable output = null, string failureMessage = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionFinishedEventData AvsScriptExecutionFinishedEventData(string operationId = null, string cmdletId = null, System.Collections.Generic.IEnumerable output = null, System.Collections.Generic.IReadOnlyDictionary namedOutputs = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionStartedEventData AvsScriptExecutionStartedEventData(string operationId = null, string cmdletId = null, System.Collections.Generic.IEnumerable output = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel CommunicationIdentifierModel(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModelKind kind = default(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModelKind), string rawId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationUserIdentifierModel communicationUser = null, Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel phoneNumber = null, Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel microsoftTeamsUser = null, Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsAppIdentifierModel microsoftTeamsApp = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel CommunicationIdentifierModel(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModelKind? kind = default(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModelKind?), string rawId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationUserIdentifierModel communicationUser = null, Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel phoneNumber = null, Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel microsoftTeamsUser = null, Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsAppIdentifierModel microsoftTeamsApp = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.CommunicationUserIdentifierModel CommunicationUserIdentifierModel(string id = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData ContainerRegistryArtifactEventData(string id = null, System.DateTimeOffset timestamp = default(System.DateTimeOffset), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData ContainerRegistryArtifactEventData(string id = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget ContainerRegistryArtifactEventTarget(string mediaType = null, long? size = default(long?), string digest = null, string repository = null, string tag = null, string name = null, string version = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryChartDeletedEventData ContainerRegistryChartDeletedEventData(string id = null, System.DateTimeOffset timestamp = default(System.DateTimeOffset), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryChartPushedEventData ContainerRegistryChartPushedEventData(string id = null, System.DateTimeOffset timestamp = default(System.DateTimeOffset), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryChartDeletedEventData ContainerRegistryChartDeletedEventData(string id = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryChartPushedEventData ContainerRegistryChartPushedEventData(string id = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor ContainerRegistryEventActor(string name = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry ContainerRegistryEventConnectedRegistry(string name = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData ContainerRegistryEventData(string id = null, System.DateTimeOffset timestamp = default(System.DateTimeOffset), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest request = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor actor = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource source = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData ContainerRegistryEventData(string id = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest request = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor actor = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource source = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest ContainerRegistryEventRequest(string id = null, string addr = null, string host = null, string method = null, string useragent = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource ContainerRegistryEventSource(string addr = null, string instanceID = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget ContainerRegistryEventTarget(string mediaType = null, long? size = default(long?), string digest = null, long? length = default(long?), string repository = null, string url = null, string tag = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryImageDeletedEventData ContainerRegistryImageDeletedEventData(string id = null, System.DateTimeOffset timestamp = default(System.DateTimeOffset), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest request = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor actor = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource source = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryImagePushedEventData ContainerRegistryImagePushedEventData(string id = null, System.DateTimeOffset timestamp = default(System.DateTimeOffset), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest request = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor actor = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource source = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryImageDeletedEventData ContainerRegistryImageDeletedEventData(string id = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest request = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor actor = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource source = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryImagePushedEventData ContainerRegistryImagePushedEventData(string id = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest request = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor actor = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource source = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEndedEventData ContainerServiceClusterSupportEndedEventData(string kubernetesVersion = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEndingEventData ContainerServiceClusterSupportEndingEventData(string kubernetesVersion = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEventData ContainerServiceClusterSupportEventData(string kubernetesVersion = null) { throw null; } @@ -2569,9 +2570,9 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingFailedEventData ContainerServiceNodePoolRollingFailedEventData(string nodePoolName = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingStartedEventData ContainerServiceNodePoolRollingStartedEventData(string nodePoolName = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingSucceededEventData ContainerServiceNodePoolRollingSucceededEventData(string nodePoolName = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyCompletedEventData DataBoxCopyCompletedEventData(string serialNumber = null, Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName stageName = default(Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName), System.DateTimeOffset stageTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyStartedEventData DataBoxCopyStartedEventData(string serialNumber = null, Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName stageName = default(Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName), System.DateTimeOffset stageTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.DataBoxOrderCompletedEventData DataBoxOrderCompletedEventData(string serialNumber = null, Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName stageName = default(Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName), System.DateTimeOffset stageTime = default(System.DateTimeOffset)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyCompletedEventData DataBoxCopyCompletedEventData(string serialNumber = null, Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? stageName = default(Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName?), System.DateTimeOffset? stageTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyStartedEventData DataBoxCopyStartedEventData(string serialNumber = null, Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? stageName = default(Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName?), System.DateTimeOffset? stageTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.DataBoxOrderCompletedEventData DataBoxOrderCompletedEventData(string serialNumber = null, Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? stageName = default(Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName?), System.DateTimeOffset? stageTime = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventInfo DeviceConnectionStateEventInfo(string sequenceNumber = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventProperties DeviceConnectionStateEventProperties(string deviceId = null, string moduleId = null, string hubName = null, Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventInfo deviceConnectionStateEventInfo = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.DeviceLifeCycleEventProperties DeviceLifeCycleEventProperties(string deviceId = null, string hubName = null, Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfo twin = null) { throw null; } @@ -2581,18 +2582,18 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfoX509Thumbprint DeviceTwinInfoX509Thumbprint(string primaryThumbprint = null, string secondaryThumbprint = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.DeviceTwinMetadata DeviceTwinMetadata(string lastUpdated = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.DeviceTwinProperties DeviceTwinProperties(Azure.Messaging.EventGrid.SystemEvents.DeviceTwinMetadata metadata = null, float? version = default(float?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientCreatedOrUpdatedEventData EventGridMQTTClientCreatedOrUpdatedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState state = default(Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset updatedOn = default(System.DateTimeOffset), System.Collections.Generic.IReadOnlyDictionary attributes = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDeletedEventData EventGridMQTTClientDeletedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientEventData EventGridMQTTClientEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientSessionConnectedEventData EventGridMQTTClientSessionConnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientSessionDisconnectedEventData EventGridMQTTClientSessionDisconnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = default(long?), Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason disconnectionReason = default(Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventHubCaptureFileCreatedEventData EventHubCaptureFileCreatedEventData(string fileurl = null, string fileType = null, string partitionId = null, int? sizeInBytes = default(int?), int? eventCount = default(int?), int? firstSequenceNumber = default(int?), int? lastSequenceNumber = default(int?), System.DateTimeOffset firstEnqueueTime = default(System.DateTimeOffset), System.DateTimeOffset lastEnqueueTime = default(System.DateTimeOffset)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientCreatedOrUpdatedEventData EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState? state = default(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), System.Collections.Generic.IReadOnlyDictionary attributes = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDeletedEventData EventGridMqttClientDeletedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData EventGridMqttClientEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientSessionConnectedEventData EventGridMqttClientSessionConnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientSessionDisconnectedEventData EventGridMqttClientSessionDisconnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = default(long?), Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason? disconnectionReason = default(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventHubCaptureFileCreatedEventData EventHubCaptureFileCreatedEventData(string fileurl = null, string fileType = null, string partitionId = null, int? sizeInBytes = default(int?), int? eventCount = default(int?), int? firstSequenceNumber = default(int?), int? lastSequenceNumber = default(int?), System.DateTimeOffset? firstEnqueueTime = default(System.DateTimeOffset?), System.DateTimeOffset? lastEnqueueTime = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageCreatedEventData HealthcareDicomImageCreatedEventData(string partitionName = null, string imageStudyInstanceUid = null, string imageSeriesInstanceUid = null, string imageSopInstanceUid = null, string serviceHostName = null, long? sequenceNumber = default(long?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageDeletedEventData HealthcareDicomImageDeletedEventData(string partitionName = null, string imageStudyInstanceUid = null, string imageSeriesInstanceUid = null, string imageSopInstanceUid = null, string serviceHostName = null, long? sequenceNumber = default(long?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageUpdatedEventData HealthcareDicomImageUpdatedEventData(string partitionName = null, string imageStudyInstanceUid = null, string imageSeriesInstanceUid = null, string imageSopInstanceUid = null, string serviceHostName = null, long? sequenceNumber = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceCreatedEventData HealthcareFhirResourceCreatedEventData(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType fhirResourceType = default(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType), string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceDeletedEventData HealthcareFhirResourceDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType fhirResourceType = default(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType), string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceUpdatedEventData HealthcareFhirResourceUpdatedEventData(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType fhirResourceType = default(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType), string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceCreatedEventData HealthcareFhirResourceCreatedEventData(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? fhirResourceType = default(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType?), string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceDeletedEventData HealthcareFhirResourceDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? fhirResourceType = default(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType?), string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceUpdatedEventData HealthcareFhirResourceUpdatedEventData(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? fhirResourceType = default(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType?), string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = default(long?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceConnectedEventData IotHubDeviceConnectedEventData(string deviceId = null, string moduleId = null, string hubName = null, Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventInfo deviceConnectionStateEventInfo = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceCreatedEventData IotHubDeviceCreatedEventData(string deviceId = null, string hubName = null, Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfo twin = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceDeletedEventData IotHubDeviceDeletedEventData(string deviceId = null, string hubName = null, Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfo twin = null) { throw null; } @@ -2608,7 +2609,7 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretExpiredEventData KeyVaultSecretExpiredEventData(string id = null, string vaultName = null, string objectType = null, string objectName = null, string version = null, float? nbf = default(float?), float? exp = default(float?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretNearExpiryEventData KeyVaultSecretNearExpiryEventData(string id = null, string vaultName = null, string objectType = null, string objectName = null, string version = null, float? nbf = default(float?), float? exp = default(float?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretNewVersionCreatedEventData KeyVaultSecretNewVersionCreatedEventData(string id = null, string vaultName = null, string objectType = null, string objectName = null, string version = null, float? nbf = default(float?), float? exp = default(float?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesDatasetDriftDetectedEventData MachineLearningServicesDatasetDriftDetectedEventData(string dataDriftId = null, string dataDriftName = null, string runId = null, string baseDatasetId = null, string targetDatasetId = null, double? driftCoefficient = default(double?), System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset endTime = default(System.DateTimeOffset)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesDatasetDriftDetectedEventData MachineLearningServicesDatasetDriftDetectedEventData(string dataDriftId = null, string dataDriftName = null, string runId = null, string baseDatasetId = null, string targetDatasetId = null, double? driftCoefficient = default(double?), System.DateTimeOffset? startTime = default(System.DateTimeOffset?), System.DateTimeOffset? endTime = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesModelDeployedEventData MachineLearningServicesModelDeployedEventData(string serviceName = null, string serviceComputeType = null, string modelIds = null, System.Collections.Generic.IReadOnlyDictionary serviceTags = null, System.Collections.Generic.IReadOnlyDictionary serviceProperties = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesModelRegisteredEventData MachineLearningServicesModelRegisteredEventData(string modelName = null, string modelVersion = null, System.Collections.Generic.IReadOnlyDictionary modelTags = null, System.Collections.Generic.IReadOnlyDictionary modelProperties = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesRunCompletedEventData MachineLearningServicesRunCompletedEventData(string experimentId = null, string experimentName = null, string runId = null, string runType = null, System.Collections.Generic.IReadOnlyDictionary runTags = null, System.Collections.Generic.IReadOnlyDictionary runProperties = null) { throw null; } @@ -2618,45 +2619,16 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceExitedEventData MapsGeofenceExitedEventData(System.Collections.Generic.IEnumerable expiredGeofenceGeometryId = null, System.Collections.Generic.IEnumerable geometries = null, System.Collections.Generic.IEnumerable invalidPeriodGeofenceGeometryId = null, bool? isEventPublished = default(bool?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceGeometry MapsGeofenceGeometry(string deviceId = null, float? distance = default(float?), string geometryId = null, float? nearestLat = default(float?), float? nearestLon = default(float?), string udId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceResultEventData MapsGeofenceResultEventData(System.Collections.Generic.IEnumerable expiredGeofenceGeometryId = null, System.Collections.Generic.IEnumerable geometries = null, System.Collections.Generic.IEnumerable invalidPeriodGeofenceGeometryId = null, bool? isEventPublished = default(bool?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobCanceledEventData MediaJobCanceledEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), System.Collections.Generic.IReadOnlyDictionary correlationData = null, System.Collections.Generic.IEnumerable outputs = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobCancelingEventData MediaJobCancelingEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), System.Collections.Generic.IReadOnlyDictionary correlationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobError MediaJobError(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode code = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode), string message = null, Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory category = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory), Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry retry = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry), System.Collections.Generic.IEnumerable details = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorDetail MediaJobErrorDetail(string code = null, string message = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErroredEventData MediaJobErroredEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), System.Collections.Generic.IReadOnlyDictionary correlationData = null, System.Collections.Generic.IEnumerable outputs = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobFinishedEventData MediaJobFinishedEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), System.Collections.Generic.IReadOnlyDictionary correlationData = null, System.Collections.Generic.IEnumerable outputs = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput MediaJobOutput(string odataType = null, Azure.Messaging.EventGrid.SystemEvents.MediaJobError error = null, string label = null, long progress = (long)0, Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputAsset MediaJobOutputAsset(Azure.Messaging.EventGrid.SystemEvents.MediaJobError error = null, string label = null, long progress = (long)0, Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), string assetName = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputCanceledEventData MediaJobOutputCanceledEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputCancelingEventData MediaJobOutputCancelingEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputErroredEventData MediaJobOutputErroredEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputFinishedEventData MediaJobOutputFinishedEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputProcessingEventData MediaJobOutputProcessingEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputProgressEventData MediaJobOutputProgressEventData(string label = null, long? progress = default(long?), System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputScheduledEventData MediaJobOutputScheduledEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputStateChangeEventData MediaJobOutputStateChangeEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobProcessingEventData MediaJobProcessingEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), System.Collections.Generic.IReadOnlyDictionary correlationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobScheduledEventData MediaJobScheduledEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), System.Collections.Generic.IReadOnlyDictionary correlationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobStateChangeEventData MediaJobStateChangeEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), System.Collections.Generic.IReadOnlyDictionary correlationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventChannelArchiveHeartbeatEventData MediaLiveEventChannelArchiveHeartbeatEventData(string channelLatencyMs = null, string latencyResultCode = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventConnectionRejectedEventData MediaLiveEventConnectionRejectedEventData(string ingestUrl = null, string streamId = null, string encoderIp = null, string encoderPort = null, string resultCode = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventEncoderConnectedEventData MediaLiveEventEncoderConnectedEventData(string ingestUrl = null, string streamId = null, string encoderIp = null, string encoderPort = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventEncoderDisconnectedEventData MediaLiveEventEncoderDisconnectedEventData(string ingestUrl = null, string streamId = null, string encoderIp = null, string encoderPort = null, string resultCode = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIncomingDataChunkDroppedEventData MediaLiveEventIncomingDataChunkDroppedEventData(string timestamp = null, string trackType = null, long? bitrate = default(long?), string timescale = null, string resultCode = null, string trackName = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIncomingStreamReceivedEventData MediaLiveEventIncomingStreamReceivedEventData(string ingestUrl = null, string trackType = null, string trackName = null, long? bitrate = default(long?), string encoderIp = null, string encoderPort = null, string timestamp = null, string duration = null, string timescale = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIncomingStreamsOutOfSyncEventData MediaLiveEventIncomingStreamsOutOfSyncEventData(string minLastTimestamp = null, string typeOfStreamWithMinLastTimestamp = null, string maxLastTimestamp = null, string typeOfStreamWithMaxLastTimestamp = null, string timescaleOfMinLastTimestamp = null, string timescaleOfMaxLastTimestamp = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIncomingVideoStreamsOutOfSyncEventData MediaLiveEventIncomingVideoStreamsOutOfSyncEventData(string firstTimestamp = null, string firstDuration = null, string secondTimestamp = null, string secondDuration = null, string timescale = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIngestHeartbeatEventData MediaLiveEventIngestHeartbeatEventData(string trackType = null, string trackName = null, string transcriptionLanguage = null, string transcriptionState = null, long? bitrate = default(long?), long? incomingBitrate = default(long?), string ingestDriftValue = null, string lastFragmentArrivalTime = null, string lastTimestamp = null, string timescale = null, long? overlapCount = default(long?), long? discontinuityCount = default(long?), long? nonincreasingCount = default(long?), bool? unexpectedBitrate = default(bool?), string state = null, bool? healthy = default(bool?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventTrackDiscontinuityDetectedEventData MediaLiveEventTrackDiscontinuityDetectedEventData(string trackType = null, string trackName = null, long? bitrate = default(long?), string previousTimestamp = null, string newTimestamp = null, string timescale = null, string discontinuityGap = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsAppIdentifierModel MicrosoftTeamsAppIdentifierModel(string appId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel cloud = default(Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel MicrosoftTeamsUserIdentifierModel(string userId = null, bool? isAnonymous = default(bool?), Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel cloud = default(Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsAppIdentifierModel MicrosoftTeamsAppIdentifierModel(string appId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel? cloud = default(Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel MicrosoftTeamsUserIdentifierModel(string userId = null, bool? isAnonymous = default(bool?), Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel? cloud = default(Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel PhoneNumberIdentifierModel(string value = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateChangedEventData PolicyInsightsPolicyStateChangedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateCreatedEventData PolicyInsightsPolicyStateCreatedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateDeletedEventData PolicyInsightsPolicyStateDeletedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.RedisExportRDBCompletedEventData RedisExportRDBCompletedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string name = null, string status = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.RedisImportRDBCompletedEventData RedisImportRDBCompletedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string name = null, string status = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.RedisPatchingCompletedEventData RedisPatchingCompletedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string name = null, string status = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.RedisScalingCompletedEventData RedisScalingCompletedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string name = null, string status = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateChangedEventData PolicyInsightsPolicyStateChangedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateCreatedEventData PolicyInsightsPolicyStateCreatedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateDeletedEventData PolicyInsightsPolicyStateDeletedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.RedisExportRdbCompletedEventData RedisExportRdbCompletedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string name = null, string status = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.RedisImportRdbCompletedEventData RedisImportRdbCompletedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string name = null, string status = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.RedisPatchingCompletedEventData RedisPatchingCompletedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string name = null, string status = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.RedisScalingCompletedEventData RedisScalingCompletedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string name = null, string status = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceActionCancelEventData ResourceActionCancelEventData(string tenantId = null, string subscriptionId = null, string resourceGroup = null, string resourceProvider = null, string resourceUri = null, string operationName = null, string status = null, Azure.Messaging.EventGrid.SystemEvents.ResourceAuthorization authorization = null, System.Collections.Generic.IReadOnlyDictionary claims = null, string correlationId = null, Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest httpRequest = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceActionFailureEventData ResourceActionFailureEventData(string tenantId = null, string subscriptionId = null, string resourceGroup = null, string resourceProvider = null, string resourceUri = null, string operationName = null, string status = null, Azure.Messaging.EventGrid.SystemEvents.ResourceAuthorization authorization = null, System.Collections.Generic.IReadOnlyDictionary claims = null, string correlationId = null, Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest httpRequest = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceActionSuccessEventData ResourceActionSuccessEventData(string tenantId = null, string subscriptionId = null, string resourceGroup = null, string resourceProvider = null, string resourceUri = null, string operationName = null, string status = null, Azure.Messaging.EventGrid.SystemEvents.ResourceAuthorization authorization = null, System.Collections.Generic.IReadOnlyDictionary claims = null, string correlationId = null, Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest httpRequest = null) { throw null; } @@ -2665,9 +2637,10 @@ public static partial class EventGridSystemEventsModelFactory 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, Azure.Messaging.EventGrid.SystemEvents.ResourceAuthorization authorization = null, System.Collections.Generic.IReadOnlyDictionary claims = null, string correlationId = null, Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest 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, Azure.Messaging.EventGrid.SystemEvents.ResourceAuthorization authorization = null, System.Collections.Generic.IReadOnlyDictionary claims = null, string correlationId = null, Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest httpRequest = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest ResourceHttpRequest(string clientRequestId = null, string clientIpAddress = null, string method = 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.ResourceNotificationsOperationalDetails ResourceNotificationsOperationalDetails(System.DateTimeOffset? resourceEventTime = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedDetails ResourceNotificationsResourceDeletedDetails(string id = 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; } @@ -2681,23 +2654,24 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.ServiceBusActiveMessagesAvailableWithNoListenersEventData ServiceBusActiveMessagesAvailableWithNoListenersEventData(string namespaceName = null, string requestUri = null, string entityType = null, string queueName = null, string topicName = null, string subscriptionName = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData(string namespaceName = null, string requestUri = null, string entityType = null, string queueName = null, string topicName = null, string subscriptionName = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ServiceBusDeadletterMessagesAvailableWithNoListenersEventData ServiceBusDeadletterMessagesAvailableWithNoListenersEventData(string namespaceName = null, string requestUri = null, string entityType = null, string queueName = null, string topicName = null, string subscriptionName = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionConnectedEventData SignalRServiceClientConnectionConnectedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string hubName = null, string connectionId = null, string userId = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionDisconnectedEventData SignalRServiceClientConnectionDisconnectedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string hubName = null, string connectionId = null, string userId = null, string errorMessage = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionConnectedEventData SignalRServiceClientConnectionConnectedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string hubName = null, string connectionId = null, string userId = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionDisconnectedEventData SignalRServiceClientConnectionDisconnectedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string hubName = null, string connectionId = null, string userId = null, string errorMessage = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageAsyncOperationInitiatedEventData StorageAsyncOperationInitiatedEventData(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, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobCreatedEventData StorageBlobCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string contentType = null, long? contentLength = default(long?), long? contentOffset = default(long?), string blobType = null, string url = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobCreatedEventData StorageBlobCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string contentType = null, long? contentLength = default(long?), long? contentOffset = default(long?), string blobType = null, Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier accessTier = default(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier), string url = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.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, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobInventoryPolicyCompletedEventData StorageBlobInventoryPolicyCompletedEventData(System.DateTimeOffset scheduleDateTime = default(System.DateTimeOffset), string accountName = null, string ruleName = null, string policyRunStatus = null, string policyRunStatusMessage = null, string policyRunId = null, string manifestBlobUrl = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobInventoryPolicyCompletedEventData StorageBlobInventoryPolicyCompletedEventData(System.DateTimeOffset? scheduleDateTime = default(System.DateTimeOffset?), string accountName = null, string ruleName = null, string policyRunStatus = null, string policyRunStatusMessage = null, string policyRunId = null, string manifestBlobUrl = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobRenamedEventData StorageBlobRenamedEventData(string api = null, string clientRequestId = null, string requestId = null, string sourceUrl = null, string destinationUrl = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } - 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, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } + 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, Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier accessTier = default(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier), Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier previousTier = default(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier), string url = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary 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, System.Collections.Generic.IReadOnlyDictionary 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 recursive = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary 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, System.Collections.Generic.IReadOnlyDictionary 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; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyCompletedEventData StorageLifecyclePolicyCompletedEventData(string scheduleTime = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail deleteSummary = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail tierToArchiveSummary = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedEventData StorageTaskAssignmentCompletedEventData(Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus status = default(Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus), System.DateTimeOffset completedOn = default(System.DateTimeOffset), string taskExecutionId = null, string taskName = null, System.Uri summaryReportBlobUri = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentQueuedEventData StorageTaskAssignmentQueuedEventData(System.DateTimeOffset queuedOn = default(System.DateTimeOffset), string taskExecutionId = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedEventData StorageTaskCompletedEventData(Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus status = default(Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus), System.DateTimeOffset completedDateTime = default(System.DateTimeOffset), string taskExecutionId = null, string taskName = null, System.Uri summaryReportBlobUrl = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskQueuedEventData StorageTaskQueuedEventData(System.DateTimeOffset queuedDateTime = default(System.DateTimeOffset), string taskExecutionId = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyCompletedEventData StorageLifecyclePolicyCompletedEventData(string scheduleTime = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyRunSummary policyRunSummary = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail deleteSummary = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail tierToArchiveSummary = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail tierToColdSummary = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyRunSummary StorageLifecyclePolicyRunSummary(Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus completionStatus = default(Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedEventData StorageTaskAssignmentCompletedEventData(Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus? status = default(Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus?), System.DateTimeOffset? completedOn = default(System.DateTimeOffset?), string taskExecutionId = null, string taskName = null, System.Uri summaryReportBlobUri = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentQueuedEventData StorageTaskAssignmentQueuedEventData(System.DateTimeOffset? queuedOn = default(System.DateTimeOffset?), string taskExecutionId = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedEventData StorageTaskCompletedEventData(Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus? status = default(Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus?), System.DateTimeOffset? completedDateTime = default(System.DateTimeOffset?), string taskExecutionId = null, string taskName = null, System.Uri summaryReportBlobUrl = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskQueuedEventData StorageTaskQueuedEventData(System.DateTimeOffset? queuedDateTime = default(System.DateTimeOffset?), string taskExecutionId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.SubscriptionDeletedEventData SubscriptionDeletedEventData(string eventSubscriptionId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.SubscriptionValidationEventData SubscriptionValidationEventData(string validationCode = null, string validationUrl = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.SubscriptionValidationResponse SubscriptionValidationResponse(string validationResponse = null) { throw null; } @@ -2722,9 +2696,9 @@ internal EventHubCaptureFileCreatedEventData() { } public int? EventCount { get { throw null; } } public string FileType { get { throw null; } } public string Fileurl { get { throw null; } } - public System.DateTimeOffset FirstEnqueueTime { get { throw null; } } + public System.DateTimeOffset? FirstEnqueueTime { get { throw null; } } public int? FirstSequenceNumber { get { throw null; } } - public System.DateTimeOffset LastEnqueueTime { get { throw null; } } + public System.DateTimeOffset? LastEnqueueTime { get { throw null; } } public int? LastSequenceNumber { get { throw null; } } public string PartitionId { get { throw null; } } public int? SizeInBytes { get { throw null; } } @@ -2787,7 +2761,7 @@ public partial class HealthcareFhirResourceCreatedEventData : System.ClientModel { internal HealthcareFhirResourceCreatedEventData() { } public string FhirResourceId { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType FhirResourceType { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? FhirResourceType { get { throw null; } } public long? FhirResourceVersionId { get { throw null; } } public string FhirServiceHostName { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -2801,7 +2775,7 @@ public partial class HealthcareFhirResourceDeletedEventData : System.ClientModel { internal HealthcareFhirResourceDeletedEventData() { } public string FhirResourceId { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType FhirResourceType { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? FhirResourceType { get { throw null; } } public long? FhirResourceVersionId { get { throw null; } } public string FhirServiceHostName { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -2992,7 +2966,7 @@ public partial class HealthcareFhirResourceUpdatedEventData : System.ClientModel { internal HealthcareFhirResourceUpdatedEventData() { } public string FhirResourceId { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType FhirResourceType { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? FhirResourceType { get { throw null; } } public long? FhirResourceVersionId { get { throw null; } } public string FhirServiceHostName { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -3229,9 +3203,9 @@ internal MachineLearningServicesDatasetDriftDetectedEventData() { } public string DataDriftId { get { throw null; } } public string DataDriftName { get { throw null; } } public double? DriftCoefficient { get { throw null; } } - public System.DateTimeOffset EndTime { get { throw null; } } + public System.DateTimeOffset? EndTime { get { throw null; } } public string RunId { get { throw null; } } - public System.DateTimeOffset StartTime { get { throw null; } } + public System.DateTimeOffset? StartTime { get { throw null; } } public string TargetDatasetId { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesDatasetDriftDetectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3362,479 +3336,11 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class MediaJobCanceledEventData : Azure.Messaging.EventGrid.SystemEvents.MediaJobStateChangeEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobCanceledEventData() { } - public System.Collections.Generic.IReadOnlyList Outputs { get { throw null; } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobCanceledEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobCanceledEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaJobCancelingEventData : Azure.Messaging.EventGrid.SystemEvents.MediaJobStateChangeEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobCancelingEventData() { } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobCancelingEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobCancelingEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaJobError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobError() { } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory Category { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode Code { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Details { get { throw null; } } - public string Message { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry Retry { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct MediaJobErrorCategory : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public MediaJobErrorCategory(string value) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory Account { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory Configuration { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory Content { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory Download { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory Service { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory Upload { get { throw null; } } - public bool Equals(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory left, Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory right) { throw null; } - public static implicit operator Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory (string value) { throw null; } - public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory left, Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory right) { throw null; } - public override string ToString() { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct MediaJobErrorCode : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public MediaJobErrorCode(string value) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode ConfigurationUnsupported { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode ContentMalformed { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode ContentUnsupported { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode DownloadNotAccessible { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode DownloadTransientError { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode IdentityUnsupported { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode ServiceError { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode ServiceTransientError { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode UploadNotAccessible { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode UploadTransientError { get { throw null; } } - public bool Equals(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode left, Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode right) { throw null; } - public static implicit operator Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode (string value) { throw null; } - public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode left, Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode right) { throw null; } - public override string ToString() { throw null; } - } - public partial class MediaJobErrorDetail : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobErrorDetail() { } - public string Code { get { throw null; } } - public string Message { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorDetail System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaJobErroredEventData : Azure.Messaging.EventGrid.SystemEvents.MediaJobStateChangeEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobErroredEventData() { } - public System.Collections.Generic.IReadOnlyList Outputs { get { throw null; } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobErroredEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobErroredEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaJobFinishedEventData : Azure.Messaging.EventGrid.SystemEvents.MediaJobStateChangeEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobFinishedEventData() { } - public System.Collections.Generic.IReadOnlyList Outputs { get { throw null; } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobFinishedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobFinishedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public abstract partial class MediaJobOutput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - protected MediaJobOutput(Azure.Messaging.EventGrid.SystemEvents.MediaJobError error, long progress, Azure.Messaging.EventGrid.SystemEvents.MediaJobState state) { } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobError Error { get { throw null; } } - public string Label { get { throw null; } } - public long Progress { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobState State { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaJobOutputAsset : Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobOutputAsset() : base (default(Azure.Messaging.EventGrid.SystemEvents.MediaJobError), default(long), default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState)) { } - public string AssetName { get { throw null; } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputAsset System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputAsset System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaJobOutputCanceledEventData : Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputStateChangeEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobOutputCanceledEventData() { } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputCanceledEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputCanceledEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaJobOutputCancelingEventData : Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputStateChangeEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobOutputCancelingEventData() { } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputCancelingEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputCancelingEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaJobOutputErroredEventData : Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputStateChangeEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobOutputErroredEventData() { } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputErroredEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputErroredEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaJobOutputFinishedEventData : Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputStateChangeEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobOutputFinishedEventData() { } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputFinishedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputFinishedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaJobOutputProcessingEventData : Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputStateChangeEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobOutputProcessingEventData() { } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputProcessingEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputProcessingEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaJobOutputProgressEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobOutputProgressEventData() { } - public System.Collections.Generic.IReadOnlyDictionary JobCorrelationData { get { throw null; } } - public string Label { get { throw null; } } - public long? Progress { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputProgressEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputProgressEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaJobOutputScheduledEventData : Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputStateChangeEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobOutputScheduledEventData() { } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputScheduledEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputScheduledEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaJobOutputStateChangeEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobOutputStateChangeEventData() { } - public System.Collections.Generic.IReadOnlyDictionary JobCorrelationData { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput Output { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobState PreviousState { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputStateChangeEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputStateChangeEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaJobProcessingEventData : Azure.Messaging.EventGrid.SystemEvents.MediaJobStateChangeEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobProcessingEventData() { } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobProcessingEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobProcessingEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct MediaJobRetry : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public MediaJobRetry(string value) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry DoNotRetry { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry MayRetry { get { throw null; } } - public bool Equals(Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry left, Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry right) { throw null; } - public static implicit operator Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry (string value) { throw null; } - public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry left, Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry right) { throw null; } - public override string ToString() { throw null; } - } - public partial class MediaJobScheduledEventData : Azure.Messaging.EventGrid.SystemEvents.MediaJobStateChangeEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobScheduledEventData() { } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobScheduledEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobScheduledEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct MediaJobState : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public MediaJobState(string value) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobState Canceled { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobState Canceling { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobState Error { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobState Finished { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobState Processing { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobState Queued { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobState Scheduled { get { throw null; } } - public bool Equals(Azure.Messaging.EventGrid.SystemEvents.MediaJobState other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.MediaJobState left, Azure.Messaging.EventGrid.SystemEvents.MediaJobState right) { throw null; } - public static implicit operator Azure.Messaging.EventGrid.SystemEvents.MediaJobState (string value) { throw null; } - public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.MediaJobState left, Azure.Messaging.EventGrid.SystemEvents.MediaJobState right) { throw null; } - public override string ToString() { throw null; } - } - public partial class MediaJobStateChangeEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobStateChangeEventData() { } - public System.Collections.Generic.IReadOnlyDictionary CorrelationData { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobState PreviousState { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobState State { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobStateChangeEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobStateChangeEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaLiveEventChannelArchiveHeartbeatEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaLiveEventChannelArchiveHeartbeatEventData() { } - public string ChannelLatencyMs { get { throw null; } } - public string LatencyResultCode { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventChannelArchiveHeartbeatEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventChannelArchiveHeartbeatEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaLiveEventConnectionRejectedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaLiveEventConnectionRejectedEventData() { } - public string EncoderIp { get { throw null; } } - public string EncoderPort { get { throw null; } } - public string IngestUrl { get { throw null; } } - public string ResultCode { get { throw null; } } - public string StreamId { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventConnectionRejectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventConnectionRejectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaLiveEventEncoderConnectedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaLiveEventEncoderConnectedEventData() { } - public string EncoderIp { get { throw null; } } - public string EncoderPort { get { throw null; } } - public string IngestUrl { get { throw null; } } - public string StreamId { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventEncoderConnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventEncoderConnectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaLiveEventEncoderDisconnectedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaLiveEventEncoderDisconnectedEventData() { } - public string EncoderIp { get { throw null; } } - public string EncoderPort { get { throw null; } } - public string IngestUrl { get { throw null; } } - public string ResultCode { get { throw null; } } - public string StreamId { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventEncoderDisconnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventEncoderDisconnectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaLiveEventIncomingDataChunkDroppedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaLiveEventIncomingDataChunkDroppedEventData() { } - public long? Bitrate { get { throw null; } } - public string ResultCode { get { throw null; } } - public string Timescale { get { throw null; } } - public string Timestamp { get { throw null; } } - public string TrackName { get { throw null; } } - public string TrackType { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIncomingDataChunkDroppedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIncomingDataChunkDroppedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaLiveEventIncomingStreamReceivedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaLiveEventIncomingStreamReceivedEventData() { } - public long? Bitrate { get { throw null; } } - public string Duration { get { throw null; } } - public string EncoderIp { get { throw null; } } - public string EncoderPort { get { throw null; } } - public string IngestUrl { get { throw null; } } - public string Timescale { get { throw null; } } - public string Timestamp { get { throw null; } } - public string TrackName { get { throw null; } } - public string TrackType { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIncomingStreamReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIncomingStreamReceivedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaLiveEventIncomingStreamsOutOfSyncEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaLiveEventIncomingStreamsOutOfSyncEventData() { } - public string MaxLastTimestamp { get { throw null; } } - public string MinLastTimestamp { get { throw null; } } - public string TimescaleOfMaxLastTimestamp { get { throw null; } } - public string TimescaleOfMinLastTimestamp { get { throw null; } } - public string TypeOfStreamWithMaxLastTimestamp { get { throw null; } } - public string TypeOfStreamWithMinLastTimestamp { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIncomingStreamsOutOfSyncEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIncomingStreamsOutOfSyncEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaLiveEventIncomingVideoStreamsOutOfSyncEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaLiveEventIncomingVideoStreamsOutOfSyncEventData() { } - public string FirstDuration { get { throw null; } } - public string FirstTimestamp { get { throw null; } } - public string SecondDuration { get { throw null; } } - public string SecondTimestamp { get { throw null; } } - public string Timescale { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIncomingVideoStreamsOutOfSyncEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIncomingVideoStreamsOutOfSyncEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaLiveEventIngestHeartbeatEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaLiveEventIngestHeartbeatEventData() { } - public long? Bitrate { get { throw null; } } - public long? DiscontinuityCount { get { throw null; } } - public bool? Healthy { get { throw null; } } - public long? IncomingBitrate { get { throw null; } } - public string IngestDriftValue { get { throw null; } } - public string LastFragmentArrivalTime { get { throw null; } } - public string LastTimestamp { get { throw null; } } - public long? NonincreasingCount { get { throw null; } } - public long? OverlapCount { get { throw null; } } - public string State { get { throw null; } } - public string Timescale { get { throw null; } } - public string TrackName { get { throw null; } } - public string TrackType { get { throw null; } } - public string TranscriptionLanguage { get { throw null; } } - public string TranscriptionState { get { throw null; } } - public bool? UnexpectedBitrate { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIngestHeartbeatEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIngestHeartbeatEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaLiveEventTrackDiscontinuityDetectedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaLiveEventTrackDiscontinuityDetectedEventData() { } - public long? Bitrate { get { throw null; } } - public string DiscontinuityGap { get { throw null; } } - public string NewTimestamp { get { throw null; } } - public string PreviousTimestamp { get { throw null; } } - public string Timescale { get { throw null; } } - public string TrackName { get { throw null; } } - public string TrackType { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventTrackDiscontinuityDetectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventTrackDiscontinuityDetectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class MicrosoftTeamsAppIdentifierModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MicrosoftTeamsAppIdentifierModel() { } public string AppId { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel Cloud { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel? Cloud { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsAppIdentifierModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -3845,7 +3351,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class MicrosoftTeamsUserIdentifierModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MicrosoftTeamsUserIdentifierModel() { } - public Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel Cloud { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel? Cloud { get { throw null; } } public bool? IsAnonymous { get { throw null; } } public string UserId { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -3875,7 +3381,7 @@ internal PolicyInsightsPolicyStateChangedEventData() { } public string PolicyDefinitionId { get { throw null; } } public string PolicyDefinitionReferenceId { get { throw null; } } public string SubscriptionId { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -3892,7 +3398,7 @@ internal PolicyInsightsPolicyStateCreatedEventData() { } public string PolicyDefinitionId { get { throw null; } } public string PolicyDefinitionReferenceId { get { throw null; } } public string SubscriptionId { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -3909,7 +3415,7 @@ internal PolicyInsightsPolicyStateDeletedEventData() { } public string PolicyDefinitionId { get { throw null; } } public string PolicyDefinitionReferenceId { get { throw null; } } public string SubscriptionId { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -3972,38 +3478,38 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType left, Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType right) { throw null; } public override string ToString() { throw null; } } - public partial class RedisExportRDBCompletedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class RedisExportRdbCompletedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal RedisExportRDBCompletedEventData() { } + internal RedisExportRdbCompletedEventData() { } public string Name { get { throw null; } } public string Status { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - 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; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(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; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class RedisImportRDBCompletedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class RedisImportRdbCompletedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal RedisImportRDBCompletedEventData() { } + internal RedisImportRdbCompletedEventData() { } public string Name { get { throw null; } } public string Status { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - 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; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(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; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class RedisPatchingCompletedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal RedisPatchingCompletedEventData() { } public string Name { get { throw null; } } public string Status { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -4016,7 +3522,7 @@ public partial class RedisScalingCompletedEventData : System.ClientModel.Primiti internal RedisScalingCompletedEventData() { } public string Name { get { throw null; } } public string Status { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -4177,6 +3683,16 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ResourceNotificationsContainerServiceEventResourcesScheduledEventData : Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ResourceNotificationsContainerServiceEventResourcesScheduledEventData() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + 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; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ResourceNotificationsHealthResourcesAnnotatedEventData : Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ResourceNotificationsHealthResourcesAnnotatedEventData() { } @@ -4200,7 +3716,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class ResourceNotificationsOperationalDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ResourceNotificationsOperationalDetails() { } - public System.DateTimeOffset ResourceEventTime { get { throw null; } } + public System.DateTimeOffset? ResourceEventTime { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -4414,7 +3930,7 @@ public partial class SignalRServiceClientConnectionConnectedEventData : System.C internal SignalRServiceClientConnectionConnectedEventData() { } public string ConnectionId { get { throw null; } } public string HubName { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } public string UserId { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionConnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4429,7 +3945,7 @@ internal SignalRServiceClientConnectionDisconnectedEventData() { } public string ConnectionId { get { throw null; } } public string ErrorMessage { get { throw null; } } public string HubName { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } public string UserId { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionDisconnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4477,9 +3993,31 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct StorageBlobAccessTier : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public StorageBlobAccessTier(string value) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Archive { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Cold { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Cool { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Default { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Hot { get { throw null; } } + public bool Equals(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + 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 bool operator !=(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier left, Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier right) { throw null; } + public override string ToString() { throw null; } + } public partial class StorageBlobCreatedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal StorageBlobCreatedEventData() { } + public Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier AccessTier { get { throw null; } } public string Api { get { throw null; } } public string BlobType { get { throw null; } } public string ClientRequestId { get { throw null; } } @@ -4527,7 +4065,7 @@ internal StorageBlobInventoryPolicyCompletedEventData() { } public string PolicyRunStatus { get { throw null; } } public string PolicyRunStatusMessage { get { throw null; } } public string RuleName { get { throw null; } } - public System.DateTimeOffset ScheduleDateTime { get { throw null; } } + public System.DateTimeOffset? ScheduleDateTime { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -4556,12 +4094,14 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class StorageBlobTierChangedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal StorageBlobTierChangedEventData() { } + public Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier AccessTier { get { throw null; } } public string Api { get { throw null; } } public string BlobType { get { throw null; } } public string ClientRequestId { get { throw null; } } public long? ContentLength { get { throw null; } } public string ContentType { get { throw null; } } public string Identity { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier PreviousTier { get { throw null; } } public string RequestId { get { throw null; } } public string Sequencer { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary StorageDiagnostics { get { throw null; } } @@ -4627,6 +4167,25 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct StorageLifecycleCompletionStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public StorageLifecycleCompletionStatus(string value) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus Completed { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus CompletedWithError { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus Incomplete { get { throw null; } } + public bool Equals(Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + 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 bool operator !=(Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus left, Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus right) { throw null; } + public override string ToString() { throw null; } + } public partial class StorageLifecyclePolicyActionSummaryDetail : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal StorageLifecyclePolicyActionSummaryDetail() { } @@ -4644,8 +4203,10 @@ public partial class StorageLifecyclePolicyCompletedEventData : System.ClientMod { internal StorageLifecyclePolicyCompletedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail DeleteSummary { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyRunSummary PolicyRunSummary { get { throw null; } } public string ScheduleTime { get { throw null; } } 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 void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4654,11 +4215,22 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class StorageLifecyclePolicyRunSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal StorageLifecyclePolicyRunSummary() { } + public Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus CompletionStatus { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + 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; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class StorageTaskAssignmentCompletedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal StorageTaskAssignmentCompletedEventData() { } - public System.DateTimeOffset CompletedOn { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus Status { get { throw null; } } + public System.DateTimeOffset? CompletedOn { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus? Status { get { throw null; } } public System.Uri SummaryReportBlobUri { get { throw null; } } public string TaskExecutionId { get { throw null; } } public string TaskName { get { throw null; } } @@ -4690,7 +4262,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class StorageTaskAssignmentQueuedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal StorageTaskAssignmentQueuedEventData() { } - public System.DateTimeOffset QueuedOn { get { throw null; } } + public System.DateTimeOffset? QueuedOn { get { throw null; } } public string TaskExecutionId { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentQueuedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4702,8 +4274,8 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class StorageTaskCompletedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal StorageTaskCompletedEventData() { } - public System.DateTimeOffset CompletedDateTime { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus Status { get { throw null; } } + public System.DateTimeOffset? CompletedDateTime { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus? Status { get { throw null; } } public System.Uri SummaryReportBlobUrl { get { throw null; } } public string TaskExecutionId { get { throw null; } } public string TaskName { get { throw null; } } @@ -4735,7 +4307,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class StorageTaskQueuedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal StorageTaskQueuedEventData() { } - public System.DateTimeOffset QueuedDateTime { get { throw null; } } + public System.DateTimeOffset? QueuedDateTime { get { throw null; } } public string TaskExecutionId { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageTaskQueuedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4884,10 +4456,10 @@ public static partial class SystemEventNames public const string DataBoxCopyCompleted = "Microsoft.DataBox.CopyCompleted"; public const string DataBoxCopyStarted = "Microsoft.DataBox.CopyStarted"; public const string DataBoxOrderCompleted = "Microsoft.DataBox.OrderCompleted"; - public const string EventGridMQTTClientCreatedOrUpdated = "Microsoft.EventGrid.MQTTClientCreatedOrUpdated"; - public const string EventGridMQTTClientDeleted = "Microsoft.EventGrid.MQTTClientDeleted"; - public const string EventGridMQTTClientSessionConnected = "Microsoft.EventGrid.MQTTClientSessionConnected"; - public const string EventGridMQTTClientSessionDisconnected = "Microsoft.EventGrid.MQTTClientSessionDisconnected"; + public const string EventGridMqttClientCreatedOrUpdated = "Microsoft.EventGrid.MQTTClientCreatedOrUpdated"; + public const string EventGridMqttClientDeleted = "Microsoft.EventGrid.MQTTClientDeleted"; + public const string EventGridMqttClientSessionConnected = "Microsoft.EventGrid.MQTTClientSessionConnected"; + public const string EventGridMqttClientSessionDisconnected = "Microsoft.EventGrid.MQTTClientSessionDisconnected"; public const string EventGridSubscriptionDeleted = "Microsoft.EventGrid.SubscriptionDeletedEvent"; public const string EventGridSubscriptionValidation = "Microsoft.EventGrid.SubscriptionValidationEvent"; public const string EventHubCaptureFileCreated = "Microsoft.EventHub.CaptureFileCreated"; @@ -4920,36 +4492,11 @@ public static partial class SystemEventNames public const string MapsGeofenceEntered = "Microsoft.Maps.GeofenceEntered"; public const string MapsGeofenceExited = "Microsoft.Maps.GeofenceExited"; public const string MapsGeofenceResult = "Microsoft.Maps.GeofenceResult"; - public const string MediaJobCanceled = "Microsoft.Media.JobCanceled"; - public const string MediaJobCanceling = "Microsoft.Media.JobCanceling"; - public const string MediaJobErrored = "Microsoft.Media.JobErrored"; - public const string MediaJobFinished = "Microsoft.Media.JobFinished"; - public const string MediaJobOutputCanceled = "Microsoft.Media.JobOutputCanceled"; - public const string MediaJobOutputCanceling = "Microsoft.Media.JobOutputCanceling"; - public const string MediaJobOutputErrored = "Microsoft.Media.JobOutputErrored"; - public const string MediaJobOutputFinished = "Microsoft.Media.JobOutputFinished"; - public const string MediaJobOutputProcessing = "Microsoft.Media.JobOutputProcessing"; - public const string MediaJobOutputProgress = "Microsoft.Media.JobOutputProgress"; - public const string MediaJobOutputScheduled = "Microsoft.Media.JobOutputScheduled"; - public const string MediaJobOutputStateChange = "Microsoft.Media.JobOutputStateChange"; - public const string MediaJobProcessing = "Microsoft.Media.JobProcessing"; - public const string MediaJobScheduled = "Microsoft.Media.JobScheduled"; - public const string MediaJobStateChange = "Microsoft.Media.JobStateChange"; - public const string MediaLiveEventChannelArchiveHeartbeat = "Microsoft.Media.LiveEventChannelArchiveHeartbeat"; - public const string MediaLiveEventConnectionRejected = "Microsoft.Media.LiveEventConnectionRejected"; - public const string MediaLiveEventEncoderConnected = "Microsoft.Media.LiveEventEncoderConnected"; - public const string MediaLiveEventEncoderDisconnected = "Microsoft.Media.LiveEventEncoderDisconnected"; - public const string MediaLiveEventIncomingDataChunkDropped = "Microsoft.Media.LiveEventIncomingDataChunkDropped"; - public const string MediaLiveEventIncomingStreamReceived = "Microsoft.Media.LiveEventIncomingStreamReceived"; - public const string MediaLiveEventIncomingStreamsOutOfSync = "Microsoft.Media.LiveEventIncomingStreamsOutOfSync"; - public const string MediaLiveEventIncomingVideoStreamsOutOfSync = "Microsoft.Media.LiveEventIncomingVideoStreamsOutOfSync"; - public const string MediaLiveEventIngestHeartbeat = "Microsoft.Media.LiveEventIngestHeartbeat"; - public const string MediaLiveEventTrackDiscontinuityDetected = "Microsoft.Media.LiveEventTrackDiscontinuityDetected"; public const string PolicyInsightsPolicyStateChanged = "Microsoft.PolicyInsights.PolicyStateChanged"; public const string PolicyInsightsPolicyStateCreated = "Microsoft.PolicyInsights.PolicyStateCreated"; public const string PolicyInsightsPolicyStateDeleted = "Microsoft.PolicyInsights.PolicyStateDeleted"; - public const string RedisExportRDBCompleted = "Microsoft.Cache.ExportRDBCompleted"; - public const string RedisImportRDBCompleted = "Microsoft.Cache.ImportRDBCompleted"; + public const string RedisExportRdbCompleted = "Microsoft.Cache.ExportRDBCompleted"; + public const string RedisImportRdbCompleted = "Microsoft.Cache.ImportRDBCompleted"; public const string RedisPatchingCompleted = "Microsoft.Cache.PatchingCompleted"; public const string RedisScalingCompleted = "Microsoft.Cache.ScalingCompleted"; public const string ResourceActionCancel = "Microsoft.Resources.ResourceActionCancel"; @@ -4958,6 +4505,7 @@ public static partial class SystemEventNames public const string ResourceDeleteCancel = "Microsoft.Resources.ResourceDeleteCancel"; public const string ResourceDeleteFailure = "Microsoft.Resources.ResourceDeleteFailure"; public const string ResourceDeleteSuccess = "Microsoft.Resources.ResourceDeleteSuccess"; + public const string ResourceNotificationsContainerServiceEventResourcesScheduled = "Microsoft.ResourceNotifications.ContainerServiceEventResources.ScheduledEventEmitted"; public const string ResourceNotificationsHealthResourcesAnnotated = "Microsoft.ResourceNotifications.HealthResources.ResourceAnnotated"; public const string ResourceNotificationsHealthResourcesAvailabilityStatusChanged = "Microsoft.ResourceNotifications.HealthResources.AvailabilityStatusChanged"; public const string ResourceNotificationsResourceManagementCreatedOrUpdated = "Microsoft.ResourceNotifications.Resources.CreatedOrUpdated"; 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 5cffdf30386c..84a5c2a9d135 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 @@ -35,7 +35,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class AcsChatMessageDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatMessageDeletedEventData() { } - public System.DateTimeOffset DeleteTime { get { throw null; } } + public System.DateTimeOffset? DeleteTime { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -46,7 +46,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AcsChatMessageDeletedInThreadEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventInThreadBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatMessageDeletedInThreadEventData() { } - public System.DateTimeOffset DeleteTime { get { throw null; } } + public System.DateTimeOffset? DeleteTime { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -57,7 +57,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AcsChatMessageEditedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatMessageEditedEventData() { } - public System.DateTimeOffset EditTime { get { throw null; } } + public System.DateTimeOffset? EditTime { get { throw null; } } public string MessageBody { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -70,7 +70,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AcsChatMessageEditedInThreadEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventInThreadBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatMessageEditedInThreadEventData() { } - public System.DateTimeOffset EditTime { get { throw null; } } + public System.DateTimeOffset? EditTime { get { throw null; } } public string MessageBody { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -83,7 +83,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AcsChatMessageEventBaseProperties : Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatMessageEventBaseProperties() { } - public System.DateTimeOffset ComposeTime { get { throw null; } } + public System.DateTimeOffset? ComposeTime { get { throw null; } } public string MessageId { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel SenderCommunicationIdentifier { get { throw null; } } public string SenderDisplayName { get { throw null; } } @@ -99,7 +99,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AcsChatMessageEventInThreadBaseProperties : Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatMessageEventInThreadBaseProperties() { } - public System.DateTimeOffset ComposeTime { get { throw null; } } + public System.DateTimeOffset? ComposeTime { get { throw null; } } public string MessageId { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel SenderCommunicationIdentifier { get { throw null; } } public string SenderDisplayName { get { throw null; } } @@ -141,7 +141,7 @@ public partial class AcsChatParticipantAddedToThreadEventData : Azure.Messaging. internal AcsChatParticipantAddedToThreadEventData() { } 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; } } + public System.DateTimeOffset? Time { get { throw null; } } public long? Version { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -155,7 +155,7 @@ public partial class AcsChatParticipantAddedToThreadWithUserEventData : Azure.Me 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; } } + public System.DateTimeOffset? Time { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -168,7 +168,7 @@ public partial class AcsChatParticipantRemovedFromThreadEventData : Azure.Messag internal AcsChatParticipantRemovedFromThreadEventData() { } 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; } } + public System.DateTimeOffset? Time { get { throw null; } } public long? Version { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -182,7 +182,7 @@ public partial class AcsChatParticipantRemovedFromThreadWithUserEventData : Azur 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; } } + public System.DateTimeOffset? Time { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -222,7 +222,7 @@ 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; } } + public System.DateTimeOffset? DeleteTime { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -233,7 +233,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AcsChatThreadEventBaseProperties : Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatThreadEventBaseProperties() { } - public System.DateTimeOffset CreateTime { get { throw null; } } + public System.DateTimeOffset? CreateTime { get { throw null; } } public long? Version { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventBaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -245,7 +245,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AcsChatThreadEventInThreadBaseProperties : Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatThreadEventInThreadBaseProperties() { } - public System.DateTimeOffset CreateTime { get { throw null; } } + public System.DateTimeOffset? CreateTime { get { throw null; } } public long? Version { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventInThreadBaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -271,7 +271,7 @@ public partial class AcsChatThreadPropertiesUpdatedEventData : Azure.Messaging.E { internal AcsChatThreadPropertiesUpdatedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel EditedByCommunicationIdentifier { get { throw null; } } - public System.DateTimeOffset EditTime { get { throw null; } } + 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 void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -285,7 +285,7 @@ public partial class AcsChatThreadPropertiesUpdatedPerUserEventData : Azure.Mess { internal AcsChatThreadPropertiesUpdatedPerUserEventData() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel EditedByCommunicationIdentifier { get { throw null; } } - public System.DateTimeOffset EditTime { get { throw null; } } + 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 void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -299,7 +299,7 @@ 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; } } + public System.DateTimeOffset? DeleteTime { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -310,12 +310,12 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AcsEmailDeliveryReportReceivedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsEmailDeliveryReportReceivedEventData() { } - public System.DateTimeOffset DeliveryAttemptTimestamp { get { throw null; } } + public System.DateTimeOffset? DeliveryAttemptTimestamp { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatusDetails DeliveryStatusDetails { get { throw null; } } public string MessageId { get { throw null; } } public string Recipient { get { throw null; } } public string Sender { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus Status { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus? Status { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -359,12 +359,12 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class AcsEmailEngagementTrackingReportReceivedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsEmailEngagementTrackingReportReceivedEventData() { } - public Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement Engagement { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement? Engagement { get { throw null; } } public string EngagementContext { get { throw null; } } public string MessageId { get { throw null; } } public string Recipient { get { throw null; } } public string Sender { get { throw null; } } - public System.DateTimeOffset UserActionTimestamp { get { throw null; } } + public System.DateTimeOffset? UserActionTimestamp { get { throw null; } } public string UserAgent { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsEmailEngagementTrackingReportReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -393,6 +393,7 @@ internal AcsIncomingCallEventData() { } public Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallCustomContext CustomContext { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel FromCommunicationIdentifier { get { throw null; } } public string IncomingCallContext { get { throw null; } } + 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 void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -499,9 +500,9 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class AcsMessageDeliveryStatusUpdatedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsMessageDeliveryStatusUpdatedEventData() { } - public Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind ChannelKind { get { throw null; } } + 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; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus? Status { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -514,7 +515,7 @@ public partial class AcsMessageEventData : System.ClientModel.Primitives.IJsonMo internal AcsMessageEventData() { } public Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError Error { get { throw null; } } public string From { get { throw null; } } - public System.DateTimeOffset ReceivedTimestamp { get { throw null; } } + public System.DateTimeOffset? ReceivedTimestamp { get { throw null; } } public string To { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -540,7 +541,7 @@ public partial class AcsMessageInteractiveContent : System.ClientModel.Primitive 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; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind? ReplyKind { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -610,11 +611,11 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class AcsRecordingFileStatusUpdatedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsRecordingFileStatusUpdatedEventData() { } - public Azure.Messaging.EventGrid.SystemEvents.RecordingChannelType RecordingChannelKind { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.RecordingContentType RecordingContentType { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.RecordingChannelType? RecordingChannelKind { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.RecordingContentType? RecordingContentType { get { throw null; } } public long? RecordingDurationMs { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType RecordingFormatType { get { throw null; } } - public System.DateTimeOffset RecordingStartTime { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType? RecordingFormatType { get { throw null; } } + 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 void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -791,10 +792,10 @@ public partial class AcsRouterJobReceivedEventData : Azure.Messaging.EventGrid.S { internal AcsRouterJobReceivedEventData() { } public string ClassificationPolicyId { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus JobStatus { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus? JobStatus { get { throw null; } } public int? Priority { get { throw null; } } public System.Collections.Generic.IReadOnlyList RequestedWorkerSelectors { get { throw null; } } - public System.DateTimeOffset ScheduledOn { get { throw null; } } + public System.DateTimeOffset? ScheduledOn { get { throw null; } } public bool UnavailableForMatching { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -810,7 +811,7 @@ internal AcsRouterJobSchedulingFailedEventData() { } public System.Collections.Generic.IReadOnlyList ExpiredRequestedWorkerSelectors { get { throw null; } } public string FailureReason { get { throw null; } } public int? Priority { get { throw null; } } - public System.DateTimeOffset ScheduledOn { get { throw null; } } + public System.DateTimeOffset? ScheduledOn { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -864,7 +865,7 @@ internal AcsRouterJobWaitingForActivationEventData() { } public System.Collections.Generic.IReadOnlyList ExpiredAttachedWorkerSelectors { get { throw null; } } public System.Collections.Generic.IReadOnlyList ExpiredRequestedWorkerSelectors { get { throw null; } } public int? Priority { get { throw null; } } - public System.DateTimeOffset ScheduledOn { get { throw null; } } + public System.DateTimeOffset? ScheduledOn { get { throw null; } } public bool UnavailableForMatching { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobWaitingForActivationEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1019,11 +1020,11 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AcsRouterWorkerOfferIssuedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsRouterWorkerOfferIssuedEventData() { } - public System.DateTimeOffset ExpiresOn { get { throw null; } } + public System.DateTimeOffset? ExpiresOn { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary JobLabels { get { throw null; } } public int? JobPriority { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary JobTags { get { throw null; } } - public System.DateTimeOffset OfferedOn { get { throw null; } } + public System.DateTimeOffset? OfferedOn { get { throw null; } } public string OfferId { get { throw null; } } public string QueueId { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary WorkerLabels { get { throw null; } } @@ -1066,11 +1067,11 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class AcsRouterWorkerSelector : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsRouterWorkerSelector() { } - public System.DateTimeOffset ExpirationTime { get { throw null; } } + public System.DateTimeOffset? ExpirationTime { get { throw null; } } public string Key { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator LabelOperator { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator? LabelOperator { get { throw null; } } public System.BinaryData LabelValue { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState SelectorState { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState? SelectorState { get { throw null; } } public double TimeToLive { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelector System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1119,7 +1120,7 @@ public partial class AcsSmsDeliveryAttemptProperties : System.ClientModel.Primit internal AcsSmsDeliveryAttemptProperties() { } public int? SegmentsFailed { get { throw null; } } public int? SegmentsSucceeded { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -1133,7 +1134,7 @@ internal AcsSmsDeliveryReportReceivedEventData() { } public System.Collections.Generic.IReadOnlyList DeliveryAttempts { get { throw null; } } public string DeliveryStatus { get { throw null; } } public string DeliveryStatusDetails { get { throw null; } } - public System.DateTimeOffset ReceivedTimestamp { get { throw null; } } + public System.DateTimeOffset? ReceivedTimestamp { get { throw null; } } public string Tag { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryReportReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1159,7 +1160,7 @@ public partial class AcsSmsReceivedEventData : Azure.Messaging.EventGrid.SystemE { internal AcsSmsReceivedEventData() { } public string Message { get { throw null; } } - public System.DateTimeOffset ReceivedTimestamp { get { throw null; } } + public System.DateTimeOffset? ReceivedTimestamp { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -1606,7 +1607,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class AppEventTypeDetail : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AppEventTypeDetail() { } - public Azure.Messaging.EventGrid.SystemEvents.AppAction Action { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AppAction? Action { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -1634,9 +1635,9 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class AppServicePlanEventTypeDetail : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { 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; } } + 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 void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -1848,7 +1849,7 @@ public partial class CommunicationIdentifierModel : System.ClientModel.Primitive { internal CommunicationIdentifierModel() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationUserIdentifierModel CommunicationUser { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModelKind Kind { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModelKind? Kind { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsAppIdentifierModel MicrosoftTeamsApp { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel MicrosoftTeamsUser { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel PhoneNumber { get { throw null; } } @@ -1899,7 +1900,7 @@ internal ContainerRegistryArtifactEventData() { } public string Id { get { throw null; } } public string Location { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget Target { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -1977,7 +1978,7 @@ internal ContainerRegistryEventData() { } public Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest Request { get { throw null; } } 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; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -2139,8 +2140,8 @@ public partial class DataBoxCopyCompletedEventData : System.ClientModel.Primitiv { 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; } } + public Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? StageName { get { throw null; } } + public System.DateTimeOffset? StageTime { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -2152,8 +2153,8 @@ public partial class DataBoxCopyStartedEventData : System.ClientModel.Primitives { 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; } } + public Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? StageName { get { throw null; } } + public System.DateTimeOffset? StageTime { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -2165,8 +2166,8 @@ public partial class DataBoxOrderCompletedEventData : System.ClientModel.Primiti { 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; } } + public Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? StageName { get { throw null; } } + public System.DateTimeOffset? StageTime { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -2312,155 +2313,155 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class EventGridMQTTClientCreatedOrUpdatedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class EventGridMqttClientCreatedOrUpdatedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal EventGridMQTTClientCreatedOrUpdatedEventData() { } + internal EventGridMqttClientCreatedOrUpdatedEventData() { } public System.Collections.Generic.IReadOnlyDictionary Attributes { get { throw null; } } - public System.DateTimeOffset CreatedOn { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState State { get { throw null; } } - public System.DateTimeOffset UpdatedOn { get { throw null; } } + 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 void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - 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; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(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; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class EventGridMQTTClientDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class EventGridMqttClientDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal EventGridMQTTClientDeletedEventData() { } + internal EventGridMqttClientDeletedEventData() { } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - 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; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(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; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct EventGridMQTTClientDisconnectionReason : System.IEquatable + public readonly partial struct EventGridMqttClientDisconnectionReason : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public EventGridMQTTClientDisconnectionReason(string value) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason ClientAuthenticationError { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason ClientAuthorizationError { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason ClientError { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason ClientInitiatedDisconnect { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason ConnectionLost { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason IpForbidden { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason QuotaExceeded { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason ServerError { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason ServerInitiatedDisconnect { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason SessionOverflow { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason SessionTakenOver { get { throw null; } } - public bool Equals(Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason other) { throw null; } + public EventGridMqttClientDisconnectionReason(string value) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ClientAuthenticationError { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ClientAuthorizationError { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ClientError { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ClientInitiatedDisconnect { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ConnectionLost { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason IpForbidden { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason QuotaExceeded { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ServerError { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ServerInitiatedDisconnect { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason SessionOverflow { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason SessionTakenOver { get { throw null; } } + public bool Equals(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] 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 bool operator !=(Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason left, Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason right) { 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 bool operator !=(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason left, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason right) { throw null; } public override string ToString() { throw null; } } - public partial class EventGridMQTTClientEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class EventGridMqttClientEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal EventGridMQTTClientEventData() { } + internal EventGridMqttClientEventData() { } public string ClientAuthenticationName { get { throw null; } } public string ClientName { get { throw null; } } public string NamespaceName { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - 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; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(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; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class EventGridMQTTClientSessionConnectedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class EventGridMqttClientSessionConnectedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal EventGridMQTTClientSessionConnectedEventData() { } + internal EventGridMqttClientSessionConnectedEventData() { } public string ClientSessionName { get { throw null; } } public long? SequenceNumber { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - 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; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(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; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class EventGridMQTTClientSessionDisconnectedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class EventGridMqttClientSessionDisconnectedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal EventGridMQTTClientSessionDisconnectedEventData() { } + internal EventGridMqttClientSessionDisconnectedEventData() { } public string ClientSessionName { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason DisconnectionReason { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason? DisconnectionReason { get { throw null; } } public long? SequenceNumber { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - 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; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(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; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct EventGridMQTTClientState : System.IEquatable + public readonly partial struct EventGridMqttClientState : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public EventGridMQTTClientState(string value) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState Disabled { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState Enabled { get { throw null; } } - public bool Equals(Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState other) { throw null; } + public EventGridMqttClientState(string value) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState Disabled { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState Enabled { get { throw null; } } + public bool Equals(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] 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 bool operator !=(Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState left, Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState right) { 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 bool operator !=(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState left, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState right) { throw null; } public override string ToString() { throw null; } } public static partial class EventGridSystemEventsModelFactory { public static Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties AcsChatEventBaseProperties(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties AcsChatEventInThreadBaseProperties(string transactionId = null, string threadId = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedEventData AcsChatMessageDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?), System.DateTimeOffset deleteTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedInThreadEventData AcsChatMessageDeletedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?), System.DateTimeOffset deleteTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEditedEventData AcsChatMessageEditedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.DateTimeOffset editTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEditedInThreadEventData AcsChatMessageEditedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.DateTimeOffset editTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventBaseProperties AcsChatMessageEventBaseProperties(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventInThreadBaseProperties AcsChatMessageEventInThreadBaseProperties(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageReceivedEventData AcsChatMessageReceivedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageReceivedInThreadEventData AcsChatMessageReceivedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadEventData AcsChatParticipantAddedToThreadEventData(string transactionId = null, string threadId = null, System.DateTimeOffset time = default(System.DateTimeOffset), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel addedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantAdded = null, long? version = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadWithUserEventData AcsChatParticipantAddedToThreadWithUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), System.DateTimeOffset time = default(System.DateTimeOffset), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel addedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantAdded = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadEventData AcsChatParticipantRemovedFromThreadEventData(string transactionId = null, string threadId = null, System.DateTimeOffset time = default(System.DateTimeOffset), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel removedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantRemoved = null, long? version = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadWithUserEventData AcsChatParticipantRemovedFromThreadWithUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), System.DateTimeOffset time = default(System.DateTimeOffset), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel removedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantRemoved = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadCreatedEventData AcsChatThreadCreatedEventData(string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel createdByCommunicationIdentifier = null, System.Collections.Generic.IReadOnlyDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IEnumerable participants = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadCreatedWithUserEventData AcsChatThreadCreatedWithUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel createdByCommunicationIdentifier = null, System.Collections.Generic.IReadOnlyDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IEnumerable participants = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadDeletedEventData AcsChatThreadDeletedEventData(string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel deletedByCommunicationIdentifier = null, System.DateTimeOffset deleteTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventBaseProperties AcsChatThreadEventBaseProperties(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventInThreadBaseProperties AcsChatThreadEventInThreadBaseProperties(string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedEventData AcsChatMessageDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?), System.DateTimeOffset? deleteTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedInThreadEventData AcsChatMessageDeletedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?), System.DateTimeOffset? deleteTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEditedEventData AcsChatMessageEditedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.DateTimeOffset? editTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEditedInThreadEventData AcsChatMessageEditedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.DateTimeOffset? editTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventBaseProperties AcsChatMessageEventBaseProperties(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventInThreadBaseProperties AcsChatMessageEventInThreadBaseProperties(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageReceivedEventData AcsChatMessageReceivedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageReceivedInThreadEventData AcsChatMessageReceivedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadEventData AcsChatParticipantAddedToThreadEventData(string transactionId = null, string threadId = null, System.DateTimeOffset? time = default(System.DateTimeOffset?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel addedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantAdded = null, long? version = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadWithUserEventData AcsChatParticipantAddedToThreadWithUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), System.DateTimeOffset? time = default(System.DateTimeOffset?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel addedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantAdded = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadEventData AcsChatParticipantRemovedFromThreadEventData(string transactionId = null, string threadId = null, System.DateTimeOffset? time = default(System.DateTimeOffset?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel removedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantRemoved = null, long? version = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadWithUserEventData AcsChatParticipantRemovedFromThreadWithUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), System.DateTimeOffset? time = default(System.DateTimeOffset?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel removedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantRemoved = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadCreatedEventData AcsChatThreadCreatedEventData(string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel createdByCommunicationIdentifier = null, System.Collections.Generic.IReadOnlyDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IEnumerable participants = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadCreatedWithUserEventData AcsChatThreadCreatedWithUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel createdByCommunicationIdentifier = null, System.Collections.Generic.IReadOnlyDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IEnumerable participants = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadDeletedEventData AcsChatThreadDeletedEventData(string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel deletedByCommunicationIdentifier = null, System.DateTimeOffset? deleteTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventBaseProperties AcsChatThreadEventBaseProperties(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventInThreadBaseProperties AcsChatThreadEventInThreadBaseProperties(string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties AcsChatThreadParticipantProperties(string displayName = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel participantCommunicationIdentifier = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadPropertiesUpdatedEventData AcsChatThreadPropertiesUpdatedEventData(string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel editedByCommunicationIdentifier = null, System.DateTimeOffset editTime = default(System.DateTimeOffset), System.Collections.Generic.IReadOnlyDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadPropertiesUpdatedPerUserEventData AcsChatThreadPropertiesUpdatedPerUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel editedByCommunicationIdentifier = null, System.DateTimeOffset editTime = default(System.DateTimeOffset), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IReadOnlyDictionary properties = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadWithUserDeletedEventData AcsChatThreadWithUserDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel deletedByCommunicationIdentifier = null, System.DateTimeOffset deleteTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportReceivedEventData AcsEmailDeliveryReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus status = default(Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus), Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatusDetails deliveryStatusDetails = null, System.DateTimeOffset deliveryAttemptTimestamp = default(System.DateTimeOffset)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadPropertiesUpdatedEventData AcsChatThreadPropertiesUpdatedEventData(string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel editedByCommunicationIdentifier = null, System.DateTimeOffset? editTime = default(System.DateTimeOffset?), System.Collections.Generic.IReadOnlyDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadPropertiesUpdatedPerUserEventData AcsChatThreadPropertiesUpdatedPerUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel editedByCommunicationIdentifier = null, System.DateTimeOffset? editTime = default(System.DateTimeOffset?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IReadOnlyDictionary properties = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadWithUserDeletedEventData AcsChatThreadWithUserDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel deletedByCommunicationIdentifier = null, System.DateTimeOffset? deleteTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportReceivedEventData AcsEmailDeliveryReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus? status = default(Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus?), Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatusDetails deliveryStatusDetails = null, System.DateTimeOffset? deliveryAttemptTimestamp = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatusDetails AcsEmailDeliveryReportStatusDetails(string statusMessage = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsEmailEngagementTrackingReportReceivedEventData AcsEmailEngagementTrackingReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, System.DateTimeOffset userActionTimestamp = default(System.DateTimeOffset), string engagementContext = null, string userAgent = null, Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement engagement = default(Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsEmailEngagementTrackingReportReceivedEventData AcsEmailEngagementTrackingReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, System.DateTimeOffset? userActionTimestamp = default(System.DateTimeOffset?), string engagementContext = null, string userAgent = null, Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement? engagement = default(Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallCustomContext AcsIncomingCallCustomContext(System.Collections.Generic.IReadOnlyDictionary sipHeaders = null, System.Collections.Generic.IReadOnlyDictionary voipHeaders = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallEventData AcsIncomingCallEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel toCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel fromCommunicationIdentifier = null, string serverCallId = null, string callerDisplayName = null, Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallCustomContext customContext = null, string incomingCallContext = null, string correlationId = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallEventData AcsIncomingCallEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel toCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel fromCommunicationIdentifier = null, string serverCallId = null, string callerDisplayName = null, Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallCustomContext customContext = null, string incomingCallContext = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel onBehalfOfCallee = null, string correlationId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageButtonContent AcsMessageButtonContent(string text = null, string payload = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError AcsMessageChannelEventError(string channelCode = null, string channelMessage = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageContext AcsMessageContext(string from = null, string messageId = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatusUpdatedEventData AcsMessageDeliveryStatusUpdatedEventData(string from = null, string to = null, System.DateTimeOffset receivedTimestamp = default(System.DateTimeOffset), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError error = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus status = default(Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind channelKind = default(Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData AcsMessageEventData(string from = null, string to = null, System.DateTimeOffset receivedTimestamp = default(System.DateTimeOffset), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError error = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatusUpdatedEventData AcsMessageDeliveryStatusUpdatedEventData(string from = null, string to = null, System.DateTimeOffset? receivedTimestamp = default(System.DateTimeOffset?), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError error = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus? status = default(Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus?), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind? channelKind = default(Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData AcsMessageEventData(string from = null, string to = null, System.DateTimeOffset? receivedTimestamp = default(System.DateTimeOffset?), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError error = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveButtonReplyContent AcsMessageInteractiveButtonReplyContent(string buttonId = null, string title = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveContent AcsMessageInteractiveContent(Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind replyKind = default(Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind), Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveButtonReplyContent buttonReply = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveListReplyContent listReply = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveContent AcsMessageInteractiveContent(Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind? replyKind = default(Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind?), Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveButtonReplyContent buttonReply = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveListReplyContent listReply = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveListReplyContent AcsMessageInteractiveListReplyContent(string listItemId = null, string title = null, string description = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageMediaContent AcsMessageMediaContent(string mimeType = null, string mediaId = null, string fileName = null, string caption = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageReceivedEventData AcsMessageReceivedEventData(string from = null, string to = null, System.DateTimeOffset receivedTimestamp = default(System.DateTimeOffset), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError error = null, string content = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind channelKind = default(Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind), Azure.Messaging.EventGrid.SystemEvents.AcsMessageMediaContent mediaContent = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageContext context = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageButtonContent button = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveContent interactiveContent = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageReceivedEventData AcsMessageReceivedEventData(string from = null, string to = null, System.DateTimeOffset? receivedTimestamp = default(System.DateTimeOffset?), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError error = null, string content = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind channelKind = default(Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind), Azure.Messaging.EventGrid.SystemEvents.AcsMessageMediaContent mediaContent = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageContext context = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageButtonContent button = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveContent interactiveContent = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRecordingChunkInfoProperties AcsRecordingChunkInfoProperties(string documentId = null, long? index = default(long?), string endReason = null, string metadataLocation = null, string contentLocation = null, string deleteLocation = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFileStatusUpdatedEventData AcsRecordingFileStatusUpdatedEventData(Azure.Messaging.EventGrid.SystemEvents.AcsRecordingStorageInfoProperties recordingStorageInfo = null, System.DateTimeOffset recordingStartTime = default(System.DateTimeOffset), long? recordingDurationMs = default(long?), Azure.Messaging.EventGrid.SystemEvents.RecordingContentType recordingContentType = default(Azure.Messaging.EventGrid.SystemEvents.RecordingContentType), Azure.Messaging.EventGrid.SystemEvents.RecordingChannelType recordingChannelKind = default(Azure.Messaging.EventGrid.SystemEvents.RecordingChannelType), Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType recordingFormatType = default(Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType), string sessionEndReason = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFileStatusUpdatedEventData AcsRecordingFileStatusUpdatedEventData(Azure.Messaging.EventGrid.SystemEvents.AcsRecordingStorageInfoProperties recordingStorageInfo = null, System.DateTimeOffset? recordingStartTime = default(System.DateTimeOffset?), long? recordingDurationMs = default(long?), Azure.Messaging.EventGrid.SystemEvents.RecordingContentType? recordingContentType = default(Azure.Messaging.EventGrid.SystemEvents.RecordingContentType?), Azure.Messaging.EventGrid.SystemEvents.RecordingChannelType? recordingChannelKind = default(Azure.Messaging.EventGrid.SystemEvents.RecordingChannelType?), Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType? recordingFormatType = default(Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType?), string sessionEndReason = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRecordingStorageInfoProperties AcsRecordingStorageInfoProperties(System.Collections.Generic.IEnumerable recordingChunks = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterChannelConfiguration AcsRouterChannelConfiguration(string channelId = null, int? capacityCostPerJob = default(int?), int? maxNumberOfJobs = default(int?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterCommunicationError AcsRouterCommunicationError(string code = null, string message = null, string target = null, Azure.Messaging.EventGrid.SystemEvents.AcsRouterCommunicationError innererror = null, System.Collections.Generic.IEnumerable details = null) { throw null; } @@ -2474,10 +2475,10 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobEventData AcsRouterJobEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobExceptionTriggeredEventData AcsRouterJobExceptionTriggeredEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, string ruleKey = null, string exceptionRuleId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobQueuedEventData AcsRouterJobQueuedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, int? priority = default(int?), System.Collections.Generic.IEnumerable attachedWorkerSelectors = null, System.Collections.Generic.IEnumerable requestedWorkerSelectors = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobReceivedEventData AcsRouterJobReceivedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus jobStatus = default(Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus), string classificationPolicyId = null, int? priority = default(int?), System.Collections.Generic.IEnumerable requestedWorkerSelectors = null, System.DateTimeOffset scheduledOn = default(System.DateTimeOffset), bool unavailableForMatching = false) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobSchedulingFailedEventData AcsRouterJobSchedulingFailedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, int? priority = default(int?), System.Collections.Generic.IEnumerable expiredAttachedWorkerSelectors = null, System.Collections.Generic.IEnumerable expiredRequestedWorkerSelectors = null, System.DateTimeOffset scheduledOn = default(System.DateTimeOffset), string failureReason = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobReceivedEventData AcsRouterJobReceivedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus? jobStatus = default(Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus?), string classificationPolicyId = null, int? priority = default(int?), System.Collections.Generic.IEnumerable requestedWorkerSelectors = null, System.DateTimeOffset? scheduledOn = default(System.DateTimeOffset?), bool unavailableForMatching = false) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobSchedulingFailedEventData AcsRouterJobSchedulingFailedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, int? priority = default(int?), System.Collections.Generic.IEnumerable expiredAttachedWorkerSelectors = null, System.Collections.Generic.IEnumerable expiredRequestedWorkerSelectors = null, System.DateTimeOffset? scheduledOn = default(System.DateTimeOffset?), string failureReason = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobUnassignedEventData AcsRouterJobUnassignedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, string assignmentId = null, string workerId = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobWaitingForActivationEventData AcsRouterJobWaitingForActivationEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, int? priority = default(int?), System.Collections.Generic.IEnumerable expiredAttachedWorkerSelectors = null, System.Collections.Generic.IEnumerable expiredRequestedWorkerSelectors = null, System.DateTimeOffset scheduledOn = default(System.DateTimeOffset), bool unavailableForMatching = false) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobWaitingForActivationEventData AcsRouterJobWaitingForActivationEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, int? priority = default(int?), System.Collections.Generic.IEnumerable expiredAttachedWorkerSelectors = null, System.Collections.Generic.IEnumerable expiredRequestedWorkerSelectors = null, System.DateTimeOffset? scheduledOn = default(System.DateTimeOffset?), bool unavailableForMatching = false) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobWorkerSelectorsExpiredEventData AcsRouterJobWorkerSelectorsExpiredEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, System.Collections.Generic.IEnumerable expiredRequestedWorkerSelectors = null, System.Collections.Generic.IEnumerable expiredAttachedWorkerSelectors = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterQueueDetails AcsRouterQueueDetails(string id = null, string name = null, System.Collections.Generic.IReadOnlyDictionary labels = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerDeletedEventData AcsRouterWorkerDeletedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null) { throw null; } @@ -2486,15 +2487,15 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.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 = default(int?), System.Collections.Generic.IReadOnlyDictionary workerLabels = null, 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.AcsRouterWorkerOfferDeclinedEventData AcsRouterWorkerOfferDeclinedEventData(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.AcsRouterWorkerOfferExpiredEventData AcsRouterWorkerOfferExpiredEventData(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.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.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 labelOperator = default(Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator), System.BinaryData labelValue = null, double timeToLive = 0, 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.AcsRouterWorkerSelector AcsRouterWorkerSelector(string key = null, Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator? labelOperator = default(Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator?), System.BinaryData labelValue = null, double timeToLive = 0, 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; } + 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; } public static Azure.Messaging.EventGrid.SystemEvents.AcsSmsEventBaseProperties AcsSmsEventBaseProperties(string messageId = null, string from = null, string to = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsSmsReceivedEventData AcsSmsReceivedEventData(string messageId = null, string from = null, string to = null, string message = null, System.DateTimeOffset receivedTimestamp = default(System.DateTimeOffset)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsSmsReceivedEventData AcsSmsReceivedEventData(string messageId = null, string from = null, string to = null, string message = null, System.DateTimeOffset? receivedTimestamp = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsUserDisconnectedEventData AcsUserDisconnectedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel userCommunicationIdentifier = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiDefinitionAddedEventData ApiCenterApiDefinitionAddedEventData(string title = null, string description = null, Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiSpecification specification = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiDefinitionUpdatedEventData ApiCenterApiDefinitionUpdatedEventData(string title = null, string description = null, Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiSpecification specification = null) { throw null; } @@ -2530,8 +2531,8 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotCreatedEventData AppConfigurationSnapshotCreatedEventData(string name = null, string etag = null, string syncToken = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData AppConfigurationSnapshotEventData(string name = null, string etag = null, string syncToken = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotModifiedEventData AppConfigurationSnapshotModifiedEventData(string name = null, string etag = null, string syncToken = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AppEventTypeDetail AppEventTypeDetail(Azure.Messaging.EventGrid.SystemEvents.AppAction action = default(Azure.Messaging.EventGrid.SystemEvents.AppAction)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AppServicePlanEventTypeDetail AppServicePlanEventTypeDetail(Azure.Messaging.EventGrid.SystemEvents.StampKind stampKind = default(Azure.Messaging.EventGrid.SystemEvents.StampKind), Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction action = default(Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction), Azure.Messaging.EventGrid.SystemEvents.AsyncStatus status = default(Azure.Messaging.EventGrid.SystemEvents.AsyncStatus)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AppEventTypeDetail AppEventTypeDetail(Azure.Messaging.EventGrid.SystemEvents.AppAction? action = default(Azure.Messaging.EventGrid.SystemEvents.AppAction?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AppServicePlanEventTypeDetail AppServicePlanEventTypeDetail(Azure.Messaging.EventGrid.SystemEvents.StampKind? stampKind = default(Azure.Messaging.EventGrid.SystemEvents.StampKind?), Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction? action = default(Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction?), Azure.Messaging.EventGrid.SystemEvents.AsyncStatus? status = default(Azure.Messaging.EventGrid.SystemEvents.AsyncStatus?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AvsClusterCreatedEventData AvsClusterCreatedEventData(string operationId = null, System.Collections.Generic.IEnumerable addedHostNames = null, System.Collections.Generic.IEnumerable removedHostNames = null, System.Collections.Generic.IEnumerable inMaintenanceHostNames = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AvsClusterDeletedEventData AvsClusterDeletedEventData(string operationId = null, System.Collections.Generic.IEnumerable addedHostNames = null, System.Collections.Generic.IEnumerable removedHostNames = null, System.Collections.Generic.IEnumerable inMaintenanceHostNames = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData AvsClusterEventData(string operationId = null, System.Collections.Generic.IEnumerable addedHostNames = null, System.Collections.Generic.IEnumerable removedHostNames = null, System.Collections.Generic.IEnumerable inMaintenanceHostNames = null) { throw null; } @@ -2547,20 +2548,20 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionFailedEventData AvsScriptExecutionFailedEventData(string operationId = null, string cmdletId = null, System.Collections.Generic.IEnumerable output = null, string failureMessage = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionFinishedEventData AvsScriptExecutionFinishedEventData(string operationId = null, string cmdletId = null, System.Collections.Generic.IEnumerable output = null, System.Collections.Generic.IReadOnlyDictionary namedOutputs = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionStartedEventData AvsScriptExecutionStartedEventData(string operationId = null, string cmdletId = null, System.Collections.Generic.IEnumerable output = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel CommunicationIdentifierModel(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModelKind kind = default(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModelKind), string rawId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationUserIdentifierModel communicationUser = null, Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel phoneNumber = null, Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel microsoftTeamsUser = null, Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsAppIdentifierModel microsoftTeamsApp = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel CommunicationIdentifierModel(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModelKind? kind = default(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModelKind?), string rawId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationUserIdentifierModel communicationUser = null, Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel phoneNumber = null, Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel microsoftTeamsUser = null, Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsAppIdentifierModel microsoftTeamsApp = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.CommunicationUserIdentifierModel CommunicationUserIdentifierModel(string id = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData ContainerRegistryArtifactEventData(string id = null, System.DateTimeOffset timestamp = default(System.DateTimeOffset), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData ContainerRegistryArtifactEventData(string id = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget ContainerRegistryArtifactEventTarget(string mediaType = null, long? size = default(long?), string digest = null, string repository = null, string tag = null, string name = null, string version = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryChartDeletedEventData ContainerRegistryChartDeletedEventData(string id = null, System.DateTimeOffset timestamp = default(System.DateTimeOffset), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryChartPushedEventData ContainerRegistryChartPushedEventData(string id = null, System.DateTimeOffset timestamp = default(System.DateTimeOffset), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryChartDeletedEventData ContainerRegistryChartDeletedEventData(string id = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryChartPushedEventData ContainerRegistryChartPushedEventData(string id = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor ContainerRegistryEventActor(string name = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry ContainerRegistryEventConnectedRegistry(string name = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData ContainerRegistryEventData(string id = null, System.DateTimeOffset timestamp = default(System.DateTimeOffset), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest request = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor actor = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource source = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData ContainerRegistryEventData(string id = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest request = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor actor = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource source = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest ContainerRegistryEventRequest(string id = null, string addr = null, string host = null, string method = null, string useragent = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource ContainerRegistryEventSource(string addr = null, string instanceID = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget ContainerRegistryEventTarget(string mediaType = null, long? size = default(long?), string digest = null, long? length = default(long?), string repository = null, string url = null, string tag = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryImageDeletedEventData ContainerRegistryImageDeletedEventData(string id = null, System.DateTimeOffset timestamp = default(System.DateTimeOffset), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest request = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor actor = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource source = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryImagePushedEventData ContainerRegistryImagePushedEventData(string id = null, System.DateTimeOffset timestamp = default(System.DateTimeOffset), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest request = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor actor = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource source = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryImageDeletedEventData ContainerRegistryImageDeletedEventData(string id = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest request = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor actor = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource source = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryImagePushedEventData ContainerRegistryImagePushedEventData(string id = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest request = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor actor = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource source = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEndedEventData ContainerServiceClusterSupportEndedEventData(string kubernetesVersion = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEndingEventData ContainerServiceClusterSupportEndingEventData(string kubernetesVersion = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEventData ContainerServiceClusterSupportEventData(string kubernetesVersion = null) { throw null; } @@ -2569,9 +2570,9 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingFailedEventData ContainerServiceNodePoolRollingFailedEventData(string nodePoolName = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingStartedEventData ContainerServiceNodePoolRollingStartedEventData(string nodePoolName = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingSucceededEventData ContainerServiceNodePoolRollingSucceededEventData(string nodePoolName = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyCompletedEventData DataBoxCopyCompletedEventData(string serialNumber = null, Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName stageName = default(Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName), System.DateTimeOffset stageTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyStartedEventData DataBoxCopyStartedEventData(string serialNumber = null, Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName stageName = default(Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName), System.DateTimeOffset stageTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.DataBoxOrderCompletedEventData DataBoxOrderCompletedEventData(string serialNumber = null, Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName stageName = default(Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName), System.DateTimeOffset stageTime = default(System.DateTimeOffset)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyCompletedEventData DataBoxCopyCompletedEventData(string serialNumber = null, Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? stageName = default(Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName?), System.DateTimeOffset? stageTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyStartedEventData DataBoxCopyStartedEventData(string serialNumber = null, Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? stageName = default(Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName?), System.DateTimeOffset? stageTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.DataBoxOrderCompletedEventData DataBoxOrderCompletedEventData(string serialNumber = null, Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? stageName = default(Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName?), System.DateTimeOffset? stageTime = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventInfo DeviceConnectionStateEventInfo(string sequenceNumber = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventProperties DeviceConnectionStateEventProperties(string deviceId = null, string moduleId = null, string hubName = null, Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventInfo deviceConnectionStateEventInfo = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.DeviceLifeCycleEventProperties DeviceLifeCycleEventProperties(string deviceId = null, string hubName = null, Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfo twin = null) { throw null; } @@ -2581,18 +2582,18 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfoX509Thumbprint DeviceTwinInfoX509Thumbprint(string primaryThumbprint = null, string secondaryThumbprint = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.DeviceTwinMetadata DeviceTwinMetadata(string lastUpdated = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.DeviceTwinProperties DeviceTwinProperties(Azure.Messaging.EventGrid.SystemEvents.DeviceTwinMetadata metadata = null, float? version = default(float?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientCreatedOrUpdatedEventData EventGridMQTTClientCreatedOrUpdatedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState state = default(Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset updatedOn = default(System.DateTimeOffset), System.Collections.Generic.IReadOnlyDictionary attributes = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDeletedEventData EventGridMQTTClientDeletedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientEventData EventGridMQTTClientEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientSessionConnectedEventData EventGridMQTTClientSessionConnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientSessionDisconnectedEventData EventGridMQTTClientSessionDisconnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = default(long?), Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason disconnectionReason = default(Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventHubCaptureFileCreatedEventData EventHubCaptureFileCreatedEventData(string fileurl = null, string fileType = null, string partitionId = null, int? sizeInBytes = default(int?), int? eventCount = default(int?), int? firstSequenceNumber = default(int?), int? lastSequenceNumber = default(int?), System.DateTimeOffset firstEnqueueTime = default(System.DateTimeOffset), System.DateTimeOffset lastEnqueueTime = default(System.DateTimeOffset)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientCreatedOrUpdatedEventData EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState? state = default(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), System.Collections.Generic.IReadOnlyDictionary attributes = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDeletedEventData EventGridMqttClientDeletedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData EventGridMqttClientEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientSessionConnectedEventData EventGridMqttClientSessionConnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientSessionDisconnectedEventData EventGridMqttClientSessionDisconnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = default(long?), Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason? disconnectionReason = default(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventHubCaptureFileCreatedEventData EventHubCaptureFileCreatedEventData(string fileurl = null, string fileType = null, string partitionId = null, int? sizeInBytes = default(int?), int? eventCount = default(int?), int? firstSequenceNumber = default(int?), int? lastSequenceNumber = default(int?), System.DateTimeOffset? firstEnqueueTime = default(System.DateTimeOffset?), System.DateTimeOffset? lastEnqueueTime = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageCreatedEventData HealthcareDicomImageCreatedEventData(string partitionName = null, string imageStudyInstanceUid = null, string imageSeriesInstanceUid = null, string imageSopInstanceUid = null, string serviceHostName = null, long? sequenceNumber = default(long?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageDeletedEventData HealthcareDicomImageDeletedEventData(string partitionName = null, string imageStudyInstanceUid = null, string imageSeriesInstanceUid = null, string imageSopInstanceUid = null, string serviceHostName = null, long? sequenceNumber = default(long?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageUpdatedEventData HealthcareDicomImageUpdatedEventData(string partitionName = null, string imageStudyInstanceUid = null, string imageSeriesInstanceUid = null, string imageSopInstanceUid = null, string serviceHostName = null, long? sequenceNumber = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceCreatedEventData HealthcareFhirResourceCreatedEventData(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType fhirResourceType = default(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType), string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceDeletedEventData HealthcareFhirResourceDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType fhirResourceType = default(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType), string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceUpdatedEventData HealthcareFhirResourceUpdatedEventData(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType fhirResourceType = default(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType), string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceCreatedEventData HealthcareFhirResourceCreatedEventData(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? fhirResourceType = default(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType?), string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceDeletedEventData HealthcareFhirResourceDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? fhirResourceType = default(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType?), string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceUpdatedEventData HealthcareFhirResourceUpdatedEventData(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? fhirResourceType = default(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType?), string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = default(long?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceConnectedEventData IotHubDeviceConnectedEventData(string deviceId = null, string moduleId = null, string hubName = null, Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventInfo deviceConnectionStateEventInfo = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceCreatedEventData IotHubDeviceCreatedEventData(string deviceId = null, string hubName = null, Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfo twin = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceDeletedEventData IotHubDeviceDeletedEventData(string deviceId = null, string hubName = null, Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfo twin = null) { throw null; } @@ -2608,7 +2609,7 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretExpiredEventData KeyVaultSecretExpiredEventData(string id = null, string vaultName = null, string objectType = null, string objectName = null, string version = null, float? nbf = default(float?), float? exp = default(float?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretNearExpiryEventData KeyVaultSecretNearExpiryEventData(string id = null, string vaultName = null, string objectType = null, string objectName = null, string version = null, float? nbf = default(float?), float? exp = default(float?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretNewVersionCreatedEventData KeyVaultSecretNewVersionCreatedEventData(string id = null, string vaultName = null, string objectType = null, string objectName = null, string version = null, float? nbf = default(float?), float? exp = default(float?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesDatasetDriftDetectedEventData MachineLearningServicesDatasetDriftDetectedEventData(string dataDriftId = null, string dataDriftName = null, string runId = null, string baseDatasetId = null, string targetDatasetId = null, double? driftCoefficient = default(double?), System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset endTime = default(System.DateTimeOffset)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesDatasetDriftDetectedEventData MachineLearningServicesDatasetDriftDetectedEventData(string dataDriftId = null, string dataDriftName = null, string runId = null, string baseDatasetId = null, string targetDatasetId = null, double? driftCoefficient = default(double?), System.DateTimeOffset? startTime = default(System.DateTimeOffset?), System.DateTimeOffset? endTime = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesModelDeployedEventData MachineLearningServicesModelDeployedEventData(string serviceName = null, string serviceComputeType = null, string modelIds = null, System.Collections.Generic.IReadOnlyDictionary serviceTags = null, System.Collections.Generic.IReadOnlyDictionary serviceProperties = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesModelRegisteredEventData MachineLearningServicesModelRegisteredEventData(string modelName = null, string modelVersion = null, System.Collections.Generic.IReadOnlyDictionary modelTags = null, System.Collections.Generic.IReadOnlyDictionary modelProperties = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesRunCompletedEventData MachineLearningServicesRunCompletedEventData(string experimentId = null, string experimentName = null, string runId = null, string runType = null, System.Collections.Generic.IReadOnlyDictionary runTags = null, System.Collections.Generic.IReadOnlyDictionary runProperties = null) { throw null; } @@ -2618,45 +2619,16 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceExitedEventData MapsGeofenceExitedEventData(System.Collections.Generic.IEnumerable expiredGeofenceGeometryId = null, System.Collections.Generic.IEnumerable geometries = null, System.Collections.Generic.IEnumerable invalidPeriodGeofenceGeometryId = null, bool? isEventPublished = default(bool?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceGeometry MapsGeofenceGeometry(string deviceId = null, float? distance = default(float?), string geometryId = null, float? nearestLat = default(float?), float? nearestLon = default(float?), string udId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceResultEventData MapsGeofenceResultEventData(System.Collections.Generic.IEnumerable expiredGeofenceGeometryId = null, System.Collections.Generic.IEnumerable geometries = null, System.Collections.Generic.IEnumerable invalidPeriodGeofenceGeometryId = null, bool? isEventPublished = default(bool?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobCanceledEventData MediaJobCanceledEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), System.Collections.Generic.IReadOnlyDictionary correlationData = null, System.Collections.Generic.IEnumerable outputs = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobCancelingEventData MediaJobCancelingEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), System.Collections.Generic.IReadOnlyDictionary correlationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobError MediaJobError(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode code = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode), string message = null, Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory category = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory), Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry retry = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry), System.Collections.Generic.IEnumerable details = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorDetail MediaJobErrorDetail(string code = null, string message = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErroredEventData MediaJobErroredEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), System.Collections.Generic.IReadOnlyDictionary correlationData = null, System.Collections.Generic.IEnumerable outputs = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobFinishedEventData MediaJobFinishedEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), System.Collections.Generic.IReadOnlyDictionary correlationData = null, System.Collections.Generic.IEnumerable outputs = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput MediaJobOutput(string odataType = null, Azure.Messaging.EventGrid.SystemEvents.MediaJobError error = null, string label = null, long progress = (long)0, Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputAsset MediaJobOutputAsset(Azure.Messaging.EventGrid.SystemEvents.MediaJobError error = null, string label = null, long progress = (long)0, Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), string assetName = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputCanceledEventData MediaJobOutputCanceledEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputCancelingEventData MediaJobOutputCancelingEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputErroredEventData MediaJobOutputErroredEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputFinishedEventData MediaJobOutputFinishedEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputProcessingEventData MediaJobOutputProcessingEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputProgressEventData MediaJobOutputProgressEventData(string label = null, long? progress = default(long?), System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputScheduledEventData MediaJobOutputScheduledEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputStateChangeEventData MediaJobOutputStateChangeEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobProcessingEventData MediaJobProcessingEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), System.Collections.Generic.IReadOnlyDictionary correlationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobScheduledEventData MediaJobScheduledEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), System.Collections.Generic.IReadOnlyDictionary correlationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobStateChangeEventData MediaJobStateChangeEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), System.Collections.Generic.IReadOnlyDictionary correlationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventChannelArchiveHeartbeatEventData MediaLiveEventChannelArchiveHeartbeatEventData(string channelLatencyMs = null, string latencyResultCode = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventConnectionRejectedEventData MediaLiveEventConnectionRejectedEventData(string ingestUrl = null, string streamId = null, string encoderIp = null, string encoderPort = null, string resultCode = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventEncoderConnectedEventData MediaLiveEventEncoderConnectedEventData(string ingestUrl = null, string streamId = null, string encoderIp = null, string encoderPort = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventEncoderDisconnectedEventData MediaLiveEventEncoderDisconnectedEventData(string ingestUrl = null, string streamId = null, string encoderIp = null, string encoderPort = null, string resultCode = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIncomingDataChunkDroppedEventData MediaLiveEventIncomingDataChunkDroppedEventData(string timestamp = null, string trackType = null, long? bitrate = default(long?), string timescale = null, string resultCode = null, string trackName = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIncomingStreamReceivedEventData MediaLiveEventIncomingStreamReceivedEventData(string ingestUrl = null, string trackType = null, string trackName = null, long? bitrate = default(long?), string encoderIp = null, string encoderPort = null, string timestamp = null, string duration = null, string timescale = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIncomingStreamsOutOfSyncEventData MediaLiveEventIncomingStreamsOutOfSyncEventData(string minLastTimestamp = null, string typeOfStreamWithMinLastTimestamp = null, string maxLastTimestamp = null, string typeOfStreamWithMaxLastTimestamp = null, string timescaleOfMinLastTimestamp = null, string timescaleOfMaxLastTimestamp = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIncomingVideoStreamsOutOfSyncEventData MediaLiveEventIncomingVideoStreamsOutOfSyncEventData(string firstTimestamp = null, string firstDuration = null, string secondTimestamp = null, string secondDuration = null, string timescale = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIngestHeartbeatEventData MediaLiveEventIngestHeartbeatEventData(string trackType = null, string trackName = null, string transcriptionLanguage = null, string transcriptionState = null, long? bitrate = default(long?), long? incomingBitrate = default(long?), string ingestDriftValue = null, string lastFragmentArrivalTime = null, string lastTimestamp = null, string timescale = null, long? overlapCount = default(long?), long? discontinuityCount = default(long?), long? nonincreasingCount = default(long?), bool? unexpectedBitrate = default(bool?), string state = null, bool? healthy = default(bool?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventTrackDiscontinuityDetectedEventData MediaLiveEventTrackDiscontinuityDetectedEventData(string trackType = null, string trackName = null, long? bitrate = default(long?), string previousTimestamp = null, string newTimestamp = null, string timescale = null, string discontinuityGap = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsAppIdentifierModel MicrosoftTeamsAppIdentifierModel(string appId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel cloud = default(Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel MicrosoftTeamsUserIdentifierModel(string userId = null, bool? isAnonymous = default(bool?), Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel cloud = default(Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsAppIdentifierModel MicrosoftTeamsAppIdentifierModel(string appId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel? cloud = default(Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel MicrosoftTeamsUserIdentifierModel(string userId = null, bool? isAnonymous = default(bool?), Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel? cloud = default(Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel PhoneNumberIdentifierModel(string value = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateChangedEventData PolicyInsightsPolicyStateChangedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateCreatedEventData PolicyInsightsPolicyStateCreatedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateDeletedEventData PolicyInsightsPolicyStateDeletedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.RedisExportRDBCompletedEventData RedisExportRDBCompletedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string name = null, string status = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.RedisImportRDBCompletedEventData RedisImportRDBCompletedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string name = null, string status = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.RedisPatchingCompletedEventData RedisPatchingCompletedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string name = null, string status = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.RedisScalingCompletedEventData RedisScalingCompletedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string name = null, string status = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateChangedEventData PolicyInsightsPolicyStateChangedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateCreatedEventData PolicyInsightsPolicyStateCreatedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateDeletedEventData PolicyInsightsPolicyStateDeletedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.RedisExportRdbCompletedEventData RedisExportRdbCompletedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string name = null, string status = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.RedisImportRdbCompletedEventData RedisImportRdbCompletedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string name = null, string status = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.RedisPatchingCompletedEventData RedisPatchingCompletedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string name = null, string status = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.RedisScalingCompletedEventData RedisScalingCompletedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string name = null, string status = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceActionCancelEventData ResourceActionCancelEventData(string tenantId = null, string subscriptionId = null, string resourceGroup = null, string resourceProvider = null, string resourceUri = null, string operationName = null, string status = null, Azure.Messaging.EventGrid.SystemEvents.ResourceAuthorization authorization = null, System.Collections.Generic.IReadOnlyDictionary claims = null, string correlationId = null, Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest httpRequest = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceActionFailureEventData ResourceActionFailureEventData(string tenantId = null, string subscriptionId = null, string resourceGroup = null, string resourceProvider = null, string resourceUri = null, string operationName = null, string status = null, Azure.Messaging.EventGrid.SystemEvents.ResourceAuthorization authorization = null, System.Collections.Generic.IReadOnlyDictionary claims = null, string correlationId = null, Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest httpRequest = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceActionSuccessEventData ResourceActionSuccessEventData(string tenantId = null, string subscriptionId = null, string resourceGroup = null, string resourceProvider = null, string resourceUri = null, string operationName = null, string status = null, Azure.Messaging.EventGrid.SystemEvents.ResourceAuthorization authorization = null, System.Collections.Generic.IReadOnlyDictionary claims = null, string correlationId = null, Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest httpRequest = null) { throw null; } @@ -2665,9 +2637,10 @@ public static partial class EventGridSystemEventsModelFactory 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, Azure.Messaging.EventGrid.SystemEvents.ResourceAuthorization authorization = null, System.Collections.Generic.IReadOnlyDictionary claims = null, string correlationId = null, Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest 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, Azure.Messaging.EventGrid.SystemEvents.ResourceAuthorization authorization = null, System.Collections.Generic.IReadOnlyDictionary claims = null, string correlationId = null, Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest httpRequest = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest ResourceHttpRequest(string clientRequestId = null, string clientIpAddress = null, string method = 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.ResourceNotificationsOperationalDetails ResourceNotificationsOperationalDetails(System.DateTimeOffset? resourceEventTime = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedDetails ResourceNotificationsResourceDeletedDetails(string id = 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; } @@ -2681,23 +2654,24 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.ServiceBusActiveMessagesAvailableWithNoListenersEventData ServiceBusActiveMessagesAvailableWithNoListenersEventData(string namespaceName = null, string requestUri = null, string entityType = null, string queueName = null, string topicName = null, string subscriptionName = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData(string namespaceName = null, string requestUri = null, string entityType = null, string queueName = null, string topicName = null, string subscriptionName = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ServiceBusDeadletterMessagesAvailableWithNoListenersEventData ServiceBusDeadletterMessagesAvailableWithNoListenersEventData(string namespaceName = null, string requestUri = null, string entityType = null, string queueName = null, string topicName = null, string subscriptionName = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionConnectedEventData SignalRServiceClientConnectionConnectedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string hubName = null, string connectionId = null, string userId = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionDisconnectedEventData SignalRServiceClientConnectionDisconnectedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string hubName = null, string connectionId = null, string userId = null, string errorMessage = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionConnectedEventData SignalRServiceClientConnectionConnectedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string hubName = null, string connectionId = null, string userId = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionDisconnectedEventData SignalRServiceClientConnectionDisconnectedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string hubName = null, string connectionId = null, string userId = null, string errorMessage = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageAsyncOperationInitiatedEventData StorageAsyncOperationInitiatedEventData(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, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobCreatedEventData StorageBlobCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string contentType = null, long? contentLength = default(long?), long? contentOffset = default(long?), string blobType = null, string url = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobCreatedEventData StorageBlobCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string contentType = null, long? contentLength = default(long?), long? contentOffset = default(long?), string blobType = null, Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier accessTier = default(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier), string url = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.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, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobInventoryPolicyCompletedEventData StorageBlobInventoryPolicyCompletedEventData(System.DateTimeOffset scheduleDateTime = default(System.DateTimeOffset), string accountName = null, string ruleName = null, string policyRunStatus = null, string policyRunStatusMessage = null, string policyRunId = null, string manifestBlobUrl = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobInventoryPolicyCompletedEventData StorageBlobInventoryPolicyCompletedEventData(System.DateTimeOffset? scheduleDateTime = default(System.DateTimeOffset?), string accountName = null, string ruleName = null, string policyRunStatus = null, string policyRunStatusMessage = null, string policyRunId = null, string manifestBlobUrl = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobRenamedEventData StorageBlobRenamedEventData(string api = null, string clientRequestId = null, string requestId = null, string sourceUrl = null, string destinationUrl = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } - 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, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } + 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, Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier accessTier = default(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier), Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier previousTier = default(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier), string url = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary 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, System.Collections.Generic.IReadOnlyDictionary 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 recursive = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary 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, System.Collections.Generic.IReadOnlyDictionary 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; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyCompletedEventData StorageLifecyclePolicyCompletedEventData(string scheduleTime = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail deleteSummary = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail tierToArchiveSummary = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedEventData StorageTaskAssignmentCompletedEventData(Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus status = default(Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus), System.DateTimeOffset completedOn = default(System.DateTimeOffset), string taskExecutionId = null, string taskName = null, System.Uri summaryReportBlobUri = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentQueuedEventData StorageTaskAssignmentQueuedEventData(System.DateTimeOffset queuedOn = default(System.DateTimeOffset), string taskExecutionId = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedEventData StorageTaskCompletedEventData(Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus status = default(Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus), System.DateTimeOffset completedDateTime = default(System.DateTimeOffset), string taskExecutionId = null, string taskName = null, System.Uri summaryReportBlobUrl = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskQueuedEventData StorageTaskQueuedEventData(System.DateTimeOffset queuedDateTime = default(System.DateTimeOffset), string taskExecutionId = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyCompletedEventData StorageLifecyclePolicyCompletedEventData(string scheduleTime = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyRunSummary policyRunSummary = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail deleteSummary = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail tierToArchiveSummary = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail tierToColdSummary = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyRunSummary StorageLifecyclePolicyRunSummary(Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus completionStatus = default(Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedEventData StorageTaskAssignmentCompletedEventData(Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus? status = default(Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus?), System.DateTimeOffset? completedOn = default(System.DateTimeOffset?), string taskExecutionId = null, string taskName = null, System.Uri summaryReportBlobUri = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentQueuedEventData StorageTaskAssignmentQueuedEventData(System.DateTimeOffset? queuedOn = default(System.DateTimeOffset?), string taskExecutionId = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedEventData StorageTaskCompletedEventData(Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus? status = default(Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus?), System.DateTimeOffset? completedDateTime = default(System.DateTimeOffset?), string taskExecutionId = null, string taskName = null, System.Uri summaryReportBlobUrl = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskQueuedEventData StorageTaskQueuedEventData(System.DateTimeOffset? queuedDateTime = default(System.DateTimeOffset?), string taskExecutionId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.SubscriptionDeletedEventData SubscriptionDeletedEventData(string eventSubscriptionId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.SubscriptionValidationEventData SubscriptionValidationEventData(string validationCode = null, string validationUrl = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.SubscriptionValidationResponse SubscriptionValidationResponse(string validationResponse = null) { throw null; } @@ -2722,9 +2696,9 @@ internal EventHubCaptureFileCreatedEventData() { } public int? EventCount { get { throw null; } } public string FileType { get { throw null; } } public string Fileurl { get { throw null; } } - public System.DateTimeOffset FirstEnqueueTime { get { throw null; } } + public System.DateTimeOffset? FirstEnqueueTime { get { throw null; } } public int? FirstSequenceNumber { get { throw null; } } - public System.DateTimeOffset LastEnqueueTime { get { throw null; } } + public System.DateTimeOffset? LastEnqueueTime { get { throw null; } } public int? LastSequenceNumber { get { throw null; } } public string PartitionId { get { throw null; } } public int? SizeInBytes { get { throw null; } } @@ -2787,7 +2761,7 @@ public partial class HealthcareFhirResourceCreatedEventData : System.ClientModel { internal HealthcareFhirResourceCreatedEventData() { } public string FhirResourceId { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType FhirResourceType { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? FhirResourceType { get { throw null; } } public long? FhirResourceVersionId { get { throw null; } } public string FhirServiceHostName { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -2801,7 +2775,7 @@ public partial class HealthcareFhirResourceDeletedEventData : System.ClientModel { internal HealthcareFhirResourceDeletedEventData() { } public string FhirResourceId { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType FhirResourceType { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? FhirResourceType { get { throw null; } } public long? FhirResourceVersionId { get { throw null; } } public string FhirServiceHostName { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -2992,7 +2966,7 @@ public partial class HealthcareFhirResourceUpdatedEventData : System.ClientModel { internal HealthcareFhirResourceUpdatedEventData() { } public string FhirResourceId { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType FhirResourceType { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? FhirResourceType { get { throw null; } } public long? FhirResourceVersionId { get { throw null; } } public string FhirServiceHostName { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -3229,9 +3203,9 @@ internal MachineLearningServicesDatasetDriftDetectedEventData() { } public string DataDriftId { get { throw null; } } public string DataDriftName { get { throw null; } } public double? DriftCoefficient { get { throw null; } } - public System.DateTimeOffset EndTime { get { throw null; } } + public System.DateTimeOffset? EndTime { get { throw null; } } public string RunId { get { throw null; } } - public System.DateTimeOffset StartTime { get { throw null; } } + public System.DateTimeOffset? StartTime { get { throw null; } } public string TargetDatasetId { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesDatasetDriftDetectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3362,479 +3336,11 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class MediaJobCanceledEventData : Azure.Messaging.EventGrid.SystemEvents.MediaJobStateChangeEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobCanceledEventData() { } - public System.Collections.Generic.IReadOnlyList Outputs { get { throw null; } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobCanceledEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobCanceledEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaJobCancelingEventData : Azure.Messaging.EventGrid.SystemEvents.MediaJobStateChangeEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobCancelingEventData() { } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobCancelingEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobCancelingEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaJobError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobError() { } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory Category { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode Code { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Details { get { throw null; } } - public string Message { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry Retry { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct MediaJobErrorCategory : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public MediaJobErrorCategory(string value) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory Account { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory Configuration { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory Content { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory Download { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory Service { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory Upload { get { throw null; } } - public bool Equals(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory left, Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory right) { throw null; } - public static implicit operator Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory (string value) { throw null; } - public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory left, Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory right) { throw null; } - public override string ToString() { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct MediaJobErrorCode : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public MediaJobErrorCode(string value) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode ConfigurationUnsupported { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode ContentMalformed { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode ContentUnsupported { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode DownloadNotAccessible { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode DownloadTransientError { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode IdentityUnsupported { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode ServiceError { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode ServiceTransientError { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode UploadNotAccessible { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode UploadTransientError { get { throw null; } } - public bool Equals(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode left, Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode right) { throw null; } - public static implicit operator Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode (string value) { throw null; } - public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode left, Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode right) { throw null; } - public override string ToString() { throw null; } - } - public partial class MediaJobErrorDetail : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobErrorDetail() { } - public string Code { get { throw null; } } - public string Message { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorDetail System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaJobErroredEventData : Azure.Messaging.EventGrid.SystemEvents.MediaJobStateChangeEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobErroredEventData() { } - public System.Collections.Generic.IReadOnlyList Outputs { get { throw null; } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobErroredEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobErroredEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaJobFinishedEventData : Azure.Messaging.EventGrid.SystemEvents.MediaJobStateChangeEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobFinishedEventData() { } - public System.Collections.Generic.IReadOnlyList Outputs { get { throw null; } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobFinishedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobFinishedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public abstract partial class MediaJobOutput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - protected MediaJobOutput(Azure.Messaging.EventGrid.SystemEvents.MediaJobError error, long progress, Azure.Messaging.EventGrid.SystemEvents.MediaJobState state) { } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobError Error { get { throw null; } } - public string Label { get { throw null; } } - public long Progress { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobState State { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaJobOutputAsset : Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobOutputAsset() : base (default(Azure.Messaging.EventGrid.SystemEvents.MediaJobError), default(long), default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState)) { } - public string AssetName { get { throw null; } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputAsset System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputAsset System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaJobOutputCanceledEventData : Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputStateChangeEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobOutputCanceledEventData() { } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputCanceledEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputCanceledEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaJobOutputCancelingEventData : Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputStateChangeEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobOutputCancelingEventData() { } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputCancelingEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputCancelingEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaJobOutputErroredEventData : Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputStateChangeEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobOutputErroredEventData() { } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputErroredEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputErroredEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaJobOutputFinishedEventData : Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputStateChangeEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobOutputFinishedEventData() { } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputFinishedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputFinishedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaJobOutputProcessingEventData : Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputStateChangeEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobOutputProcessingEventData() { } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputProcessingEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputProcessingEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaJobOutputProgressEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobOutputProgressEventData() { } - public System.Collections.Generic.IReadOnlyDictionary JobCorrelationData { get { throw null; } } - public string Label { get { throw null; } } - public long? Progress { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputProgressEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputProgressEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaJobOutputScheduledEventData : Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputStateChangeEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobOutputScheduledEventData() { } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputScheduledEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputScheduledEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaJobOutputStateChangeEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobOutputStateChangeEventData() { } - public System.Collections.Generic.IReadOnlyDictionary JobCorrelationData { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput Output { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobState PreviousState { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputStateChangeEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputStateChangeEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaJobProcessingEventData : Azure.Messaging.EventGrid.SystemEvents.MediaJobStateChangeEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobProcessingEventData() { } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobProcessingEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobProcessingEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct MediaJobRetry : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public MediaJobRetry(string value) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry DoNotRetry { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry MayRetry { get { throw null; } } - public bool Equals(Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry left, Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry right) { throw null; } - public static implicit operator Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry (string value) { throw null; } - public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry left, Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry right) { throw null; } - public override string ToString() { throw null; } - } - public partial class MediaJobScheduledEventData : Azure.Messaging.EventGrid.SystemEvents.MediaJobStateChangeEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobScheduledEventData() { } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobScheduledEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobScheduledEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct MediaJobState : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public MediaJobState(string value) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobState Canceled { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobState Canceling { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobState Error { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobState Finished { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobState Processing { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobState Queued { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobState Scheduled { get { throw null; } } - public bool Equals(Azure.Messaging.EventGrid.SystemEvents.MediaJobState other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.MediaJobState left, Azure.Messaging.EventGrid.SystemEvents.MediaJobState right) { throw null; } - public static implicit operator Azure.Messaging.EventGrid.SystemEvents.MediaJobState (string value) { throw null; } - public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.MediaJobState left, Azure.Messaging.EventGrid.SystemEvents.MediaJobState right) { throw null; } - public override string ToString() { throw null; } - } - public partial class MediaJobStateChangeEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaJobStateChangeEventData() { } - public System.Collections.Generic.IReadOnlyDictionary CorrelationData { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobState PreviousState { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobState State { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobStateChangeEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaJobStateChangeEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaLiveEventChannelArchiveHeartbeatEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaLiveEventChannelArchiveHeartbeatEventData() { } - public string ChannelLatencyMs { get { throw null; } } - public string LatencyResultCode { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventChannelArchiveHeartbeatEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventChannelArchiveHeartbeatEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaLiveEventConnectionRejectedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaLiveEventConnectionRejectedEventData() { } - public string EncoderIp { get { throw null; } } - public string EncoderPort { get { throw null; } } - public string IngestUrl { get { throw null; } } - public string ResultCode { get { throw null; } } - public string StreamId { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventConnectionRejectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventConnectionRejectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaLiveEventEncoderConnectedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaLiveEventEncoderConnectedEventData() { } - public string EncoderIp { get { throw null; } } - public string EncoderPort { get { throw null; } } - public string IngestUrl { get { throw null; } } - public string StreamId { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventEncoderConnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventEncoderConnectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaLiveEventEncoderDisconnectedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaLiveEventEncoderDisconnectedEventData() { } - public string EncoderIp { get { throw null; } } - public string EncoderPort { get { throw null; } } - public string IngestUrl { get { throw null; } } - public string ResultCode { get { throw null; } } - public string StreamId { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventEncoderDisconnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventEncoderDisconnectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaLiveEventIncomingDataChunkDroppedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaLiveEventIncomingDataChunkDroppedEventData() { } - public long? Bitrate { get { throw null; } } - public string ResultCode { get { throw null; } } - public string Timescale { get { throw null; } } - public string Timestamp { get { throw null; } } - public string TrackName { get { throw null; } } - public string TrackType { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIncomingDataChunkDroppedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIncomingDataChunkDroppedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaLiveEventIncomingStreamReceivedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaLiveEventIncomingStreamReceivedEventData() { } - public long? Bitrate { get { throw null; } } - public string Duration { get { throw null; } } - public string EncoderIp { get { throw null; } } - public string EncoderPort { get { throw null; } } - public string IngestUrl { get { throw null; } } - public string Timescale { get { throw null; } } - public string Timestamp { get { throw null; } } - public string TrackName { get { throw null; } } - public string TrackType { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIncomingStreamReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIncomingStreamReceivedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaLiveEventIncomingStreamsOutOfSyncEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaLiveEventIncomingStreamsOutOfSyncEventData() { } - public string MaxLastTimestamp { get { throw null; } } - public string MinLastTimestamp { get { throw null; } } - public string TimescaleOfMaxLastTimestamp { get { throw null; } } - public string TimescaleOfMinLastTimestamp { get { throw null; } } - public string TypeOfStreamWithMaxLastTimestamp { get { throw null; } } - public string TypeOfStreamWithMinLastTimestamp { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIncomingStreamsOutOfSyncEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIncomingStreamsOutOfSyncEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaLiveEventIncomingVideoStreamsOutOfSyncEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaLiveEventIncomingVideoStreamsOutOfSyncEventData() { } - public string FirstDuration { get { throw null; } } - public string FirstTimestamp { get { throw null; } } - public string SecondDuration { get { throw null; } } - public string SecondTimestamp { get { throw null; } } - public string Timescale { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIncomingVideoStreamsOutOfSyncEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIncomingVideoStreamsOutOfSyncEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaLiveEventIngestHeartbeatEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaLiveEventIngestHeartbeatEventData() { } - public long? Bitrate { get { throw null; } } - public long? DiscontinuityCount { get { throw null; } } - public bool? Healthy { get { throw null; } } - public long? IncomingBitrate { get { throw null; } } - public string IngestDriftValue { get { throw null; } } - public string LastFragmentArrivalTime { get { throw null; } } - public string LastTimestamp { get { throw null; } } - public long? NonincreasingCount { get { throw null; } } - public long? OverlapCount { get { throw null; } } - public string State { get { throw null; } } - public string Timescale { get { throw null; } } - public string TrackName { get { throw null; } } - public string TrackType { get { throw null; } } - public string TranscriptionLanguage { get { throw null; } } - public string TranscriptionState { get { throw null; } } - public bool? UnexpectedBitrate { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIngestHeartbeatEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIngestHeartbeatEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MediaLiveEventTrackDiscontinuityDetectedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MediaLiveEventTrackDiscontinuityDetectedEventData() { } - public long? Bitrate { get { throw null; } } - public string DiscontinuityGap { get { throw null; } } - public string NewTimestamp { get { throw null; } } - public string PreviousTimestamp { get { throw null; } } - public string Timescale { get { throw null; } } - public string TrackName { get { throw null; } } - public string TrackType { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventTrackDiscontinuityDetectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventTrackDiscontinuityDetectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class MicrosoftTeamsAppIdentifierModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MicrosoftTeamsAppIdentifierModel() { } public string AppId { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel Cloud { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel? Cloud { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsAppIdentifierModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -3845,7 +3351,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class MicrosoftTeamsUserIdentifierModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MicrosoftTeamsUserIdentifierModel() { } - public Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel Cloud { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel? Cloud { get { throw null; } } public bool? IsAnonymous { get { throw null; } } public string UserId { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -3875,7 +3381,7 @@ internal PolicyInsightsPolicyStateChangedEventData() { } public string PolicyDefinitionId { get { throw null; } } public string PolicyDefinitionReferenceId { get { throw null; } } public string SubscriptionId { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -3892,7 +3398,7 @@ internal PolicyInsightsPolicyStateCreatedEventData() { } public string PolicyDefinitionId { get { throw null; } } public string PolicyDefinitionReferenceId { get { throw null; } } public string SubscriptionId { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -3909,7 +3415,7 @@ internal PolicyInsightsPolicyStateDeletedEventData() { } public string PolicyDefinitionId { get { throw null; } } public string PolicyDefinitionReferenceId { get { throw null; } } public string SubscriptionId { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -3972,38 +3478,38 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType left, Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType right) { throw null; } public override string ToString() { throw null; } } - public partial class RedisExportRDBCompletedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class RedisExportRdbCompletedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal RedisExportRDBCompletedEventData() { } + internal RedisExportRdbCompletedEventData() { } public string Name { get { throw null; } } public string Status { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - 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; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(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; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class RedisImportRDBCompletedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class RedisImportRdbCompletedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal RedisImportRDBCompletedEventData() { } + internal RedisImportRdbCompletedEventData() { } public string Name { get { throw null; } } public string Status { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - 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; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(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; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class RedisPatchingCompletedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal RedisPatchingCompletedEventData() { } public string Name { get { throw null; } } public string Status { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -4016,7 +3522,7 @@ public partial class RedisScalingCompletedEventData : System.ClientModel.Primiti internal RedisScalingCompletedEventData() { } public string Name { get { throw null; } } public string Status { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -4177,6 +3683,16 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ResourceNotificationsContainerServiceEventResourcesScheduledEventData : Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ResourceNotificationsContainerServiceEventResourcesScheduledEventData() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + 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; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ResourceNotificationsHealthResourcesAnnotatedEventData : Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ResourceNotificationsHealthResourcesAnnotatedEventData() { } @@ -4200,7 +3716,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class ResourceNotificationsOperationalDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ResourceNotificationsOperationalDetails() { } - public System.DateTimeOffset ResourceEventTime { get { throw null; } } + public System.DateTimeOffset? ResourceEventTime { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -4414,7 +3930,7 @@ public partial class SignalRServiceClientConnectionConnectedEventData : System.C internal SignalRServiceClientConnectionConnectedEventData() { } public string ConnectionId { get { throw null; } } public string HubName { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } public string UserId { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionConnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4429,7 +3945,7 @@ internal SignalRServiceClientConnectionDisconnectedEventData() { } public string ConnectionId { get { throw null; } } public string ErrorMessage { get { throw null; } } public string HubName { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } public string UserId { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionDisconnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4477,9 +3993,31 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct StorageBlobAccessTier : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public StorageBlobAccessTier(string value) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Archive { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Cold { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Cool { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Default { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Hot { get { throw null; } } + public bool Equals(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + 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 bool operator !=(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier left, Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier right) { throw null; } + public override string ToString() { throw null; } + } public partial class StorageBlobCreatedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal StorageBlobCreatedEventData() { } + public Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier AccessTier { get { throw null; } } public string Api { get { throw null; } } public string BlobType { get { throw null; } } public string ClientRequestId { get { throw null; } } @@ -4527,7 +4065,7 @@ internal StorageBlobInventoryPolicyCompletedEventData() { } public string PolicyRunStatus { get { throw null; } } public string PolicyRunStatusMessage { get { throw null; } } public string RuleName { get { throw null; } } - public System.DateTimeOffset ScheduleDateTime { get { throw null; } } + public System.DateTimeOffset? ScheduleDateTime { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -4556,12 +4094,14 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class StorageBlobTierChangedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal StorageBlobTierChangedEventData() { } + public Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier AccessTier { get { throw null; } } public string Api { get { throw null; } } public string BlobType { get { throw null; } } public string ClientRequestId { get { throw null; } } public long? ContentLength { get { throw null; } } public string ContentType { get { throw null; } } public string Identity { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier PreviousTier { get { throw null; } } public string RequestId { get { throw null; } } public string Sequencer { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary StorageDiagnostics { get { throw null; } } @@ -4627,6 +4167,25 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct StorageLifecycleCompletionStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public StorageLifecycleCompletionStatus(string value) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus Completed { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus CompletedWithError { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus Incomplete { get { throw null; } } + public bool Equals(Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + 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 bool operator !=(Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus left, Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus right) { throw null; } + public override string ToString() { throw null; } + } public partial class StorageLifecyclePolicyActionSummaryDetail : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal StorageLifecyclePolicyActionSummaryDetail() { } @@ -4644,8 +4203,10 @@ public partial class StorageLifecyclePolicyCompletedEventData : System.ClientMod { internal StorageLifecyclePolicyCompletedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail DeleteSummary { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyRunSummary PolicyRunSummary { get { throw null; } } public string ScheduleTime { get { throw null; } } 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 void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4654,11 +4215,22 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class StorageLifecyclePolicyRunSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal StorageLifecyclePolicyRunSummary() { } + public Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus CompletionStatus { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + 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; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class StorageTaskAssignmentCompletedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal StorageTaskAssignmentCompletedEventData() { } - public System.DateTimeOffset CompletedOn { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus Status { get { throw null; } } + public System.DateTimeOffset? CompletedOn { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus? Status { get { throw null; } } public System.Uri SummaryReportBlobUri { get { throw null; } } public string TaskExecutionId { get { throw null; } } public string TaskName { get { throw null; } } @@ -4690,7 +4262,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class StorageTaskAssignmentQueuedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal StorageTaskAssignmentQueuedEventData() { } - public System.DateTimeOffset QueuedOn { get { throw null; } } + public System.DateTimeOffset? QueuedOn { get { throw null; } } public string TaskExecutionId { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentQueuedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4702,8 +4274,8 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class StorageTaskCompletedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal StorageTaskCompletedEventData() { } - public System.DateTimeOffset CompletedDateTime { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus Status { get { throw null; } } + public System.DateTimeOffset? CompletedDateTime { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus? Status { get { throw null; } } public System.Uri SummaryReportBlobUrl { get { throw null; } } public string TaskExecutionId { get { throw null; } } public string TaskName { get { throw null; } } @@ -4735,7 +4307,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class StorageTaskQueuedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal StorageTaskQueuedEventData() { } - public System.DateTimeOffset QueuedDateTime { get { throw null; } } + public System.DateTimeOffset? QueuedDateTime { get { throw null; } } public string TaskExecutionId { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageTaskQueuedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4884,10 +4456,10 @@ public static partial class SystemEventNames public const string DataBoxCopyCompleted = "Microsoft.DataBox.CopyCompleted"; public const string DataBoxCopyStarted = "Microsoft.DataBox.CopyStarted"; public const string DataBoxOrderCompleted = "Microsoft.DataBox.OrderCompleted"; - public const string EventGridMQTTClientCreatedOrUpdated = "Microsoft.EventGrid.MQTTClientCreatedOrUpdated"; - public const string EventGridMQTTClientDeleted = "Microsoft.EventGrid.MQTTClientDeleted"; - public const string EventGridMQTTClientSessionConnected = "Microsoft.EventGrid.MQTTClientSessionConnected"; - public const string EventGridMQTTClientSessionDisconnected = "Microsoft.EventGrid.MQTTClientSessionDisconnected"; + public const string EventGridMqttClientCreatedOrUpdated = "Microsoft.EventGrid.MQTTClientCreatedOrUpdated"; + public const string EventGridMqttClientDeleted = "Microsoft.EventGrid.MQTTClientDeleted"; + public const string EventGridMqttClientSessionConnected = "Microsoft.EventGrid.MQTTClientSessionConnected"; + public const string EventGridMqttClientSessionDisconnected = "Microsoft.EventGrid.MQTTClientSessionDisconnected"; public const string EventGridSubscriptionDeleted = "Microsoft.EventGrid.SubscriptionDeletedEvent"; public const string EventGridSubscriptionValidation = "Microsoft.EventGrid.SubscriptionValidationEvent"; public const string EventHubCaptureFileCreated = "Microsoft.EventHub.CaptureFileCreated"; @@ -4920,36 +4492,11 @@ public static partial class SystemEventNames public const string MapsGeofenceEntered = "Microsoft.Maps.GeofenceEntered"; public const string MapsGeofenceExited = "Microsoft.Maps.GeofenceExited"; public const string MapsGeofenceResult = "Microsoft.Maps.GeofenceResult"; - public const string MediaJobCanceled = "Microsoft.Media.JobCanceled"; - public const string MediaJobCanceling = "Microsoft.Media.JobCanceling"; - public const string MediaJobErrored = "Microsoft.Media.JobErrored"; - public const string MediaJobFinished = "Microsoft.Media.JobFinished"; - public const string MediaJobOutputCanceled = "Microsoft.Media.JobOutputCanceled"; - public const string MediaJobOutputCanceling = "Microsoft.Media.JobOutputCanceling"; - public const string MediaJobOutputErrored = "Microsoft.Media.JobOutputErrored"; - public const string MediaJobOutputFinished = "Microsoft.Media.JobOutputFinished"; - public const string MediaJobOutputProcessing = "Microsoft.Media.JobOutputProcessing"; - public const string MediaJobOutputProgress = "Microsoft.Media.JobOutputProgress"; - public const string MediaJobOutputScheduled = "Microsoft.Media.JobOutputScheduled"; - public const string MediaJobOutputStateChange = "Microsoft.Media.JobOutputStateChange"; - public const string MediaJobProcessing = "Microsoft.Media.JobProcessing"; - public const string MediaJobScheduled = "Microsoft.Media.JobScheduled"; - public const string MediaJobStateChange = "Microsoft.Media.JobStateChange"; - public const string MediaLiveEventChannelArchiveHeartbeat = "Microsoft.Media.LiveEventChannelArchiveHeartbeat"; - public const string MediaLiveEventConnectionRejected = "Microsoft.Media.LiveEventConnectionRejected"; - public const string MediaLiveEventEncoderConnected = "Microsoft.Media.LiveEventEncoderConnected"; - public const string MediaLiveEventEncoderDisconnected = "Microsoft.Media.LiveEventEncoderDisconnected"; - public const string MediaLiveEventIncomingDataChunkDropped = "Microsoft.Media.LiveEventIncomingDataChunkDropped"; - public const string MediaLiveEventIncomingStreamReceived = "Microsoft.Media.LiveEventIncomingStreamReceived"; - public const string MediaLiveEventIncomingStreamsOutOfSync = "Microsoft.Media.LiveEventIncomingStreamsOutOfSync"; - public const string MediaLiveEventIncomingVideoStreamsOutOfSync = "Microsoft.Media.LiveEventIncomingVideoStreamsOutOfSync"; - public const string MediaLiveEventIngestHeartbeat = "Microsoft.Media.LiveEventIngestHeartbeat"; - public const string MediaLiveEventTrackDiscontinuityDetected = "Microsoft.Media.LiveEventTrackDiscontinuityDetected"; public const string PolicyInsightsPolicyStateChanged = "Microsoft.PolicyInsights.PolicyStateChanged"; public const string PolicyInsightsPolicyStateCreated = "Microsoft.PolicyInsights.PolicyStateCreated"; public const string PolicyInsightsPolicyStateDeleted = "Microsoft.PolicyInsights.PolicyStateDeleted"; - public const string RedisExportRDBCompleted = "Microsoft.Cache.ExportRDBCompleted"; - public const string RedisImportRDBCompleted = "Microsoft.Cache.ImportRDBCompleted"; + public const string RedisExportRdbCompleted = "Microsoft.Cache.ExportRDBCompleted"; + public const string RedisImportRdbCompleted = "Microsoft.Cache.ImportRDBCompleted"; public const string RedisPatchingCompleted = "Microsoft.Cache.PatchingCompleted"; public const string RedisScalingCompleted = "Microsoft.Cache.ScalingCompleted"; public const string ResourceActionCancel = "Microsoft.Resources.ResourceActionCancel"; @@ -4958,6 +4505,7 @@ public static partial class SystemEventNames public const string ResourceDeleteCancel = "Microsoft.Resources.ResourceDeleteCancel"; public const string ResourceDeleteFailure = "Microsoft.Resources.ResourceDeleteFailure"; public const string ResourceDeleteSuccess = "Microsoft.Resources.ResourceDeleteSuccess"; + public const string ResourceNotificationsContainerServiceEventResourcesScheduled = "Microsoft.ResourceNotifications.ContainerServiceEventResources.ScheduledEventEmitted"; public const string ResourceNotificationsHealthResourcesAnnotated = "Microsoft.ResourceNotifications.HealthResources.ResourceAnnotated"; public const string ResourceNotificationsHealthResourcesAvailabilityStatusChanged = "Microsoft.ResourceNotifications.HealthResources.AvailabilityStatusChanged"; public const string ResourceNotificationsResourceManagementCreatedOrUpdated = "Microsoft.ResourceNotifications.Resources.CreatedOrUpdated"; 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 a4aae168de79..c576c2ad3982 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 @@ -35,8 +35,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("deleteTime"u8); - writer.WriteStringValue(DeleteTime, "O"); + if (Optional.IsDefined(DeleteTime)) + { + writer.WritePropertyName("deleteTime"u8); + writer.WriteStringValue(DeleteTime.Value, "O"); + } } AcsChatMessageDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -59,11 +62,11 @@ internal static AcsChatMessageDeletedEventData DeserializeAcsChatMessageDeletedE { return null; } - DateTimeOffset deleteTime = default; + DateTimeOffset? deleteTime = default; string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; - DateTimeOffset composeTime = default; + DateTimeOffset? composeTime = default; string type = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; @@ -75,6 +78,10 @@ internal static AcsChatMessageDeletedEventData DeserializeAcsChatMessageDeletedE { if (property.NameEquals("deleteTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } deleteTime = property.Value.GetDateTimeOffset("O"); continue; } @@ -95,6 +102,10 @@ internal static AcsChatMessageDeletedEventData DeserializeAcsChatMessageDeletedE } if (property.NameEquals("composeTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } composeTime = property.Value.GetDateTimeOffset("O"); continue; } 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 29bd2123a788..5f6a22502794 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.cs @@ -16,15 +16,11 @@ public partial class AcsChatMessageDeletedEventData : AcsChatMessageEventBasePro /// Initializes a new instance of . /// The communication identifier of the target user. /// The communication identifier of the sender. - /// The original compose time of the message. - /// The time at which the message was deleted. /// or is null. - internal AcsChatMessageDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime, DateTimeOffset deleteTime) : base(recipientCommunicationIdentifier, senderCommunicationIdentifier, composeTime) + internal AcsChatMessageDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel senderCommunicationIdentifier) : base(recipientCommunicationIdentifier, senderCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); - - DeleteTime = deleteTime; } /// Initializes a new instance of . @@ -39,7 +35,7 @@ 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 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) { DeleteTime = deleteTime; } @@ -50,6 +46,6 @@ internal AcsChatMessageDeletedEventData() } /// The time at which the message was deleted. - public DateTimeOffset DeleteTime { get; } + 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 bceef0c48673..f2ada1639717 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 @@ -35,8 +35,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("deleteTime"u8); - writer.WriteStringValue(DeleteTime, "O"); + if (Optional.IsDefined(DeleteTime)) + { + writer.WritePropertyName("deleteTime"u8); + writer.WriteStringValue(DeleteTime.Value, "O"); + } } AcsChatMessageDeletedInThreadEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -59,11 +62,11 @@ internal static AcsChatMessageDeletedInThreadEventData DeserializeAcsChatMessage { return null; } - DateTimeOffset deleteTime = default; + DateTimeOffset? deleteTime = default; string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; - DateTimeOffset composeTime = default; + DateTimeOffset? composeTime = default; string type = default; long? version = default; string transactionId = default; @@ -74,6 +77,10 @@ internal static AcsChatMessageDeletedInThreadEventData DeserializeAcsChatMessage { if (property.NameEquals("deleteTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } deleteTime = property.Value.GetDateTimeOffset("O"); continue; } @@ -94,6 +101,10 @@ internal static AcsChatMessageDeletedInThreadEventData DeserializeAcsChatMessage } if (property.NameEquals("composeTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } composeTime = property.Value.GetDateTimeOffset("O"); continue; } 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 fdf50c683027..36a7b77ba1a3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.cs @@ -15,14 +15,10 @@ public partial class AcsChatMessageDeletedInThreadEventData : AcsChatMessageEven { /// Initializes a new instance of . /// The communication identifier of the sender. - /// The original compose time of the message. - /// The time at which the message was deleted. /// is null. - internal AcsChatMessageDeletedInThreadEventData(CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime, DateTimeOffset deleteTime) : base(senderCommunicationIdentifier, composeTime) + internal AcsChatMessageDeletedInThreadEventData(CommunicationIdentifierModel senderCommunicationIdentifier) : base(senderCommunicationIdentifier) { Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); - - DeleteTime = deleteTime; } /// Initializes a new instance of . @@ -36,7 +32,7 @@ internal AcsChatMessageDeletedInThreadEventData(CommunicationIdentifierModel sen /// 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 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) { DeleteTime = deleteTime; } @@ -47,6 +43,6 @@ internal AcsChatMessageDeletedInThreadEventData() } /// The time at which the message was deleted. - public DateTimeOffset DeleteTime { get; } + 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 97ee30c1867a..7089e7a032d1 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 @@ -48,8 +48,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteStringValue(item.Value); } writer.WriteEndObject(); - writer.WritePropertyName("editTime"u8); - writer.WriteStringValue(EditTime, "O"); + if (Optional.IsDefined(EditTime)) + { + writer.WritePropertyName("editTime"u8); + writer.WriteStringValue(EditTime.Value, "O"); + } } AcsChatMessageEditedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -74,11 +77,11 @@ internal static AcsChatMessageEditedEventData DeserializeAcsChatMessageEditedEve } string messageBody = default; IReadOnlyDictionary metadata = default; - DateTimeOffset editTime = default; + DateTimeOffset? editTime = default; string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; - DateTimeOffset composeTime = default; + DateTimeOffset? composeTime = default; string type = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; @@ -105,6 +108,10 @@ internal static AcsChatMessageEditedEventData DeserializeAcsChatMessageEditedEve } if (property.NameEquals("editTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } editTime = property.Value.GetDateTimeOffset("O"); continue; } @@ -125,6 +132,10 @@ internal static AcsChatMessageEditedEventData DeserializeAcsChatMessageEditedEve } if (property.NameEquals("composeTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } composeTime = property.Value.GetDateTimeOffset("O"); continue; } 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 92f3f537ac6c..b124a0af4025 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.cs @@ -16,18 +16,15 @@ public partial class AcsChatMessageEditedEventData : AcsChatMessageEventBaseProp /// Initializes a new instance of . /// The communication identifier of the target user. /// The communication identifier of the sender. - /// The original compose time of the message. /// The chat message metadata. - /// The time at which the message was edited. /// , or is null. - internal AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime, IReadOnlyDictionary metadata, DateTimeOffset editTime) : base(recipientCommunicationIdentifier, senderCommunicationIdentifier, composeTime) + internal AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel senderCommunicationIdentifier, IReadOnlyDictionary metadata) : base(recipientCommunicationIdentifier, senderCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); Argument.AssertNotNull(metadata, nameof(metadata)); Metadata = metadata; - EditTime = editTime; } /// Initializes a new instance of . @@ -44,7 +41,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 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 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) { MessageBody = messageBody; Metadata = metadata; @@ -61,6 +58,6 @@ internal AcsChatMessageEditedEventData() /// The chat message metadata. public IReadOnlyDictionary Metadata { get; } /// The time at which the message was edited. - public DateTimeOffset EditTime { get; } + 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 7bf5019d2ec1..b80d18d9684e 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 @@ -48,8 +48,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteStringValue(item.Value); } writer.WriteEndObject(); - writer.WritePropertyName("editTime"u8); - writer.WriteStringValue(EditTime, "O"); + if (Optional.IsDefined(EditTime)) + { + writer.WritePropertyName("editTime"u8); + writer.WriteStringValue(EditTime.Value, "O"); + } } AcsChatMessageEditedInThreadEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -74,11 +77,11 @@ internal static AcsChatMessageEditedInThreadEventData DeserializeAcsChatMessageE } string messageBody = default; IReadOnlyDictionary metadata = default; - DateTimeOffset editTime = default; + DateTimeOffset? editTime = default; string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; - DateTimeOffset composeTime = default; + DateTimeOffset? composeTime = default; string type = default; long? version = default; string transactionId = default; @@ -104,6 +107,10 @@ internal static AcsChatMessageEditedInThreadEventData DeserializeAcsChatMessageE } if (property.NameEquals("editTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } editTime = property.Value.GetDateTimeOffset("O"); continue; } @@ -124,6 +131,10 @@ internal static AcsChatMessageEditedInThreadEventData DeserializeAcsChatMessageE } if (property.NameEquals("composeTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } composeTime = property.Value.GetDateTimeOffset("O"); continue; } 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 99134233639c..70250f33da52 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.cs @@ -15,17 +15,14 @@ public partial class AcsChatMessageEditedInThreadEventData : AcsChatMessageEvent { /// Initializes a new instance of . /// The communication identifier of the sender. - /// The original compose time of the message. /// The chat message metadata. - /// The time at which the message was edited. /// or is null. - internal AcsChatMessageEditedInThreadEventData(CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime, IReadOnlyDictionary metadata, DateTimeOffset editTime) : base(senderCommunicationIdentifier, composeTime) + internal AcsChatMessageEditedInThreadEventData(CommunicationIdentifierModel senderCommunicationIdentifier, IReadOnlyDictionary metadata) : base(senderCommunicationIdentifier) { Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); Argument.AssertNotNull(metadata, nameof(metadata)); Metadata = metadata; - EditTime = editTime; } /// Initializes a new instance of . @@ -41,7 +38,7 @@ internal AcsChatMessageEditedInThreadEventData(CommunicationIdentifierModel send /// 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 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) { MessageBody = messageBody; Metadata = metadata; @@ -58,6 +55,6 @@ internal AcsChatMessageEditedInThreadEventData() /// The chat message metadata. public IReadOnlyDictionary Metadata { get; } /// The time at which the message was edited. - public DateTimeOffset EditTime { get; } + 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 5c8edcacc2cc..b26b9d5da963 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 @@ -47,8 +47,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("senderDisplayName"u8); writer.WriteStringValue(SenderDisplayName); } - writer.WritePropertyName("composeTime"u8); - writer.WriteStringValue(ComposeTime, "O"); + if (Optional.IsDefined(ComposeTime)) + { + writer.WritePropertyName("composeTime"u8); + writer.WriteStringValue(ComposeTime.Value, "O"); + } if (Optional.IsDefined(Type)) { writer.WritePropertyName("type"u8); @@ -84,7 +87,7 @@ internal static AcsChatMessageEventBaseProperties DeserializeAcsChatMessageEvent string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; - DateTimeOffset composeTime = default; + DateTimeOffset? composeTime = default; string type = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; @@ -111,6 +114,10 @@ internal static AcsChatMessageEventBaseProperties DeserializeAcsChatMessageEvent } if (property.NameEquals("composeTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } composeTime = property.Value.GetDateTimeOffset("O"); continue; } 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 d0109a86be03..0d2231a308ce 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.cs @@ -16,15 +16,13 @@ public partial class AcsChatMessageEventBaseProperties : AcsChatEventBasePropert /// Initializes a new instance of . /// The communication identifier of the target user. /// The communication identifier of the sender. - /// The original compose time of the message. /// or is null. - internal AcsChatMessageEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime) : base(recipientCommunicationIdentifier) + internal AcsChatMessageEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel senderCommunicationIdentifier) : base(recipientCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); SenderCommunicationIdentifier = senderCommunicationIdentifier; - ComposeTime = composeTime; } /// Initializes a new instance of . @@ -38,7 +36,7 @@ internal AcsChatMessageEventBaseProperties(CommunicationIdentifierModel recipien /// 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 serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData) { MessageId = messageId; SenderCommunicationIdentifier = senderCommunicationIdentifier; @@ -60,7 +58,7 @@ internal AcsChatMessageEventBaseProperties() /// The display name of the sender. public string SenderDisplayName { get; } /// The original compose time of the message. - public DateTimeOffset ComposeTime { get; } + public DateTimeOffset? ComposeTime { get; } /// The type of the message. public string Type { get; } /// The version of the message. 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 daf9837f457b..551eb7cbc09e 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 @@ -47,8 +47,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("senderDisplayName"u8); writer.WriteStringValue(SenderDisplayName); } - writer.WritePropertyName("composeTime"u8); - writer.WriteStringValue(ComposeTime, "O"); + if (Optional.IsDefined(ComposeTime)) + { + writer.WritePropertyName("composeTime"u8); + writer.WriteStringValue(ComposeTime.Value, "O"); + } if (Optional.IsDefined(Type)) { writer.WritePropertyName("type"u8); @@ -84,7 +87,7 @@ internal static AcsChatMessageEventInThreadBaseProperties DeserializeAcsChatMess string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; - DateTimeOffset composeTime = default; + DateTimeOffset? composeTime = default; string type = default; long? version = default; string transactionId = default; @@ -110,6 +113,10 @@ internal static AcsChatMessageEventInThreadBaseProperties DeserializeAcsChatMess } if (property.NameEquals("composeTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } composeTime = property.Value.GetDateTimeOffset("O"); continue; } 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 72fdab5e25f7..3ae4acc44ddd 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.cs @@ -15,14 +15,12 @@ public partial class AcsChatMessageEventInThreadBaseProperties : AcsChatEventInT { /// Initializes a new instance of . /// The communication identifier of the sender. - /// The original compose time of the message. /// is null. - internal AcsChatMessageEventInThreadBaseProperties(CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime) + internal AcsChatMessageEventInThreadBaseProperties(CommunicationIdentifierModel senderCommunicationIdentifier) { Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); SenderCommunicationIdentifier = senderCommunicationIdentifier; - ComposeTime = composeTime; } /// Initializes a new instance of . @@ -35,7 +33,7 @@ internal AcsChatMessageEventInThreadBaseProperties(CommunicationIdentifierModel /// 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 serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version) : base(transactionId, threadId, serializedAdditionalRawData) { MessageId = messageId; SenderCommunicationIdentifier = senderCommunicationIdentifier; @@ -57,7 +55,7 @@ internal AcsChatMessageEventInThreadBaseProperties() /// The display name of the sender. public string SenderDisplayName { get; } /// The original compose time of the message. - public DateTimeOffset ComposeTime { get; } + public DateTimeOffset? ComposeTime { get; } /// The type of the message. public string Type { get; } /// The version of the message. 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 30ba40046cec..a1dd48dcb7d6 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 @@ -75,7 +75,7 @@ internal static AcsChatMessageReceivedEventData DeserializeAcsChatMessageReceive string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; - DateTimeOffset composeTime = default; + DateTimeOffset? composeTime = default; string type = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; @@ -117,6 +117,10 @@ internal static AcsChatMessageReceivedEventData DeserializeAcsChatMessageReceive } if (property.NameEquals("composeTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } composeTime = property.Value.GetDateTimeOffset("O"); continue; } 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 2410db3e730b..1f9a4f91d206 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.cs @@ -16,10 +16,9 @@ public partial class AcsChatMessageReceivedEventData : AcsChatMessageEventBasePr /// Initializes a new instance of . /// The communication identifier of the target user. /// The communication identifier of the sender. - /// The original compose time of the message. /// The chat message metadata. /// , or is null. - internal AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime, IReadOnlyDictionary metadata) : base(recipientCommunicationIdentifier, senderCommunicationIdentifier, composeTime) + internal AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel senderCommunicationIdentifier, IReadOnlyDictionary metadata) : base(recipientCommunicationIdentifier, senderCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); @@ -41,7 +40,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 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 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) { MessageBody = messageBody; Metadata = metadata; 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 03658d848d09..79d5f3347c25 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 @@ -75,7 +75,7 @@ internal static AcsChatMessageReceivedInThreadEventData DeserializeAcsChatMessag string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; - DateTimeOffset composeTime = default; + DateTimeOffset? composeTime = default; string type = default; long? version = default; string transactionId = default; @@ -116,6 +116,10 @@ internal static AcsChatMessageReceivedInThreadEventData DeserializeAcsChatMessag } if (property.NameEquals("composeTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } composeTime = property.Value.GetDateTimeOffset("O"); continue; } 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 8698284721c1..c99363e44298 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.cs @@ -15,10 +15,9 @@ public partial class AcsChatMessageReceivedInThreadEventData : AcsChatMessageEve { /// Initializes a new instance of . /// The communication identifier of the sender. - /// The original compose time of the message. /// The chat message metadata. /// or is null. - internal AcsChatMessageReceivedInThreadEventData(CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime, IReadOnlyDictionary metadata) : base(senderCommunicationIdentifier, composeTime) + internal AcsChatMessageReceivedInThreadEventData(CommunicationIdentifierModel senderCommunicationIdentifier, IReadOnlyDictionary metadata) : base(senderCommunicationIdentifier) { Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); Argument.AssertNotNull(metadata, nameof(metadata)); @@ -38,7 +37,7 @@ internal AcsChatMessageReceivedInThreadEventData(CommunicationIdentifierModel se /// 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 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) { MessageBody = messageBody; Metadata = metadata; 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 4acb68c7bf71..0fb98f1e374c 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 @@ -35,8 +35,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("time"u8); - writer.WriteStringValue(Time, "O"); + if (Optional.IsDefined(Time)) + { + writer.WritePropertyName("time"u8); + writer.WriteStringValue(Time.Value, "O"); + } writer.WritePropertyName("addedByCommunicationIdentifier"u8); writer.WriteObjectValue(AddedByCommunicationIdentifier, options); writer.WritePropertyName("participantAdded"u8); @@ -68,7 +71,7 @@ internal static AcsChatParticipantAddedToThreadEventData DeserializeAcsChatParti { return null; } - DateTimeOffset time = default; + DateTimeOffset? time = default; CommunicationIdentifierModel addedByCommunicationIdentifier = default; AcsChatThreadParticipantProperties participantAdded = default; long? version = default; @@ -80,6 +83,10 @@ internal static AcsChatParticipantAddedToThreadEventData DeserializeAcsChatParti { if (property.NameEquals("time"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } time = property.Value.GetDateTimeOffset("O"); continue; } 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 0c74e23af594..5ae69978e278 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.cs @@ -14,16 +14,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsChatParticipantAddedToThreadEventData : AcsChatEventInThreadBaseProperties { /// Initializes a new instance of . - /// 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. /// or is null. - internal AcsChatParticipantAddedToThreadEventData(DateTimeOffset time, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded) + internal AcsChatParticipantAddedToThreadEventData(CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded) { Argument.AssertNotNull(addedByCommunicationIdentifier, nameof(addedByCommunicationIdentifier)); Argument.AssertNotNull(participantAdded, nameof(participantAdded)); - Time = time; AddedByCommunicationIdentifier = addedByCommunicationIdentifier; ParticipantAdded = participantAdded; } @@ -36,7 +34,7 @@ internal AcsChatParticipantAddedToThreadEventData(DateTimeOffset time, Communica /// 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 serializedAdditionalRawData, DateTimeOffset? time, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded, long? version) : base(transactionId, threadId, serializedAdditionalRawData) { Time = time; AddedByCommunicationIdentifier = addedByCommunicationIdentifier; @@ -50,7 +48,7 @@ internal AcsChatParticipantAddedToThreadEventData() } /// The time at which the user was added to the thread. - public DateTimeOffset Time { get; } + 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. 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 656b0ad7865b..ae5dd878b827 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 @@ -35,8 +35,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("time"u8); - writer.WriteStringValue(Time, "O"); + if (Optional.IsDefined(Time)) + { + writer.WritePropertyName("time"u8); + writer.WriteStringValue(Time.Value, "O"); + } writer.WritePropertyName("addedByCommunicationIdentifier"u8); writer.WriteObjectValue(AddedByCommunicationIdentifier, options); writer.WritePropertyName("participantAdded"u8); @@ -63,10 +66,10 @@ internal static AcsChatParticipantAddedToThreadWithUserEventData DeserializeAcsC { return null; } - DateTimeOffset time = default; + DateTimeOffset? time = default; CommunicationIdentifierModel addedByCommunicationIdentifier = default; AcsChatThreadParticipantProperties participantAdded = default; - DateTimeOffset createTime = default; + DateTimeOffset? createTime = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; string transactionId = default; @@ -77,6 +80,10 @@ internal static AcsChatParticipantAddedToThreadWithUserEventData DeserializeAcsC { if (property.NameEquals("time"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } time = property.Value.GetDateTimeOffset("O"); continue; } @@ -92,6 +99,10 @@ internal static AcsChatParticipantAddedToThreadWithUserEventData DeserializeAcsC } if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } 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 95e15aab1526..407412eb394b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.cs @@ -15,18 +15,15 @@ public partial class AcsChatParticipantAddedToThreadWithUserEventData : AcsChatT { /// Initializes a new instance of . /// The communication identifier of the target user. - /// The original creation time 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. /// , or is null. - internal AcsChatParticipantAddedToThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, DateTimeOffset createTime, DateTimeOffset time, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded) : base(recipientCommunicationIdentifier, createTime) + internal AcsChatParticipantAddedToThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded) : base(recipientCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); Argument.AssertNotNull(addedByCommunicationIdentifier, nameof(addedByCommunicationIdentifier)); Argument.AssertNotNull(participantAdded, nameof(participantAdded)); - Time = time; AddedByCommunicationIdentifier = addedByCommunicationIdentifier; ParticipantAdded = participantAdded; } @@ -41,7 +38,7 @@ internal AcsChatParticipantAddedToThreadWithUserEventData(CommunicationIdentifie /// 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 serializedAdditionalRawData, DateTimeOffset? createTime, long? version, DateTimeOffset? time, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) { Time = time; AddedByCommunicationIdentifier = addedByCommunicationIdentifier; @@ -54,7 +51,7 @@ internal AcsChatParticipantAddedToThreadWithUserEventData() } /// The time at which the user was added to the thread. - public DateTimeOffset Time { get; } + 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. 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 34a1f1d8e6bd..bc2524b9e98b 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 @@ -35,8 +35,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("time"u8); - writer.WriteStringValue(Time, "O"); + if (Optional.IsDefined(Time)) + { + writer.WritePropertyName("time"u8); + writer.WriteStringValue(Time.Value, "O"); + } writer.WritePropertyName("removedByCommunicationIdentifier"u8); writer.WriteObjectValue(RemovedByCommunicationIdentifier, options); writer.WritePropertyName("participantRemoved"u8); @@ -68,7 +71,7 @@ internal static AcsChatParticipantRemovedFromThreadEventData DeserializeAcsChatP { return null; } - DateTimeOffset time = default; + DateTimeOffset? time = default; CommunicationIdentifierModel removedByCommunicationIdentifier = default; AcsChatThreadParticipantProperties participantRemoved = default; long? version = default; @@ -80,6 +83,10 @@ internal static AcsChatParticipantRemovedFromThreadEventData DeserializeAcsChatP { if (property.NameEquals("time"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } time = property.Value.GetDateTimeOffset("O"); continue; } 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 2984453d0a26..b3b2328112b9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.cs @@ -14,16 +14,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsChatParticipantRemovedFromThreadEventData : AcsChatEventInThreadBaseProperties { /// Initializes a new instance of . - /// 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. /// or is null. - internal AcsChatParticipantRemovedFromThreadEventData(DateTimeOffset time, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved) + internal AcsChatParticipantRemovedFromThreadEventData(CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved) { Argument.AssertNotNull(removedByCommunicationIdentifier, nameof(removedByCommunicationIdentifier)); Argument.AssertNotNull(participantRemoved, nameof(participantRemoved)); - Time = time; RemovedByCommunicationIdentifier = removedByCommunicationIdentifier; ParticipantRemoved = participantRemoved; } @@ -36,7 +34,7 @@ internal AcsChatParticipantRemovedFromThreadEventData(DateTimeOffset time, Commu /// 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 serializedAdditionalRawData, DateTimeOffset? time, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved, long? version) : base(transactionId, threadId, serializedAdditionalRawData) { Time = time; RemovedByCommunicationIdentifier = removedByCommunicationIdentifier; @@ -50,7 +48,7 @@ internal AcsChatParticipantRemovedFromThreadEventData() } /// The time at which the user was removed to the thread. - public DateTimeOffset Time { get; } + 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. 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 f7db6f14d6f8..8d192bc51bd6 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 @@ -35,8 +35,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("time"u8); - writer.WriteStringValue(Time, "O"); + if (Optional.IsDefined(Time)) + { + writer.WritePropertyName("time"u8); + writer.WriteStringValue(Time.Value, "O"); + } writer.WritePropertyName("removedByCommunicationIdentifier"u8); writer.WriteObjectValue(RemovedByCommunicationIdentifier, options); writer.WritePropertyName("participantRemoved"u8); @@ -63,10 +66,10 @@ internal static AcsChatParticipantRemovedFromThreadWithUserEventData Deserialize { return null; } - DateTimeOffset time = default; + DateTimeOffset? time = default; CommunicationIdentifierModel removedByCommunicationIdentifier = default; AcsChatThreadParticipantProperties participantRemoved = default; - DateTimeOffset createTime = default; + DateTimeOffset? createTime = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; string transactionId = default; @@ -77,6 +80,10 @@ internal static AcsChatParticipantRemovedFromThreadWithUserEventData Deserialize { if (property.NameEquals("time"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } time = property.Value.GetDateTimeOffset("O"); continue; } @@ -92,6 +99,10 @@ internal static AcsChatParticipantRemovedFromThreadWithUserEventData Deserialize } if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } 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 109684ffc523..d99153a59c67 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.cs @@ -15,18 +15,15 @@ public partial class AcsChatParticipantRemovedFromThreadWithUserEventData : AcsC { /// Initializes a new instance of . /// The communication identifier of the target user. - /// The original creation time 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. /// , or is null. - internal AcsChatParticipantRemovedFromThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, DateTimeOffset createTime, DateTimeOffset time, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved) : base(recipientCommunicationIdentifier, createTime) + internal AcsChatParticipantRemovedFromThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved) : base(recipientCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); Argument.AssertNotNull(removedByCommunicationIdentifier, nameof(removedByCommunicationIdentifier)); Argument.AssertNotNull(participantRemoved, nameof(participantRemoved)); - Time = time; RemovedByCommunicationIdentifier = removedByCommunicationIdentifier; ParticipantRemoved = participantRemoved; } @@ -41,7 +38,7 @@ internal AcsChatParticipantRemovedFromThreadWithUserEventData(CommunicationIdent /// 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 serializedAdditionalRawData, DateTimeOffset? createTime, long? version, DateTimeOffset? time, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) { Time = time; RemovedByCommunicationIdentifier = removedByCommunicationIdentifier; @@ -54,7 +51,7 @@ internal AcsChatParticipantRemovedFromThreadWithUserEventData() } /// The time at which the user was removed to the thread. - public DateTimeOffset Time { get; } + 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. 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 660520158e5d..ee2fb0dfd2c7 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 @@ -98,7 +98,7 @@ internal static AcsChatThreadCreatedEventData DeserializeAcsChatThreadCreatedEve IReadOnlyDictionary properties = default; IReadOnlyDictionary metadata = default; IReadOnlyList participants = default; - DateTimeOffset createTime = default; + DateTimeOffset? createTime = default; long? version = default; string transactionId = default; string threadId = default; @@ -150,6 +150,10 @@ internal static AcsChatThreadCreatedEventData DeserializeAcsChatThreadCreatedEve } if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } 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 30a77e8200e9..dd366f600f08 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.cs @@ -15,13 +15,12 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsChatThreadCreatedEventData : AcsChatThreadEventInThreadBaseProperties { /// Initializes a new instance of . - /// The original creation time of the thread. /// The communication identifier of the user who created the thread. /// The thread properties. /// The thread metadata. /// The list of properties of participants who are part of the thread. /// , , or is null. - internal AcsChatThreadCreatedEventData(DateTimeOffset createTime, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata, IEnumerable participants) : base(createTime) + internal AcsChatThreadCreatedEventData(CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata, IEnumerable participants) { Argument.AssertNotNull(createdByCommunicationIdentifier, nameof(createdByCommunicationIdentifier)); Argument.AssertNotNull(properties, nameof(properties)); @@ -44,7 +43,7 @@ internal AcsChatThreadCreatedEventData(DateTimeOffset createTime, CommunicationI /// The thread properties. /// 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 serializedAdditionalRawData, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata, IReadOnlyList participants) : base(transactionId, threadId, serializedAdditionalRawData, createTime, version) { CreatedByCommunicationIdentifier = createdByCommunicationIdentifier; Properties = properties; 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 096a08aa546a..90312e3dc159 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 @@ -98,7 +98,7 @@ internal static AcsChatThreadCreatedWithUserEventData DeserializeAcsChatThreadCr IReadOnlyDictionary properties = default; IReadOnlyDictionary metadata = default; IReadOnlyList participants = default; - DateTimeOffset createTime = default; + DateTimeOffset? createTime = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; string transactionId = default; @@ -151,6 +151,10 @@ internal static AcsChatThreadCreatedWithUserEventData DeserializeAcsChatThreadCr } if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } 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 1016b59134b6..428a332bf9a3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.cs @@ -16,13 +16,12 @@ public partial class AcsChatThreadCreatedWithUserEventData : AcsChatThreadEventB { /// Initializes a new instance of . /// The communication identifier of the target user. - /// The original creation time of the thread. /// The communication identifier of the user who created the thread. /// The thread properties. /// The thread metadata. /// The list of properties of participants who are part of the thread. /// , , , or is null. - internal AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, DateTimeOffset createTime, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata, IEnumerable participants) : base(recipientCommunicationIdentifier, createTime) + internal AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata, IEnumerable participants) : base(recipientCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); Argument.AssertNotNull(createdByCommunicationIdentifier, nameof(createdByCommunicationIdentifier)); @@ -47,7 +46,7 @@ internal AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel reci /// The thread properties. /// 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 serializedAdditionalRawData, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata, IReadOnlyList participants) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) { CreatedByCommunicationIdentifier = createdByCommunicationIdentifier; Properties = properties; 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 8b2f2a7db481..5d0579bd4d1b 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 @@ -37,8 +37,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("deletedByCommunicationIdentifier"u8); writer.WriteObjectValue(DeletedByCommunicationIdentifier, options); - writer.WritePropertyName("deleteTime"u8); - writer.WriteStringValue(DeleteTime, "O"); + if (Optional.IsDefined(DeleteTime)) + { + writer.WritePropertyName("deleteTime"u8); + writer.WriteStringValue(DeleteTime.Value, "O"); + } } AcsChatThreadDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -62,8 +65,8 @@ internal static AcsChatThreadDeletedEventData DeserializeAcsChatThreadDeletedEve return null; } CommunicationIdentifierModel deletedByCommunicationIdentifier = default; - DateTimeOffset deleteTime = default; - DateTimeOffset createTime = default; + DateTimeOffset? deleteTime = default; + DateTimeOffset? createTime = default; long? version = default; string transactionId = default; string threadId = default; @@ -78,11 +81,19 @@ internal static AcsChatThreadDeletedEventData DeserializeAcsChatThreadDeletedEve } if (property.NameEquals("deleteTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } deleteTime = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } 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 68b39610ce9d..249893e1f9ee 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadDeletedEventData.cs @@ -14,16 +14,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsChatThreadDeletedEventData : AcsChatThreadEventInThreadBaseProperties { /// Initializes a new instance of . - /// The original creation time of the thread. /// The communication identifier of the user who deleted the thread. - /// The deletion time of the thread. /// is null. - internal AcsChatThreadDeletedEventData(DateTimeOffset createTime, CommunicationIdentifierModel deletedByCommunicationIdentifier, DateTimeOffset deleteTime) : base(createTime) + internal AcsChatThreadDeletedEventData(CommunicationIdentifierModel deletedByCommunicationIdentifier) { Argument.AssertNotNull(deletedByCommunicationIdentifier, nameof(deletedByCommunicationIdentifier)); DeletedByCommunicationIdentifier = deletedByCommunicationIdentifier; - DeleteTime = deleteTime; } /// Initializes a new instance of . @@ -34,7 +31,7 @@ internal AcsChatThreadDeletedEventData(DateTimeOffset createTime, CommunicationI /// 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 serializedAdditionalRawData, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel deletedByCommunicationIdentifier, DateTimeOffset? deleteTime) : base(transactionId, threadId, serializedAdditionalRawData, createTime, version) { DeletedByCommunicationIdentifier = deletedByCommunicationIdentifier; DeleteTime = deleteTime; @@ -48,6 +45,6 @@ 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; } + 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 dbc9bad2c0fe..0fd9ce223580 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 @@ -35,8 +35,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("createTime"u8); - writer.WriteStringValue(CreateTime, "O"); + if (Optional.IsDefined(CreateTime)) + { + writer.WritePropertyName("createTime"u8); + writer.WriteStringValue(CreateTime.Value, "O"); + } if (Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); @@ -64,7 +67,7 @@ internal static AcsChatThreadEventBaseProperties DeserializeAcsChatThreadEventBa { return null; } - DateTimeOffset createTime = default; + DateTimeOffset? createTime = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; string transactionId = default; @@ -75,6 +78,10 @@ internal static AcsChatThreadEventBaseProperties DeserializeAcsChatThreadEventBa { if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } 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 d2a25d81594d..1ead8005f0c1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventBaseProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventBaseProperties.cs @@ -15,13 +15,10 @@ public partial class AcsChatThreadEventBaseProperties : AcsChatEventBaseProperti { /// Initializes a new instance of . /// The communication identifier of the target user. - /// The original creation time of the thread. /// is null. - internal AcsChatThreadEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, DateTimeOffset createTime) : base(recipientCommunicationIdentifier) + internal AcsChatThreadEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier) : base(recipientCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); - - CreateTime = createTime; } /// Initializes a new instance of . @@ -31,7 +28,7 @@ internal AcsChatThreadEventBaseProperties(CommunicationIdentifierModel recipient /// 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 serializedAdditionalRawData, DateTimeOffset? createTime, long? version) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData) { CreateTime = createTime; Version = version; @@ -43,7 +40,7 @@ internal AcsChatThreadEventBaseProperties() } /// The original creation time of the thread. - public DateTimeOffset CreateTime { get; } + 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 c6a84493d388..fb41d9e54f3c 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 @@ -35,8 +35,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("createTime"u8); - writer.WriteStringValue(CreateTime, "O"); + if (Optional.IsDefined(CreateTime)) + { + writer.WritePropertyName("createTime"u8); + writer.WriteStringValue(CreateTime.Value, "O"); + } if (Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); @@ -64,7 +67,7 @@ internal static AcsChatThreadEventInThreadBaseProperties DeserializeAcsChatThrea { return null; } - DateTimeOffset createTime = default; + DateTimeOffset? createTime = default; long? version = default; string transactionId = default; string threadId = default; @@ -74,6 +77,10 @@ internal static AcsChatThreadEventInThreadBaseProperties DeserializeAcsChatThrea { if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } 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 6f41f0fe85ee..511e7ddeba0e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventInThreadBaseProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventInThreadBaseProperties.cs @@ -14,10 +14,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsChatThreadEventInThreadBaseProperties : AcsChatEventInThreadBaseProperties { /// Initializes a new instance of . - /// The original creation time of the thread. - internal AcsChatThreadEventInThreadBaseProperties(DateTimeOffset createTime) + internal AcsChatThreadEventInThreadBaseProperties() { - CreateTime = createTime; } /// Initializes a new instance of . @@ -26,19 +24,14 @@ internal AcsChatThreadEventInThreadBaseProperties(DateTimeOffset createTime) /// 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 serializedAdditionalRawData, DateTimeOffset? createTime, long? version) : base(transactionId, threadId, serializedAdditionalRawData) { CreateTime = createTime; Version = version; } - /// Initializes a new instance of for deserialization. - internal AcsChatThreadEventInThreadBaseProperties() - { - } - /// The original creation time of the thread. - public DateTimeOffset CreateTime { get; } + public DateTimeOffset? CreateTime { get; } /// The version of the thread. public long? Version { 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 1b26923f5d7d..0bb6a47da7d4 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 @@ -37,8 +37,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("editedByCommunicationIdentifier"u8); writer.WriteObjectValue(EditedByCommunicationIdentifier, options); - writer.WritePropertyName("editTime"u8); - writer.WriteStringValue(EditTime, "O"); + if (Optional.IsDefined(EditTime)) + { + writer.WritePropertyName("editTime"u8); + writer.WriteStringValue(EditTime.Value, "O"); + } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); foreach (var item in Properties) @@ -90,10 +93,10 @@ internal static AcsChatThreadPropertiesUpdatedEventData DeserializeAcsChatThread return null; } CommunicationIdentifierModel editedByCommunicationIdentifier = default; - DateTimeOffset editTime = default; + DateTimeOffset? editTime = default; IReadOnlyDictionary properties = default; IReadOnlyDictionary metadata = default; - DateTimeOffset createTime = default; + DateTimeOffset? createTime = default; long? version = default; string transactionId = default; string threadId = default; @@ -108,6 +111,10 @@ internal static AcsChatThreadPropertiesUpdatedEventData DeserializeAcsChatThread } if (property.NameEquals("editTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } editTime = property.Value.GetDateTimeOffset("O"); continue; } @@ -140,6 +147,10 @@ internal static AcsChatThreadPropertiesUpdatedEventData DeserializeAcsChatThread } if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } 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 44f774f4f9a4..748afca8b6d6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.cs @@ -14,20 +14,17 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsChatThreadPropertiesUpdatedEventData : AcsChatThreadEventInThreadBaseProperties { /// Initializes a new instance of . - /// The original creation time 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. /// The thread metadata. /// , or is null. - internal AcsChatThreadPropertiesUpdatedEventData(DateTimeOffset createTime, CommunicationIdentifierModel editedByCommunicationIdentifier, DateTimeOffset editTime, IReadOnlyDictionary properties, IReadOnlyDictionary metadata) : base(createTime) + internal AcsChatThreadPropertiesUpdatedEventData(CommunicationIdentifierModel editedByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata) { Argument.AssertNotNull(editedByCommunicationIdentifier, nameof(editedByCommunicationIdentifier)); Argument.AssertNotNull(properties, nameof(properties)); Argument.AssertNotNull(metadata, nameof(metadata)); EditedByCommunicationIdentifier = editedByCommunicationIdentifier; - EditTime = editTime; Properties = properties; Metadata = metadata; } @@ -42,7 +39,7 @@ internal AcsChatThreadPropertiesUpdatedEventData(DateTimeOffset createTime, Comm /// The time at which the properties of the thread were updated. /// The updated thread properties. /// 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 serializedAdditionalRawData, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel editedByCommunicationIdentifier, DateTimeOffset? editTime, IReadOnlyDictionary properties, IReadOnlyDictionary metadata) : base(transactionId, threadId, serializedAdditionalRawData, createTime, version) { EditedByCommunicationIdentifier = editedByCommunicationIdentifier; EditTime = editTime; @@ -58,7 +55,7 @@ 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; } + public DateTimeOffset? EditTime { get; } /// /// The updated thread properties /// 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 572d294f52df..8a95ccab1e89 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 @@ -37,8 +37,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("editedByCommunicationIdentifier"u8); writer.WriteObjectValue(EditedByCommunicationIdentifier, options); - writer.WritePropertyName("editTime"u8); - writer.WriteStringValue(EditTime, "O"); + if (Optional.IsDefined(EditTime)) + { + writer.WritePropertyName("editTime"u8); + writer.WriteStringValue(EditTime.Value, "O"); + } writer.WritePropertyName("metadata"u8); writer.WriteStartObject(); foreach (var item in Metadata) @@ -90,10 +93,10 @@ internal static AcsChatThreadPropertiesUpdatedPerUserEventData DeserializeAcsCha return null; } CommunicationIdentifierModel editedByCommunicationIdentifier = default; - DateTimeOffset editTime = default; + DateTimeOffset? editTime = default; IReadOnlyDictionary metadata = default; IReadOnlyDictionary properties = default; - DateTimeOffset createTime = default; + DateTimeOffset? createTime = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; string transactionId = default; @@ -109,6 +112,10 @@ internal static AcsChatThreadPropertiesUpdatedPerUserEventData DeserializeAcsCha } if (property.NameEquals("editTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } editTime = property.Value.GetDateTimeOffset("O"); continue; } @@ -141,6 +148,10 @@ internal static AcsChatThreadPropertiesUpdatedPerUserEventData DeserializeAcsCha } if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } 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 571ff029f325..dc53eadefb4c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.cs @@ -15,13 +15,11 @@ public partial class AcsChatThreadPropertiesUpdatedPerUserEventData : AcsChatThr { /// Initializes a new instance of . /// The communication identifier of the target user. - /// The original creation time 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. /// , , or is null. - internal AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, DateTimeOffset createTime, CommunicationIdentifierModel editedByCommunicationIdentifier, DateTimeOffset editTime, IReadOnlyDictionary metadata, IReadOnlyDictionary properties) : base(recipientCommunicationIdentifier, createTime) + internal AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel editedByCommunicationIdentifier, IReadOnlyDictionary metadata, IReadOnlyDictionary properties) : base(recipientCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); Argument.AssertNotNull(editedByCommunicationIdentifier, nameof(editedByCommunicationIdentifier)); @@ -29,7 +27,6 @@ internal AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierM Argument.AssertNotNull(properties, nameof(properties)); EditedByCommunicationIdentifier = editedByCommunicationIdentifier; - EditTime = editTime; Metadata = metadata; Properties = properties; } @@ -45,7 +42,7 @@ internal AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierM /// 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) + 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) { EditedByCommunicationIdentifier = editedByCommunicationIdentifier; EditTime = editTime; @@ -61,7 +58,7 @@ 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; } + public DateTimeOffset? EditTime { get; } /// The thread metadata. public IReadOnlyDictionary 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 e3eb7fc57494..2089dce751cc 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 @@ -37,8 +37,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("deletedByCommunicationIdentifier"u8); writer.WriteObjectValue(DeletedByCommunicationIdentifier, options); - writer.WritePropertyName("deleteTime"u8); - writer.WriteStringValue(DeleteTime, "O"); + if (Optional.IsDefined(DeleteTime)) + { + writer.WritePropertyName("deleteTime"u8); + writer.WriteStringValue(DeleteTime.Value, "O"); + } } AcsChatThreadWithUserDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -62,8 +65,8 @@ internal static AcsChatThreadWithUserDeletedEventData DeserializeAcsChatThreadWi return null; } CommunicationIdentifierModel deletedByCommunicationIdentifier = default; - DateTimeOffset deleteTime = default; - DateTimeOffset createTime = default; + DateTimeOffset? deleteTime = default; + DateTimeOffset? createTime = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; string transactionId = default; @@ -79,11 +82,19 @@ internal static AcsChatThreadWithUserDeletedEventData DeserializeAcsChatThreadWi } if (property.NameEquals("deleteTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } deleteTime = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } 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 2b366137bfd7..d0c52952554e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadWithUserDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadWithUserDeletedEventData.cs @@ -15,17 +15,14 @@ public partial class AcsChatThreadWithUserDeletedEventData : AcsChatThreadEventB { /// Initializes a new instance of . /// The communication identifier of the target user. - /// The original creation time of the thread. /// The communication identifier of the user who deleted the thread. - /// The deletion time of the thread. /// or is null. - internal AcsChatThreadWithUserDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, DateTimeOffset createTime, CommunicationIdentifierModel deletedByCommunicationIdentifier, DateTimeOffset deleteTime) : base(recipientCommunicationIdentifier, createTime) + internal AcsChatThreadWithUserDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel deletedByCommunicationIdentifier) : base(recipientCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); Argument.AssertNotNull(deletedByCommunicationIdentifier, nameof(deletedByCommunicationIdentifier)); DeletedByCommunicationIdentifier = deletedByCommunicationIdentifier; - DeleteTime = deleteTime; } /// Initializes a new instance of . @@ -37,7 +34,7 @@ internal AcsChatThreadWithUserDeletedEventData(CommunicationIdentifierModel reci /// 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 serializedAdditionalRawData, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel deletedByCommunicationIdentifier, DateTimeOffset? deleteTime) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) { DeletedByCommunicationIdentifier = deletedByCommunicationIdentifier; DeleteTime = deleteTime; @@ -51,6 +48,6 @@ 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; } + public DateTimeOffset? DeleteTime { get; } } } 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 e923e3d0b390..84ce34b4a0e8 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 @@ -49,12 +49,18 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("messageId"u8); writer.WriteStringValue(MessageId); } - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.ToString()); + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } writer.WritePropertyName("deliveryStatusDetails"u8); writer.WriteObjectValue(DeliveryStatusDetails, options); - writer.WritePropertyName("deliveryAttemptTimeStamp"u8); - writer.WriteStringValue(DeliveryAttemptTimestamp, "O"); + if (Optional.IsDefined(DeliveryAttemptTimestamp)) + { + writer.WritePropertyName("deliveryAttemptTimestamp"u8); + writer.WriteStringValue(DeliveryAttemptTimestamp.Value, "O"); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -95,9 +101,9 @@ internal static AcsEmailDeliveryReportReceivedEventData DeserializeAcsEmailDeliv string sender = default; string recipient = default; string messageId = default; - AcsEmailDeliveryReportStatus status = default; + AcsEmailDeliveryReportStatus? status = default; AcsEmailDeliveryReportStatusDetails deliveryStatusDetails = default; - DateTimeOffset deliveryAttemptTimeStamp = default; + DateTimeOffset? deliveryAttemptTimestamp = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -119,6 +125,10 @@ internal static AcsEmailDeliveryReportReceivedEventData DeserializeAcsEmailDeliv } if (property.NameEquals("status"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } status = new AcsEmailDeliveryReportStatus(property.Value.GetString()); continue; } @@ -127,9 +137,13 @@ internal static AcsEmailDeliveryReportReceivedEventData DeserializeAcsEmailDeliv deliveryStatusDetails = AcsEmailDeliveryReportStatusDetails.DeserializeAcsEmailDeliveryReportStatusDetails(property.Value, options); continue; } - if (property.NameEquals("deliveryAttemptTimeStamp"u8)) + if (property.NameEquals("deliveryAttemptTimestamp"u8)) { - deliveryAttemptTimeStamp = property.Value.GetDateTimeOffset("O"); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deliveryAttemptTimestamp = property.Value.GetDateTimeOffset("O"); continue; } if (options.Format != "W") @@ -144,7 +158,7 @@ internal static AcsEmailDeliveryReportReceivedEventData DeserializeAcsEmailDeliv messageId, status, deliveryStatusDetails, - deliveryAttemptTimeStamp, + deliveryAttemptTimestamp, serializedAdditionalRawData); } 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 f733218d6093..6b5ccc21acf3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportReceivedEventData.cs @@ -46,17 +46,13 @@ public partial class AcsEmailDeliveryReportReceivedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// 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. /// is null. - internal AcsEmailDeliveryReportReceivedEventData(AcsEmailDeliveryReportStatus status, AcsEmailDeliveryReportStatusDetails deliveryStatusDetails, DateTimeOffset deliveryAttemptTimestamp) + internal AcsEmailDeliveryReportReceivedEventData(AcsEmailDeliveryReportStatusDetails deliveryStatusDetails) { Argument.AssertNotNull(deliveryStatusDetails, nameof(deliveryStatusDetails)); - Status = status; DeliveryStatusDetails = deliveryStatusDetails; - DeliveryAttemptTimestamp = deliveryAttemptTimestamp; } /// Initializes a new instance of . @@ -67,7 +63,7 @@ internal AcsEmailDeliveryReportReceivedEventData(AcsEmailDeliveryReportStatus st /// 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 messageId, AcsEmailDeliveryReportStatus status, AcsEmailDeliveryReportStatusDetails deliveryStatusDetails, DateTimeOffset deliveryAttemptTimestamp, IDictionary serializedAdditionalRawData) + internal AcsEmailDeliveryReportReceivedEventData(string sender, string recipient, string messageId, AcsEmailDeliveryReportStatus? status, AcsEmailDeliveryReportStatusDetails deliveryStatusDetails, DateTimeOffset? deliveryAttemptTimestamp, IDictionary serializedAdditionalRawData) { Sender = sender; Recipient = recipient; @@ -90,10 +86,10 @@ internal AcsEmailDeliveryReportReceivedEventData() /// The Id of the email been sent. public string MessageId { get; } /// The status of the email. Any value other than Delivered is considered failed. - public AcsEmailDeliveryReportStatus Status { get; } + 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; } + public DateTimeOffset? DeliveryAttemptTimestamp { 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 de59f4582b5e..8dc5e773bd03 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 @@ -49,8 +49,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("messageId"u8); writer.WriteStringValue(MessageId); } - writer.WritePropertyName("userActionTimeStamp"u8); - writer.WriteStringValue(UserActionTimestamp, "O"); + if (Optional.IsDefined(UserActionTimestamp)) + { + writer.WritePropertyName("userActionTimestamp"u8); + writer.WriteStringValue(UserActionTimestamp.Value, "O"); + } if (Optional.IsDefined(EngagementContext)) { writer.WritePropertyName("engagementContext"u8); @@ -61,8 +64,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("userAgent"u8); writer.WriteStringValue(UserAgent); } - writer.WritePropertyName("engagementType"u8); - writer.WriteStringValue(Engagement.ToString()); + if (Optional.IsDefined(Engagement)) + { + writer.WritePropertyName("engagementType"u8); + writer.WriteStringValue(Engagement.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -103,10 +109,10 @@ internal static AcsEmailEngagementTrackingReportReceivedEventData DeserializeAcs string sender = default; string recipient = default; string messageId = default; - DateTimeOffset userActionTimeStamp = default; + DateTimeOffset? userActionTimestamp = default; string engagementContext = default; string userAgent = default; - AcsUserEngagement engagementType = default; + AcsUserEngagement? engagementType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -126,9 +132,13 @@ internal static AcsEmailEngagementTrackingReportReceivedEventData DeserializeAcs messageId = property.Value.GetString(); continue; } - if (property.NameEquals("userActionTimeStamp"u8)) + if (property.NameEquals("userActionTimestamp"u8)) { - userActionTimeStamp = property.Value.GetDateTimeOffset("O"); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userActionTimestamp = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("engagementContext"u8)) @@ -143,6 +153,10 @@ internal static AcsEmailEngagementTrackingReportReceivedEventData DeserializeAcs } if (property.NameEquals("engagementType"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } engagementType = new AcsUserEngagement(property.Value.GetString()); continue; } @@ -156,7 +170,7 @@ internal static AcsEmailEngagementTrackingReportReceivedEventData DeserializeAcs sender, recipient, messageId, - userActionTimeStamp, + userActionTimestamp, engagementContext, userAgent, engagementType, 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 9de2267639d7..78ece94104a5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailEngagementTrackingReportReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailEngagementTrackingReportReceivedEventData.cs @@ -46,12 +46,8 @@ public partial class AcsEmailEngagementTrackingReportReceivedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which the user interacted with the email. - /// The type of engagement user have with email. - internal AcsEmailEngagementTrackingReportReceivedEventData(DateTimeOffset userActionTimestamp, AcsUserEngagement engagement) + internal AcsEmailEngagementTrackingReportReceivedEventData() { - UserActionTimestamp = userActionTimestamp; - Engagement = engagement; } /// Initializes a new instance of . @@ -63,7 +59,7 @@ internal AcsEmailEngagementTrackingReportReceivedEventData(DateTimeOffset userAc /// 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) + internal AcsEmailEngagementTrackingReportReceivedEventData(string sender, string recipient, string messageId, DateTimeOffset? userActionTimestamp, string engagementContext, string userAgent, AcsUserEngagement? engagement, IDictionary serializedAdditionalRawData) { Sender = sender; Recipient = recipient; @@ -75,11 +71,6 @@ internal AcsEmailEngagementTrackingReportReceivedEventData(string sender, string _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal AcsEmailEngagementTrackingReportReceivedEventData() - { - } - /// The Sender Email Address. public string Sender { get; } /// The Recipient Email Address. @@ -87,12 +78,12 @@ internal AcsEmailEngagementTrackingReportReceivedEventData() /// 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; } + 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; } + public AcsUserEngagement? Engagement { 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 30e667ddb263..bb6789f2570e 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 @@ -55,6 +55,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("incomingCallContext"u8); writer.WriteStringValue(IncomingCallContext); } + if (Optional.IsDefined(OnBehalfOfCallee)) + { + writer.WritePropertyName("onBehalfOfCallee"u8); + writer.WriteObjectValue(OnBehalfOfCallee, options); + } if (Optional.IsDefined(CorrelationId)) { writer.WritePropertyName("correlationId"u8); @@ -103,6 +108,7 @@ internal static AcsIncomingCallEventData DeserializeAcsIncomingCallEventData(Jso string callerDisplayName = default; AcsIncomingCallCustomContext customContext = default; string incomingCallContext = default; + CommunicationIdentifierModel onBehalfOfCallee = default; string correlationId = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -138,6 +144,15 @@ internal static AcsIncomingCallEventData DeserializeAcsIncomingCallEventData(Jso incomingCallContext = property.Value.GetString(); continue; } + if (property.NameEquals("onBehalfOfCallee"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + onBehalfOfCallee = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options); + continue; + } if (property.NameEquals("correlationId"u8)) { correlationId = property.Value.GetString(); @@ -156,6 +171,7 @@ internal static AcsIncomingCallEventData DeserializeAcsIncomingCallEventData(Jso callerDisplayName, customContext, incomingCallContext, + onBehalfOfCallee, correlationId, serializedAdditionalRawData); } 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 a5ce2d8a623d..2a02164d5e87 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsIncomingCallEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsIncomingCallEventData.cs @@ -68,9 +68,10 @@ internal AcsIncomingCallEventData(CommunicationIdentifierModel toCommunicationId /// Display name of caller. /// Custom Context of Incoming Call. /// 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, string correlationId, IDictionary serializedAdditionalRawData) + internal AcsIncomingCallEventData(CommunicationIdentifierModel toCommunicationIdentifier, CommunicationIdentifierModel fromCommunicationIdentifier, string serverCallId, string callerDisplayName, AcsIncomingCallCustomContext customContext, string incomingCallContext, CommunicationIdentifierModel onBehalfOfCallee, string correlationId, IDictionary serializedAdditionalRawData) { ToCommunicationIdentifier = toCommunicationIdentifier; FromCommunicationIdentifier = fromCommunicationIdentifier; @@ -78,6 +79,7 @@ internal AcsIncomingCallEventData(CommunicationIdentifierModel toCommunicationId CallerDisplayName = callerDisplayName; CustomContext = customContext; IncomingCallContext = incomingCallContext; + OnBehalfOfCallee = onBehalfOfCallee; CorrelationId = correlationId; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -99,6 +101,8 @@ internal AcsIncomingCallEventData() 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/AcsMessageDeliveryStatusUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatusUpdatedEventData.Serialization.cs index 72b0f5b834ec..9a5bc5366221 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 @@ -40,10 +40,16 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("messageId"u8); writer.WriteStringValue(MessageId); } - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.ToString()); - writer.WritePropertyName("channelType"u8); - writer.WriteStringValue(ChannelKind.ToString()); + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(ChannelKind)) + { + writer.WritePropertyName("channelType"u8); + writer.WriteStringValue(ChannelKind.Value.ToString()); + } } AcsMessageDeliveryStatusUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -67,11 +73,11 @@ internal static AcsMessageDeliveryStatusUpdatedEventData DeserializeAcsMessageDe return null; } string messageId = default; - AcsMessageDeliveryStatus status = default; - AcsMessageChannelKind channelType = default; + AcsMessageDeliveryStatus? status = default; + AcsMessageChannelKind? channelType = default; string @from = default; string to = default; - DateTimeOffset receivedTimeStamp = default; + DateTimeOffset? receivedTimeStamp = default; AcsMessageChannelEventError error = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -84,11 +90,19 @@ internal static AcsMessageDeliveryStatusUpdatedEventData DeserializeAcsMessageDe } if (property.NameEquals("status"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } status = new AcsMessageDeliveryStatus(property.Value.GetString()); continue; } if (property.NameEquals("channelType"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } channelType = new AcsMessageChannelKind(property.Value.GetString()); continue; } @@ -104,6 +118,10 @@ internal static AcsMessageDeliveryStatusUpdatedEventData DeserializeAcsMessageDe } if (property.NameEquals("receivedTimeStamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } receivedTimeStamp = property.Value.GetDateTimeOffset("O"); continue; } 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 08ee6836ec0e..f4bd6f681f1e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatusUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatusUpdatedEventData.cs @@ -14,17 +14,11 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsMessageDeliveryStatusUpdatedEventData : AcsMessageEventData { /// Initializes a new instance of . - /// The time message was received. /// The channel event error. - /// The updated message status. - /// The updated message channel type. /// is null. - internal AcsMessageDeliveryStatusUpdatedEventData(DateTimeOffset receivedTimestamp, AcsMessageChannelEventError error, AcsMessageDeliveryStatus status, AcsMessageChannelKind channelKind) : base(receivedTimestamp, error) + internal AcsMessageDeliveryStatusUpdatedEventData(AcsMessageChannelEventError error) : base(error) { Argument.AssertNotNull(error, nameof(error)); - - Status = status; - ChannelKind = channelKind; } /// Initializes a new instance of . @@ -36,7 +30,7 @@ internal AcsMessageDeliveryStatusUpdatedEventData(DateTimeOffset receivedTimesta /// The message id. /// The updated message status. /// The updated message channel type. - internal AcsMessageDeliveryStatusUpdatedEventData(string @from, string to, DateTimeOffset receivedTimestamp, AcsMessageChannelEventError error, IDictionary serializedAdditionalRawData, string messageId, AcsMessageDeliveryStatus status, AcsMessageChannelKind channelKind) : base(@from, to, receivedTimestamp, error, serializedAdditionalRawData) + internal AcsMessageDeliveryStatusUpdatedEventData(string @from, string to, DateTimeOffset? receivedTimestamp, AcsMessageChannelEventError error, IDictionary serializedAdditionalRawData, string messageId, AcsMessageDeliveryStatus? status, AcsMessageChannelKind? channelKind) : base(@from, to, receivedTimestamp, error, serializedAdditionalRawData) { MessageId = messageId; Status = status; @@ -51,8 +45,8 @@ internal AcsMessageDeliveryStatusUpdatedEventData() /// The message id. public string MessageId { get; } /// The updated message status. - public AcsMessageDeliveryStatus Status { get; } + public AcsMessageDeliveryStatus? Status { get; } /// The updated message channel type. - public AcsMessageChannelKind ChannelKind { get; } + 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 a2d1c63653e7..f95937b13670 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 @@ -44,8 +44,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("to"u8); writer.WriteStringValue(To); } - writer.WritePropertyName("receivedTimeStamp"u8); - writer.WriteStringValue(ReceivedTimestamp, "O"); + if (Optional.IsDefined(ReceivedTimestamp)) + { + writer.WritePropertyName("receivedTimeStamp"u8); + writer.WriteStringValue(ReceivedTimestamp.Value, "O"); + } writer.WritePropertyName("error"u8); writer.WriteObjectValue(Error, options); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -87,7 +90,7 @@ internal static AcsMessageEventData DeserializeAcsMessageEventData(JsonElement e } string @from = default; string to = default; - DateTimeOffset receivedTimeStamp = default; + DateTimeOffset? receivedTimeStamp = default; AcsMessageChannelEventError error = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -105,6 +108,10 @@ internal static AcsMessageEventData DeserializeAcsMessageEventData(JsonElement e } if (property.NameEquals("receivedTimeStamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } receivedTimeStamp = property.Value.GetDateTimeOffset("O"); continue; } 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 cedcc1dc0758..7bcb742ac6ae 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageEventData.cs @@ -46,14 +46,12 @@ public partial class AcsMessageEventData private protected IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time message was received. /// The channel event error. /// is null. - internal AcsMessageEventData(DateTimeOffset receivedTimestamp, AcsMessageChannelEventError error) + internal AcsMessageEventData(AcsMessageChannelEventError error) { Argument.AssertNotNull(error, nameof(error)); - ReceivedTimestamp = receivedTimestamp; Error = error; } @@ -63,7 +61,7 @@ internal AcsMessageEventData(DateTimeOffset receivedTimestamp, AcsMessageChannel /// 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 error, IDictionary serializedAdditionalRawData) + internal AcsMessageEventData(string @from, string to, DateTimeOffset? receivedTimestamp, AcsMessageChannelEventError error, IDictionary serializedAdditionalRawData) { From = @from; To = to; @@ -82,7 +80,7 @@ internal AcsMessageEventData() /// The message recipient. public string To { get; } /// The time message was received. - public DateTimeOffset ReceivedTimestamp { get; } + public DateTimeOffset? ReceivedTimestamp { get; } /// The channel event error. public AcsMessageChannelEventError Error { 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 6ff87f62f04f..9460ca64b380 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 @@ -34,8 +34,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(AcsMessageInteractiveContent)} does not support writing '{format}' format."); } - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ReplyKind.ToString()); + if (Optional.IsDefined(ReplyKind)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ReplyKind.Value.ToString()); + } writer.WritePropertyName("buttonReply"u8); writer.WriteObjectValue(ButtonReply, options); writer.WritePropertyName("listReply"u8); @@ -77,7 +80,7 @@ internal static AcsMessageInteractiveContent DeserializeAcsMessageInteractiveCon { return null; } - AcsInteractiveReplyKind type = default; + AcsInteractiveReplyKind? type = default; AcsMessageInteractiveButtonReplyContent buttonReply = default; AcsMessageInteractiveListReplyContent listReply = default; IDictionary serializedAdditionalRawData = default; @@ -86,6 +89,10 @@ internal static AcsMessageInteractiveContent DeserializeAcsMessageInteractiveCon { if (property.NameEquals("type"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } type = new AcsInteractiveReplyKind(property.Value.GetString()); continue; } 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 0d59cf31c2ff..9b8cdb2ab40a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveContent.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveContent.cs @@ -46,16 +46,14 @@ public partial class AcsMessageInteractiveContent private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// 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. /// or is null. - internal AcsMessageInteractiveContent(AcsInteractiveReplyKind replyKind, AcsMessageInteractiveButtonReplyContent buttonReply, AcsMessageInteractiveListReplyContent listReply) + internal AcsMessageInteractiveContent(AcsMessageInteractiveButtonReplyContent buttonReply, AcsMessageInteractiveListReplyContent listReply) { Argument.AssertNotNull(buttonReply, nameof(buttonReply)); Argument.AssertNotNull(listReply, nameof(listReply)); - ReplyKind = replyKind; ButtonReply = buttonReply; ListReply = listReply; } @@ -65,7 +63,7 @@ internal AcsMessageInteractiveContent(AcsInteractiveReplyKind replyKind, AcsMess /// 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) + internal AcsMessageInteractiveContent(AcsInteractiveReplyKind? replyKind, AcsMessageInteractiveButtonReplyContent buttonReply, AcsMessageInteractiveListReplyContent listReply, IDictionary serializedAdditionalRawData) { ReplyKind = replyKind; ButtonReply = buttonReply; @@ -79,7 +77,7 @@ internal AcsMessageInteractiveContent() } /// The Message interactive reply type. - public AcsInteractiveReplyKind ReplyKind { get; } + 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. 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 29d76082dfa2..8face35c5d00 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 @@ -80,7 +80,7 @@ internal static AcsMessageReceivedEventData DeserializeAcsMessageReceivedEventDa AcsMessageInteractiveContent interactive = default; string @from = default; string to = default; - DateTimeOffset receivedTimeStamp = default; + DateTimeOffset? receivedTimeStamp = default; AcsMessageChannelEventError error = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -128,6 +128,10 @@ internal static AcsMessageReceivedEventData DeserializeAcsMessageReceivedEventDa } if (property.NameEquals("receivedTimeStamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } receivedTimeStamp = property.Value.GetDateTimeOffset("O"); continue; } 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 b7435b051bdf..a15a9991bdda 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReceivedEventData.cs @@ -14,7 +14,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsMessageReceivedEventData : AcsMessageEventData { /// Initializes a new instance of . - /// The time message was received. /// The channel event error. /// The message channel type. /// The received message media content. @@ -22,7 +21,7 @@ public partial class AcsMessageReceivedEventData : AcsMessageEventData /// The received message button content. /// The received message interactive content. /// , , , or is null. - internal AcsMessageReceivedEventData(DateTimeOffset receivedTimestamp, AcsMessageChannelEventError error, AcsMessageChannelKind channelKind, AcsMessageMediaContent mediaContent, AcsMessageContext context, AcsMessageButtonContent button, AcsMessageInteractiveContent interactiveContent) : base(receivedTimestamp, error) + internal AcsMessageReceivedEventData(AcsMessageChannelEventError error, AcsMessageChannelKind channelKind, AcsMessageMediaContent mediaContent, AcsMessageContext context, AcsMessageButtonContent button, AcsMessageInteractiveContent interactiveContent) : base(error) { Argument.AssertNotNull(error, nameof(error)); Argument.AssertNotNull(mediaContent, nameof(mediaContent)); @@ -49,7 +48,7 @@ internal AcsMessageReceivedEventData(DateTimeOffset receivedTimestamp, AcsMessag /// The received message context. /// The received message button content. /// The received message interactive content. - internal AcsMessageReceivedEventData(string @from, string to, DateTimeOffset receivedTimestamp, AcsMessageChannelEventError error, IDictionary serializedAdditionalRawData, string content, AcsMessageChannelKind channelKind, AcsMessageMediaContent mediaContent, AcsMessageContext context, AcsMessageButtonContent button, AcsMessageInteractiveContent interactiveContent) : base(@from, to, receivedTimestamp, error, serializedAdditionalRawData) + internal AcsMessageReceivedEventData(string @from, string to, DateTimeOffset? receivedTimestamp, AcsMessageChannelEventError error, IDictionary serializedAdditionalRawData, string content, AcsMessageChannelKind channelKind, AcsMessageMediaContent mediaContent, AcsMessageContext context, AcsMessageButtonContent button, AcsMessageInteractiveContent interactiveContent) : base(@from, to, receivedTimestamp, error, serializedAdditionalRawData) { Content = content; ChannelKind = channelKind; 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 395739dfd570..52e7e0473140 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 @@ -36,19 +36,31 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("recordingStorageInfo"u8); writer.WriteObjectValue(RecordingStorageInfo, options); - writer.WritePropertyName("recordingStartTime"u8); - writer.WriteStringValue(RecordingStartTime, "O"); + if (Optional.IsDefined(RecordingStartTime)) + { + writer.WritePropertyName("recordingStartTime"u8); + writer.WriteStringValue(RecordingStartTime.Value, "O"); + } if (Optional.IsDefined(RecordingDurationMs)) { writer.WritePropertyName("recordingDurationMs"u8); writer.WriteNumberValue(RecordingDurationMs.Value); } - writer.WritePropertyName("recordingContentType"u8); - writer.WriteStringValue(RecordingContentType.ToString()); - writer.WritePropertyName("recordingChannelType"u8); - writer.WriteStringValue(RecordingChannelKind.ToString()); - writer.WritePropertyName("recordingFormatType"u8); - writer.WriteStringValue(RecordingFormatType.ToString()); + if (Optional.IsDefined(RecordingContentType)) + { + writer.WritePropertyName("recordingContentType"u8); + writer.WriteStringValue(RecordingContentType.Value.ToString()); + } + if (Optional.IsDefined(RecordingChannelKind)) + { + writer.WritePropertyName("recordingChannelType"u8); + writer.WriteStringValue(RecordingChannelKind.Value.ToString()); + } + if (Optional.IsDefined(RecordingFormatType)) + { + writer.WritePropertyName("recordingFormatType"u8); + writer.WriteStringValue(RecordingFormatType.Value.ToString()); + } if (Optional.IsDefined(SessionEndReason)) { writer.WritePropertyName("sessionEndReason"u8); @@ -92,11 +104,11 @@ internal static AcsRecordingFileStatusUpdatedEventData DeserializeAcsRecordingFi return null; } AcsRecordingStorageInfoProperties recordingStorageInfo = default; - DateTimeOffset recordingStartTime = default; + DateTimeOffset? recordingStartTime = default; long? recordingDurationMs = default; - RecordingContentType recordingContentType = default; - RecordingChannelType recordingChannelType = default; - RecordingFormatType recordingFormatType = default; + RecordingContentType? recordingContentType = default; + RecordingChannelType? recordingChannelType = default; + RecordingFormatType? recordingFormatType = default; string sessionEndReason = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -109,6 +121,10 @@ internal static AcsRecordingFileStatusUpdatedEventData DeserializeAcsRecordingFi } if (property.NameEquals("recordingStartTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } recordingStartTime = property.Value.GetDateTimeOffset("O"); continue; } @@ -123,16 +139,28 @@ internal static AcsRecordingFileStatusUpdatedEventData DeserializeAcsRecordingFi } if (property.NameEquals("recordingContentType"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } recordingContentType = new RecordingContentType(property.Value.GetString()); continue; } if (property.NameEquals("recordingChannelType"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } recordingChannelType = new RecordingChannelType(property.Value.GetString()); continue; } if (property.NameEquals("recordingFormatType"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } recordingFormatType = new RecordingFormatType(property.Value.GetString()); continue; } 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 a5e50aee2cc8..6e00dccf4760 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFileStatusUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFileStatusUpdatedEventData.cs @@ -47,20 +47,12 @@ public partial class AcsRecordingFileStatusUpdatedEventData /// Initializes a new instance of . /// The details of recording storage information. - /// The time at which the recording started. - /// The recording content type- AudioVideo, or Audio. - /// The recording channel type - Mixed, Unmixed. - /// The recording format type - Mp4, Mp3, Wav. /// is null. - internal AcsRecordingFileStatusUpdatedEventData(AcsRecordingStorageInfoProperties recordingStorageInfo, DateTimeOffset recordingStartTime, RecordingContentType recordingContentType, RecordingChannelType recordingChannelKind, RecordingFormatType recordingFormatType) + internal AcsRecordingFileStatusUpdatedEventData(AcsRecordingStorageInfoProperties recordingStorageInfo) { Argument.AssertNotNull(recordingStorageInfo, nameof(recordingStorageInfo)); RecordingStorageInfo = recordingStorageInfo; - RecordingStartTime = recordingStartTime; - RecordingContentType = recordingContentType; - RecordingChannelKind = recordingChannelKind; - RecordingFormatType = recordingFormatType; } /// Initializes a new instance of . @@ -72,7 +64,7 @@ internal AcsRecordingFileStatusUpdatedEventData(AcsRecordingStorageInfoPropertie /// 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, RecordingContentType recordingContentType, RecordingChannelType recordingChannelKind, RecordingFormatType recordingFormatType, string sessionEndReason, IDictionary serializedAdditionalRawData) + internal AcsRecordingFileStatusUpdatedEventData(AcsRecordingStorageInfoProperties recordingStorageInfo, DateTimeOffset? recordingStartTime, long? recordingDurationMs, RecordingContentType? recordingContentType, RecordingChannelType? recordingChannelKind, RecordingFormatType? recordingFormatType, string sessionEndReason, IDictionary serializedAdditionalRawData) { RecordingStorageInfo = recordingStorageInfo; RecordingStartTime = recordingStartTime; @@ -92,15 +84,15 @@ internal AcsRecordingFileStatusUpdatedEventData() /// The details of recording storage information. public AcsRecordingStorageInfoProperties RecordingStorageInfo { get; } /// The time at which the recording started. - public DateTimeOffset RecordingStartTime { get; } + public DateTimeOffset? RecordingStartTime { get; } /// The recording duration in milliseconds. public long? RecordingDurationMs { get; } /// The recording content type- AudioVideo, or Audio. - public RecordingContentType RecordingContentType { get; } + public RecordingContentType? RecordingContentType { get; } /// The recording channel type - Mixed, Unmixed. - public RecordingChannelType RecordingChannelKind { get; } + public RecordingChannelType? RecordingChannelKind { get; } /// The recording format type - Mp4, Mp3, Wav. - public RecordingFormatType RecordingFormatType { get; } + public RecordingFormatType? RecordingFormatType { get; } /// The reason for ending recording session. public string SessionEndReason { 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 0e2b60e8c2da..f82d0a483631 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 @@ -35,8 +35,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("jobStatus"u8); - writer.WriteStringValue(JobStatus.ToString()); + if (Optional.IsDefined(JobStatus)) + { + writer.WritePropertyName("jobStatus"u8); + writer.WriteStringValue(JobStatus.Value.ToString()); + } if (Optional.IsDefined(ClassificationPolicyId)) { writer.WritePropertyName("classificationPolicyId"u8); @@ -54,8 +57,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("scheduledOn"u8); - writer.WriteStringValue(ScheduledOn, "O"); + if (Optional.IsDefined(ScheduledOn)) + { + writer.WritePropertyName("scheduledOn"u8); + writer.WriteStringValue(ScheduledOn.Value, "O"); + } writer.WritePropertyName("unavailableForMatching"u8); writer.WriteBooleanValue(UnavailableForMatching); } @@ -80,11 +86,11 @@ internal static AcsRouterJobReceivedEventData DeserializeAcsRouterJobReceivedEve { return null; } - AcsRouterJobStatus jobStatus = default; + AcsRouterJobStatus? jobStatus = default; string classificationPolicyId = default; int? priority = default; IReadOnlyList requestedWorkerSelectors = default; - DateTimeOffset scheduledOn = default; + DateTimeOffset? scheduledOn = default; bool unavailableForMatching = default; string queueId = default; IReadOnlyDictionary labels = default; @@ -98,6 +104,10 @@ internal static AcsRouterJobReceivedEventData DeserializeAcsRouterJobReceivedEve { if (property.NameEquals("jobStatus"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } jobStatus = new AcsRouterJobStatus(property.Value.GetString()); continue; } @@ -127,6 +137,10 @@ internal static AcsRouterJobReceivedEventData DeserializeAcsRouterJobReceivedEve } if (property.NameEquals("scheduledOn"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } scheduledOn = property.Value.GetDateTimeOffset("O"); continue; } 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 3a5d5a136ea7..e13d3fb3647b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.cs @@ -17,20 +17,16 @@ public partial class AcsRouterJobReceivedEventData : AcsRouterJobEventData /// Initializes a new instance of . /// Router Job events Labels. /// Router Jobs events Tags. - /// Router Job Received Job Status. /// Router Job Received Requested Worker Selectors. - /// Router Job Received Scheduled Time in UTC. /// Unavailable For Matching for Router Job Received. /// , or is null. - internal AcsRouterJobReceivedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags, AcsRouterJobStatus jobStatus, IEnumerable requestedWorkerSelectors, DateTimeOffset scheduledOn, bool unavailableForMatching) : base(labels, tags) + internal AcsRouterJobReceivedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags, IEnumerable requestedWorkerSelectors, bool unavailableForMatching) : base(labels, tags) { Argument.AssertNotNull(labels, nameof(labels)); Argument.AssertNotNull(tags, nameof(tags)); Argument.AssertNotNull(requestedWorkerSelectors, nameof(requestedWorkerSelectors)); - JobStatus = jobStatus; RequestedWorkerSelectors = requestedWorkerSelectors.ToList(); - ScheduledOn = scheduledOn; UnavailableForMatching = unavailableForMatching; } @@ -48,7 +44,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 jobStatus, 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 serializedAdditionalRawData, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, AcsRouterJobStatus? jobStatus, string classificationPolicyId, int? priority, IReadOnlyList requestedWorkerSelectors, DateTimeOffset? scheduledOn, bool unavailableForMatching) : base(jobId, channelReference, channelId, serializedAdditionalRawData, queueId, labels, tags) { JobStatus = jobStatus; ClassificationPolicyId = classificationPolicyId; @@ -64,7 +60,7 @@ internal AcsRouterJobReceivedEventData() } /// Router Job Received Job Status. - public AcsRouterJobStatus JobStatus { get; } + public AcsRouterJobStatus? JobStatus { get; } /// Router Job Classification Policy Id. public string ClassificationPolicyId { get; } /// Router Job Priority. @@ -72,7 +68,7 @@ internal AcsRouterJobReceivedEventData() /// Router Job Received Requested Worker Selectors. public IReadOnlyList RequestedWorkerSelectors { get; } /// Router Job Received Scheduled Time in UTC. - public DateTimeOffset ScheduledOn { get; } + 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 69d6854197d6..d08a190f14e9 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 @@ -54,8 +54,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("scheduledOn"u8); - writer.WriteStringValue(ScheduledOn, "O"); + if (Optional.IsDefined(ScheduledOn)) + { + writer.WritePropertyName("scheduledOn"u8); + writer.WriteStringValue(ScheduledOn.Value, "O"); + } if (Optional.IsDefined(FailureReason)) { writer.WritePropertyName("failureReason"u8); @@ -86,7 +89,7 @@ internal static AcsRouterJobSchedulingFailedEventData DeserializeAcsRouterJobSch int? priority = default; IReadOnlyList expiredAttachedWorkerSelectors = default; IReadOnlyList expiredRequestedWorkerSelectors = default; - DateTimeOffset scheduledOn = default; + DateTimeOffset? scheduledOn = default; string failureReason = default; string queueId = default; IReadOnlyDictionary labels = default; @@ -129,6 +132,10 @@ internal static AcsRouterJobSchedulingFailedEventData DeserializeAcsRouterJobSch } if (property.NameEquals("scheduledOn"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } scheduledOn = property.Value.GetDateTimeOffset("O"); continue; } 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 6d55b80f185a..2f38f8a6466d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.cs @@ -19,9 +19,8 @@ public partial class AcsRouterJobSchedulingFailedEventData : AcsRouterJobEventDa /// Router Jobs events Tags. /// Router Job Scheduling Failed Attached Worker Selector Expired. /// Router Job Scheduling Failed Requested Worker Selector Expired. - /// Router Job Scheduling Failed Scheduled Time in UTC. /// , , or is null. - internal AcsRouterJobSchedulingFailedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags, IEnumerable expiredAttachedWorkerSelectors, IEnumerable expiredRequestedWorkerSelectors, DateTimeOffset scheduledOn) : base(labels, tags) + internal AcsRouterJobSchedulingFailedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags, IEnumerable expiredAttachedWorkerSelectors, IEnumerable expiredRequestedWorkerSelectors) : base(labels, tags) { Argument.AssertNotNull(labels, nameof(labels)); Argument.AssertNotNull(tags, nameof(tags)); @@ -30,7 +29,6 @@ internal AcsRouterJobSchedulingFailedEventData(IReadOnlyDictionary Initializes a new instance of . @@ -46,7 +44,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 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) { Priority = priority; ExpiredAttachedWorkerSelectors = expiredAttachedWorkerSelectors; @@ -67,7 +65,7 @@ internal AcsRouterJobSchedulingFailedEventData() /// Router Job Scheduling Failed Requested Worker Selector Expired. public IReadOnlyList ExpiredRequestedWorkerSelectors { get; } /// Router Job Scheduling Failed Scheduled Time in UTC. - public DateTimeOffset ScheduledOn { get; } + public DateTimeOffset? ScheduledOn { get; } /// Router Job Scheduling Failed Reason. public string FailureReason { 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 fc5948af2cc9..223cd09e3997 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 @@ -54,8 +54,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("scheduledOn"u8); - writer.WriteStringValue(ScheduledOn, "O"); + if (Optional.IsDefined(ScheduledOn)) + { + writer.WritePropertyName("scheduledOn"u8); + writer.WriteStringValue(ScheduledOn.Value, "O"); + } writer.WritePropertyName("unavailableForMatching"u8); writer.WriteBooleanValue(UnavailableForMatching); } @@ -83,7 +86,7 @@ internal static AcsRouterJobWaitingForActivationEventData DeserializeAcsRouterJo int? priority = default; IReadOnlyList expiredAttachedWorkerSelectors = default; IReadOnlyList expiredRequestedWorkerSelectors = default; - DateTimeOffset scheduledOn = default; + DateTimeOffset? scheduledOn = default; bool unavailableForMatching = default; string queueId = default; IReadOnlyDictionary labels = default; @@ -126,6 +129,10 @@ internal static AcsRouterJobWaitingForActivationEventData DeserializeAcsRouterJo } if (property.NameEquals("scheduledOn"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } scheduledOn = property.Value.GetDateTimeOffset("O"); continue; } 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 445da526d6c0..df1a3085421f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.cs @@ -19,10 +19,9 @@ public partial class AcsRouterJobWaitingForActivationEventData : AcsRouterJobEve /// Router Jobs events Tags. /// Router Job Waiting For Activation Worker Selector Expired. /// 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. /// , , or is null. - internal AcsRouterJobWaitingForActivationEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags, IEnumerable expiredAttachedWorkerSelectors, IEnumerable expiredRequestedWorkerSelectors, DateTimeOffset scheduledOn, bool unavailableForMatching) : base(labels, tags) + internal AcsRouterJobWaitingForActivationEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags, IEnumerable expiredAttachedWorkerSelectors, IEnumerable expiredRequestedWorkerSelectors, bool unavailableForMatching) : base(labels, tags) { Argument.AssertNotNull(labels, nameof(labels)); Argument.AssertNotNull(tags, nameof(tags)); @@ -31,7 +30,6 @@ 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 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) { Priority = priority; ExpiredAttachedWorkerSelectors = expiredAttachedWorkerSelectors; @@ -69,7 +67,7 @@ internal AcsRouterJobWaitingForActivationEventData() /// 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; } + 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/AcsRouterWorkerOfferIssuedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.Serialization.cs index 817a8da1b0fd..cd148300a18f 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 @@ -58,10 +58,16 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteStringValue(item.Value); } writer.WriteEndObject(); - writer.WritePropertyName("offeredOn"u8); - writer.WriteStringValue(OfferedOn, "O"); - writer.WritePropertyName("expiresOn"u8); - writer.WriteStringValue(ExpiresOn, "O"); + if (Optional.IsDefined(OfferedOn)) + { + writer.WritePropertyName("offeredOn"u8); + writer.WriteStringValue(OfferedOn.Value, "O"); + } + if (Optional.IsDefined(ExpiresOn)) + { + writer.WritePropertyName("expiresOn"u8); + writer.WriteStringValue(ExpiresOn.Value, "O"); + } writer.WritePropertyName("workerTags"u8); writer.WriteStartObject(); foreach (var item in WorkerTags) @@ -112,8 +118,8 @@ internal static AcsRouterWorkerOfferIssuedEventData DeserializeAcsRouterWorkerOf string offerId = default; int? jobPriority = default; IReadOnlyDictionary workerLabels = default; - DateTimeOffset offeredOn = default; - DateTimeOffset expiresOn = default; + DateTimeOffset? offeredOn = default; + DateTimeOffset? expiresOn = default; IReadOnlyDictionary workerTags = default; IReadOnlyDictionary jobLabels = default; IReadOnlyDictionary jobTags = default; @@ -156,11 +162,19 @@ internal static AcsRouterWorkerOfferIssuedEventData DeserializeAcsRouterWorkerOf } if (property.NameEquals("offeredOn"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } offeredOn = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("expiresOn"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } expiresOn = property.Value.GetDateTimeOffset("O"); continue; } 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 f964beba9d50..ac8aee0106c3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.cs @@ -15,13 +15,11 @@ public partial class AcsRouterWorkerOfferIssuedEventData : AcsRouterWorkerEventD { /// Initializes a new instance of . /// Router Worker Offer Issued Worker Labels. - /// Router Worker Offer Issued Time in UTC. - /// Router Worker Offer Issued Expiration Time in UTC. /// 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, DateTimeOffset offeredOn, DateTimeOffset expiresOn, IReadOnlyDictionary workerTags, IReadOnlyDictionary jobLabels, IReadOnlyDictionary jobTags) + internal AcsRouterWorkerOfferIssuedEventData(IReadOnlyDictionary workerLabels, IReadOnlyDictionary workerTags, IReadOnlyDictionary jobLabels, IReadOnlyDictionary jobTags) { Argument.AssertNotNull(workerLabels, nameof(workerLabels)); Argument.AssertNotNull(workerTags, nameof(workerTags)); @@ -29,8 +27,6 @@ internal AcsRouterWorkerOfferIssuedEventData(IReadOnlyDictionary Argument.AssertNotNull(jobTags, nameof(jobTags)); WorkerLabels = workerLabels; - OfferedOn = offeredOn; - ExpiresOn = expiresOn; WorkerTags = workerTags; JobLabels = jobLabels; JobTags = jobTags; @@ -51,7 +47,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 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) { QueueId = queueId; OfferId = offerId; @@ -78,9 +74,9 @@ internal AcsRouterWorkerOfferIssuedEventData() /// Router Worker Offer Issued Worker Labels. public IReadOnlyDictionary WorkerLabels { get; } /// Router Worker Offer Issued Time in UTC. - public DateTimeOffset OfferedOn { get; } + public DateTimeOffset? OfferedOn { get; } /// Router Worker Offer Issued Expiration Time in UTC. - public DateTimeOffset ExpiresOn { get; } + public DateTimeOffset? ExpiresOn { get; } /// Router Worker Offer Issued Worker Tags. public IReadOnlyDictionary WorkerTags { get; } /// Router Worker Offer Issued Job Labels. 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 36871c0eb165..423a69d56695 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 @@ -39,8 +39,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("key"u8); writer.WriteStringValue(Key); } - writer.WritePropertyName("labelOperator"u8); - writer.WriteStringValue(LabelOperator.ToString()); + if (Optional.IsDefined(LabelOperator)) + { + writer.WritePropertyName("labelOperator"u8); + writer.WriteStringValue(LabelOperator.Value.ToString()); + } writer.WritePropertyName("value"u8); #if NET6_0_OR_GREATER writer.WriteRawValue(LabelValue); @@ -52,10 +55,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit #endif writer.WritePropertyName("ttlSeconds"u8); writer.WriteNumberValue(TimeToLive); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(SelectorState.ToString()); - writer.WritePropertyName("expirationTime"u8); - writer.WriteStringValue(ExpirationTime, "O"); + if (Optional.IsDefined(SelectorState)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(SelectorState.Value.ToString()); + } + if (Optional.IsDefined(ExpirationTime)) + { + writer.WritePropertyName("expirationTime"u8); + writer.WriteStringValue(ExpirationTime.Value, "O"); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -94,11 +103,11 @@ internal static AcsRouterWorkerSelector DeserializeAcsRouterWorkerSelector(JsonE return null; } string key = default; - AcsRouterLabelOperator labelOperator = default; + AcsRouterLabelOperator? labelOperator = default; BinaryData value = default; double ttlSeconds = default; - AcsRouterWorkerSelectorState state = default; - DateTimeOffset expirationTime = default; + AcsRouterWorkerSelectorState? state = default; + DateTimeOffset? expirationTime = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -110,6 +119,10 @@ internal static AcsRouterWorkerSelector DeserializeAcsRouterWorkerSelector(JsonE } if (property.NameEquals("labelOperator"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } labelOperator = new AcsRouterLabelOperator(property.Value.GetString()); continue; } @@ -125,11 +138,19 @@ internal static AcsRouterWorkerSelector DeserializeAcsRouterWorkerSelector(JsonE } if (property.NameEquals("state"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } state = new AcsRouterWorkerSelectorState(property.Value.GetString()); continue; } if (property.NameEquals("expirationTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } expirationTime = property.Value.GetDateTimeOffset("O"); continue; } 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 0de728036de4..fa8232506cbe 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelector.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelector.cs @@ -46,21 +46,15 @@ public partial class AcsRouterWorkerSelector private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// 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. /// is null. - internal AcsRouterWorkerSelector(AcsRouterLabelOperator labelOperator, BinaryData labelValue, double timeToLive, AcsRouterWorkerSelectorState selectorState, DateTimeOffset expirationTime) + internal AcsRouterWorkerSelector(BinaryData labelValue, double timeToLive) { Argument.AssertNotNull(labelValue, nameof(labelValue)); - LabelOperator = labelOperator; LabelValue = labelValue; TimeToLive = timeToLive; - SelectorState = selectorState; - ExpirationTime = expirationTime; } /// Initializes a new instance of . @@ -71,7 +65,7 @@ internal AcsRouterWorkerSelector(AcsRouterLabelOperator labelOperator, BinaryDat /// 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 labelOperator, BinaryData labelValue, double timeToLive, AcsRouterWorkerSelectorState selectorState, DateTimeOffset expirationTime, IDictionary serializedAdditionalRawData) + internal AcsRouterWorkerSelector(string key, AcsRouterLabelOperator? labelOperator, BinaryData labelValue, double timeToLive, AcsRouterWorkerSelectorState? selectorState, DateTimeOffset? expirationTime, IDictionary serializedAdditionalRawData) { Key = key; LabelOperator = labelOperator; @@ -90,7 +84,7 @@ internal AcsRouterWorkerSelector() /// Router Job Worker Selector Key. public string Key { get; } /// Router Job Worker Selector Label Operator. - public AcsRouterLabelOperator LabelOperator { get; } + public AcsRouterLabelOperator? LabelOperator { get; } /// /// Router Job Worker Selector Value /// @@ -125,8 +119,8 @@ internal AcsRouterWorkerSelector() /// Router Job Worker Selector Time to Live in Seconds. public double TimeToLive { get; } /// Router Job Worker Selector State. - public AcsRouterWorkerSelectorState SelectorState { get; } + public AcsRouterWorkerSelectorState? SelectorState { get; } /// Router Job Worker Selector Expiration Time. - public DateTimeOffset ExpirationTime { get; } + public DateTimeOffset? ExpirationTime { 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 b717e628d80f..c2d6a9178af7 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 @@ -34,8 +34,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(AcsSmsDeliveryAttemptProperties)} does not support writing '{format}' format."); } - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(SegmentsSucceeded)) { writer.WritePropertyName("segmentsSucceeded"u8); @@ -83,7 +86,7 @@ internal static AcsSmsDeliveryAttemptProperties DeserializeAcsSmsDeliveryAttempt { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; int? segmentsSucceeded = default; int? segmentsFailed = default; IDictionary serializedAdditionalRawData = default; @@ -92,6 +95,10 @@ internal static AcsSmsDeliveryAttemptProperties DeserializeAcsSmsDeliveryAttempt { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } 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 79cc8014347e..21453a993a3f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryAttemptProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryAttemptProperties.cs @@ -46,10 +46,8 @@ public partial class AcsSmsDeliveryAttemptProperties private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// TimeStamp when delivery was attempted. - internal AcsSmsDeliveryAttemptProperties(DateTimeOffset timestamp) + internal AcsSmsDeliveryAttemptProperties() { - Timestamp = timestamp; } /// Initializes a new instance of . @@ -57,7 +55,7 @@ internal AcsSmsDeliveryAttemptProperties(DateTimeOffset timestamp) /// 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) + internal AcsSmsDeliveryAttemptProperties(DateTimeOffset? timestamp, int? segmentsSucceeded, int? segmentsFailed, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; SegmentsSucceeded = segmentsSucceeded; @@ -65,13 +63,8 @@ internal AcsSmsDeliveryAttemptProperties(DateTimeOffset timestamp, int? segments _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal AcsSmsDeliveryAttemptProperties() - { - } - /// TimeStamp when delivery was attempted. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// Number of segments that were successfully delivered. public int? SegmentsSucceeded { get; } /// Number of segments whose delivery failed. 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 3daf4e3535c6..af9ec51948bc 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 @@ -52,8 +52,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("receivedTimestamp"u8); - writer.WriteStringValue(ReceivedTimestamp, "O"); + if (Optional.IsDefined(ReceivedTimestamp)) + { + writer.WritePropertyName("receivedTimestamp"u8); + writer.WriteStringValue(ReceivedTimestamp.Value, "O"); + } if (Optional.IsDefined(Tag)) { writer.WritePropertyName("tag"u8); @@ -84,7 +87,7 @@ internal static AcsSmsDeliveryReportReceivedEventData DeserializeAcsSmsDeliveryR string deliveryStatus = default; string deliveryStatusDetails = default; IReadOnlyList deliveryAttempts = default; - DateTimeOffset receivedTimestamp = default; + DateTimeOffset? receivedTimestamp = default; string tag = default; string messageId = default; string @from = default; @@ -115,6 +118,10 @@ internal static AcsSmsDeliveryReportReceivedEventData DeserializeAcsSmsDeliveryR } if (property.NameEquals("receivedTimestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } receivedTimestamp = property.Value.GetDateTimeOffset("O"); continue; } 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 3f14eeca621a..3e3649e9affe 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryReportReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryReportReceivedEventData.cs @@ -16,14 +16,12 @@ public partial class AcsSmsDeliveryReportReceivedEventData : AcsSmsEventBaseProp { /// Initializes a new instance of . /// List of details of delivery attempts made. - /// The time at which the SMS delivery report was received. /// is null. - internal AcsSmsDeliveryReportReceivedEventData(IEnumerable deliveryAttempts, DateTimeOffset receivedTimestamp) + internal AcsSmsDeliveryReportReceivedEventData(IEnumerable deliveryAttempts) { Argument.AssertNotNull(deliveryAttempts, nameof(deliveryAttempts)); DeliveryAttempts = deliveryAttempts.ToList(); - ReceivedTimestamp = receivedTimestamp; } /// Initializes a new instance of . @@ -36,7 +34,7 @@ internal AcsSmsDeliveryReportReceivedEventData(IEnumerable 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 serializedAdditionalRawData, string deliveryStatus, string deliveryStatusDetails, IReadOnlyList deliveryAttempts, DateTimeOffset? receivedTimestamp, string tag) : base(messageId, @from, to, serializedAdditionalRawData) { DeliveryStatus = deliveryStatus; DeliveryStatusDetails = deliveryStatusDetails; @@ -57,7 +55,7 @@ internal AcsSmsDeliveryReportReceivedEventData() /// 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; } + public DateTimeOffset? ReceivedTimestamp { get; } /// Customer Content. public string Tag { 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 0f08b2151d59..07d45c2ab1c7 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 @@ -40,8 +40,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("message"u8); writer.WriteStringValue(Message); } - writer.WritePropertyName("receivedTimestamp"u8); - writer.WriteStringValue(ReceivedTimestamp, "O"); + if (Optional.IsDefined(ReceivedTimestamp)) + { + writer.WritePropertyName("receivedTimestamp"u8); + writer.WriteStringValue(ReceivedTimestamp.Value, "O"); + } } AcsSmsReceivedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -65,7 +68,7 @@ internal static AcsSmsReceivedEventData DeserializeAcsSmsReceivedEventData(JsonE return null; } string message = default; - DateTimeOffset receivedTimestamp = default; + DateTimeOffset? receivedTimestamp = default; string messageId = default; string @from = default; string to = default; @@ -80,6 +83,10 @@ internal static AcsSmsReceivedEventData DeserializeAcsSmsReceivedEventData(JsonE } if (property.NameEquals("receivedTimestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } receivedTimestamp = property.Value.GetDateTimeOffset("O"); continue; } 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 75b7cdc072c2..3891a5e2fa73 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsReceivedEventData.cs @@ -14,10 +14,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsSmsReceivedEventData : AcsSmsEventBaseProperties { /// Initializes a new instance of . - /// The time at which the SMS was received. - internal AcsSmsReceivedEventData(DateTimeOffset receivedTimestamp) + internal AcsSmsReceivedEventData() { - ReceivedTimestamp = receivedTimestamp; } /// Initializes a new instance of . @@ -27,20 +25,15 @@ internal AcsSmsReceivedEventData(DateTimeOffset receivedTimestamp) /// Keeps track of any properties unknown to the library. /// The SMS content. /// The time at which the SMS was received. - internal AcsSmsReceivedEventData(string messageId, string @from, string to, IDictionary serializedAdditionalRawData, string message, DateTimeOffset receivedTimestamp) : base(messageId, @from, to, serializedAdditionalRawData) + internal AcsSmsReceivedEventData(string messageId, string @from, string to, IDictionary serializedAdditionalRawData, string message, DateTimeOffset? receivedTimestamp) : base(messageId, @from, to, serializedAdditionalRawData) { Message = message; ReceivedTimestamp = receivedTimestamp; } - /// 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; } + public DateTimeOffset? ReceivedTimestamp { get; } } } 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 800e8325ee3a..ba0469f3fa2e 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 @@ -34,18 +34,18 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ApiCenterApiDefinitionAddedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Title)) - { - writer.WritePropertyName("title"u8); - writer.WriteStringValue(Title); - } + writer.WritePropertyName("title"u8); + writer.WriteStringValue(Title); if (Optional.IsDefined(Description)) { writer.WritePropertyName("description"u8); writer.WriteStringValue(Description); } - writer.WritePropertyName("specification"u8); - writer.WriteObjectValue(Specification, options); + if (Optional.IsDefined(Specification)) + { + writer.WritePropertyName("specification"u8); + writer.WriteObjectValue(Specification, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -102,6 +102,10 @@ internal static ApiCenterApiDefinitionAddedEventData DeserializeApiCenterApiDefi } if (property.NameEquals("specification"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } specification = ApiCenterApiSpecification.DeserializeApiCenterApiSpecification(property.Value, options); continue; } 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 57570dd11c36..f5920be20c66 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiDefinitionAddedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiDefinitionAddedEventData.cs @@ -46,13 +46,13 @@ public partial class ApiCenterApiDefinitionAddedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// API definition specification. - /// is null. - internal ApiCenterApiDefinitionAddedEventData(ApiCenterApiSpecification specification) + /// API definition title. + /// is null. + internal ApiCenterApiDefinitionAddedEventData(string title) { - Argument.AssertNotNull(specification, nameof(specification)); + Argument.AssertNotNull(title, nameof(title)); - Specification = specification; + Title = title; } /// Initializes a new instance of . 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 67da914fdaef..7918fff15754 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 @@ -34,18 +34,18 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ApiCenterApiDefinitionUpdatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Title)) - { - writer.WritePropertyName("title"u8); - writer.WriteStringValue(Title); - } + writer.WritePropertyName("title"u8); + writer.WriteStringValue(Title); if (Optional.IsDefined(Description)) { writer.WritePropertyName("description"u8); writer.WriteStringValue(Description); } - writer.WritePropertyName("specification"u8); - writer.WriteObjectValue(Specification, options); + if (Optional.IsDefined(Specification)) + { + writer.WritePropertyName("specification"u8); + writer.WriteObjectValue(Specification, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -102,6 +102,10 @@ internal static ApiCenterApiDefinitionUpdatedEventData DeserializeApiCenterApiDe } if (property.NameEquals("specification"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } specification = ApiCenterApiSpecification.DeserializeApiCenterApiSpecification(property.Value, options); continue; } 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 cc06633b915f..86329b11c419 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiDefinitionUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiDefinitionUpdatedEventData.cs @@ -46,13 +46,13 @@ public partial class ApiCenterApiDefinitionUpdatedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// API definition specification. - /// is null. - internal ApiCenterApiDefinitionUpdatedEventData(ApiCenterApiSpecification specification) + /// API definition title. + /// is null. + internal ApiCenterApiDefinitionUpdatedEventData(string title) { - Argument.AssertNotNull(specification, nameof(specification)); + Argument.AssertNotNull(title, nameof(title)); - Specification = specification; + Title = title; } /// Initializes a new instance of . 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 795c1c8642f9..0e5905742ba1 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 @@ -34,11 +34,8 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ApiCenterApiSpecification)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); if (Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); 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 9e0f43020490..3e357444901a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiSpecification.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ApiCenterApiSpecification.cs @@ -46,8 +46,13 @@ public partial class ApiCenterApiSpecification private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal ApiCenterApiSpecification() + /// Specification name. + /// is null. + internal ApiCenterApiSpecification(string name) { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; } /// Initializes a new instance of . @@ -61,6 +66,11 @@ internal ApiCenterApiSpecification(string name, string version, IDictionary Initializes a new instance of for deserialization. + internal ApiCenterApiSpecification() + { + } + /// Specification name. public string Name { get; } /// Specification version. 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 fb9093c7757e..83b8a609ac6c 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 @@ -34,8 +34,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(AppEventTypeDetail)} does not support writing '{format}' format."); } - writer.WritePropertyName("action"u8); - writer.WriteStringValue(Action.ToString()); + if (Optional.IsDefined(Action)) + { + writer.WritePropertyName("action"u8); + writer.WriteStringValue(Action.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -73,13 +76,17 @@ internal static AppEventTypeDetail DeserializeAppEventTypeDetail(JsonElement ele { return null; } - AppAction action = default; + AppAction? action = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("action"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } action = new AppAction(property.Value.GetString()); continue; } 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 43550772de8f..236b12ab039c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppEventTypeDetail.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppEventTypeDetail.cs @@ -46,27 +46,20 @@ public partial class AppEventTypeDetail private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Type of action of the operation. - internal AppEventTypeDetail(AppAction action) + internal AppEventTypeDetail() { - Action = action; } /// 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) + internal AppEventTypeDetail(AppAction? action, IDictionary serializedAdditionalRawData) { Action = action; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal AppEventTypeDetail() - { - } - /// Type of action of the operation. - public AppAction Action { get; } + public AppAction? Action { get; } } } 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 af722568a779..1f5702657d47 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 @@ -34,12 +34,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(AppServicePlanEventTypeDetail)} does not support writing '{format}' format."); } - writer.WritePropertyName("stampKind"u8); - writer.WriteStringValue(StampKind.ToString()); - writer.WritePropertyName("action"u8); - writer.WriteStringValue(Action.ToString()); - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.ToString()); + if (Optional.IsDefined(StampKind)) + { + writer.WritePropertyName("stampKind"u8); + writer.WriteStringValue(StampKind.Value.ToString()); + } + if (Optional.IsDefined(Action)) + { + writer.WritePropertyName("action"u8); + writer.WriteStringValue(Action.Value.ToString()); + } + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -77,25 +86,37 @@ internal static AppServicePlanEventTypeDetail DeserializeAppServicePlanEventType { return null; } - StampKind stampKind = default; - AppServicePlanAction action = default; - AsyncStatus status = default; + StampKind? stampKind = default; + AppServicePlanAction? action = default; + AsyncStatus? status = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("stampKind"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } stampKind = new StampKind(property.Value.GetString()); continue; } if (property.NameEquals("action"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } action = new AppServicePlanAction(property.Value.GetString()); continue; } if (property.NameEquals("status"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } status = new AsyncStatus(property.Value.GetString()); continue; } 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 f4c61633045b..52cf7ca3592a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanEventTypeDetail.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanEventTypeDetail.cs @@ -46,14 +46,8 @@ public partial class AppServicePlanEventTypeDetail private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// 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. - internal AppServicePlanEventTypeDetail(StampKind stampKind, AppServicePlanAction action, AsyncStatus status) + internal AppServicePlanEventTypeDetail() { - StampKind = stampKind; - Action = action; - Status = status; } /// Initializes a new instance of . @@ -61,7 +55,7 @@ internal AppServicePlanEventTypeDetail(StampKind stampKind, AppServicePlanAction /// 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) + internal AppServicePlanEventTypeDetail(StampKind? stampKind, AppServicePlanAction? action, AsyncStatus? status, IDictionary serializedAdditionalRawData) { StampKind = stampKind; Action = action; @@ -69,16 +63,11 @@ internal AppServicePlanEventTypeDetail(StampKind stampKind, AppServicePlanAction _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal AppServicePlanEventTypeDetail() - { - } - /// Kind of environment where app service plan is. - public StampKind StampKind { get; } + public StampKind? StampKind { get; } /// Type of action on the app service plan. - public AppServicePlanAction Action { get; } + public AppServicePlanAction? Action { get; } /// Asynchronous operation status of the operation on the app service plan. - public AsyncStatus Status { get; } + public AsyncStatus? Status { get; } } } 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 46bc8cc4d87a..3bfe56d1ac5b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterCreatedEventData.cs @@ -14,8 +14,11 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AvsClusterCreatedEventData : AvsClusterEventData { /// Initializes a new instance of . - internal AvsClusterCreatedEventData() + /// 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 . @@ -27,5 +30,10 @@ internal AvsClusterCreatedEventData() 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() + { + } } } 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 9dc7f3790647..785c205d911b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterDeletedEventData.cs @@ -14,8 +14,11 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AvsClusterDeletedEventData : AvsClusterEventData { /// Initializes a new instance of . - internal AvsClusterDeletedEventData() + /// 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 . @@ -27,5 +30,10 @@ internal AvsClusterDeletedEventData() 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() + { + } } } 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 3b0b93de6011..5164e72eb188 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 @@ -34,11 +34,8 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(AvsClusterEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(OperationId)) - { - writer.WritePropertyName("operationId"u8); - writer.WriteStringValue(OperationId); - } + writer.WritePropertyName("operationId"u8); + writer.WriteStringValue(OperationId); if (Optional.IsCollectionDefined(AddedHostNames)) { writer.WritePropertyName("addedHostNames"u8); 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 4eef16191dbf..9bcbb7937d13 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterEventData.cs @@ -46,8 +46,13 @@ public partial class AvsClusterEventData private protected IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal AvsClusterEventData() + /// 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(); InMaintenanceHostNames = new ChangeTrackingList(); @@ -68,6 +73,11 @@ internal AvsClusterEventData(string operationId, IReadOnlyList addedHost _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal AvsClusterEventData() + { + } + /// Id of the operation that caused this event. public string OperationId { get; } /// Hosts added to the cluster in this event, if any. 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 35f0e1353db6..d1a51d6c905a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterFailedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterFailedEventData.cs @@ -14,8 +14,11 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AvsClusterFailedEventData : AvsClusterEventData { /// Initializes a new instance of . - internal AvsClusterFailedEventData() + /// 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 . @@ -30,6 +33,11 @@ internal AvsClusterFailedEventData(string operationId, IReadOnlyList add 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.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterUpdatedEventData.cs index 7ec6e28e0484..8c2a1e287b48 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterUpdatedEventData.cs @@ -14,8 +14,11 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AvsClusterUpdatedEventData : AvsClusterEventData { /// Initializes a new instance of . - internal AvsClusterUpdatedEventData() + /// 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 . @@ -27,5 +30,10 @@ internal AvsClusterUpdatedEventData() 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() + { + } } } 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 92b2529146e6..94e2a20e48e5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterUpdatingEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsClusterUpdatingEventData.cs @@ -14,8 +14,11 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AvsClusterUpdatingEventData : AvsClusterEventData { /// Initializes a new instance of . - internal AvsClusterUpdatingEventData() + /// 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 . @@ -27,5 +30,10 @@ internal AvsClusterUpdatingEventData() 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() + { + } } } 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 2e7a26a87921..15c33bc73eb1 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 @@ -34,11 +34,8 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(AvsPrivateCloudEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(OperationId)) - { - writer.WritePropertyName("operationId"u8); - writer.WriteStringValue(OperationId); - } + writer.WritePropertyName("operationId"u8); + writer.WriteStringValue(OperationId); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) 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 391917dfb4a6..34b79d5aa63c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudEventData.cs @@ -46,8 +46,13 @@ public partial class AvsPrivateCloudEventData private protected IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal AvsPrivateCloudEventData() + /// 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 . @@ -59,6 +64,11 @@ internal AvsPrivateCloudEventData(string operationId, IDictionary Initializes a new instance of for deserialization. + internal AvsPrivateCloudEventData() + { + } + /// Id of the operation that caused this event. public string OperationId { get; } } 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 58e2c3216b39..462c74752b07 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudFailedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudFailedEventData.cs @@ -14,8 +14,11 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AvsPrivateCloudFailedEventData : AvsPrivateCloudEventData { /// Initializes a new instance of . - internal AvsPrivateCloudFailedEventData() + /// 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 . @@ -27,6 +30,11 @@ internal AvsPrivateCloudFailedEventData(string operationId, IDictionary 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.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudUpdatedEventData.cs index 523ad0039dad..08700112d7a0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudUpdatedEventData.cs @@ -14,8 +14,11 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AvsPrivateCloudUpdatedEventData : AvsPrivateCloudEventData { /// Initializes a new instance of . - internal AvsPrivateCloudUpdatedEventData() + /// 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 . @@ -24,5 +27,10 @@ internal AvsPrivateCloudUpdatedEventData() internal AvsPrivateCloudUpdatedEventData(string operationId, IDictionary serializedAdditionalRawData) : base(operationId, serializedAdditionalRawData) { } + + /// Initializes a new instance of for deserialization. + internal AvsPrivateCloudUpdatedEventData() + { + } } } 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 d3bd82ababd3..160c3343a6cf 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudUpdatingEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsPrivateCloudUpdatingEventData.cs @@ -14,8 +14,11 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AvsPrivateCloudUpdatingEventData : AvsPrivateCloudEventData { /// Initializes a new instance of . - internal AvsPrivateCloudUpdatingEventData() + /// 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 . @@ -24,5 +27,10 @@ internal AvsPrivateCloudUpdatingEventData() internal AvsPrivateCloudUpdatingEventData(string operationId, IDictionary serializedAdditionalRawData) : base(operationId, serializedAdditionalRawData) { } + + /// Initializes a new instance of for deserialization. + internal AvsPrivateCloudUpdatingEventData() + { + } } } 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 0116ef430dee..c19de0780976 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionCancelledEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionCancelledEventData.cs @@ -14,8 +14,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AvsScriptExecutionCancelledEventData : AvsScriptExecutionEventData { /// Initializes a new instance of . - internal AvsScriptExecutionCancelledEventData() + /// 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 . @@ -26,5 +31,10 @@ internal AvsScriptExecutionCancelledEventData() internal AvsScriptExecutionCancelledEventData(string operationId, string cmdletId, IReadOnlyList output, IDictionary serializedAdditionalRawData) : base(operationId, cmdletId, output, serializedAdditionalRawData) { } + + /// Initializes a new instance of for deserialization. + internal AvsScriptExecutionCancelledEventData() + { + } } } 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 c22765b20104..06e9dd2ce5b6 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 @@ -34,16 +34,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(AvsScriptExecutionEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(OperationId)) - { - writer.WritePropertyName("operationId"u8); - writer.WriteStringValue(OperationId); - } - if (Optional.IsDefined(CmdletId)) - { - writer.WritePropertyName("cmdletId"u8); - writer.WriteStringValue(CmdletId); - } + writer.WritePropertyName("operationId"u8); + writer.WriteStringValue(OperationId); + writer.WritePropertyName("cmdletId"u8); + writer.WriteStringValue(CmdletId); if (Optional.IsCollectionDefined(Output)) { writer.WritePropertyName("output"u8); 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 d21ddf7920bf..90ddfcbfd12d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionEventData.cs @@ -46,8 +46,16 @@ public partial class AvsScriptExecutionEventData private protected IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal AvsScriptExecutionEventData() + /// 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(); } @@ -64,6 +72,11 @@ internal AvsScriptExecutionEventData(string operationId, string cmdletId, IReadO _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal AvsScriptExecutionEventData() + { + } + /// Id of the operation that caused this event. public string OperationId { get; } /// Cmdlet referenced in the execution that caused this event. 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 e5a135482869..c508a421bf97 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFailedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFailedEventData.cs @@ -14,8 +14,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AvsScriptExecutionFailedEventData : AvsScriptExecutionEventData { /// Initializes a new instance of . - internal AvsScriptExecutionFailedEventData() + /// 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 . @@ -29,6 +34,11 @@ internal AvsScriptExecutionFailedEventData(string operationId, string cmdletId, 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.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFinishedEventData.cs index 84f2fd9fd36a..caca8718ae2e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFinishedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionFinishedEventData.cs @@ -14,10 +14,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AvsScriptExecutionFinishedEventData : AvsScriptExecutionEventData { /// 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. - /// is null. - internal AvsScriptExecutionFinishedEventData(IReadOnlyDictionary namedOutputs) + /// , or is null. + internal AvsScriptExecutionFinishedEventData(string operationId, string cmdletId, IReadOnlyDictionary namedOutputs) : base(operationId, cmdletId) { + Argument.AssertNotNull(operationId, nameof(operationId)); + Argument.AssertNotNull(cmdletId, nameof(cmdletId)); Argument.AssertNotNull(namedOutputs, nameof(namedOutputs)); NamedOutputs = namedOutputs; 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 08424798e522..2f07a5a6a36a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionStartedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AvsScriptExecutionStartedEventData.cs @@ -14,8 +14,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AvsScriptExecutionStartedEventData : AvsScriptExecutionEventData { /// Initializes a new instance of . - internal AvsScriptExecutionStartedEventData() + /// 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 . @@ -26,5 +31,10 @@ internal AvsScriptExecutionStartedEventData() internal AvsScriptExecutionStartedEventData(string operationId, string cmdletId, IReadOnlyList output, IDictionary serializedAdditionalRawData) : base(operationId, cmdletId, output, serializedAdditionalRawData) { } + + /// Initializes a new instance of for deserialization. + internal AvsScriptExecutionStartedEventData() + { + } } } 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 cc557dfeed21..02b5d22bc485 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 @@ -34,8 +34,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(CommunicationIdentifierModel)} does not support writing '{format}' format."); } - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.Value.ToString()); + } if (Optional.IsDefined(RawId)) { writer.WritePropertyName("rawId"u8); @@ -86,7 +89,7 @@ internal static CommunicationIdentifierModel DeserializeCommunicationIdentifierM { return null; } - CommunicationIdentifierModelKind kind = default; + CommunicationIdentifierModelKind? kind = default; string rawId = default; CommunicationUserIdentifierModel communicationUser = default; PhoneNumberIdentifierModel phoneNumber = default; @@ -98,6 +101,10 @@ internal static CommunicationIdentifierModel DeserializeCommunicationIdentifierM { if (property.NameEquals("kind"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } kind = new CommunicationIdentifierModelKind(property.Value.GetString()); continue; } 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 391730bf3a99..00e7ea22dcd5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationIdentifierModel.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationIdentifierModel.cs @@ -46,20 +46,18 @@ public partial class CommunicationIdentifierModel private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The identifier kind. Only required in responses. /// The communication user. /// The phone number. /// The Microsoft Teams user. /// The Microsoft Teams application. /// , , or is null. - internal CommunicationIdentifierModel(CommunicationIdentifierModelKind kind, CommunicationUserIdentifierModel communicationUser, PhoneNumberIdentifierModel phoneNumber, MicrosoftTeamsUserIdentifierModel microsoftTeamsUser, MicrosoftTeamsAppIdentifierModel microsoftTeamsApp) + internal CommunicationIdentifierModel(CommunicationUserIdentifierModel communicationUser, PhoneNumberIdentifierModel phoneNumber, MicrosoftTeamsUserIdentifierModel microsoftTeamsUser, MicrosoftTeamsAppIdentifierModel microsoftTeamsApp) { Argument.AssertNotNull(communicationUser, nameof(communicationUser)); Argument.AssertNotNull(phoneNumber, nameof(phoneNumber)); Argument.AssertNotNull(microsoftTeamsUser, nameof(microsoftTeamsUser)); Argument.AssertNotNull(microsoftTeamsApp, nameof(microsoftTeamsApp)); - Kind = kind; CommunicationUser = communicationUser; PhoneNumber = phoneNumber; MicrosoftTeamsUser = microsoftTeamsUser; @@ -74,7 +72,7 @@ internal CommunicationIdentifierModel(CommunicationIdentifierModelKind kind, Com /// The Microsoft Teams user. /// The Microsoft Teams application. /// Keeps track of any properties unknown to the library. - internal CommunicationIdentifierModel(CommunicationIdentifierModelKind kind, string rawId, CommunicationUserIdentifierModel communicationUser, PhoneNumberIdentifierModel phoneNumber, MicrosoftTeamsUserIdentifierModel microsoftTeamsUser, MicrosoftTeamsAppIdentifierModel microsoftTeamsApp, IDictionary serializedAdditionalRawData) + internal CommunicationIdentifierModel(CommunicationIdentifierModelKind? kind, string rawId, CommunicationUserIdentifierModel communicationUser, PhoneNumberIdentifierModel phoneNumber, MicrosoftTeamsUserIdentifierModel microsoftTeamsUser, MicrosoftTeamsAppIdentifierModel microsoftTeamsApp, IDictionary serializedAdditionalRawData) { Kind = kind; RawId = rawId; @@ -91,7 +89,7 @@ internal CommunicationIdentifierModel() } /// The identifier kind. Only required in responses. - public CommunicationIdentifierModelKind Kind { get; } + public CommunicationIdentifierModelKind? Kind { get; } /// Raw Id of the identifier. Optional in requests, required in responses. public string RawId { get; } /// 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 9c0c10f7ce8b..0de61693f354 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 @@ -34,27 +34,24 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ContainerRegistryArtifactEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Id)) + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + if (Optional.IsDefined(Timestamp)) { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); - if (Optional.IsDefined(Action)) - { - writer.WritePropertyName("action"u8); - writer.WriteStringValue(Action); - } - if (Optional.IsDefined(Location)) - { - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); } + writer.WritePropertyName("action"u8); + writer.WriteStringValue(Action); + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); writer.WritePropertyName("target"u8); writer.WriteObjectValue(Target, options); - writer.WritePropertyName("connectedRegistry"u8); - writer.WriteObjectValue(ConnectedRegistry, options); + if (Optional.IsDefined(ConnectedRegistry)) + { + writer.WritePropertyName("connectedRegistry"u8); + writer.WriteObjectValue(ConnectedRegistry, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -93,7 +90,7 @@ internal static ContainerRegistryArtifactEventData DeserializeContainerRegistryA return null; } string id = default; - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string action = default; string location = default; ContainerRegistryArtifactEventTarget target = default; @@ -109,6 +106,10 @@ internal static ContainerRegistryArtifactEventData DeserializeContainerRegistryA } if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } @@ -129,6 +130,10 @@ internal static ContainerRegistryArtifactEventData DeserializeContainerRegistryA } if (property.NameEquals("connectedRegistry"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } connectedRegistry = ContainerRegistryEventConnectedRegistry.DeserializeContainerRegistryEventConnectedRegistry(property.Value, options); continue; } 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 9fb1972e3d56..ae8dced1073a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventData.cs @@ -46,18 +46,22 @@ public partial class ContainerRegistryArtifactEventData private protected IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which the event occurred. + /// The event ID. + /// The action that encompasses the provided event. + /// The location of the event. /// The target of the event. - /// The connected registry information if the event is generated by a connected registry. - /// or is null. - internal ContainerRegistryArtifactEventData(DateTimeOffset timestamp, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry) + /// , , 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)); - Argument.AssertNotNull(connectedRegistry, nameof(connectedRegistry)); - Timestamp = timestamp; + Id = id; + Action = action; + Location = location; Target = target; - ConnectedRegistry = connectedRegistry; } /// Initializes a new instance of . @@ -68,7 +72,7 @@ internal ContainerRegistryArtifactEventData(DateTimeOffset timestamp, ContainerR /// 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) + internal ContainerRegistryArtifactEventData(string id, DateTimeOffset? timestamp, string action, string location, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) { Id = id; Timestamp = timestamp; @@ -87,7 +91,7 @@ internal ContainerRegistryArtifactEventData() /// The event ID. public string Id { get; } /// The time at which the event occurred. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The action that encompasses the provided event. public string Action { get; } /// The location of the event. 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 a34f0291630d..fbb31f7131e4 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 @@ -34,11 +34,8 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ContainerRegistryArtifactEventTarget)} does not support writing '{format}' format."); } - if (Optional.IsDefined(MediaType)) - { - writer.WritePropertyName("mediaType"u8); - writer.WriteStringValue(MediaType); - } + writer.WritePropertyName("mediaType"u8); + writer.WriteStringValue(MediaType); if (Optional.IsDefined(Size)) { writer.WritePropertyName("size"u8); @@ -49,11 +46,8 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("digest"u8); writer.WriteStringValue(Digest); } - if (Optional.IsDefined(Repository)) - { - writer.WritePropertyName("repository"u8); - writer.WriteStringValue(Repository); - } + writer.WritePropertyName("repository"u8); + writer.WriteStringValue(Repository); if (Optional.IsDefined(Tag)) { writer.WritePropertyName("tag"u8); 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 a0b3692c64ba..c33a1758babc 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventTarget.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventTarget.cs @@ -46,8 +46,16 @@ public partial class ContainerRegistryArtifactEventTarget private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal ContainerRegistryArtifactEventTarget() + /// 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; } /// Initializes a new instance of . @@ -71,6 +79,11 @@ internal ContainerRegistryArtifactEventTarget(string mediaType, long? size, stri _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal ContainerRegistryArtifactEventTarget() + { + } + /// The MIME type of the artifact. public string MediaType { get; } /// The size in bytes of the artifact. 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 e10e1f4b30e6..d473908f204c 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 @@ -58,7 +58,7 @@ internal static ContainerRegistryChartDeletedEventData DeserializeContainerRegis return null; } string id = default; - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string action = default; string location = default; ContainerRegistryArtifactEventTarget target = default; @@ -74,6 +74,10 @@ internal static ContainerRegistryChartDeletedEventData DeserializeContainerRegis } if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } @@ -94,6 +98,10 @@ internal static ContainerRegistryChartDeletedEventData DeserializeContainerRegis } if (property.NameEquals("connectedRegistry"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } connectedRegistry = ContainerRegistryEventConnectedRegistry.DeserializeContainerRegistryEventConnectedRegistry(property.Value, options); continue; } 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 c51cacba09e9..8cf7aa2797a8 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartDeletedEventData.cs @@ -14,14 +14,17 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class ContainerRegistryChartDeletedEventData : ContainerRegistryArtifactEventData { /// Initializes a new instance of . - /// The time at which the event occurred. + /// The event ID. + /// The action that encompasses the provided event. + /// The location of the event. /// The target of the event. - /// The connected registry information if the event is generated by a connected registry. - /// or is null. - internal ContainerRegistryChartDeletedEventData(DateTimeOffset timestamp, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry) : base(timestamp, target, connectedRegistry) + /// , , 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)); - Argument.AssertNotNull(connectedRegistry, nameof(connectedRegistry)); } /// Initializes a new instance of . @@ -32,7 +35,7 @@ internal ContainerRegistryChartDeletedEventData(DateTimeOffset timestamp, Contai /// 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) + internal ContainerRegistryChartDeletedEventData(string id, DateTimeOffset? timestamp, string action, string location, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) : base(id, timestamp, action, location, target, connectedRegistry, serializedAdditionalRawData) { } 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 6e292e2bd1fd..7a8c41bb194a 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 @@ -58,7 +58,7 @@ internal static ContainerRegistryChartPushedEventData DeserializeContainerRegist return null; } string id = default; - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string action = default; string location = default; ContainerRegistryArtifactEventTarget target = default; @@ -74,6 +74,10 @@ internal static ContainerRegistryChartPushedEventData DeserializeContainerRegist } if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } @@ -94,6 +98,10 @@ internal static ContainerRegistryChartPushedEventData DeserializeContainerRegist } if (property.NameEquals("connectedRegistry"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } connectedRegistry = ContainerRegistryEventConnectedRegistry.DeserializeContainerRegistryEventConnectedRegistry(property.Value, options); continue; } 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 1e05ff576eac..ca4482c21288 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartPushedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartPushedEventData.cs @@ -14,14 +14,17 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class ContainerRegistryChartPushedEventData : ContainerRegistryArtifactEventData { /// Initializes a new instance of . - /// The time at which the event occurred. + /// The event ID. + /// The action that encompasses the provided event. + /// The location of the event. /// The target of the event. - /// The connected registry information if the event is generated by a connected registry. - /// or is null. - internal ContainerRegistryChartPushedEventData(DateTimeOffset timestamp, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry) : base(timestamp, target, connectedRegistry) + /// , , 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)); - Argument.AssertNotNull(connectedRegistry, nameof(connectedRegistry)); } /// Initializes a new instance of . @@ -32,7 +35,7 @@ internal ContainerRegistryChartPushedEventData(DateTimeOffset timestamp, Contain /// 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) + internal ContainerRegistryChartPushedEventData(string id, DateTimeOffset? timestamp, string action, string location, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) : base(id, timestamp, action, location, target, connectedRegistry, serializedAdditionalRawData) { } 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 b28bb98afa41..d43adc3663fe 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 @@ -34,11 +34,8 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ContainerRegistryEventConnectedRegistry)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) 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 60e9c7295966..e39009f58d84 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventConnectedRegistry.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventConnectedRegistry.cs @@ -46,8 +46,13 @@ public partial class ContainerRegistryEventConnectedRegistry private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal ContainerRegistryEventConnectedRegistry() + /// 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 . @@ -59,6 +64,11 @@ internal ContainerRegistryEventConnectedRegistry(string name, IDictionary Initializes a new instance of for deserialization. + internal ContainerRegistryEventConnectedRegistry() + { + } + /// The name of the connected registry that generated this event. public string Name { get; } } 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 e9f801089099..433a48ce116e 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 @@ -34,33 +34,39 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ContainerRegistryEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Id)) + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + if (Optional.IsDefined(Timestamp)) { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); } - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); - if (Optional.IsDefined(Action)) + writer.WritePropertyName("action"u8); + writer.WriteStringValue(Action); + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + writer.WritePropertyName("target"u8); + writer.WriteObjectValue(Target, options); + if (Optional.IsDefined(Request)) { - writer.WritePropertyName("action"u8); - writer.WriteStringValue(Action); + writer.WritePropertyName("request"u8); + writer.WriteObjectValue(Request, options); } - if (Optional.IsDefined(Location)) + if (Optional.IsDefined(Actor)) { - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); + writer.WritePropertyName("actor"u8); + writer.WriteObjectValue(Actor, options); + } + if (Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteObjectValue(Source, options); + } + if (Optional.IsDefined(ConnectedRegistry)) + { + writer.WritePropertyName("connectedRegistry"u8); + writer.WriteObjectValue(ConnectedRegistry, options); } - writer.WritePropertyName("target"u8); - writer.WriteObjectValue(Target, options); - writer.WritePropertyName("request"u8); - writer.WriteObjectValue(Request, options); - writer.WritePropertyName("actor"u8); - writer.WriteObjectValue(Actor, options); - writer.WritePropertyName("source"u8); - writer.WriteObjectValue(Source, options); - writer.WritePropertyName("connectedRegistry"u8); - writer.WriteObjectValue(ConnectedRegistry, options); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -99,7 +105,7 @@ internal static ContainerRegistryEventData DeserializeContainerRegistryEventData return null; } string id = default; - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string action = default; string location = default; ContainerRegistryEventTarget target = default; @@ -118,6 +124,10 @@ internal static ContainerRegistryEventData DeserializeContainerRegistryEventData } if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } @@ -138,21 +148,37 @@ internal static ContainerRegistryEventData DeserializeContainerRegistryEventData } if (property.NameEquals("request"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } request = ContainerRegistryEventRequest.DeserializeContainerRegistryEventRequest(property.Value, options); continue; } if (property.NameEquals("actor"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } actor = ContainerRegistryEventActor.DeserializeContainerRegistryEventActor(property.Value, options); continue; } if (property.NameEquals("source"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } source = ContainerRegistryEventSource.DeserializeContainerRegistryEventSource(property.Value, options); continue; } if (property.NameEquals("connectedRegistry"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } connectedRegistry = ContainerRegistryEventConnectedRegistry.DeserializeContainerRegistryEventConnectedRegistry(property.Value, options); continue; } 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 6f9e05701bed..c576dad7a791 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventData.cs @@ -46,27 +46,22 @@ public partial class ContainerRegistryEventData private protected IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which the event occurred. + /// The event ID. + /// The action that encompasses the provided event. + /// The location of the event. /// The target of the event. - /// The request that generated the event. - /// 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. - /// , , , or is null. - internal ContainerRegistryEventData(DateTimeOffset timestamp, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry) + /// , , 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)); - Argument.AssertNotNull(request, nameof(request)); - Argument.AssertNotNull(actor, nameof(actor)); - Argument.AssertNotNull(source, nameof(source)); - Argument.AssertNotNull(connectedRegistry, nameof(connectedRegistry)); - Timestamp = timestamp; + Id = id; + Action = action; + Location = location; Target = target; - Request = request; - Actor = actor; - Source = source; - ConnectedRegistry = connectedRegistry; } /// Initializes a new instance of . @@ -80,7 +75,7 @@ internal ContainerRegistryEventData(DateTimeOffset timestamp, ContainerRegistryE /// 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) + internal ContainerRegistryEventData(string id, DateTimeOffset? timestamp, string action, string location, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) { Id = id; Timestamp = timestamp; @@ -102,7 +97,7 @@ internal ContainerRegistryEventData() /// The event ID. public string Id { get; } /// The time at which the event occurred. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The action that encompasses the provided event. public string Action { get; } /// The location of the event. 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 f1d8f38ecf9f..e2216bc68624 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 @@ -34,26 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ContainerRegistryEventRequest)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); if (Optional.IsDefined(Addr)) { writer.WritePropertyName("addr"u8); writer.WriteStringValue(Addr); } - if (Optional.IsDefined(Host)) - { - writer.WritePropertyName("host"u8); - writer.WriteStringValue(Host); - } - if (Optional.IsDefined(Method)) - { - writer.WritePropertyName("method"u8); - writer.WriteStringValue(Method); - } + writer.WritePropertyName("host"u8); + writer.WriteStringValue(Host); + writer.WritePropertyName("method"u8); + writer.WriteStringValue(Method); if (Optional.IsDefined(Useragent)) { writer.WritePropertyName("useragent"u8); 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 c53cd2d48a7c..96ca17beee49 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventRequest.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventRequest.cs @@ -46,8 +46,19 @@ public partial class ContainerRegistryEventRequest private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal ContainerRegistryEventRequest() + /// 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) { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(host, nameof(host)); + Argument.AssertNotNull(method, nameof(method)); + + Id = id; + Host = host; + Method = method; } /// Initializes a new instance of . @@ -67,6 +78,11 @@ internal ContainerRegistryEventRequest(string id, string addr, string host, stri _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal ContainerRegistryEventRequest() + { + } + /// 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. 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 b04cd91daf5b..c8ffd31bc848 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 @@ -34,11 +34,8 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ContainerRegistryEventTarget)} does not support writing '{format}' format."); } - if (Optional.IsDefined(MediaType)) - { - writer.WritePropertyName("mediaType"u8); - writer.WriteStringValue(MediaType); - } + writer.WritePropertyName("mediaType"u8); + writer.WriteStringValue(MediaType); if (Optional.IsDefined(Size)) { writer.WritePropertyName("size"u8); @@ -54,11 +51,8 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("length"u8); writer.WriteNumberValue(Length.Value); } - if (Optional.IsDefined(Repository)) - { - writer.WritePropertyName("repository"u8); - writer.WriteStringValue(Repository); - } + writer.WritePropertyName("repository"u8); + writer.WriteStringValue(Repository); if (Optional.IsDefined(Url)) { writer.WritePropertyName("url"u8); 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 1494dff1e4ff..c7d5aecf612a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventTarget.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventTarget.cs @@ -46,8 +46,16 @@ public partial class ContainerRegistryEventTarget private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal ContainerRegistryEventTarget() + /// 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; } /// Initializes a new instance of . @@ -71,6 +79,11 @@ internal ContainerRegistryEventTarget(string mediaType, long? size, string diges _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal ContainerRegistryEventTarget() + { + } + /// The MIME type of the referenced object. public string MediaType { get; } /// The number of bytes of the content. Same as Length field. 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 2317c3678deb..7c757a8b1acf 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 @@ -58,7 +58,7 @@ internal static ContainerRegistryImageDeletedEventData DeserializeContainerRegis return null; } string id = default; - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string action = default; string location = default; ContainerRegistryEventTarget target = default; @@ -77,6 +77,10 @@ internal static ContainerRegistryImageDeletedEventData DeserializeContainerRegis } if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } @@ -97,21 +101,37 @@ internal static ContainerRegistryImageDeletedEventData DeserializeContainerRegis } if (property.NameEquals("request"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } request = ContainerRegistryEventRequest.DeserializeContainerRegistryEventRequest(property.Value, options); continue; } if (property.NameEquals("actor"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } actor = ContainerRegistryEventActor.DeserializeContainerRegistryEventActor(property.Value, options); continue; } if (property.NameEquals("source"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } source = ContainerRegistryEventSource.DeserializeContainerRegistryEventSource(property.Value, options); continue; } if (property.NameEquals("connectedRegistry"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } connectedRegistry = ContainerRegistryEventConnectedRegistry.DeserializeContainerRegistryEventConnectedRegistry(property.Value, options); continue; } 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 c839e9590b91..eaee919d7c56 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImageDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImageDeletedEventData.cs @@ -14,20 +14,17 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class ContainerRegistryImageDeletedEventData : ContainerRegistryEventData { /// Initializes a new instance of . - /// The time at which the event occurred. + /// The event ID. + /// The action that encompasses the provided event. + /// The location of the event. /// The target of the event. - /// The request that generated the event. - /// 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. - /// , , , or is null. - internal ContainerRegistryImageDeletedEventData(DateTimeOffset timestamp, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry) : base(timestamp, target, request, actor, source, connectedRegistry) + /// , , 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)); - Argument.AssertNotNull(request, nameof(request)); - Argument.AssertNotNull(actor, nameof(actor)); - Argument.AssertNotNull(source, nameof(source)); - Argument.AssertNotNull(connectedRegistry, nameof(connectedRegistry)); } /// Initializes a new instance of . @@ -41,7 +38,7 @@ internal ContainerRegistryImageDeletedEventData(DateTimeOffset timestamp, Contai /// 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) + 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) { } 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 99f3256056db..a4005700d684 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 @@ -58,7 +58,7 @@ internal static ContainerRegistryImagePushedEventData DeserializeContainerRegist return null; } string id = default; - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string action = default; string location = default; ContainerRegistryEventTarget target = default; @@ -77,6 +77,10 @@ internal static ContainerRegistryImagePushedEventData DeserializeContainerRegist } if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } @@ -97,21 +101,37 @@ internal static ContainerRegistryImagePushedEventData DeserializeContainerRegist } if (property.NameEquals("request"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } request = ContainerRegistryEventRequest.DeserializeContainerRegistryEventRequest(property.Value, options); continue; } if (property.NameEquals("actor"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } actor = ContainerRegistryEventActor.DeserializeContainerRegistryEventActor(property.Value, options); continue; } if (property.NameEquals("source"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } source = ContainerRegistryEventSource.DeserializeContainerRegistryEventSource(property.Value, options); continue; } if (property.NameEquals("connectedRegistry"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } connectedRegistry = ContainerRegistryEventConnectedRegistry.DeserializeContainerRegistryEventConnectedRegistry(property.Value, options); continue; } 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 32fbf481e6df..fc790eefe615 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImagePushedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImagePushedEventData.cs @@ -14,20 +14,17 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class ContainerRegistryImagePushedEventData : ContainerRegistryEventData { /// Initializes a new instance of . - /// The time at which the event occurred. + /// The event ID. + /// The action that encompasses the provided event. + /// The location of the event. /// The target of the event. - /// The request that generated the event. - /// 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. - /// , , , or is null. - internal ContainerRegistryImagePushedEventData(DateTimeOffset timestamp, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry) : base(timestamp, target, request, actor, source, connectedRegistry) + /// , , 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)); - Argument.AssertNotNull(request, nameof(request)); - Argument.AssertNotNull(actor, nameof(actor)); - Argument.AssertNotNull(source, nameof(source)); - Argument.AssertNotNull(connectedRegistry, nameof(connectedRegistry)); } /// Initializes a new instance of . @@ -41,7 +38,7 @@ internal ContainerRegistryImagePushedEventData(DateTimeOffset timestamp, Contain /// 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) + 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) { } 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 48825fb0fed9..6e078081a1a8 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 @@ -34,15 +34,18 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(DataBoxCopyCompletedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(SerialNumber)) + writer.WritePropertyName("serialNumber"u8); + writer.WriteStringValue(SerialNumber); + if (Optional.IsDefined(StageName)) { - writer.WritePropertyName("serialNumber"u8); - writer.WriteStringValue(SerialNumber); + writer.WritePropertyName("stageName"u8); + writer.WriteStringValue(StageName.Value.ToString()); + } + if (Optional.IsDefined(StageTime)) + { + writer.WritePropertyName("stageTime"u8); + writer.WriteStringValue(StageTime.Value, "O"); } - writer.WritePropertyName("stageName"u8); - writer.WriteStringValue(StageName.ToString()); - writer.WritePropertyName("stageTime"u8); - writer.WriteStringValue(StageTime, "O"); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -81,8 +84,8 @@ internal static DataBoxCopyCompletedEventData DeserializeDataBoxCopyCompletedEve return null; } string serialNumber = default; - DataBoxStageName stageName = default; - DateTimeOffset stageTime = default; + DataBoxStageName? stageName = default; + DateTimeOffset? stageTime = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -94,11 +97,19 @@ internal static DataBoxCopyCompletedEventData DeserializeDataBoxCopyCompletedEve } if (property.NameEquals("stageName"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } stageName = new DataBoxStageName(property.Value.GetString()); continue; } if (property.NameEquals("stageTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } stageTime = property.Value.GetDateTimeOffset("O"); continue; } 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 75a73c0475e9..c894a2bb1bc9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyCompletedEventData.cs @@ -46,12 +46,13 @@ public partial class DataBoxCopyCompletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Name of the current Stage. - /// The time at which the stage happened. - internal DataBoxCopyCompletedEventData(DataBoxStageName stageName, DateTimeOffset stageTime) + /// 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) { - StageName = stageName; - StageTime = stageTime; + Argument.AssertNotNull(serialNumber, nameof(serialNumber)); + + SerialNumber = serialNumber; } /// Initializes a new instance of . @@ -59,7 +60,7 @@ internal DataBoxCopyCompletedEventData(DataBoxStageName stageName, DateTimeOffse /// 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) + internal DataBoxCopyCompletedEventData(string serialNumber, DataBoxStageName? stageName, DateTimeOffset? stageTime, IDictionary serializedAdditionalRawData) { SerialNumber = serialNumber; StageName = stageName; @@ -75,8 +76,8 @@ internal DataBoxCopyCompletedEventData() /// 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; } + public DataBoxStageName? StageName { get; } /// The time at which the stage happened. - public DateTimeOffset StageTime { get; } + 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 e0603dee3265..2e0f8ce7063f 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 @@ -34,15 +34,18 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(DataBoxCopyStartedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(SerialNumber)) + writer.WritePropertyName("serialNumber"u8); + writer.WriteStringValue(SerialNumber); + if (Optional.IsDefined(StageName)) { - writer.WritePropertyName("serialNumber"u8); - writer.WriteStringValue(SerialNumber); + writer.WritePropertyName("stageName"u8); + writer.WriteStringValue(StageName.Value.ToString()); + } + if (Optional.IsDefined(StageTime)) + { + writer.WritePropertyName("stageTime"u8); + writer.WriteStringValue(StageTime.Value, "O"); } - writer.WritePropertyName("stageName"u8); - writer.WriteStringValue(StageName.ToString()); - writer.WritePropertyName("stageTime"u8); - writer.WriteStringValue(StageTime, "O"); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -81,8 +84,8 @@ internal static DataBoxCopyStartedEventData DeserializeDataBoxCopyStartedEventDa return null; } string serialNumber = default; - DataBoxStageName stageName = default; - DateTimeOffset stageTime = default; + DataBoxStageName? stageName = default; + DateTimeOffset? stageTime = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -94,11 +97,19 @@ internal static DataBoxCopyStartedEventData DeserializeDataBoxCopyStartedEventDa } if (property.NameEquals("stageName"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } stageName = new DataBoxStageName(property.Value.GetString()); continue; } if (property.NameEquals("stageTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } stageTime = property.Value.GetDateTimeOffset("O"); continue; } 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 2c607fcec991..13592291ba61 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyStartedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyStartedEventData.cs @@ -46,12 +46,13 @@ public partial class DataBoxCopyStartedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Name of the current Stage. - /// The time at which the stage happened. - internal DataBoxCopyStartedEventData(DataBoxStageName stageName, DateTimeOffset stageTime) + /// 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) { - StageName = stageName; - StageTime = stageTime; + Argument.AssertNotNull(serialNumber, nameof(serialNumber)); + + SerialNumber = serialNumber; } /// Initializes a new instance of . @@ -59,7 +60,7 @@ internal DataBoxCopyStartedEventData(DataBoxStageName stageName, DateTimeOffset /// 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) + internal DataBoxCopyStartedEventData(string serialNumber, DataBoxStageName? stageName, DateTimeOffset? stageTime, IDictionary serializedAdditionalRawData) { SerialNumber = serialNumber; StageName = stageName; @@ -75,8 +76,8 @@ internal DataBoxCopyStartedEventData() /// 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; } + public DataBoxStageName? StageName { get; } /// The time at which the stage happened. - public DateTimeOffset StageTime { get; } + 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 036c53c1f5ca..828c44871f30 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 @@ -34,15 +34,18 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(DataBoxOrderCompletedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(SerialNumber)) + writer.WritePropertyName("serialNumber"u8); + writer.WriteStringValue(SerialNumber); + if (Optional.IsDefined(StageName)) { - writer.WritePropertyName("serialNumber"u8); - writer.WriteStringValue(SerialNumber); + writer.WritePropertyName("stageName"u8); + writer.WriteStringValue(StageName.Value.ToString()); + } + if (Optional.IsDefined(StageTime)) + { + writer.WritePropertyName("stageTime"u8); + writer.WriteStringValue(StageTime.Value, "O"); } - writer.WritePropertyName("stageName"u8); - writer.WriteStringValue(StageName.ToString()); - writer.WritePropertyName("stageTime"u8); - writer.WriteStringValue(StageTime, "O"); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -81,8 +84,8 @@ internal static DataBoxOrderCompletedEventData DeserializeDataBoxOrderCompletedE return null; } string serialNumber = default; - DataBoxStageName stageName = default; - DateTimeOffset stageTime = default; + DataBoxStageName? stageName = default; + DateTimeOffset? stageTime = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -94,11 +97,19 @@ internal static DataBoxOrderCompletedEventData DeserializeDataBoxOrderCompletedE } if (property.NameEquals("stageName"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } stageName = new DataBoxStageName(property.Value.GetString()); continue; } if (property.NameEquals("stageTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } stageTime = property.Value.GetDateTimeOffset("O"); continue; } 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 b610d5819b26..a2887e55cc49 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxOrderCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxOrderCompletedEventData.cs @@ -46,12 +46,13 @@ public partial class DataBoxOrderCompletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Name of the current Stage. - /// The time at which the stage happened. - internal DataBoxOrderCompletedEventData(DataBoxStageName stageName, DateTimeOffset stageTime) + /// 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) { - StageName = stageName; - StageTime = stageTime; + Argument.AssertNotNull(serialNumber, nameof(serialNumber)); + + SerialNumber = serialNumber; } /// Initializes a new instance of . @@ -59,7 +60,7 @@ internal DataBoxOrderCompletedEventData(DataBoxStageName stageName, DateTimeOffs /// 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) + internal DataBoxOrderCompletedEventData(string serialNumber, DataBoxStageName? stageName, DateTimeOffset? stageTime, IDictionary serializedAdditionalRawData) { SerialNumber = serialNumber; StageName = stageName; @@ -75,8 +76,8 @@ internal DataBoxOrderCompletedEventData() /// 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; } + public DataBoxStageName? StageName { get; } /// The time at which the stage happened. - public DateTimeOffset StageTime { get; } + public DateTimeOffset? StageTime { get; } } } 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 e5f7910703dc..bf902cc3055e 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 @@ -34,11 +34,8 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(DeviceConnectionStateEventInfo)} does not support writing '{format}' format."); } - if (Optional.IsDefined(SequenceNumber)) - { - writer.WritePropertyName("sequenceNumber"u8); - writer.WriteStringValue(SequenceNumber); - } + writer.WritePropertyName("sequenceNumber"u8); + writer.WriteStringValue(SequenceNumber); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) 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 215ec30e9369..94f66c88bade 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceConnectionStateEventInfo.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceConnectionStateEventInfo.cs @@ -46,8 +46,13 @@ public partial class DeviceConnectionStateEventInfo private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal DeviceConnectionStateEventInfo() + /// 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 . @@ -59,6 +64,11 @@ internal DeviceConnectionStateEventInfo(string sequenceNumber, IDictionary Initializes a new instance of for deserialization. + internal DeviceConnectionStateEventInfo() + { + } + /// 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. public string SequenceNumber { get; } } 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 f281e719035a..b0ec0a9a35e8 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 @@ -34,21 +34,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(DeviceConnectionStateEventProperties)} does not support writing '{format}' format."); } - if (Optional.IsDefined(DeviceId)) - { - writer.WritePropertyName("deviceId"u8); - writer.WriteStringValue(DeviceId); - } + writer.WritePropertyName("deviceId"u8); + writer.WriteStringValue(DeviceId); if (Optional.IsDefined(ModuleId)) { writer.WritePropertyName("moduleId"u8); writer.WriteStringValue(ModuleId); } - if (Optional.IsDefined(HubName)) - { - writer.WritePropertyName("hubName"u8); - writer.WriteStringValue(HubName); - } + writer.WritePropertyName("hubName"u8); + writer.WriteStringValue(HubName); writer.WritePropertyName("deviceConnectionStateEventInfo"u8); writer.WriteObjectValue(DeviceConnectionStateEventInfo, options); if (options.Format != "W" && _serializedAdditionalRawData != null) 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 d271d4d44c8c..ec2dc0697b9f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceConnectionStateEventProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceConnectionStateEventProperties.cs @@ -46,12 +46,18 @@ public partial class DeviceConnectionStateEventProperties private protected IDictionary _serializedAdditionalRawData; /// 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. - /// is null. - internal DeviceConnectionStateEventProperties(DeviceConnectionStateEventInfo deviceConnectionStateEventInfo) + /// , 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; } 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 067326794b32..2a8313261233 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 @@ -34,16 +34,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(DeviceLifeCycleEventProperties)} does not support writing '{format}' format."); } - if (Optional.IsDefined(DeviceId)) - { - writer.WritePropertyName("deviceId"u8); - writer.WriteStringValue(DeviceId); - } - if (Optional.IsDefined(HubName)) - { - writer.WritePropertyName("hubName"u8); - writer.WriteStringValue(HubName); - } + 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) 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 cb931023ce50..3991030cc4f6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceLifeCycleEventProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceLifeCycleEventProperties.cs @@ -46,12 +46,18 @@ public partial class DeviceLifeCycleEventProperties private protected IDictionary _serializedAdditionalRawData; /// 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. - /// is null. - internal DeviceLifeCycleEventProperties(DeviceTwinInfo twin) + /// , 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; } 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 e5d3ab3d59e6..9b6d3cb453ba 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 @@ -34,48 +34,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(DeviceTwinInfo)} does not support writing '{format}' format."); } - if (Optional.IsDefined(AuthenticationType)) - { - writer.WritePropertyName("authenticationType"u8); - writer.WriteStringValue(AuthenticationType); - } + writer.WritePropertyName("authenticationType"u8); + writer.WriteStringValue(AuthenticationType); if (Optional.IsDefined(CloudToDeviceMessageCount)) { writer.WritePropertyName("cloudToDeviceMessageCount"u8); writer.WriteNumberValue(CloudToDeviceMessageCount.Value); } - if (Optional.IsDefined(ConnectionState)) - { - writer.WritePropertyName("connectionState"u8); - writer.WriteStringValue(ConnectionState); - } - if (Optional.IsDefined(DeviceId)) - { - writer.WritePropertyName("deviceId"u8); - writer.WriteStringValue(DeviceId); - } - if (Optional.IsDefined(Etag)) - { - writer.WritePropertyName("etag"u8); - writer.WriteStringValue(Etag); - } - if (Optional.IsDefined(LastActivityTime)) - { - writer.WritePropertyName("lastActivityTime"u8); - writer.WriteStringValue(LastActivityTime); - } + writer.WritePropertyName("connectionState"u8); + writer.WriteStringValue(ConnectionState); + writer.WritePropertyName("deviceId"u8); + writer.WriteStringValue(DeviceId); + writer.WritePropertyName("etag"u8); + writer.WriteStringValue(Etag); + writer.WritePropertyName("lastActivityTime"u8); + writer.WriteStringValue(LastActivityTime); writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); - if (Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status); - } - if (Optional.IsDefined(StatusUpdateTime)) - { - writer.WritePropertyName("statusUpdateTime"u8); - writer.WriteStringValue(StatusUpdateTime); - } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status); + writer.WritePropertyName("statusUpdateTime"u8); + writer.WriteStringValue(StatusUpdateTime); if (Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); 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 8852435012fb..24cbbbc5ddd7 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinInfo.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinInfo.cs @@ -46,15 +46,36 @@ public partial class DeviceTwinInfo private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . + /// Authentication type used for this device: either SAS, SelfSigned, or CertificateAuthority. + /// Whether the device is connected or disconnected. + /// The unique identifier of the device twin. + /// A piece of information that describes the content of the device twin. Each etag is guaranteed to be unique per device twin. + /// The ISO8601 timestamp of the last activity. /// Properties JSON element. + /// 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(DeviceTwinInfoProperties properties, DeviceTwinInfoX509Thumbprint x509Thumbprint) + /// , , , , , , , 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; + Etag = etag; + LastActivityTime = lastActivityTime; Properties = properties; + Status = status; + StatusUpdateTime = statusUpdateTime; X509Thumbprint = x509Thumbprint; } 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 c239f0edb6a5..4671fa872f9d 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 @@ -34,16 +34,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(DeviceTwinInfoX509Thumbprint)} does not support writing '{format}' format."); } - if (Optional.IsDefined(PrimaryThumbprint)) - { - writer.WritePropertyName("primaryThumbprint"u8); - writer.WriteStringValue(PrimaryThumbprint); - } - if (Optional.IsDefined(SecondaryThumbprint)) - { - writer.WritePropertyName("secondaryThumbprint"u8); - writer.WriteStringValue(SecondaryThumbprint); - } + writer.WritePropertyName("primaryThumbprint"u8); + writer.WriteStringValue(PrimaryThumbprint); + writer.WritePropertyName("secondaryThumbprint"u8); + writer.WriteStringValue(SecondaryThumbprint); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) 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 f28b11657691..16f1d0d0ff9a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinInfoX509Thumbprint.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinInfoX509Thumbprint.cs @@ -46,8 +46,16 @@ public partial class DeviceTwinInfoX509Thumbprint private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal DeviceTwinInfoX509Thumbprint() + /// 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; } /// Initializes a new instance of . @@ -61,6 +69,11 @@ internal DeviceTwinInfoX509Thumbprint(string primaryThumbprint, string secondary _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal DeviceTwinInfoX509Thumbprint() + { + } + /// Primary thumbprint for the x509 certificate. public string PrimaryThumbprint { get; } /// Secondary thumbprint for the x509 certificate. 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 52a1525e9cec..b1a1702b6dc3 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 @@ -34,11 +34,8 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(DeviceTwinMetadata)} does not support writing '{format}' format."); } - if (Optional.IsDefined(LastUpdated)) - { - writer.WritePropertyName("lastUpdated"u8); - writer.WriteStringValue(LastUpdated); - } + writer.WritePropertyName("lastUpdated"u8); + writer.WriteStringValue(LastUpdated); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) 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 f9e2218438b6..80dcb2ffa49e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinMetadata.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DeviceTwinMetadata.cs @@ -46,8 +46,13 @@ public partial class DeviceTwinMetadata private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal DeviceTwinMetadata() + /// 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 . @@ -59,6 +64,11 @@ internal DeviceTwinMetadata(string lastUpdated, IDictionary _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal DeviceTwinMetadata() + { + } + /// The ISO8601 timestamp of the last time the properties were updated. public string LastUpdated { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientDeletedEventData.cs deleted file mode 100644 index a5660854989a..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientDeletedEventData.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// Event data for Microsoft.EventGrid.MQTTClientDeleted event. - public partial class EventGridMQTTClientDeletedEventData : EventGridMQTTClientEventData - { - /// Initializes a new instance of . - internal EventGridMQTTClientDeletedEventData() - { - } - - /// Initializes a new instance of . - /// - /// 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 - /// long, and supports UTF-8 characters. - /// - /// 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) - { - } - } -} 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 similarity index 70% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientCreatedOrUpdatedEventData.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.Serialization.cs index 6ca3505ba0e6..0c7cef95068e 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 @@ -13,11 +13,11 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class EventGridMQTTClientCreatedOrUpdatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class EventGridMqttClientCreatedOrUpdatedEventData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,19 +28,28 @@ 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; + var 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."); + throw new FormatException($"The model {nameof(EventGridMqttClientCreatedOrUpdatedEventData)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToString()); - writer.WritePropertyName("createdOn"u8); - writer.WriteStringValue(CreatedOn, "O"); - writer.WritePropertyName("updatedOn"u8); - writer.WriteStringValue(UpdatedOn, "O"); + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } + if (Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("createdOn"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (Optional.IsDefined(UpdatedOn)) + { + writer.WritePropertyName("updatedOn"u8); + writer.WriteStringValue(UpdatedOn.Value, "O"); + } writer.WritePropertyName("attributes"u8); writer.WriteStartObject(); foreach (var item in Attributes) @@ -51,19 +60,19 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteEndObject(); } - EventGridMQTTClientCreatedOrUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + EventGridMqttClientCreatedOrUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var 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."); + 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); + return DeserializeEventGridMqttClientCreatedOrUpdatedEventData(document.RootElement, options); } - internal static EventGridMQTTClientCreatedOrUpdatedEventData DeserializeEventGridMQTTClientCreatedOrUpdatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static EventGridMqttClientCreatedOrUpdatedEventData DeserializeEventGridMqttClientCreatedOrUpdatedEventData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -71,9 +80,9 @@ internal static EventGridMQTTClientCreatedOrUpdatedEventData DeserializeEventGri { return null; } - EventGridMQTTClientState state = default; - DateTimeOffset createdOn = default; - DateTimeOffset updatedOn = default; + EventGridMqttClientState? state = default; + DateTimeOffset? createdOn = default; + DateTimeOffset? updatedOn = default; IReadOnlyDictionary attributes = default; string clientAuthenticationName = default; string clientName = default; @@ -84,16 +93,28 @@ internal static EventGridMQTTClientCreatedOrUpdatedEventData DeserializeEventGri { if (property.NameEquals("state"u8)) { - state = new EventGridMQTTClientState(property.Value.GetString()); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new EventGridMqttClientState(property.Value.GetString()); continue; } if (property.NameEquals("createdOn"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createdOn = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("updatedOn"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } updatedOn = property.Value.GetDateTimeOffset("O"); continue; } @@ -128,7 +149,7 @@ internal static EventGridMQTTClientCreatedOrUpdatedEventData DeserializeEventGri } } serializedAdditionalRawData = rawDataDictionary; - return new EventGridMQTTClientCreatedOrUpdatedEventData( + return new EventGridMqttClientCreatedOrUpdatedEventData( clientAuthenticationName, clientName, namespaceName, @@ -139,43 +160,43 @@ internal static EventGridMQTTClientCreatedOrUpdatedEventData DeserializeEventGri attributes); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(EventGridMQTTClientCreatedOrUpdatedEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientCreatedOrUpdatedEventData)} does not support writing '{options.Format}' format."); } } - EventGridMQTTClientCreatedOrUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + EventGridMqttClientCreatedOrUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeEventGridMQTTClientCreatedOrUpdatedEventData(document.RootElement, options); + return DeserializeEventGridMqttClientCreatedOrUpdatedEventData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(EventGridMQTTClientCreatedOrUpdatedEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientCreatedOrUpdatedEventData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + 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) + internal static new EventGridMqttClientCreatedOrUpdatedEventData FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeEventGridMQTTClientCreatedOrUpdatedEventData(document.RootElement); + return DeserializeEventGridMqttClientCreatedOrUpdatedEventData(document.RootElement); } /// Convert into a . diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientCreatedOrUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.cs similarity index 61% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientCreatedOrUpdatedEventData.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.cs index dde0c575b475..af38930eb467 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientCreatedOrUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.cs @@ -11,29 +11,29 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Event data for Microsoft.EventGrid.MQTTClientCreatedOrUpdated event. - public partial class EventGridMQTTClientCreatedOrUpdatedEventData : EventGridMQTTClientEventData + public partial class EventGridMqttClientCreatedOrUpdatedEventData : EventGridMqttClientEventData { - /// Initializes a new instance of . - /// 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. - /// - /// 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. + /// Initializes a new instance of . + /// + /// 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 + /// long, and supports UTF-8 characters. /// + /// Name of the client resource in the Event Grid namespace. + /// 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. - /// is null. - internal EventGridMQTTClientCreatedOrUpdatedEventData(EventGridMQTTClientState state, DateTimeOffset createdOn, DateTimeOffset updatedOn, IReadOnlyDictionary attributes) + /// , , or is null. + internal EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticationName, string clientName, string namespaceName, IReadOnlyDictionary attributes) : base(clientAuthenticationName, clientName, namespaceName) { + Argument.AssertNotNull(clientAuthenticationName, nameof(clientAuthenticationName)); + Argument.AssertNotNull(clientName, nameof(clientName)); + Argument.AssertNotNull(namespaceName, nameof(namespaceName)); Argument.AssertNotNull(attributes, nameof(attributes)); - State = state; - CreatedOn = createdOn; - UpdatedOn = updatedOn; Attributes = attributes; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// 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 @@ -50,7 +50,7 @@ internal EventGridMQTTClientCreatedOrUpdatedEventData(EventGridMQTTClientState s /// 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 serializedAdditionalRawData, EventGridMqttClientState? state, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, IReadOnlyDictionary attributes) : base(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData) { State = state; CreatedOn = createdOn; @@ -58,21 +58,21 @@ internal EventGridMQTTClientCreatedOrUpdatedEventData(string clientAuthenticatio Attributes = attributes; } - /// Initializes a new instance of for deserialization. - internal EventGridMQTTClientCreatedOrUpdatedEventData() + /// 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; } + public EventGridMqttClientState? State { get; } /// Time the client resource is created based on the provider's UTC time. - public DateTimeOffset CreatedOn { get; } + 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; } + public DateTimeOffset? UpdatedOn { get; } /// The key-value attributes that are assigned to the client resource. public IReadOnlyDictionary 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 similarity index 75% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientDeletedEventData.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDeletedEventData.Serialization.cs index 7e81e11c1acd..b07692ad3f7d 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 @@ -13,11 +13,11 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class EventGridMQTTClientDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class EventGridMqttClientDeletedEventData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,28 +28,28 @@ 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; + var 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."); + 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) + EventGridMqttClientDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var 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."); + 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); + return DeserializeEventGridMqttClientDeletedEventData(document.RootElement, options); } - internal static EventGridMQTTClientDeletedEventData DeserializeEventGridMQTTClientDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static EventGridMqttClientDeletedEventData DeserializeEventGridMqttClientDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -85,46 +85,46 @@ internal static EventGridMQTTClientDeletedEventData DeserializeEventGridMQTTClie } } serializedAdditionalRawData = rawDataDictionary; - return new EventGridMQTTClientDeletedEventData(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData); + return new EventGridMqttClientDeletedEventData(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(EventGridMQTTClientDeletedEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientDeletedEventData)} does not support writing '{options.Format}' format."); } } - EventGridMQTTClientDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + EventGridMqttClientDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeEventGridMQTTClientDeletedEventData(document.RootElement, options); + return DeserializeEventGridMqttClientDeletedEventData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(EventGridMQTTClientDeletedEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientDeletedEventData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + 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) + internal static new EventGridMqttClientDeletedEventData FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeEventGridMQTTClientDeletedEventData(document.RootElement); + return DeserializeEventGridMqttClientDeletedEventData(document.RootElement); } /// Convert into a . diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDeletedEventData.cs new file mode 100644 index 000000000000..787906968fb7 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDeletedEventData.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Event data for Microsoft.EventGrid.MQTTClientDeleted event. + public partial class EventGridMqttClientDeletedEventData : EventGridMqttClientEventData + { + /// Initializes a new instance of . + /// + /// 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 + /// long, and supports UTF-8 characters. + /// + /// Name of the client resource in the Event Grid namespace. + /// Name of the Event Grid namespace where the MQTT client was created or updated. + /// , or is null. + internal EventGridMqttClientDeletedEventData(string clientAuthenticationName, string clientName, string namespaceName) : base(clientAuthenticationName, clientName, namespaceName) + { + Argument.AssertNotNull(clientAuthenticationName, nameof(clientAuthenticationName)); + Argument.AssertNotNull(clientName, nameof(clientName)); + Argument.AssertNotNull(namespaceName, nameof(namespaceName)); + } + + /// Initializes a new instance of . + /// + /// 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 + /// long, and supports UTF-8 characters. + /// + /// 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() + { + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientDisconnectionReason.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDisconnectionReason.cs similarity index 64% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientDisconnectionReason.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDisconnectionReason.cs index a8e88d5b0c30..9f960c3de714 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientDisconnectionReason.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDisconnectionReason.cs @@ -11,13 +11,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// EventGrid MQTT Client Disconnection Reason. - public readonly partial struct EventGridMQTTClientDisconnectionReason : IEquatable + public readonly partial struct EventGridMqttClientDisconnectionReason : IEquatable { private readonly string _value; - /// Initializes a new instance of . + /// Initializes a new instance of . /// is null. - public EventGridMQTTClientDisconnectionReason(string value) + public EventGridMqttClientDisconnectionReason(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } @@ -35,39 +35,39 @@ public EventGridMQTTClientDisconnectionReason(string value) private const string SessionTakenOverValue = "SessionTakenOver"; /// 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); + 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); + 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); + 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); + 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); + public static EventGridMqttClientDisconnectionReason ConnectionLost { get; } = new EventGridMqttClientDisconnectionReason(ConnectionLostValue); /// The client's IP address is blocked by IP filter or Private links configuration. - public static EventGridMQTTClientDisconnectionReason IpForbidden { get; } = new EventGridMQTTClientDisconnectionReason(IpForbiddenValue); + public static EventGridMqttClientDisconnectionReason IpForbidden { get; } = new EventGridMqttClientDisconnectionReason(IpForbiddenValue); /// 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); + 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); + 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); + 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); + 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. - public static bool operator ==(EventGridMQTTClientDisconnectionReason left, EventGridMQTTClientDisconnectionReason right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(EventGridMQTTClientDisconnectionReason left, EventGridMQTTClientDisconnectionReason right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator EventGridMQTTClientDisconnectionReason(string value) => new EventGridMQTTClientDisconnectionReason(value); + public static EventGridMqttClientDisconnectionReason SessionTakenOver { get; } = new EventGridMqttClientDisconnectionReason(SessionTakenOverValue); + /// Determines if two values are the same. + public static bool operator ==(EventGridMqttClientDisconnectionReason left, EventGridMqttClientDisconnectionReason right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EventGridMqttClientDisconnectionReason left, EventGridMqttClientDisconnectionReason right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator EventGridMqttClientDisconnectionReason(string value) => new EventGridMqttClientDisconnectionReason(value); /// [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is EventGridMQTTClientDisconnectionReason other && Equals(other); + public override bool Equals(object obj) => obj is EventGridMqttClientDisconnectionReason other && Equals(other); /// - public bool Equals(EventGridMQTTClientDisconnectionReason other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + public bool Equals(EventGridMqttClientDisconnectionReason other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); /// [EditorBrowsable(EditorBrowsableState.Never)] 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 similarity index 71% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientEventData.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientEventData.Serialization.cs index eac1ae874e9f..f7e053d48371 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 @@ -13,11 +13,11 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class EventGridMQTTClientEventData : IUtf8JsonSerializable, IJsonModel + public partial class EventGridMqttClientEventData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,27 +28,18 @@ 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; + var 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."); + throw new FormatException($"The model {nameof(EventGridMqttClientEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ClientAuthenticationName)) - { - writer.WritePropertyName("clientAuthenticationName"u8); - writer.WriteStringValue(ClientAuthenticationName); - } - if (Optional.IsDefined(ClientName)) - { - writer.WritePropertyName("clientName"u8); - writer.WriteStringValue(ClientName); - } - if (Optional.IsDefined(NamespaceName)) - { - writer.WritePropertyName("namespaceName"u8); - writer.WriteStringValue(NamespaceName); - } + writer.WritePropertyName("clientAuthenticationName"u8); + writer.WriteStringValue(ClientAuthenticationName); + writer.WritePropertyName("clientName"u8); + writer.WriteStringValue(ClientName); + writer.WritePropertyName("namespaceName"u8); + writer.WriteStringValue(NamespaceName); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -66,19 +57,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - EventGridMQTTClientEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + EventGridMqttClientEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var 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."); + 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); + return DeserializeEventGridMqttClientEventData(document.RootElement, options); } - internal static EventGridMQTTClientEventData DeserializeEventGridMQTTClientEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static EventGridMqttClientEventData DeserializeEventGridMqttClientEventData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -114,46 +105,46 @@ internal static EventGridMQTTClientEventData DeserializeEventGridMQTTClientEvent } } serializedAdditionalRawData = rawDataDictionary; - return new EventGridMQTTClientEventData(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData); + return new EventGridMqttClientEventData(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(EventGridMQTTClientEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientEventData)} does not support writing '{options.Format}' format."); } } - EventGridMQTTClientEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + EventGridMqttClientEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeEventGridMQTTClientEventData(document.RootElement, options); + return DeserializeEventGridMqttClientEventData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(EventGridMQTTClientEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientEventData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + 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) + internal static EventGridMqttClientEventData FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeEventGridMQTTClientEventData(document.RootElement); + return DeserializeEventGridMqttClientEventData(document.RootElement); } /// Convert into a . diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientEventData.cs similarity index 68% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientEventData.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientEventData.cs index 8c69eb51fec2..d5c8ab4a5ab6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientEventData.cs @@ -11,7 +11,7 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Schema of the Data property of an EventGridEvent for MQTT Client state changes. - public partial class EventGridMQTTClientEventData + public partial class EventGridMqttClientEventData { /// /// Keeps track of any properties unknown to the library. @@ -45,12 +45,27 @@ public partial class EventGridMQTTClientEventData /// private protected IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal EventGridMQTTClientEventData() + /// Initializes a new instance of . + /// + /// 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 + /// long, and supports UTF-8 characters. + /// + /// Name of the client resource in the Event Grid namespace. + /// Name of the Event Grid namespace where the MQTT client was created or updated. + /// , or is null. + internal EventGridMqttClientEventData(string clientAuthenticationName, string clientName, string namespaceName) { + Argument.AssertNotNull(clientAuthenticationName, nameof(clientAuthenticationName)); + Argument.AssertNotNull(clientName, nameof(clientName)); + Argument.AssertNotNull(namespaceName, nameof(namespaceName)); + + ClientAuthenticationName = clientAuthenticationName; + ClientName = clientName; + NamespaceName = namespaceName; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// 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 @@ -59,7 +74,7 @@ internal EventGridMQTTClientEventData() /// 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) + internal EventGridMqttClientEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary serializedAdditionalRawData) { ClientAuthenticationName = clientAuthenticationName; ClientName = clientName; @@ -67,6 +82,11 @@ internal EventGridMQTTClientEventData(string clientAuthenticationName, string cl _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal EventGridMqttClientEventData() + { + } + /// /// 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 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 similarity index 77% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionConnectedEventData.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionConnectedEventData.Serialization.cs index 79241a95385d..dcaaf4cfcbe8 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 @@ -13,11 +13,11 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class EventGridMQTTClientSessionConnectedEventData : IUtf8JsonSerializable, IJsonModel + public partial class EventGridMqttClientSessionConnectedEventData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,18 +28,15 @@ 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; + var 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."); + throw new FormatException($"The model {nameof(EventGridMqttClientSessionConnectedEventData)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(ClientSessionName)) - { - writer.WritePropertyName("clientSessionName"u8); - writer.WriteStringValue(ClientSessionName); - } + writer.WritePropertyName("clientSessionName"u8); + writer.WriteStringValue(ClientSessionName); if (Optional.IsDefined(SequenceNumber)) { writer.WritePropertyName("sequenceNumber"u8); @@ -47,19 +44,19 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - EventGridMQTTClientSessionConnectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + EventGridMqttClientSessionConnectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var 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."); + 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); + return DeserializeEventGridMqttClientSessionConnectedEventData(document.RootElement, options); } - internal static EventGridMQTTClientSessionConnectedEventData DeserializeEventGridMQTTClientSessionConnectedEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static EventGridMqttClientSessionConnectedEventData DeserializeEventGridMqttClientSessionConnectedEventData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -111,7 +108,7 @@ internal static EventGridMQTTClientSessionConnectedEventData DeserializeEventGri } } serializedAdditionalRawData = rawDataDictionary; - return new EventGridMQTTClientSessionConnectedEventData( + return new EventGridMqttClientSessionConnectedEventData( clientAuthenticationName, clientName, namespaceName, @@ -120,43 +117,43 @@ internal static EventGridMQTTClientSessionConnectedEventData DeserializeEventGri sequenceNumber); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(EventGridMQTTClientSessionConnectedEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientSessionConnectedEventData)} does not support writing '{options.Format}' format."); } } - EventGridMQTTClientSessionConnectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + EventGridMqttClientSessionConnectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeEventGridMQTTClientSessionConnectedEventData(document.RootElement, options); + return DeserializeEventGridMqttClientSessionConnectedEventData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(EventGridMQTTClientSessionConnectedEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientSessionConnectedEventData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + 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) + internal static new EventGridMqttClientSessionConnectedEventData FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeEventGridMQTTClientSessionConnectedEventData(document.RootElement); + return DeserializeEventGridMqttClientSessionConnectedEventData(document.RootElement); } /// Convert into a . diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionConnectedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionConnectedEventData.cs similarity index 55% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionConnectedEventData.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionConnectedEventData.cs index 3a8dcde09042..53460a402b66 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionConnectedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionConnectedEventData.cs @@ -11,14 +11,32 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Event data for Microsoft.EventGrid.MQTTClientSessionConnected event. - public partial class EventGridMQTTClientSessionConnectedEventData : EventGridMQTTClientEventData + public partial class EventGridMqttClientSessionConnectedEventData : EventGridMqttClientEventData { - /// Initializes a new instance of . - internal EventGridMQTTClientSessionConnectedEventData() + /// Initializes a new instance of . + /// + /// 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 + /// long, and supports UTF-8 characters. + /// + /// Name of the client resource in the Event Grid namespace. + /// Name of the Event Grid namespace where the MQTT client was created or updated. + /// + /// 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 clientName, string namespaceName, string clientSessionName) : base(clientAuthenticationName, clientName, namespaceName) { + Argument.AssertNotNull(clientAuthenticationName, nameof(clientAuthenticationName)); + Argument.AssertNotNull(clientName, nameof(clientName)); + Argument.AssertNotNull(namespaceName, nameof(namespaceName)); + Argument.AssertNotNull(clientSessionName, nameof(clientSessionName)); + + ClientSessionName = clientSessionName; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// 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 @@ -36,12 +54,17 @@ internal EventGridMQTTClientSessionConnectedEventData() /// 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 serializedAdditionalRawData, string clientSessionName, long? sequenceNumber) : base(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData) { 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. 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 similarity index 74% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionDisconnectedEventData.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionDisconnectedEventData.Serialization.cs index b0c2ea8c13df..9cd833e45a33 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 @@ -13,11 +13,11 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class EventGridMQTTClientSessionDisconnectedEventData : IUtf8JsonSerializable, IJsonModel + public partial class EventGridMqttClientSessionDisconnectedEventData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,40 +28,40 @@ 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; + var 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."); + throw new FormatException($"The model {nameof(EventGridMqttClientSessionDisconnectedEventData)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(ClientSessionName)) - { - writer.WritePropertyName("clientSessionName"u8); - writer.WriteStringValue(ClientSessionName); - } + writer.WritePropertyName("clientSessionName"u8); + writer.WriteStringValue(ClientSessionName); if (Optional.IsDefined(SequenceNumber)) { writer.WritePropertyName("sequenceNumber"u8); writer.WriteNumberValue(SequenceNumber.Value); } - writer.WritePropertyName("disconnectionReason"u8); - writer.WriteStringValue(DisconnectionReason.ToString()); + if (Optional.IsDefined(DisconnectionReason)) + { + writer.WritePropertyName("disconnectionReason"u8); + writer.WriteStringValue(DisconnectionReason.Value.ToString()); + } } - EventGridMQTTClientSessionDisconnectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + EventGridMqttClientSessionDisconnectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var 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."); + 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); + return DeserializeEventGridMqttClientSessionDisconnectedEventData(document.RootElement, options); } - internal static EventGridMQTTClientSessionDisconnectedEventData DeserializeEventGridMQTTClientSessionDisconnectedEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static EventGridMqttClientSessionDisconnectedEventData DeserializeEventGridMqttClientSessionDisconnectedEventData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -71,7 +71,7 @@ internal static EventGridMQTTClientSessionDisconnectedEventData DeserializeEvent } string clientSessionName = default; long? sequenceNumber = default; - EventGridMQTTClientDisconnectionReason disconnectionReason = default; + EventGridMqttClientDisconnectionReason? disconnectionReason = default; string clientAuthenticationName = default; string clientName = default; string namespaceName = default; @@ -95,7 +95,11 @@ internal static EventGridMQTTClientSessionDisconnectedEventData DeserializeEvent } if (property.NameEquals("disconnectionReason"u8)) { - disconnectionReason = new EventGridMQTTClientDisconnectionReason(property.Value.GetString()); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + disconnectionReason = new EventGridMqttClientDisconnectionReason(property.Value.GetString()); continue; } if (property.NameEquals("clientAuthenticationName"u8)) @@ -119,7 +123,7 @@ internal static EventGridMQTTClientSessionDisconnectedEventData DeserializeEvent } } serializedAdditionalRawData = rawDataDictionary; - return new EventGridMQTTClientSessionDisconnectedEventData( + return new EventGridMqttClientSessionDisconnectedEventData( clientAuthenticationName, clientName, namespaceName, @@ -129,43 +133,43 @@ internal static EventGridMQTTClientSessionDisconnectedEventData DeserializeEvent disconnectionReason); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(EventGridMQTTClientSessionDisconnectedEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientSessionDisconnectedEventData)} does not support writing '{options.Format}' format."); } } - EventGridMQTTClientSessionDisconnectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + EventGridMqttClientSessionDisconnectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeEventGridMQTTClientSessionDisconnectedEventData(document.RootElement, options); + return DeserializeEventGridMqttClientSessionDisconnectedEventData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(EventGridMQTTClientSessionDisconnectedEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientSessionDisconnectedEventData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + 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) + internal static new EventGridMqttClientSessionDisconnectedEventData FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeEventGridMQTTClientSessionDisconnectedEventData(document.RootElement); + return DeserializeEventGridMqttClientSessionDisconnectedEventData(document.RootElement); } /// Convert into a . diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionDisconnectedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionDisconnectedEventData.cs similarity index 58% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionDisconnectedEventData.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionDisconnectedEventData.cs index 2f9fcb7f6158..463875e83646 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionDisconnectedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionDisconnectedEventData.cs @@ -11,19 +11,32 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Event data for Microsoft.EventGrid.MQTTClientSessionDisconnected event. - public partial class EventGridMQTTClientSessionDisconnectedEventData : EventGridMQTTClientEventData + public partial class EventGridMqttClientSessionDisconnectedEventData : EventGridMqttClientEventData { - /// Initializes a new instance of . - /// - /// Reason for the disconnection of the MQTT client's session. The value could be - /// one of the values in the disconnection reasons table. + /// Initializes a new instance of . + /// + /// 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 + /// long, and supports UTF-8 characters. + /// + /// Name of the client resource in the Event Grid namespace. + /// Name of the Event Grid namespace where the MQTT client was created or updated. + /// + /// Unique identifier for the MQTT client's session. This case-sensitive string can + /// be up to 128 characters long, and supports UTF-8 characters. /// - internal EventGridMQTTClientSessionDisconnectedEventData(EventGridMQTTClientDisconnectionReason disconnectionReason) + /// , , or is null. + internal EventGridMqttClientSessionDisconnectedEventData(string clientAuthenticationName, string clientName, string namespaceName, string clientSessionName) : base(clientAuthenticationName, clientName, namespaceName) { - DisconnectionReason = disconnectionReason; + Argument.AssertNotNull(clientAuthenticationName, nameof(clientAuthenticationName)); + Argument.AssertNotNull(clientName, nameof(clientName)); + Argument.AssertNotNull(namespaceName, nameof(namespaceName)); + Argument.AssertNotNull(clientSessionName, nameof(clientSessionName)); + + ClientSessionName = clientSessionName; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// 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 @@ -45,15 +58,15 @@ internal EventGridMQTTClientSessionDisconnectedEventData(EventGridMQTTClientDisc /// 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 serializedAdditionalRawData, string clientSessionName, long? sequenceNumber, EventGridMqttClientDisconnectionReason? disconnectionReason) : base(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData) { ClientSessionName = clientSessionName; SequenceNumber = sequenceNumber; DisconnectionReason = disconnectionReason; } - /// Initializes a new instance of for deserialization. - internal EventGridMQTTClientSessionDisconnectedEventData() + /// Initializes a new instance of for deserialization. + internal EventGridMqttClientSessionDisconnectedEventData() { } @@ -72,6 +85,6 @@ internal EventGridMQTTClientSessionDisconnectedEventData() /// Reason for the disconnection of the MQTT client's session. The value could be /// one of the values in the disconnection reasons table. /// - public EventGridMQTTClientDisconnectionReason DisconnectionReason { get; } + public EventGridMqttClientDisconnectionReason? DisconnectionReason { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientState.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientState.cs similarity index 58% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientState.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientState.cs index 7d2907bb7bd0..d12b28d8e9aa 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientState.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientState.cs @@ -11,13 +11,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// EventGrid MQTT Client State. - public readonly partial struct EventGridMQTTClientState : IEquatable + public readonly partial struct EventGridMqttClientState : IEquatable { private readonly string _value; - /// Initializes a new instance of . + /// Initializes a new instance of . /// is null. - public EventGridMQTTClientState(string value) + public EventGridMqttClientState(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } @@ -26,21 +26,21 @@ public EventGridMQTTClientState(string value) private const string DisabledValue = "Disabled"; /// Enabled. - public static EventGridMQTTClientState Enabled { get; } = new EventGridMQTTClientState(EnabledValue); + public static EventGridMqttClientState Enabled { get; } = new EventGridMqttClientState(EnabledValue); /// Disabled. - public static EventGridMQTTClientState Disabled { get; } = new EventGridMQTTClientState(DisabledValue); - /// Determines if two values are the same. - public static bool operator ==(EventGridMQTTClientState left, EventGridMQTTClientState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(EventGridMQTTClientState left, EventGridMQTTClientState right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator EventGridMQTTClientState(string value) => new EventGridMQTTClientState(value); + public static EventGridMqttClientState Disabled { get; } = new EventGridMqttClientState(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(EventGridMqttClientState left, EventGridMqttClientState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EventGridMqttClientState left, EventGridMqttClientState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator EventGridMqttClientState(string value) => new EventGridMqttClientState(value); /// [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is EventGridMQTTClientState other && Equals(other); + public override bool Equals(object obj) => obj is EventGridMqttClientState other && Equals(other); /// - public bool Equals(EventGridMQTTClientState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + public bool Equals(EventGridMqttClientState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); /// [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridSystemEventsModelFactory.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridSystemEventsModelFactory.cs index 3b3868356788..07229545cdbd 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridSystemEventsModelFactory.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridSystemEventsModelFactory.cs @@ -503,9 +503,10 @@ public static AvsScriptExecutionFailedEventData AvsScriptExecutionFailedEventDat /// Display name of caller. /// Custom Context of Incoming Call. /// Signed incoming call context. + /// 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, string correlationId = null) + 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) { return new AcsIncomingCallEventData( toCommunicationIdentifier, @@ -514,6 +515,7 @@ public static AcsIncomingCallEventData AcsIncomingCallEventData(CommunicationIde callerDisplayName, customContext, incomingCallContext, + onBehalfOfCallee, correlationId, serializedAdditionalRawData: null); } @@ -526,7 +528,7 @@ public static AcsIncomingCallEventData AcsIncomingCallEventData(CommunicationIde /// The Microsoft Teams user. /// The Microsoft Teams application. /// A new instance for mocking. - public static CommunicationIdentifierModel CommunicationIdentifierModel(CommunicationIdentifierModelKind kind = default, string rawId = null, CommunicationUserIdentifierModel communicationUser = null, PhoneNumberIdentifierModel phoneNumber = null, MicrosoftTeamsUserIdentifierModel microsoftTeamsUser = null, MicrosoftTeamsAppIdentifierModel microsoftTeamsApp = null) + public static CommunicationIdentifierModel CommunicationIdentifierModel(CommunicationIdentifierModelKind? kind = null, string rawId = null, CommunicationUserIdentifierModel communicationUser = null, PhoneNumberIdentifierModel phoneNumber = null, MicrosoftTeamsUserIdentifierModel microsoftTeamsUser = null, MicrosoftTeamsAppIdentifierModel microsoftTeamsApp = null) { return new CommunicationIdentifierModel( kind, @@ -559,7 +561,7 @@ public static PhoneNumberIdentifierModel PhoneNumberIdentifierModel(string value /// 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 = default) + public static MicrosoftTeamsUserIdentifierModel MicrosoftTeamsUserIdentifierModel(string userId = null, bool? isAnonymous = null, CommunicationCloudEnvironmentModel? cloud = null) { return new MicrosoftTeamsUserIdentifierModel(userId, isAnonymous, cloud, serializedAdditionalRawData: null); } @@ -568,7 +570,7 @@ public static MicrosoftTeamsUserIdentifierModel MicrosoftTeamsUserIdentifierMode /// 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 MicrosoftTeamsAppIdentifierModel MicrosoftTeamsAppIdentifierModel(string appId = null, CommunicationCloudEnvironmentModel cloud = default) + public static MicrosoftTeamsAppIdentifierModel MicrosoftTeamsAppIdentifierModel(string appId = null, CommunicationCloudEnvironmentModel? cloud = null) { return new MicrosoftTeamsAppIdentifierModel(appId, cloud, serializedAdditionalRawData: null); } @@ -623,7 +625,7 @@ 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 = default, string type = null, long? version = null) + 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) { return new AcsChatMessageEventBaseProperties( recipientCommunicationIdentifier, @@ -651,7 +653,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 = null, string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset composeTime = default, string type = null, long? version = null, string messageBody = null, IReadOnlyDictionary metadata = null) + 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) { metadata ??= new Dictionary(); @@ -680,7 +682,7 @@ 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 = default, string type = null, long? version = null) + 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) { return new AcsChatMessageEventInThreadBaseProperties( transactionId, @@ -706,7 +708,7 @@ public static AcsChatMessageEventInThreadBaseProperties AcsChatMessageEventInThr /// 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 = default, string type = null, long? version = null, string messageBody = null, IReadOnlyDictionary metadata = null) + 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) { metadata ??= new Dictionary(); @@ -738,7 +740,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 = null, string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset composeTime = default, string type = null, long? version = null, string messageBody = null, IReadOnlyDictionary metadata = null, DateTimeOffset editTime = default) + 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) { metadata ??= new Dictionary(); @@ -771,7 +773,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 = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset composeTime = default, string type = null, long? version = null, string messageBody = null, IReadOnlyDictionary metadata = null, DateTimeOffset editTime = default) + 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) { metadata ??= new Dictionary(); @@ -802,7 +804,7 @@ 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 = default, string type = null, long? version = null, DateTimeOffset deleteTime = default) + 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) { return new AcsChatMessageDeletedEventData( recipientCommunicationIdentifier, @@ -829,7 +831,7 @@ 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 = default, string type = null, long? version = null, DateTimeOffset deleteTime = default) + 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) { return new AcsChatMessageDeletedInThreadEventData( transactionId, @@ -851,7 +853,7 @@ public static AcsChatMessageDeletedInThreadEventData AcsChatMessageDeletedInThre /// 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 = default, long? version = null) + public static AcsChatThreadEventBaseProperties AcsChatThreadEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null) { return new AcsChatThreadEventBaseProperties( recipientCommunicationIdentifier, @@ -873,7 +875,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 = null, string transactionId = null, string threadId = null, DateTimeOffset createTime = default, long? version = null, CommunicationIdentifierModel createdByCommunicationIdentifier = null, IReadOnlyDictionary properties = null, IReadOnlyDictionary metadata = null, IEnumerable participants = null) + 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) { properties ??= new Dictionary(); metadata ??= new Dictionary(); @@ -910,7 +912,7 @@ public static AcsChatThreadParticipantProperties AcsChatThreadParticipantPropert /// 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 = default, long? version = null) + public static AcsChatThreadEventInThreadBaseProperties AcsChatThreadEventInThreadBaseProperties(string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null) { return new AcsChatThreadEventInThreadBaseProperties(transactionId, threadId, serializedAdditionalRawData: null, createTime, version); } @@ -925,7 +927,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 = null, string threadId = null, DateTimeOffset createTime = default, long? version = null, CommunicationIdentifierModel createdByCommunicationIdentifier = null, IReadOnlyDictionary properties = null, IReadOnlyDictionary metadata = null, IEnumerable participants = null) + 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) { properties ??= new Dictionary(); metadata ??= new Dictionary(); @@ -952,7 +954,7 @@ 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 = default, long? version = null, CommunicationIdentifierModel deletedByCommunicationIdentifier = null, DateTimeOffset deleteTime = default) + 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) { return new AcsChatThreadWithUserDeletedEventData( recipientCommunicationIdentifier, @@ -973,7 +975,7 @@ 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 = default, long? version = null, CommunicationIdentifierModel deletedByCommunicationIdentifier = null, DateTimeOffset deleteTime = default) + public static AcsChatThreadDeletedEventData AcsChatThreadDeletedEventData(string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null, CommunicationIdentifierModel deletedByCommunicationIdentifier = null, DateTimeOffset? deleteTime = null) { return new AcsChatThreadDeletedEventData( transactionId, @@ -996,7 +998,7 @@ public static AcsChatThreadDeletedEventData AcsChatThreadDeletedEventData(string /// The thread metadata. /// The updated thread properties. /// A new instance for mocking. - public static AcsChatThreadPropertiesUpdatedPerUserEventData AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset createTime = default, long? version = null, CommunicationIdentifierModel editedByCommunicationIdentifier = null, DateTimeOffset editTime = default, IReadOnlyDictionary metadata = null, IReadOnlyDictionary properties = null) + 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) { metadata ??= new Dictionary(); properties ??= new Dictionary(); @@ -1024,7 +1026,7 @@ public static AcsChatThreadPropertiesUpdatedPerUserEventData AcsChatThreadProper /// The updated thread properties. /// The thread metadata. /// A new instance for mocking. - public static AcsChatThreadPropertiesUpdatedEventData AcsChatThreadPropertiesUpdatedEventData(string transactionId = null, string threadId = null, DateTimeOffset createTime = default, long? version = null, CommunicationIdentifierModel editedByCommunicationIdentifier = null, DateTimeOffset editTime = default, IReadOnlyDictionary properties = null, IReadOnlyDictionary metadata = null) + 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) { properties ??= new Dictionary(); metadata ??= new Dictionary(); @@ -1051,7 +1053,7 @@ 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 = default, long? version = null, DateTimeOffset time = default, CommunicationIdentifierModel addedByCommunicationIdentifier = null, AcsChatThreadParticipantProperties participantAdded = null) + 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) { return new AcsChatParticipantAddedToThreadWithUserEventData( recipientCommunicationIdentifier, @@ -1075,7 +1077,7 @@ 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 = default, long? version = null, DateTimeOffset time = default, CommunicationIdentifierModel removedByCommunicationIdentifier = null, AcsChatThreadParticipantProperties participantRemoved = null) + 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) { return new AcsChatParticipantRemovedFromThreadWithUserEventData( recipientCommunicationIdentifier, @@ -1097,7 +1099,7 @@ 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 = default, CommunicationIdentifierModel addedByCommunicationIdentifier = null, AcsChatThreadParticipantProperties participantAdded = null, long? version = null) + public static AcsChatParticipantAddedToThreadEventData AcsChatParticipantAddedToThreadEventData(string transactionId = null, string threadId = null, DateTimeOffset? time = null, CommunicationIdentifierModel addedByCommunicationIdentifier = null, AcsChatThreadParticipantProperties participantAdded = null, long? version = null) { return new AcsChatParticipantAddedToThreadEventData( transactionId, @@ -1117,7 +1119,7 @@ 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 = default, CommunicationIdentifierModel removedByCommunicationIdentifier = null, AcsChatThreadParticipantProperties participantRemoved = null, long? version = null) + public static AcsChatParticipantRemovedFromThreadEventData AcsChatParticipantRemovedFromThreadEventData(string transactionId = null, string threadId = null, DateTimeOffset? time = null, CommunicationIdentifierModel removedByCommunicationIdentifier = null, AcsChatThreadParticipantProperties participantRemoved = null, long? version = null) { return new AcsChatParticipantRemovedFromThreadEventData( transactionId, @@ -1149,7 +1151,7 @@ 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 = default, string tag = null) + 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) { deliveryAttempts ??= new List(); @@ -1170,7 +1172,7 @@ public static AcsSmsDeliveryReportReceivedEventData AcsSmsDeliveryReportReceived /// Number of segments that were successfully delivered. /// Number of segments whose delivery failed. /// A new instance for mocking. - public static AcsSmsDeliveryAttemptProperties AcsSmsDeliveryAttemptProperties(DateTimeOffset timestamp = default, int? segmentsSucceeded = null, int? segmentsFailed = null) + public static AcsSmsDeliveryAttemptProperties AcsSmsDeliveryAttemptProperties(DateTimeOffset? timestamp = null, int? segmentsSucceeded = null, int? segmentsFailed = null) { return new AcsSmsDeliveryAttemptProperties(timestamp, segmentsSucceeded, segmentsFailed, serializedAdditionalRawData: null); } @@ -1182,7 +1184,7 @@ public static AcsSmsDeliveryAttemptProperties AcsSmsDeliveryAttemptProperties(Da /// The SMS content. /// The time at which the SMS was received. /// A new instance for mocking. - public static AcsSmsReceivedEventData AcsSmsReceivedEventData(string messageId = null, string @from = null, string to = null, string message = null, DateTimeOffset receivedTimestamp = default) + public static AcsSmsReceivedEventData AcsSmsReceivedEventData(string messageId = null, string @from = null, string to = null, string message = null, DateTimeOffset? receivedTimestamp = null) { return new AcsSmsReceivedEventData( messageId, @@ -1202,7 +1204,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 = default, long? recordingDurationMs = null, RecordingContentType recordingContentType = default, RecordingChannelType recordingChannelKind = default, RecordingFormatType recordingFormatType = default, string sessionEndReason = null) + public static AcsRecordingFileStatusUpdatedEventData AcsRecordingFileStatusUpdatedEventData(AcsRecordingStorageInfoProperties recordingStorageInfo = null, DateTimeOffset? recordingStartTime = null, long? recordingDurationMs = null, RecordingContentType? recordingContentType = null, RecordingChannelType? recordingChannelKind = null, RecordingFormatType? recordingFormatType = null, string sessionEndReason = null) { return new AcsRecordingFileStatusUpdatedEventData( recordingStorageInfo, @@ -1253,7 +1255,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 messageId = null, AcsEmailDeliveryReportStatus status = default, AcsEmailDeliveryReportStatusDetails deliveryStatusDetails = null, DateTimeOffset deliveryAttemptTimestamp = default) + public static AcsEmailDeliveryReportReceivedEventData AcsEmailDeliveryReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, AcsEmailDeliveryReportStatus? status = null, AcsEmailDeliveryReportStatusDetails deliveryStatusDetails = null, DateTimeOffset? deliveryAttemptTimestamp = null) { return new AcsEmailDeliveryReportReceivedEventData( sender, @@ -1282,7 +1284,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 = default, string engagementContext = null, string userAgent = null, AcsUserEngagement engagement = default) + 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) { return new AcsEmailEngagementTrackingReportReceivedEventData( sender, @@ -1455,7 +1457,7 @@ public static AcsRouterQueueDetails AcsRouterQueueDetails(string id = null, stri /// Router Job Worker Selector State. /// Router Job Worker Selector Expiration Time. /// A new instance for mocking. - public static AcsRouterWorkerSelector AcsRouterWorkerSelector(string key = null, AcsRouterLabelOperator labelOperator = default, BinaryData labelValue = null, double timeToLive = default, AcsRouterWorkerSelectorState selectorState = default, DateTimeOffset expirationTime = default) + public static AcsRouterWorkerSelector AcsRouterWorkerSelector(string key = null, AcsRouterLabelOperator? labelOperator = null, BinaryData labelValue = null, double timeToLive = default, AcsRouterWorkerSelectorState? selectorState = null, DateTimeOffset? expirationTime = null) { return new AcsRouterWorkerSelector( key, @@ -1618,7 +1620,7 @@ 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 jobStatus = default, string classificationPolicyId = null, int? priority = null, IEnumerable requestedWorkerSelectors = null, DateTimeOffset scheduledOn = default, 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(); @@ -1653,7 +1655,7 @@ 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 = default, string failureReason = null) + 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) { labels ??= new Dictionary(); tags ??= new Dictionary(); @@ -1715,7 +1717,7 @@ 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 = default, bool unavailableForMatching = default) + 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) { labels ??= new Dictionary(); tags ??= new Dictionary(); @@ -1888,7 +1890,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 = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null, int? jobPriority = null, IReadOnlyDictionary workerLabels = null, DateTimeOffset offeredOn = default, DateTimeOffset expiresOn = default, IReadOnlyDictionary workerTags = null, IReadOnlyDictionary jobLabels = null, IReadOnlyDictionary jobTags = null) + 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) { workerLabels ??= new Dictionary(); workerTags ??= new Dictionary(); @@ -2001,7 +2003,7 @@ public static AcsRouterWorkerUpdatedEventData AcsRouterWorkerUpdatedEventData(st /// The time message was received. /// The channel event error. /// A new instance for mocking. - public static AcsMessageEventData AcsMessageEventData(string @from = null, string to = null, DateTimeOffset receivedTimestamp = default, AcsMessageChannelEventError error = null) + public static AcsMessageEventData AcsMessageEventData(string @from = null, string to = null, DateTimeOffset? receivedTimestamp = null, AcsMessageChannelEventError error = null) { return new AcsMessageEventData(@from, to, receivedTimestamp, error, serializedAdditionalRawData: null); } @@ -2024,7 +2026,7 @@ public static AcsMessageChannelEventError AcsMessageChannelEventError(string cha /// The updated message status. /// The updated message channel type. /// A new instance for mocking. - public static AcsMessageDeliveryStatusUpdatedEventData AcsMessageDeliveryStatusUpdatedEventData(string @from = null, string to = null, DateTimeOffset receivedTimestamp = default, AcsMessageChannelEventError error = null, string messageId = null, AcsMessageDeliveryStatus status = default, AcsMessageChannelKind channelKind = default) + public static AcsMessageDeliveryStatusUpdatedEventData AcsMessageDeliveryStatusUpdatedEventData(string @from = null, string to = null, DateTimeOffset? receivedTimestamp = null, AcsMessageChannelEventError error = null, string messageId = null, AcsMessageDeliveryStatus? status = null, AcsMessageChannelKind? channelKind = null) { return new AcsMessageDeliveryStatusUpdatedEventData( @from, @@ -2049,7 +2051,7 @@ public static AcsMessageDeliveryStatusUpdatedEventData AcsMessageDeliveryStatusU /// The received message button content. /// The received message interactive content. /// A new instance for mocking. - public static AcsMessageReceivedEventData AcsMessageReceivedEventData(string @from = null, string to = null, DateTimeOffset receivedTimestamp = default, AcsMessageChannelEventError error = null, string content = null, AcsMessageChannelKind channelKind = default, AcsMessageMediaContent mediaContent = null, AcsMessageContext context = null, AcsMessageButtonContent button = null, AcsMessageInteractiveContent interactiveContent = null) + public static AcsMessageReceivedEventData AcsMessageReceivedEventData(string @from = null, string to = null, DateTimeOffset? receivedTimestamp = null, AcsMessageChannelEventError error = null, string content = null, AcsMessageChannelKind channelKind = default, AcsMessageMediaContent mediaContent = null, AcsMessageContext context = null, AcsMessageButtonContent button = null, AcsMessageInteractiveContent interactiveContent = null) { return new AcsMessageReceivedEventData( @from, @@ -2099,7 +2101,7 @@ public static AcsMessageButtonContent AcsMessageButtonContent(string text = null /// 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 = default, AcsMessageInteractiveButtonReplyContent buttonReply = null, AcsMessageInteractiveListReplyContent listReply = null) + public static AcsMessageInteractiveContent AcsMessageInteractiveContent(AcsInteractiveReplyKind? replyKind = null, AcsMessageInteractiveButtonReplyContent buttonReply = null, AcsMessageInteractiveListReplyContent listReply = null) { return new AcsMessageInteractiveContent(replyKind, buttonReply, listReply, serializedAdditionalRawData: null); } @@ -2134,7 +2136,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 = default, 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 = 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) { return new ContainerRegistryEventData( id, @@ -2225,7 +2227,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 = default, 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 = 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) { return new ContainerRegistryImagePushedEventData( id, @@ -2251,7 +2253,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 = default, 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 = 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) { return new ContainerRegistryImageDeletedEventData( id, @@ -2274,7 +2276,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 = default, string action = null, string location = null, ContainerRegistryArtifactEventTarget target = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) + public static ContainerRegistryArtifactEventData ContainerRegistryArtifactEventData(string id = null, DateTimeOffset? timestamp = null, string action = null, string location = null, ContainerRegistryArtifactEventTarget target = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) { return new ContainerRegistryArtifactEventData( id, @@ -2316,7 +2318,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 = default, string action = null, string location = null, ContainerRegistryArtifactEventTarget target = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) + public static ContainerRegistryChartPushedEventData ContainerRegistryChartPushedEventData(string id = null, DateTimeOffset? timestamp = null, string action = null, string location = null, ContainerRegistryArtifactEventTarget target = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) { return new ContainerRegistryChartPushedEventData( id, @@ -2336,7 +2338,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 = default, string action = null, string location = null, ContainerRegistryArtifactEventTarget target = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) + public static ContainerRegistryChartDeletedEventData ContainerRegistryChartDeletedEventData(string id = null, DateTimeOffset? timestamp = null, string action = null, string location = null, ContainerRegistryArtifactEventTarget target = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) { return new ContainerRegistryChartDeletedEventData( id, @@ -2420,7 +2422,7 @@ public static ContainerServiceNodePoolRollingFailedEventData ContainerServiceNod /// 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 = default, DateTimeOffset stageTime = default) + public static DataBoxCopyStartedEventData DataBoxCopyStartedEventData(string serialNumber = null, DataBoxStageName? stageName = null, DateTimeOffset? stageTime = null) { return new DataBoxCopyStartedEventData(serialNumber, stageName, stageTime, serializedAdditionalRawData: null); } @@ -2430,7 +2432,7 @@ public static DataBoxCopyStartedEventData DataBoxCopyStartedEventData(string ser /// 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 = default, DateTimeOffset stageTime = default) + public static DataBoxCopyCompletedEventData DataBoxCopyCompletedEventData(string serialNumber = null, DataBoxStageName? stageName = null, DateTimeOffset? stageTime = null) { return new DataBoxCopyCompletedEventData(serialNumber, stageName, stageTime, serializedAdditionalRawData: null); } @@ -2440,7 +2442,7 @@ public static DataBoxCopyCompletedEventData DataBoxCopyCompletedEventData(string /// 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 = default, DateTimeOffset stageTime = default) + public static DataBoxOrderCompletedEventData DataBoxOrderCompletedEventData(string serialNumber = null, DataBoxStageName? stageName = null, DateTimeOffset? stageTime = null) { return new DataBoxOrderCompletedEventData(serialNumber, stageName, stageTime, serializedAdditionalRawData: null); } @@ -2456,7 +2458,7 @@ public static DataBoxOrderCompletedEventData DataBoxOrderCompletedEventData(stri /// 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 = default, DateTimeOffset lastEnqueueTime = default) + 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) { return new EventHubCaptureFileCreatedEventData( fileurl, @@ -2721,7 +2723,7 @@ public static IotHubDeviceTelemetryEventData IotHubDeviceTelemetryEventData(IRea /// 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 = default, string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = null) + public static HealthcareFhirResourceCreatedEventData HealthcareFhirResourceCreatedEventData(HealthcareFhirResourceType? fhirResourceType = null, string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = null) { return new HealthcareFhirResourceCreatedEventData(fhirResourceType, fhirServiceHostName, fhirResourceId, fhirResourceVersionId, serializedAdditionalRawData: null); } @@ -2732,7 +2734,7 @@ public static HealthcareFhirResourceCreatedEventData HealthcareFhirResourceCreat /// 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 = default, string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = null) + public static HealthcareFhirResourceUpdatedEventData HealthcareFhirResourceUpdatedEventData(HealthcareFhirResourceType? fhirResourceType = null, string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = null) { return new HealthcareFhirResourceUpdatedEventData(fhirResourceType, fhirServiceHostName, fhirResourceId, fhirResourceVersionId, serializedAdditionalRawData: null); } @@ -2743,7 +2745,7 @@ public static HealthcareFhirResourceUpdatedEventData HealthcareFhirResourceUpdat /// 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 = default, string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = null) + public static HealthcareFhirResourceDeletedEventData HealthcareFhirResourceDeletedEventData(HealthcareFhirResourceType? fhirResourceType = null, string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = null) { return new HealthcareFhirResourceDeletedEventData(fhirResourceType, fhirServiceHostName, fhirResourceId, fhirResourceVersionId, serializedAdditionalRawData: null); } @@ -3096,7 +3098,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 = default, DateTimeOffset endTime = default) + 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) { return new MachineLearningServicesDatasetDriftDetectedEventData( dataDriftId, @@ -3135,500 +3137,6 @@ public static MachineLearningServicesRunStatusChangedEventData MachineLearningSe serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. - /// Gets the Job correlation data. - /// A new instance for mocking. - public static MediaJobStateChangeEventData MediaJobStateChangeEventData(MediaJobState previousState = default, MediaJobState state = default, IReadOnlyDictionary correlationData = null) - { - correlationData ??= new Dictionary(); - - return new MediaJobStateChangeEventData(previousState, state, correlationData, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Error code describing the error. - /// A human-readable language-dependent representation of the error. - /// Helps with categorization of errors. - /// Indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact Azure support via Azure Portal. - /// An array of details about specific errors that led to this reported error. - /// A new instance for mocking. - public static MediaJobError MediaJobError(MediaJobErrorCode code = default, string message = null, MediaJobErrorCategory category = default, MediaJobRetry retry = default, IEnumerable details = null) - { - details ??= new List(); - - return new MediaJobError( - code, - message, - category, - retry, - details?.ToList(), - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Code describing the error detail. - /// A human-readable representation of the error. - /// A new instance for mocking. - public static MediaJobErrorDetail MediaJobErrorDetail(string code = null, string message = null) - { - return new MediaJobErrorDetail(code, message, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The discriminator for derived types. - /// Gets the Job output error. - /// Gets the Job output label. - /// Gets the Job output progress. - /// Gets the Job output state. - /// A new instance for mocking. - public static MediaJobOutput MediaJobOutput(string odataType = null, MediaJobError error = null, string label = null, long progress = default, MediaJobState state = default) - { - return new UnknownMediaJobOutput( - odataType, - error, - label, - progress, - state, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Gets the Job output error. - /// Gets the Job output label. - /// Gets the Job output progress. - /// Gets the Job output state. - /// Gets the Job output asset name. - /// A new instance for mocking. - public static MediaJobOutputAsset MediaJobOutputAsset(MediaJobError error = null, string label = null, long progress = default, MediaJobState state = default, string assetName = null) - { - return new MediaJobOutputAsset( - "#Microsoft.Media.JobOutputAsset", - error, - label, - progress, - state, - serializedAdditionalRawData: null, - assetName); - } - - /// Initializes a new instance of . - /// Gets the Job output label. - /// Gets the Job output progress. - /// Gets the Job correlation data. - /// A new instance for mocking. - public static MediaJobOutputProgressEventData MediaJobOutputProgressEventData(string label = null, long? progress = null, IReadOnlyDictionary jobCorrelationData = null) - { - jobCorrelationData ??= new Dictionary(); - - return new MediaJobOutputProgressEventData(label, progress, jobCorrelationData, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The previous state of the Job. - /// - /// Gets the output. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// Gets the Job correlation data. - /// A new instance for mocking. - public static MediaJobOutputStateChangeEventData MediaJobOutputStateChangeEventData(MediaJobState previousState = default, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) - { - jobCorrelationData ??= new Dictionary(); - - return new MediaJobOutputStateChangeEventData(previousState, output, jobCorrelationData, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. - /// Gets the Job correlation data. - /// A new instance for mocking. - public static MediaJobScheduledEventData MediaJobScheduledEventData(MediaJobState previousState = default, MediaJobState state = default, IReadOnlyDictionary correlationData = null) - { - correlationData ??= new Dictionary(); - - return new MediaJobScheduledEventData(previousState, state, correlationData, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. - /// Gets the Job correlation data. - /// A new instance for mocking. - public static MediaJobProcessingEventData MediaJobProcessingEventData(MediaJobState previousState = default, MediaJobState state = default, IReadOnlyDictionary correlationData = null) - { - correlationData ??= new Dictionary(); - - return new MediaJobProcessingEventData(previousState, state, correlationData, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. - /// Gets the Job correlation data. - /// A new instance for mocking. - public static MediaJobCancelingEventData MediaJobCancelingEventData(MediaJobState previousState = default, MediaJobState state = default, IReadOnlyDictionary correlationData = null) - { - correlationData ??= new Dictionary(); - - return new MediaJobCancelingEventData(previousState, state, correlationData, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. - /// Gets the Job correlation data. - /// - /// Gets the Job outputs. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// A new instance for mocking. - public static MediaJobFinishedEventData MediaJobFinishedEventData(MediaJobState previousState = default, MediaJobState state = default, IReadOnlyDictionary correlationData = null, IEnumerable outputs = null) - { - correlationData ??= new Dictionary(); - outputs ??= new List(); - - return new MediaJobFinishedEventData(previousState, state, correlationData, serializedAdditionalRawData: null, outputs?.ToList()); - } - - /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. - /// Gets the Job correlation data. - /// - /// Gets the Job outputs. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// A new instance for mocking. - public static MediaJobCanceledEventData MediaJobCanceledEventData(MediaJobState previousState = default, MediaJobState state = default, IReadOnlyDictionary correlationData = null, IEnumerable outputs = null) - { - correlationData ??= new Dictionary(); - outputs ??= new List(); - - return new MediaJobCanceledEventData(previousState, state, correlationData, serializedAdditionalRawData: null, outputs?.ToList()); - } - - /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. - /// Gets the Job correlation data. - /// - /// Gets the Job outputs. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// A new instance for mocking. - public static MediaJobErroredEventData MediaJobErroredEventData(MediaJobState previousState = default, MediaJobState state = default, IReadOnlyDictionary correlationData = null, IEnumerable outputs = null) - { - correlationData ??= new Dictionary(); - outputs ??= new List(); - - return new MediaJobErroredEventData(previousState, state, correlationData, serializedAdditionalRawData: null, outputs?.ToList()); - } - - /// Initializes a new instance of . - /// The previous state of the Job. - /// - /// Gets the output. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// Gets the Job correlation data. - /// A new instance for mocking. - public static MediaJobOutputCanceledEventData MediaJobOutputCanceledEventData(MediaJobState previousState = default, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) - { - jobCorrelationData ??= new Dictionary(); - - return new MediaJobOutputCanceledEventData(previousState, output, jobCorrelationData, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The previous state of the Job. - /// - /// Gets the output. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// Gets the Job correlation data. - /// A new instance for mocking. - public static MediaJobOutputCancelingEventData MediaJobOutputCancelingEventData(MediaJobState previousState = default, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) - { - jobCorrelationData ??= new Dictionary(); - - return new MediaJobOutputCancelingEventData(previousState, output, jobCorrelationData, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The previous state of the Job. - /// - /// Gets the output. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// Gets the Job correlation data. - /// A new instance for mocking. - public static MediaJobOutputErroredEventData MediaJobOutputErroredEventData(MediaJobState previousState = default, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) - { - jobCorrelationData ??= new Dictionary(); - - return new MediaJobOutputErroredEventData(previousState, output, jobCorrelationData, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The previous state of the Job. - /// - /// Gets the output. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// Gets the Job correlation data. - /// A new instance for mocking. - public static MediaJobOutputFinishedEventData MediaJobOutputFinishedEventData(MediaJobState previousState = default, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) - { - jobCorrelationData ??= new Dictionary(); - - return new MediaJobOutputFinishedEventData(previousState, output, jobCorrelationData, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The previous state of the Job. - /// - /// Gets the output. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// Gets the Job correlation data. - /// A new instance for mocking. - public static MediaJobOutputProcessingEventData MediaJobOutputProcessingEventData(MediaJobState previousState = default, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) - { - jobCorrelationData ??= new Dictionary(); - - return new MediaJobOutputProcessingEventData(previousState, output, jobCorrelationData, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The previous state of the Job. - /// - /// Gets the output. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// Gets the Job correlation data. - /// A new instance for mocking. - public static MediaJobOutputScheduledEventData MediaJobOutputScheduledEventData(MediaJobState previousState = default, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) - { - jobCorrelationData ??= new Dictionary(); - - return new MediaJobOutputScheduledEventData(previousState, output, jobCorrelationData, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Gets the ingest URL provided by the live event. - /// Gets the stream Id. - /// Gets the remote IP. - /// Gets the remote port. - /// A new instance for mocking. - public static MediaLiveEventEncoderConnectedEventData MediaLiveEventEncoderConnectedEventData(string ingestUrl = null, string streamId = null, string encoderIp = null, string encoderPort = null) - { - return new MediaLiveEventEncoderConnectedEventData(ingestUrl, streamId, encoderIp, encoderPort, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Gets the ingest URL provided by the live event. - /// Gets the stream Id. - /// Gets the remote IP. - /// Gets the remote port. - /// Gets the result code. - /// A new instance for mocking. - public static MediaLiveEventConnectionRejectedEventData MediaLiveEventConnectionRejectedEventData(string ingestUrl = null, string streamId = null, string encoderIp = null, string encoderPort = null, string resultCode = null) - { - return new MediaLiveEventConnectionRejectedEventData( - ingestUrl, - streamId, - encoderIp, - encoderPort, - resultCode, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Gets the ingest URL provided by the live event. - /// Gets the stream Id. - /// Gets the remote IP. - /// Gets the remote port. - /// Gets the result code. - /// A new instance for mocking. - public static MediaLiveEventEncoderDisconnectedEventData MediaLiveEventEncoderDisconnectedEventData(string ingestUrl = null, string streamId = null, string encoderIp = null, string encoderPort = null, string resultCode = null) - { - return new MediaLiveEventEncoderDisconnectedEventData( - ingestUrl, - streamId, - encoderIp, - encoderPort, - resultCode, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Gets the ingest URL provided by the live event. - /// Gets the type of the track (Audio / Video). - /// Gets the track name. - /// Gets the bitrate of the track. - /// Gets the remote IP. - /// Gets the remote port. - /// Gets the first timestamp of the data chunk received. - /// Gets the duration of the first data chunk. - /// Gets the timescale in which timestamp is represented. - /// A new instance for mocking. - public static MediaLiveEventIncomingStreamReceivedEventData MediaLiveEventIncomingStreamReceivedEventData(string ingestUrl = null, string trackType = null, string trackName = null, long? bitrate = null, string encoderIp = null, string encoderPort = null, string timestamp = null, string duration = null, string timescale = null) - { - return new MediaLiveEventIncomingStreamReceivedEventData( - ingestUrl, - trackType, - trackName, - bitrate, - encoderIp, - encoderPort, - timestamp, - duration, - timescale, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Gets the minimum last timestamp received. - /// Gets the type of stream with minimum last timestamp. - /// Gets the maximum timestamp among all the tracks (audio or video). - /// Gets the type of stream with maximum last timestamp. - /// Gets the timescale in which \"MinLastTimestamp\" is represented. - /// Gets the timescale in which \"MaxLastTimestamp\" is represented. - /// A new instance for mocking. - public static MediaLiveEventIncomingStreamsOutOfSyncEventData MediaLiveEventIncomingStreamsOutOfSyncEventData(string minLastTimestamp = null, string typeOfStreamWithMinLastTimestamp = null, string maxLastTimestamp = null, string typeOfStreamWithMaxLastTimestamp = null, string timescaleOfMinLastTimestamp = null, string timescaleOfMaxLastTimestamp = null) - { - return new MediaLiveEventIncomingStreamsOutOfSyncEventData( - minLastTimestamp, - typeOfStreamWithMinLastTimestamp, - maxLastTimestamp, - typeOfStreamWithMaxLastTimestamp, - timescaleOfMinLastTimestamp, - timescaleOfMaxLastTimestamp, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Gets the first timestamp received for one of the quality levels. - /// Gets the duration of the data chunk with first timestamp. - /// Gets the timestamp received for some other quality levels. - /// Gets the duration of the data chunk with second timestamp. - /// Gets the timescale in which both the timestamps and durations are represented. - /// A new instance for mocking. - public static MediaLiveEventIncomingVideoStreamsOutOfSyncEventData MediaLiveEventIncomingVideoStreamsOutOfSyncEventData(string firstTimestamp = null, string firstDuration = null, string secondTimestamp = null, string secondDuration = null, string timescale = null) - { - return new MediaLiveEventIncomingVideoStreamsOutOfSyncEventData( - firstTimestamp, - firstDuration, - secondTimestamp, - secondDuration, - timescale, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Gets the timestamp of the data chunk dropped. - /// Gets the type of the track (Audio / Video). - /// Gets the bitrate of the track. - /// Gets the timescale of the Timestamp. - /// Gets the result code for fragment drop operation. - /// Gets the name of the track for which fragment is dropped. - /// A new instance for mocking. - public static MediaLiveEventIncomingDataChunkDroppedEventData MediaLiveEventIncomingDataChunkDroppedEventData(string timestamp = null, string trackType = null, long? bitrate = null, string timescale = null, string resultCode = null, string trackName = null) - { - return new MediaLiveEventIncomingDataChunkDroppedEventData( - timestamp, - trackType, - bitrate, - timescale, - resultCode, - trackName, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Gets the type of the track (Audio / Video). - /// Gets the track name. - /// Gets the Live Transcription language. - /// Gets the Live Transcription state. - /// Gets the bitrate of the track. - /// Gets the incoming bitrate. - /// Gets the track ingest drift value. - /// Gets the arrival UTC time of the last fragment. - /// Gets the last timestamp. - /// Gets the timescale of the last timestamp. - /// Gets the fragment Overlap count. - /// Gets the fragment Discontinuity count. - /// Gets Non increasing count. - /// Gets a value indicating whether unexpected bitrate is present or not. - /// Gets the state of the live event. - /// Gets a value indicating whether preview is healthy or not. - /// A new instance for mocking. - public static MediaLiveEventIngestHeartbeatEventData MediaLiveEventIngestHeartbeatEventData(string trackType = null, string trackName = null, string transcriptionLanguage = null, string transcriptionState = null, long? bitrate = null, long? incomingBitrate = null, string ingestDriftValue = null, string lastFragmentArrivalTime = null, string lastTimestamp = null, string timescale = null, long? overlapCount = null, long? discontinuityCount = null, long? nonincreasingCount = null, bool? unexpectedBitrate = null, string state = null, bool? healthy = null) - { - return new MediaLiveEventIngestHeartbeatEventData( - trackType, - trackName, - transcriptionLanguage, - transcriptionState, - bitrate, - incomingBitrate, - ingestDriftValue, - lastFragmentArrivalTime, - lastTimestamp, - timescale, - overlapCount, - discontinuityCount, - nonincreasingCount, - unexpectedBitrate, - state, - healthy, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Gets the type of the track (Audio / Video). - /// Gets the track name. - /// Gets the bitrate. - /// Gets the timestamp of the previous fragment. - /// Gets the timestamp of the current fragment. - /// Gets the timescale in which both timestamps and discontinuity gap are represented. - /// Gets the discontinuity gap between PreviousTimestamp and NewTimestamp. - /// A new instance for mocking. - public static MediaLiveEventTrackDiscontinuityDetectedEventData MediaLiveEventTrackDiscontinuityDetectedEventData(string trackType = null, string trackName = null, long? bitrate = null, string previousTimestamp = null, string newTimestamp = null, string timescale = null, string discontinuityGap = null) - { - return new MediaLiveEventTrackDiscontinuityDetectedEventData( - trackType, - trackName, - bitrate, - previousTimestamp, - newTimestamp, - timescale, - discontinuityGap, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Gets the channel latency in ms. - /// Gets the latency result code. - /// A new instance for mocking. - public static MediaLiveEventChannelArchiveHeartbeatEventData MediaLiveEventChannelArchiveHeartbeatEventData(string channelLatencyMs = null, string latencyResultCode = null) - { - return new MediaLiveEventChannelArchiveHeartbeatEventData(channelLatencyMs, latencyResultCode, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// 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. @@ -3638,7 +3146,7 @@ public static MediaLiveEventChannelArchiveHeartbeatEventData MediaLiveEventChann /// The subscription ID of the resource. /// The compliance reason code. May be empty. /// A new instance for mocking. - public static PolicyInsightsPolicyStateCreatedEventData PolicyInsightsPolicyStateCreatedEventData(DateTimeOffset timestamp = default, string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) + 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) { return new PolicyInsightsPolicyStateCreatedEventData( timestamp, @@ -3660,7 +3168,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 = default, string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) + 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) { return new PolicyInsightsPolicyStateChangedEventData( timestamp, @@ -3682,7 +3190,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 = default, string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) + 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) { return new PolicyInsightsPolicyStateDeletedEventData( timestamp, @@ -3700,7 +3208,7 @@ public static PolicyInsightsPolicyStateDeletedEventData PolicyInsightsPolicyStat /// The name of this event. /// The status of this event. Failed or succeeded. /// A new instance for mocking. - public static RedisPatchingCompletedEventData RedisPatchingCompletedEventData(DateTimeOffset timestamp = default, string name = null, string status = null) + public static RedisPatchingCompletedEventData RedisPatchingCompletedEventData(DateTimeOffset? timestamp = null, string name = null, string status = null) { return new RedisPatchingCompletedEventData(timestamp, name, status, serializedAdditionalRawData: null); } @@ -3710,29 +3218,29 @@ public static RedisPatchingCompletedEventData RedisPatchingCompletedEventData(Da /// The name of this event. /// The status of this event. Failed or succeeded. /// A new instance for mocking. - public static RedisScalingCompletedEventData RedisScalingCompletedEventData(DateTimeOffset timestamp = default, string name = null, string status = null) + public static RedisScalingCompletedEventData RedisScalingCompletedEventData(DateTimeOffset? timestamp = null, string name = null, string status = null) { return new RedisScalingCompletedEventData(timestamp, name, status, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// 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 = default, string name = null, string status = null) + /// A new instance for mocking. + public static RedisExportRdbCompletedEventData RedisExportRdbCompletedEventData(DateTimeOffset? timestamp = null, string name = null, string status = null) { - return new RedisExportRDBCompletedEventData(timestamp, name, status, serializedAdditionalRawData: null); + return new RedisExportRdbCompletedEventData(timestamp, name, status, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// 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 = default, string name = null, string status = null) + /// A new instance for mocking. + public static RedisImportRdbCompletedEventData RedisImportRdbCompletedEventData(DateTimeOffset? timestamp = null, string name = null, string status = null) { - return new RedisImportRDBCompletedEventData(timestamp, name, status, serializedAdditionalRawData: null); + return new RedisImportRdbCompletedEventData(timestamp, name, status, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -4132,7 +3640,7 @@ public static ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventDat /// 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 = default, string hubName = null, string connectionId = null, string userId = null) + public static SignalRServiceClientConnectionConnectedEventData SignalRServiceClientConnectionConnectedEventData(DateTimeOffset? timestamp = null, string hubName = null, string connectionId = null, string userId = null) { return new SignalRServiceClientConnectionConnectedEventData(timestamp, hubName, connectionId, userId, serializedAdditionalRawData: null); } @@ -4144,7 +3652,7 @@ public static SignalRServiceClientConnectionConnectedEventData SignalRServiceCli /// 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 = default, string hubName = null, string connectionId = null, string userId = null, string errorMessage = null) + public static SignalRServiceClientConnectionDisconnectedEventData SignalRServiceClientConnectionDisconnectedEventData(DateTimeOffset? timestamp = null, string hubName = null, string connectionId = null, string userId = null, string errorMessage = null) { return new SignalRServiceClientConnectionDisconnectedEventData( timestamp, @@ -4164,12 +3672,13 @@ public static SignalRServiceClientConnectionDisconnectedEventData SignalRService /// The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob. /// The offset of the blob in bytes. /// The type of blob. + /// The current tier of the blob. /// The path to the blob. /// 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. /// 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, string url = null, string sequencer = null, string identity = null, IReadOnlyDictionary storageDiagnostics = null) + 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, IReadOnlyDictionary storageDiagnostics = null) { storageDiagnostics ??= new Dictionary(); @@ -4182,6 +3691,7 @@ public static StorageBlobCreatedEventData StorageBlobCreatedEventData(string api contentLength, contentOffset, blobType, + accessTier, url, sequencer, identity, @@ -4323,13 +3833,30 @@ public static StorageDirectoryRenamedEventData StorageDirectoryRenamedEventData( /// Initializes a new instance of . /// 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. /// 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. /// A new instance for mocking. - public static StorageLifecyclePolicyCompletedEventData StorageLifecyclePolicyCompletedEventData(string scheduleTime = null, StorageLifecyclePolicyActionSummaryDetail deleteSummary = null, StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary = null, StorageLifecyclePolicyActionSummaryDetail tierToArchiveSummary = null) + public static StorageLifecyclePolicyCompletedEventData StorageLifecyclePolicyCompletedEventData(string scheduleTime = null, StorageLifecyclePolicyRunSummary policyRunSummary = null, StorageLifecyclePolicyActionSummaryDetail deleteSummary = null, StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary = null, StorageLifecyclePolicyActionSummaryDetail tierToArchiveSummary = null, StorageLifecyclePolicyActionSummaryDetail tierToColdSummary = null) + { + return new StorageLifecyclePolicyCompletedEventData( + scheduleTime, + policyRunSummary, + deleteSummary, + tierToCoolSummary, + tierToArchiveSummary, + tierToColdSummary, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Policy status can be Completed/CompletedWithError/Incomplete. + /// A new instance for mocking. + public static StorageLifecyclePolicyRunSummary StorageLifecyclePolicyRunSummary(StorageLifecycleCompletionStatus completionStatus = default) { - return new StorageLifecyclePolicyCompletedEventData(scheduleTime, deleteSummary, tierToCoolSummary, tierToArchiveSummary, serializedAdditionalRawData: null); + return new StorageLifecyclePolicyRunSummary(completionStatus, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -4349,12 +3876,14 @@ public static StorageLifecyclePolicyActionSummaryDetail StorageLifecyclePolicyAc /// The content type of the blob. This is the same as what would be returned in the Content-Type header from the blob. /// The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob. /// The type of blob. + /// The current tier of the blob. + /// The previous tier of the blob. /// The path to the blob. /// 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. /// 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, string url = null, string sequencer = null, string identity = null, IReadOnlyDictionary storageDiagnostics = null) + 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, IReadOnlyDictionary storageDiagnostics = null) { storageDiagnostics ??= new Dictionary(); @@ -4365,6 +3894,8 @@ public static StorageBlobTierChangedEventData StorageBlobTierChangedEventData(st contentType, contentLength, blobType, + accessTier, + previousTier, url, sequencer, identity, @@ -4411,7 +3942,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 = default, string accountName = null, string ruleName = null, string policyRunStatus = null, string policyRunStatusMessage = null, string policyRunId = null, string manifestBlobUrl = null) + 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) { return new StorageBlobInventoryPolicyCompletedEventData( scheduleDateTime, @@ -4431,7 +3962,7 @@ public static StorageBlobInventoryPolicyCompletedEventData StorageBlobInventoryP /// 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 = default, DateTimeOffset completedDateTime = default, string taskExecutionId = null, string taskName = null, Uri summaryReportBlobUrl = null) + public static StorageTaskCompletedEventData StorageTaskCompletedEventData(StorageTaskCompletedStatus? status = null, DateTimeOffset? completedDateTime = null, string taskExecutionId = null, string taskName = null, Uri summaryReportBlobUrl = null) { return new StorageTaskCompletedEventData( status, @@ -4446,7 +3977,7 @@ public static StorageTaskCompletedEventData StorageTaskCompletedEventData(Storag /// 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 = default, string taskExecutionId = null) + public static StorageTaskQueuedEventData StorageTaskQueuedEventData(DateTimeOffset? queuedDateTime = null, string taskExecutionId = null) { return new StorageTaskQueuedEventData(queuedDateTime, taskExecutionId, serializedAdditionalRawData: null); } @@ -4455,7 +3986,7 @@ public static StorageTaskQueuedEventData StorageTaskQueuedEventData(DateTimeOffs /// 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 = default, string taskExecutionId = null) + public static StorageTaskAssignmentQueuedEventData StorageTaskAssignmentQueuedEventData(DateTimeOffset? queuedOn = null, string taskExecutionId = null) { return new StorageTaskAssignmentQueuedEventData(queuedOn, taskExecutionId, serializedAdditionalRawData: null); } @@ -4467,7 +3998,7 @@ public static StorageTaskAssignmentQueuedEventData StorageTaskAssignmentQueuedEv /// 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 = default, DateTimeOffset completedOn = default, string taskExecutionId = null, string taskName = null, Uri summaryReportBlobUri = null) + public static StorageTaskAssignmentCompletedEventData StorageTaskAssignmentCompletedEventData(StorageTaskAssignmentCompletedStatus? status = null, DateTimeOffset? completedOn = null, string taskExecutionId = null, string taskName = null, Uri summaryReportBlobUri = null) { return new StorageTaskAssignmentCompletedEventData( status, @@ -4481,7 +4012,7 @@ public static StorageTaskAssignmentCompletedEventData StorageTaskAssignmentCompl /// Initializes a new instance of . /// Type of action of the operation. /// A new instance for mocking. - public static AppEventTypeDetail AppEventTypeDetail(AppAction action = default) + public static AppEventTypeDetail AppEventTypeDetail(AppAction? action = null) { return new AppEventTypeDetail(action, serializedAdditionalRawData: null); } @@ -4779,7 +4310,7 @@ public static WebAppServicePlanUpdatedEventData WebAppServicePlanUpdatedEventDat /// 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 = default, AppServicePlanAction action = default, AsyncStatus status = default) + public static AppServicePlanEventTypeDetail AppServicePlanEventTypeDetail(StampKind? stampKind = null, AppServicePlanAction? action = null, AsyncStatus? status = null) { return new AppServicePlanEventTypeDetail(stampKind, action, status, serializedAdditionalRawData: null); } @@ -4835,7 +4366,7 @@ public static SubscriptionDeletedEventData SubscriptionDeletedEventData(string e return new SubscriptionDeletedEventData(eventSubscriptionId, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// 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 @@ -4843,13 +4374,13 @@ 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) + /// A new instance for mocking. + public static EventGridMqttClientEventData EventGridMqttClientEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) { - return new EventGridMQTTClientEventData(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData: null); + return new EventGridMqttClientEventData(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// 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 @@ -4865,12 +4396,12 @@ public static EventGridMQTTClientEventData EventGridMQTTClientEventData(string c /// 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 = null, string clientName = null, string namespaceName = null, EventGridMQTTClientState state = default, DateTimeOffset createdOn = default, DateTimeOffset updatedOn = default, IReadOnlyDictionary attributes = null) + /// 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) { attributes ??= new Dictionary(); - return new EventGridMQTTClientCreatedOrUpdatedEventData( + return new EventGridMqttClientCreatedOrUpdatedEventData( clientAuthenticationName, clientName, namespaceName, @@ -4881,7 +4412,7 @@ public static EventGridMQTTClientCreatedOrUpdatedEventData EventGridMQTTClientCr attributes); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// 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 @@ -4889,13 +4420,13 @@ 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) + /// A new instance for mocking. + public static EventGridMqttClientDeletedEventData EventGridMqttClientDeletedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) { - return new EventGridMQTTClientDeletedEventData(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData: null); + return new EventGridMqttClientDeletedEventData(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// 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 @@ -4912,10 +4443,10 @@ public static EventGridMQTTClientDeletedEventData EventGridMQTTClientDeletedEven /// disconnected events. Latest event will have a sequence number that is higher /// 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) + /// A new instance for mocking. + public static EventGridMqttClientSessionConnectedEventData EventGridMqttClientSessionConnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = null) { - return new EventGridMQTTClientSessionConnectedEventData( + return new EventGridMqttClientSessionConnectedEventData( clientAuthenticationName, clientName, namespaceName, @@ -4924,7 +4455,7 @@ public static EventGridMQTTClientSessionConnectedEventData EventGridMQTTClientSe sequenceNumber); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// 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 @@ -4945,10 +4476,10 @@ public static EventGridMQTTClientSessionConnectedEventData EventGridMQTTClientSe /// Reason for the disconnection of the MQTT client's session. The value could be /// 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 = default) + /// 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) { - return new EventGridMQTTClientSessionDisconnectedEventData( + return new EventGridMqttClientSessionDisconnectedEventData( clientAuthenticationName, clientName, namespaceName, @@ -4994,7 +4525,7 @@ public static ResourceNotificationsResourceUpdatedDetails ResourceNotificationsR /// Initializes a new instance of . /// Date and Time when resource was updated. /// A new instance for mocking. - public static ResourceNotificationsOperationalDetails ResourceNotificationsOperationalDetails(DateTimeOffset resourceEventTime = default) + public static ResourceNotificationsOperationalDetails ResourceNotificationsOperationalDetails(DateTimeOffset? resourceEventTime = null) { return new ResourceNotificationsOperationalDetails(resourceEventTime, serializedAdditionalRawData: null); } @@ -5019,14 +4550,14 @@ public static ResourceNotificationsHealthResourcesAnnotatedEventData ResourceNot return new ResourceNotificationsHealthResourcesAnnotatedEventData(resourceDetails, operationalDetails, apiVersion, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// 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) + /// 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. + /// A new instance for mocking. + public static ResourceNotificationsResourceDeletedDetails ResourceNotificationsResourceDeletedDetails(string id = null, string name = null, string type = null) { - return new ResourceNotificationsResourceManagementCreatedOrUpdatedEventData(resourceDetails, operationalDetails, apiVersion, serializedAdditionalRawData: null); + return new ResourceNotificationsResourceDeletedDetails(id, name, type, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -5038,14 +4569,14 @@ public static ResourceNotificationsResourceDeletedEventData ResourceNotification return new ResourceNotificationsResourceDeletedEventData(resourceDetails, operationalDetails, serializedAdditionalRawData: null); } - /// 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. - /// A new instance for mocking. - public static ResourceNotificationsResourceDeletedDetails ResourceNotificationsResourceDeletedDetails(string id = null, string name = null, string type = null) + /// Initializes a new instance of . + /// 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) { - return new ResourceNotificationsResourceDeletedDetails(id, name, type, serializedAdditionalRawData: null); + return new ResourceNotificationsResourceManagementCreatedOrUpdatedEventData(resourceDetails, operationalDetails, apiVersion, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -5056,5 +4587,15 @@ public static ResourceNotificationsResourceManagementDeletedEventData ResourceNo { return new ResourceNotificationsResourceManagementDeletedEventData(resourceDetails, operationalDetails, serializedAdditionalRawData: null); } + + /// Initializes a new instance of . + /// 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) + { + return new ResourceNotificationsContainerServiceEventResourcesScheduledEventData(resourceDetails, operationalDetails, apiVersion, serializedAdditionalRawData: null); + } } } 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 1df0132a3c36..bcfc2a20f2a0 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 @@ -69,10 +69,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("lastSequenceNumber"u8); writer.WriteNumberValue(LastSequenceNumber.Value); } - writer.WritePropertyName("firstEnqueueTime"u8); - writer.WriteStringValue(FirstEnqueueTime, "O"); - writer.WritePropertyName("lastEnqueueTime"u8); - writer.WriteStringValue(LastEnqueueTime, "O"); + if (Optional.IsDefined(FirstEnqueueTime)) + { + writer.WritePropertyName("firstEnqueueTime"u8); + writer.WriteStringValue(FirstEnqueueTime.Value, "O"); + } + if (Optional.IsDefined(LastEnqueueTime)) + { + writer.WritePropertyName("lastEnqueueTime"u8); + writer.WriteStringValue(LastEnqueueTime.Value, "O"); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -117,8 +123,8 @@ internal static EventHubCaptureFileCreatedEventData DeserializeEventHubCaptureFi int? eventCount = default; int? firstSequenceNumber = default; int? lastSequenceNumber = default; - DateTimeOffset firstEnqueueTime = default; - DateTimeOffset lastEnqueueTime = default; + DateTimeOffset? firstEnqueueTime = default; + DateTimeOffset? lastEnqueueTime = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -176,11 +182,19 @@ internal static EventHubCaptureFileCreatedEventData DeserializeEventHubCaptureFi } if (property.NameEquals("firstEnqueueTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } firstEnqueueTime = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("lastEnqueueTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } lastEnqueueTime = property.Value.GetDateTimeOffset("O"); continue; } 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 0c670ab7b195..ff8f7f2a0e35 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventHubCaptureFileCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventHubCaptureFileCreatedEventData.cs @@ -46,12 +46,8 @@ public partial class EventHubCaptureFileCreatedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The first time from the queue. - /// The last time from the queue. - internal EventHubCaptureFileCreatedEventData(DateTimeOffset firstEnqueueTime, DateTimeOffset lastEnqueueTime) + internal EventHubCaptureFileCreatedEventData() { - FirstEnqueueTime = firstEnqueueTime; - LastEnqueueTime = lastEnqueueTime; } /// Initializes a new instance of . @@ -65,7 +61,7 @@ internal EventHubCaptureFileCreatedEventData(DateTimeOffset firstEnqueueTime, Da /// 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) + internal EventHubCaptureFileCreatedEventData(string fileurl, string fileType, string partitionId, int? sizeInBytes, int? eventCount, int? firstSequenceNumber, int? lastSequenceNumber, DateTimeOffset? firstEnqueueTime, DateTimeOffset? lastEnqueueTime, IDictionary serializedAdditionalRawData) { Fileurl = fileurl; FileType = fileType; @@ -79,11 +75,6 @@ internal EventHubCaptureFileCreatedEventData(string fileurl, string fileType, st _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal EventHubCaptureFileCreatedEventData() - { - } - /// The path to the capture file. public string Fileurl { get; } /// The file type of the capture file. @@ -99,8 +90,8 @@ internal EventHubCaptureFileCreatedEventData() /// The last sequence number from the queue. public int? LastSequenceNumber { get; } /// The first time from the queue. - public DateTimeOffset FirstEnqueueTime { get; } + public DateTimeOffset? FirstEnqueueTime { get; } /// The last time from the queue. - public DateTimeOffset LastEnqueueTime { get; } + 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 feacefff2563..41eaebac4c23 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 @@ -34,31 +34,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(HealthcareDicomImageCreatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(PartitionName)) - { - writer.WritePropertyName("partitionName"u8); - writer.WriteStringValue(PartitionName); - } - if (Optional.IsDefined(ImageStudyInstanceUid)) - { - writer.WritePropertyName("imageStudyInstanceUid"u8); - writer.WriteStringValue(ImageStudyInstanceUid); - } - if (Optional.IsDefined(ImageSeriesInstanceUid)) - { - writer.WritePropertyName("imageSeriesInstanceUid"u8); - writer.WriteStringValue(ImageSeriesInstanceUid); - } - if (Optional.IsDefined(ImageSopInstanceUid)) - { - writer.WritePropertyName("imageSopInstanceUid"u8); - writer.WriteStringValue(ImageSopInstanceUid); - } - if (Optional.IsDefined(ServiceHostName)) - { - writer.WritePropertyName("serviceHostName"u8); - writer.WriteStringValue(ServiceHostName); - } + writer.WritePropertyName("partitionName"u8); + writer.WriteStringValue(PartitionName); + writer.WritePropertyName("imageStudyInstanceUid"u8); + writer.WriteStringValue(ImageStudyInstanceUid); + writer.WritePropertyName("imageSeriesInstanceUid"u8); + writer.WriteStringValue(ImageSeriesInstanceUid); + writer.WritePropertyName("imageSopInstanceUid"u8); + writer.WriteStringValue(ImageSopInstanceUid); + writer.WritePropertyName("serviceHostName"u8); + writer.WriteStringValue(ServiceHostName); if (Optional.IsDefined(SequenceNumber)) { writer.WritePropertyName("sequenceNumber"u8); 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 debb8542d70c..8202334c23bd 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageCreatedEventData.cs @@ -46,8 +46,25 @@ public partial class HealthcareDicomImageCreatedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal HealthcareDicomImageCreatedEventData() + /// Data partition name. + /// Unique identifier for the Study. + /// 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; + ImageSopInstanceUid = imageSopInstanceUid; + ServiceHostName = serviceHostName; } /// Initializes a new instance of . @@ -69,6 +86,11 @@ internal HealthcareDicomImageCreatedEventData(string partitionName, string image _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal HealthcareDicomImageCreatedEventData() + { + } + /// Data partition name. public string PartitionName { get; } /// Unique identifier for the Study. 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 bb9a3dfd42ae..105ab8bb3223 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 @@ -34,31 +34,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(HealthcareDicomImageDeletedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(PartitionName)) - { - writer.WritePropertyName("partitionName"u8); - writer.WriteStringValue(PartitionName); - } - if (Optional.IsDefined(ImageStudyInstanceUid)) - { - writer.WritePropertyName("imageStudyInstanceUid"u8); - writer.WriteStringValue(ImageStudyInstanceUid); - } - if (Optional.IsDefined(ImageSeriesInstanceUid)) - { - writer.WritePropertyName("imageSeriesInstanceUid"u8); - writer.WriteStringValue(ImageSeriesInstanceUid); - } - if (Optional.IsDefined(ImageSopInstanceUid)) - { - writer.WritePropertyName("imageSopInstanceUid"u8); - writer.WriteStringValue(ImageSopInstanceUid); - } - if (Optional.IsDefined(ServiceHostName)) - { - writer.WritePropertyName("serviceHostName"u8); - writer.WriteStringValue(ServiceHostName); - } + writer.WritePropertyName("partitionName"u8); + writer.WriteStringValue(PartitionName); + writer.WritePropertyName("imageStudyInstanceUid"u8); + writer.WriteStringValue(ImageStudyInstanceUid); + writer.WritePropertyName("imageSeriesInstanceUid"u8); + writer.WriteStringValue(ImageSeriesInstanceUid); + writer.WritePropertyName("imageSopInstanceUid"u8); + writer.WriteStringValue(ImageSopInstanceUid); + writer.WritePropertyName("serviceHostName"u8); + writer.WriteStringValue(ServiceHostName); if (Optional.IsDefined(SequenceNumber)) { writer.WritePropertyName("sequenceNumber"u8); 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 abac35f2b0bc..01ba56441069 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageDeletedEventData.cs @@ -46,8 +46,25 @@ public partial class HealthcareDicomImageDeletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal HealthcareDicomImageDeletedEventData() + /// Data partition name. + /// Unique identifier for the Study. + /// 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; + ImageSopInstanceUid = imageSopInstanceUid; + ServiceHostName = serviceHostName; } /// Initializes a new instance of . @@ -69,6 +86,11 @@ internal HealthcareDicomImageDeletedEventData(string partitionName, string image _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal HealthcareDicomImageDeletedEventData() + { + } + /// Data partition name. public string PartitionName { get; } /// Unique identifier for the Study. 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 54bba1c9d572..6a26d14ec5e0 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 @@ -34,31 +34,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(HealthcareDicomImageUpdatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(PartitionName)) - { - writer.WritePropertyName("partitionName"u8); - writer.WriteStringValue(PartitionName); - } - if (Optional.IsDefined(ImageStudyInstanceUid)) - { - writer.WritePropertyName("imageStudyInstanceUid"u8); - writer.WriteStringValue(ImageStudyInstanceUid); - } - if (Optional.IsDefined(ImageSeriesInstanceUid)) - { - writer.WritePropertyName("imageSeriesInstanceUid"u8); - writer.WriteStringValue(ImageSeriesInstanceUid); - } - if (Optional.IsDefined(ImageSopInstanceUid)) - { - writer.WritePropertyName("imageSopInstanceUid"u8); - writer.WriteStringValue(ImageSopInstanceUid); - } - if (Optional.IsDefined(ServiceHostName)) - { - writer.WritePropertyName("serviceHostName"u8); - writer.WriteStringValue(ServiceHostName); - } + writer.WritePropertyName("partitionName"u8); + writer.WriteStringValue(PartitionName); + writer.WritePropertyName("imageStudyInstanceUid"u8); + writer.WriteStringValue(ImageStudyInstanceUid); + writer.WritePropertyName("imageSeriesInstanceUid"u8); + writer.WriteStringValue(ImageSeriesInstanceUid); + writer.WritePropertyName("imageSopInstanceUid"u8); + writer.WriteStringValue(ImageSopInstanceUid); + writer.WritePropertyName("serviceHostName"u8); + writer.WriteStringValue(ServiceHostName); if (Optional.IsDefined(SequenceNumber)) { writer.WritePropertyName("sequenceNumber"u8); 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 eb248a7f72ad..f81a0ac11aa9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareDicomImageUpdatedEventData.cs @@ -46,8 +46,25 @@ public partial class HealthcareDicomImageUpdatedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal HealthcareDicomImageUpdatedEventData() + /// Data partition name. + /// Unique identifier for the Study. + /// 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; + ImageSopInstanceUid = imageSopInstanceUid; + ServiceHostName = serviceHostName; } /// Initializes a new instance of . @@ -69,6 +86,11 @@ internal HealthcareDicomImageUpdatedEventData(string partitionName, string image _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal HealthcareDicomImageUpdatedEventData() + { + } + /// Data partition name. public string PartitionName { get; } /// Unique identifier for the Study. 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 5750aeda70b5..a9da3e071c06 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 @@ -34,18 +34,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(HealthcareFhirResourceCreatedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("resourceType"u8); - writer.WriteStringValue(FhirResourceType.ToString()); - if (Optional.IsDefined(FhirServiceHostName)) + if (Optional.IsDefined(FhirResourceType)) { - writer.WritePropertyName("resourceFhirAccount"u8); - writer.WriteStringValue(FhirServiceHostName); - } - if (Optional.IsDefined(FhirResourceId)) - { - writer.WritePropertyName("resourceFhirId"u8); - writer.WriteStringValue(FhirResourceId); + writer.WritePropertyName("resourceType"u8); + writer.WriteStringValue(FhirResourceType.Value.ToString()); } + writer.WritePropertyName("resourceFhirAccount"u8); + writer.WriteStringValue(FhirServiceHostName); + writer.WritePropertyName("resourceFhirId"u8); + writer.WriteStringValue(FhirResourceId); if (Optional.IsDefined(FhirResourceVersionId)) { writer.WritePropertyName("resourceVersionId"u8); @@ -88,7 +85,7 @@ internal static HealthcareFhirResourceCreatedEventData DeserializeHealthcareFhir { return null; } - HealthcareFhirResourceType resourceType = default; + HealthcareFhirResourceType? resourceType = default; string resourceFhirAccount = default; string resourceFhirId = default; long? resourceVersionId = default; @@ -98,6 +95,10 @@ internal static HealthcareFhirResourceCreatedEventData DeserializeHealthcareFhir { if (property.NameEquals("resourceType"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } resourceType = new HealthcareFhirResourceType(property.Value.GetString()); continue; } 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 ed48894c3e41..f6ed3ccbdae2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceCreatedEventData.cs @@ -46,10 +46,16 @@ public partial class HealthcareFhirResourceCreatedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Type of HL7 FHIR resource. - internal HealthcareFhirResourceCreatedEventData(HealthcareFhirResourceType fhirResourceType) + /// Domain name of FHIR account for this resource. + /// Id of HL7 FHIR resource. + /// or is null. + internal HealthcareFhirResourceCreatedEventData(string fhirServiceHostName, string fhirResourceId) { - FhirResourceType = fhirResourceType; + Argument.AssertNotNull(fhirServiceHostName, nameof(fhirServiceHostName)); + Argument.AssertNotNull(fhirResourceId, nameof(fhirResourceId)); + + FhirServiceHostName = fhirServiceHostName; + FhirResourceId = fhirResourceId; } /// Initializes a new instance of . @@ -58,7 +64,7 @@ internal HealthcareFhirResourceCreatedEventData(HealthcareFhirResourceType fhirR /// 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) + internal HealthcareFhirResourceCreatedEventData(HealthcareFhirResourceType? fhirResourceType, string fhirServiceHostName, string fhirResourceId, long? fhirResourceVersionId, IDictionary serializedAdditionalRawData) { FhirResourceType = fhirResourceType; FhirServiceHostName = fhirServiceHostName; @@ -73,7 +79,7 @@ internal HealthcareFhirResourceCreatedEventData() } /// Type of HL7 FHIR resource. - public HealthcareFhirResourceType FhirResourceType { get; } + public HealthcareFhirResourceType? FhirResourceType { get; } /// Domain name of FHIR account for this resource. public string FhirServiceHostName { get; } /// Id of HL7 FHIR resource. 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 f51a529553b5..f303e72b00ad 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 @@ -34,18 +34,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(HealthcareFhirResourceDeletedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("resourceType"u8); - writer.WriteStringValue(FhirResourceType.ToString()); - if (Optional.IsDefined(FhirServiceHostName)) + if (Optional.IsDefined(FhirResourceType)) { - writer.WritePropertyName("resourceFhirAccount"u8); - writer.WriteStringValue(FhirServiceHostName); - } - if (Optional.IsDefined(FhirResourceId)) - { - writer.WritePropertyName("resourceFhirId"u8); - writer.WriteStringValue(FhirResourceId); + writer.WritePropertyName("resourceType"u8); + writer.WriteStringValue(FhirResourceType.Value.ToString()); } + writer.WritePropertyName("resourceFhirAccount"u8); + writer.WriteStringValue(FhirServiceHostName); + writer.WritePropertyName("resourceFhirId"u8); + writer.WriteStringValue(FhirResourceId); if (Optional.IsDefined(FhirResourceVersionId)) { writer.WritePropertyName("resourceVersionId"u8); @@ -88,7 +85,7 @@ internal static HealthcareFhirResourceDeletedEventData DeserializeHealthcareFhir { return null; } - HealthcareFhirResourceType resourceType = default; + HealthcareFhirResourceType? resourceType = default; string resourceFhirAccount = default; string resourceFhirId = default; long? resourceVersionId = default; @@ -98,6 +95,10 @@ internal static HealthcareFhirResourceDeletedEventData DeserializeHealthcareFhir { if (property.NameEquals("resourceType"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } resourceType = new HealthcareFhirResourceType(property.Value.GetString()); continue; } 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 6e883f6f61e4..441bbec65068 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceDeletedEventData.cs @@ -46,10 +46,16 @@ public partial class HealthcareFhirResourceDeletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Type of HL7 FHIR resource. - internal HealthcareFhirResourceDeletedEventData(HealthcareFhirResourceType fhirResourceType) + /// Domain name of FHIR account for this resource. + /// Id of HL7 FHIR resource. + /// or is null. + internal HealthcareFhirResourceDeletedEventData(string fhirServiceHostName, string fhirResourceId) { - FhirResourceType = fhirResourceType; + Argument.AssertNotNull(fhirServiceHostName, nameof(fhirServiceHostName)); + Argument.AssertNotNull(fhirResourceId, nameof(fhirResourceId)); + + FhirServiceHostName = fhirServiceHostName; + FhirResourceId = fhirResourceId; } /// Initializes a new instance of . @@ -58,7 +64,7 @@ internal HealthcareFhirResourceDeletedEventData(HealthcareFhirResourceType fhirR /// 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) + internal HealthcareFhirResourceDeletedEventData(HealthcareFhirResourceType? fhirResourceType, string fhirServiceHostName, string fhirResourceId, long? fhirResourceVersionId, IDictionary serializedAdditionalRawData) { FhirResourceType = fhirResourceType; FhirServiceHostName = fhirServiceHostName; @@ -73,7 +79,7 @@ internal HealthcareFhirResourceDeletedEventData() } /// Type of HL7 FHIR resource. - public HealthcareFhirResourceType FhirResourceType { get; } + public HealthcareFhirResourceType? FhirResourceType { get; } /// Domain name of FHIR account for this resource. public string FhirServiceHostName { get; } /// Id of HL7 FHIR resource. 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 c8002a984a9c..3175942b0b59 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 @@ -34,18 +34,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(HealthcareFhirResourceUpdatedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("resourceType"u8); - writer.WriteStringValue(FhirResourceType.ToString()); - if (Optional.IsDefined(FhirServiceHostName)) + if (Optional.IsDefined(FhirResourceType)) { - writer.WritePropertyName("resourceFhirAccount"u8); - writer.WriteStringValue(FhirServiceHostName); - } - if (Optional.IsDefined(FhirResourceId)) - { - writer.WritePropertyName("resourceFhirId"u8); - writer.WriteStringValue(FhirResourceId); + writer.WritePropertyName("resourceType"u8); + writer.WriteStringValue(FhirResourceType.Value.ToString()); } + writer.WritePropertyName("resourceFhirAccount"u8); + writer.WriteStringValue(FhirServiceHostName); + writer.WritePropertyName("resourceFhirId"u8); + writer.WriteStringValue(FhirResourceId); if (Optional.IsDefined(FhirResourceVersionId)) { writer.WritePropertyName("resourceVersionId"u8); @@ -88,7 +85,7 @@ internal static HealthcareFhirResourceUpdatedEventData DeserializeHealthcareFhir { return null; } - HealthcareFhirResourceType resourceType = default; + HealthcareFhirResourceType? resourceType = default; string resourceFhirAccount = default; string resourceFhirId = default; long? resourceVersionId = default; @@ -98,6 +95,10 @@ internal static HealthcareFhirResourceUpdatedEventData DeserializeHealthcareFhir { if (property.NameEquals("resourceType"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } resourceType = new HealthcareFhirResourceType(property.Value.GetString()); continue; } 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 7133f01a47d2..0dc5a17532fb 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceUpdatedEventData.cs @@ -46,10 +46,16 @@ public partial class HealthcareFhirResourceUpdatedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Type of HL7 FHIR resource. - internal HealthcareFhirResourceUpdatedEventData(HealthcareFhirResourceType fhirResourceType) + /// Domain name of FHIR account for this resource. + /// Id of HL7 FHIR resource. + /// or is null. + internal HealthcareFhirResourceUpdatedEventData(string fhirServiceHostName, string fhirResourceId) { - FhirResourceType = fhirResourceType; + Argument.AssertNotNull(fhirServiceHostName, nameof(fhirServiceHostName)); + Argument.AssertNotNull(fhirResourceId, nameof(fhirResourceId)); + + FhirServiceHostName = fhirServiceHostName; + FhirResourceId = fhirResourceId; } /// Initializes a new instance of . @@ -58,7 +64,7 @@ internal HealthcareFhirResourceUpdatedEventData(HealthcareFhirResourceType fhirR /// 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) + internal HealthcareFhirResourceUpdatedEventData(HealthcareFhirResourceType? fhirResourceType, string fhirServiceHostName, string fhirResourceId, long? fhirResourceVersionId, IDictionary serializedAdditionalRawData) { FhirResourceType = fhirResourceType; FhirServiceHostName = fhirServiceHostName; @@ -73,7 +79,7 @@ internal HealthcareFhirResourceUpdatedEventData() } /// Type of HL7 FHIR resource. - public HealthcareFhirResourceType FhirResourceType { get; } + public HealthcareFhirResourceType? FhirResourceType { get; } /// Domain name of FHIR account for this resource. public string FhirServiceHostName { get; } /// Id of HL7 FHIR resource. 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 bab1f7fd67b6..f94cca1d08ef 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceConnectedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceConnectedEventData.cs @@ -14,10 +14,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class IotHubDeviceConnectedEventData : DeviceConnectionStateEventProperties { /// 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. - /// is null. - internal IotHubDeviceConnectedEventData(DeviceConnectionStateEventInfo deviceConnectionStateEventInfo) : base(deviceConnectionStateEventInfo) + /// , 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)); } 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 6fff044ca2cd..b2e7faff176b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceCreatedEventData.cs @@ -14,10 +14,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class IotHubDeviceCreatedEventData : DeviceLifeCycleEventProperties { /// 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. - /// is null. - internal IotHubDeviceCreatedEventData(DeviceTwinInfo twin) : base(twin) + /// , 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)); } 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 3bc2d22cdc0e..6226a6094009 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceDeletedEventData.cs @@ -14,10 +14,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class IotHubDeviceDeletedEventData : DeviceLifeCycleEventProperties { /// 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. - /// is null. - internal IotHubDeviceDeletedEventData(DeviceTwinInfo twin) : base(twin) + /// , 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)); } 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 3d5cbc20be6d..ca74eb38c106 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceDisconnectedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/IotHubDeviceDisconnectedEventData.cs @@ -14,10 +14,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class IotHubDeviceDisconnectedEventData : DeviceConnectionStateEventProperties { /// 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. - /// is null. - internal IotHubDeviceDisconnectedEventData(DeviceConnectionStateEventInfo deviceConnectionStateEventInfo) : base(deviceConnectionStateEventInfo) + /// , 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)); } 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 1889a7a88d95..a7ac599f13c7 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 @@ -34,31 +34,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(KeyVaultAccessPolicyChangedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("Id"u8); - writer.WriteStringValue(Id); - } - if (Optional.IsDefined(VaultName)) - { - writer.WritePropertyName("VaultName"u8); - writer.WriteStringValue(VaultName); - } - if (Optional.IsDefined(ObjectType)) - { - writer.WritePropertyName("ObjectType"u8); - writer.WriteStringValue(ObjectType); - } - if (Optional.IsDefined(ObjectName)) - { - writer.WritePropertyName("ObjectName"u8); - writer.WriteStringValue(ObjectName); - } - if (Optional.IsDefined(Version)) - { - writer.WritePropertyName("Version"u8); - writer.WriteStringValue(Version); - } + writer.WritePropertyName("Id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("VaultName"u8); + writer.WriteStringValue(VaultName); + writer.WritePropertyName("ObjectType"u8); + writer.WriteStringValue(ObjectType); + writer.WritePropertyName("ObjectName"u8); + writer.WriteStringValue(ObjectName); + writer.WritePropertyName("Version"u8); + writer.WriteStringValue(Version); if (Optional.IsDefined(NBF)) { writer.WritePropertyName("NBF"u8); 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 98eb5f13d699..35ef2fcff5e6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultAccessPolicyChangedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultAccessPolicyChangedEventData.cs @@ -46,8 +46,25 @@ public partial class KeyVaultAccessPolicyChangedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal KeyVaultAccessPolicyChangedEventData() + /// 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. + /// 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; + ObjectName = objectName; + Version = version; } /// Initializes a new instance of . @@ -71,6 +88,11 @@ internal KeyVaultAccessPolicyChangedEventData(string id, string vaultName, strin _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal KeyVaultAccessPolicyChangedEventData() + { + } + /// The id of the object that triggered this event. public string Id { get; } /// Key vault name of the object that triggered this event. 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 97133d32eff4..d5ae93322338 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 @@ -34,31 +34,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(KeyVaultCertificateExpiredEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("Id"u8); - writer.WriteStringValue(Id); - } - if (Optional.IsDefined(VaultName)) - { - writer.WritePropertyName("VaultName"u8); - writer.WriteStringValue(VaultName); - } - if (Optional.IsDefined(ObjectType)) - { - writer.WritePropertyName("ObjectType"u8); - writer.WriteStringValue(ObjectType); - } - if (Optional.IsDefined(ObjectName)) - { - writer.WritePropertyName("ObjectName"u8); - writer.WriteStringValue(ObjectName); - } - if (Optional.IsDefined(Version)) - { - writer.WritePropertyName("Version"u8); - writer.WriteStringValue(Version); - } + writer.WritePropertyName("Id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("VaultName"u8); + writer.WriteStringValue(VaultName); + writer.WritePropertyName("ObjectType"u8); + writer.WriteStringValue(ObjectType); + writer.WritePropertyName("ObjectName"u8); + writer.WriteStringValue(ObjectName); + writer.WritePropertyName("Version"u8); + writer.WriteStringValue(Version); if (Optional.IsDefined(NBF)) { writer.WritePropertyName("NBF"u8); 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 c210c2b0a99a..eefd80650744 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateExpiredEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateExpiredEventData.cs @@ -46,8 +46,25 @@ public partial class KeyVaultCertificateExpiredEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal KeyVaultCertificateExpiredEventData() + /// 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. + /// 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; + ObjectName = objectName; + Version = version; } /// Initializes a new instance of . @@ -71,6 +88,11 @@ internal KeyVaultCertificateExpiredEventData(string id, string vaultName, string _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal KeyVaultCertificateExpiredEventData() + { + } + /// The id of the object that triggered this event. public string Id { get; } /// Key vault name of the object that triggered this event. 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 93bdba22a7c9..916471725a84 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 @@ -34,31 +34,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(KeyVaultCertificateNearExpiryEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("Id"u8); - writer.WriteStringValue(Id); - } - if (Optional.IsDefined(VaultName)) - { - writer.WritePropertyName("VaultName"u8); - writer.WriteStringValue(VaultName); - } - if (Optional.IsDefined(ObjectType)) - { - writer.WritePropertyName("ObjectType"u8); - writer.WriteStringValue(ObjectType); - } - if (Optional.IsDefined(ObjectName)) - { - writer.WritePropertyName("ObjectName"u8); - writer.WriteStringValue(ObjectName); - } - if (Optional.IsDefined(Version)) - { - writer.WritePropertyName("Version"u8); - writer.WriteStringValue(Version); - } + writer.WritePropertyName("Id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("VaultName"u8); + writer.WriteStringValue(VaultName); + writer.WritePropertyName("ObjectType"u8); + writer.WriteStringValue(ObjectType); + writer.WritePropertyName("ObjectName"u8); + writer.WriteStringValue(ObjectName); + writer.WritePropertyName("Version"u8); + writer.WriteStringValue(Version); if (Optional.IsDefined(NBF)) { writer.WritePropertyName("NBF"u8); 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 149ea3648db0..7d3580ca230d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateNearExpiryEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateNearExpiryEventData.cs @@ -46,8 +46,25 @@ public partial class KeyVaultCertificateNearExpiryEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal KeyVaultCertificateNearExpiryEventData() + /// 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. + /// 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; + ObjectName = objectName; + Version = version; } /// Initializes a new instance of . @@ -71,6 +88,11 @@ internal KeyVaultCertificateNearExpiryEventData(string id, string vaultName, str _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal KeyVaultCertificateNearExpiryEventData() + { + } + /// The id of the object that triggered this event. public string Id { get; } /// Key vault name of the object that triggered this event. 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 20a19baa3ea8..1ca8334ebf3c 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 @@ -34,31 +34,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(KeyVaultCertificateNewVersionCreatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("Id"u8); - writer.WriteStringValue(Id); - } - if (Optional.IsDefined(VaultName)) - { - writer.WritePropertyName("VaultName"u8); - writer.WriteStringValue(VaultName); - } - if (Optional.IsDefined(ObjectType)) - { - writer.WritePropertyName("ObjectType"u8); - writer.WriteStringValue(ObjectType); - } - if (Optional.IsDefined(ObjectName)) - { - writer.WritePropertyName("ObjectName"u8); - writer.WriteStringValue(ObjectName); - } - if (Optional.IsDefined(Version)) - { - writer.WritePropertyName("Version"u8); - writer.WriteStringValue(Version); - } + writer.WritePropertyName("Id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("VaultName"u8); + writer.WriteStringValue(VaultName); + writer.WritePropertyName("ObjectType"u8); + writer.WriteStringValue(ObjectType); + writer.WritePropertyName("ObjectName"u8); + writer.WriteStringValue(ObjectName); + writer.WritePropertyName("Version"u8); + writer.WriteStringValue(Version); if (Optional.IsDefined(NBF)) { writer.WritePropertyName("NBF"u8); 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 317264ad4e2e..bac010c9001f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateNewVersionCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultCertificateNewVersionCreatedEventData.cs @@ -46,8 +46,25 @@ public partial class KeyVaultCertificateNewVersionCreatedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal KeyVaultCertificateNewVersionCreatedEventData() + /// 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. + /// 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; + ObjectName = objectName; + Version = version; } /// Initializes a new instance of . @@ -71,6 +88,11 @@ internal KeyVaultCertificateNewVersionCreatedEventData(string id, string vaultNa _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal KeyVaultCertificateNewVersionCreatedEventData() + { + } + /// The id of the object that triggered this event. public string Id { get; } /// Key vault name of the object that triggered this event. 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 f3399ac7eb99..4c106de46849 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 @@ -34,31 +34,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(KeyVaultKeyExpiredEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("Id"u8); - writer.WriteStringValue(Id); - } - if (Optional.IsDefined(VaultName)) - { - writer.WritePropertyName("VaultName"u8); - writer.WriteStringValue(VaultName); - } - if (Optional.IsDefined(ObjectType)) - { - writer.WritePropertyName("ObjectType"u8); - writer.WriteStringValue(ObjectType); - } - if (Optional.IsDefined(ObjectName)) - { - writer.WritePropertyName("ObjectName"u8); - writer.WriteStringValue(ObjectName); - } - if (Optional.IsDefined(Version)) - { - writer.WritePropertyName("Version"u8); - writer.WriteStringValue(Version); - } + writer.WritePropertyName("Id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("VaultName"u8); + writer.WriteStringValue(VaultName); + writer.WritePropertyName("ObjectType"u8); + writer.WriteStringValue(ObjectType); + writer.WritePropertyName("ObjectName"u8); + writer.WriteStringValue(ObjectName); + writer.WritePropertyName("Version"u8); + writer.WriteStringValue(Version); if (Optional.IsDefined(NBF)) { writer.WritePropertyName("NBF"u8); 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 673c5bcc5b78..ba077c479918 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyExpiredEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyExpiredEventData.cs @@ -46,8 +46,25 @@ public partial class KeyVaultKeyExpiredEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal KeyVaultKeyExpiredEventData() + /// 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. + /// 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; + ObjectName = objectName; + Version = version; } /// Initializes a new instance of . @@ -71,6 +88,11 @@ internal KeyVaultKeyExpiredEventData(string id, string vaultName, string objectT _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal KeyVaultKeyExpiredEventData() + { + } + /// The id of the object that triggered this event. public string Id { get; } /// Key vault name of the object that triggered this event. 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 57bfc5f4618c..d3b00ac7a8c2 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 @@ -34,31 +34,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(KeyVaultKeyNearExpiryEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("Id"u8); - writer.WriteStringValue(Id); - } - if (Optional.IsDefined(VaultName)) - { - writer.WritePropertyName("VaultName"u8); - writer.WriteStringValue(VaultName); - } - if (Optional.IsDefined(ObjectType)) - { - writer.WritePropertyName("ObjectType"u8); - writer.WriteStringValue(ObjectType); - } - if (Optional.IsDefined(ObjectName)) - { - writer.WritePropertyName("ObjectName"u8); - writer.WriteStringValue(ObjectName); - } - if (Optional.IsDefined(Version)) - { - writer.WritePropertyName("Version"u8); - writer.WriteStringValue(Version); - } + writer.WritePropertyName("Id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("VaultName"u8); + writer.WriteStringValue(VaultName); + writer.WritePropertyName("ObjectType"u8); + writer.WriteStringValue(ObjectType); + writer.WritePropertyName("ObjectName"u8); + writer.WriteStringValue(ObjectName); + writer.WritePropertyName("Version"u8); + writer.WriteStringValue(Version); if (Optional.IsDefined(NBF)) { writer.WritePropertyName("NBF"u8); 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 97ceefad9691..a9908f32b10f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyNearExpiryEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyNearExpiryEventData.cs @@ -46,8 +46,25 @@ public partial class KeyVaultKeyNearExpiryEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal KeyVaultKeyNearExpiryEventData() + /// 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. + /// 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; + ObjectName = objectName; + Version = version; } /// Initializes a new instance of . @@ -71,6 +88,11 @@ internal KeyVaultKeyNearExpiryEventData(string id, string vaultName, string obje _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal KeyVaultKeyNearExpiryEventData() + { + } + /// The id of the object that triggered this event. public string Id { get; } /// Key vault name of the object that triggered this event. 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 ff158b77a99d..ba1975673cd0 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 @@ -34,31 +34,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(KeyVaultKeyNewVersionCreatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("Id"u8); - writer.WriteStringValue(Id); - } - if (Optional.IsDefined(VaultName)) - { - writer.WritePropertyName("VaultName"u8); - writer.WriteStringValue(VaultName); - } - if (Optional.IsDefined(ObjectType)) - { - writer.WritePropertyName("ObjectType"u8); - writer.WriteStringValue(ObjectType); - } - if (Optional.IsDefined(ObjectName)) - { - writer.WritePropertyName("ObjectName"u8); - writer.WriteStringValue(ObjectName); - } - if (Optional.IsDefined(Version)) - { - writer.WritePropertyName("Version"u8); - writer.WriteStringValue(Version); - } + writer.WritePropertyName("Id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("VaultName"u8); + writer.WriteStringValue(VaultName); + writer.WritePropertyName("ObjectType"u8); + writer.WriteStringValue(ObjectType); + writer.WritePropertyName("ObjectName"u8); + writer.WriteStringValue(ObjectName); + writer.WritePropertyName("Version"u8); + writer.WriteStringValue(Version); if (Optional.IsDefined(NBF)) { writer.WritePropertyName("NBF"u8); 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 1f656d1e5b92..e2d9fc43b302 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyNewVersionCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultKeyNewVersionCreatedEventData.cs @@ -46,8 +46,25 @@ public partial class KeyVaultKeyNewVersionCreatedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal KeyVaultKeyNewVersionCreatedEventData() + /// 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. + /// 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; + ObjectName = objectName; + Version = version; } /// Initializes a new instance of . @@ -71,6 +88,11 @@ internal KeyVaultKeyNewVersionCreatedEventData(string id, string vaultName, stri _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal KeyVaultKeyNewVersionCreatedEventData() + { + } + /// The id of the object that triggered this event. public string Id { get; } /// Key vault name of the object that triggered this event. 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 efa809daa4ef..7bf0545cb70a 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 @@ -34,31 +34,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(KeyVaultSecretExpiredEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("Id"u8); - writer.WriteStringValue(Id); - } - if (Optional.IsDefined(VaultName)) - { - writer.WritePropertyName("VaultName"u8); - writer.WriteStringValue(VaultName); - } - if (Optional.IsDefined(ObjectType)) - { - writer.WritePropertyName("ObjectType"u8); - writer.WriteStringValue(ObjectType); - } - if (Optional.IsDefined(ObjectName)) - { - writer.WritePropertyName("ObjectName"u8); - writer.WriteStringValue(ObjectName); - } - if (Optional.IsDefined(Version)) - { - writer.WritePropertyName("Version"u8); - writer.WriteStringValue(Version); - } + writer.WritePropertyName("Id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("VaultName"u8); + writer.WriteStringValue(VaultName); + writer.WritePropertyName("ObjectType"u8); + writer.WriteStringValue(ObjectType); + writer.WritePropertyName("ObjectName"u8); + writer.WriteStringValue(ObjectName); + writer.WritePropertyName("Version"u8); + writer.WriteStringValue(Version); if (Optional.IsDefined(NBF)) { writer.WritePropertyName("NBF"u8); 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 8746341b9068..ac13e3c32701 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretExpiredEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretExpiredEventData.cs @@ -46,8 +46,25 @@ public partial class KeyVaultSecretExpiredEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal KeyVaultSecretExpiredEventData() + /// 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. + /// 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; + ObjectName = objectName; + Version = version; } /// Initializes a new instance of . @@ -71,6 +88,11 @@ internal KeyVaultSecretExpiredEventData(string id, string vaultName, string obje _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal KeyVaultSecretExpiredEventData() + { + } + /// The id of the object that triggered this event. public string Id { get; } /// Key vault name of the object that triggered this event. 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 563a0c32ffe0..da765c1a7dbe 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 @@ -34,31 +34,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(KeyVaultSecretNearExpiryEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("Id"u8); - writer.WriteStringValue(Id); - } - if (Optional.IsDefined(VaultName)) - { - writer.WritePropertyName("VaultName"u8); - writer.WriteStringValue(VaultName); - } - if (Optional.IsDefined(ObjectType)) - { - writer.WritePropertyName("ObjectType"u8); - writer.WriteStringValue(ObjectType); - } - if (Optional.IsDefined(ObjectName)) - { - writer.WritePropertyName("ObjectName"u8); - writer.WriteStringValue(ObjectName); - } - if (Optional.IsDefined(Version)) - { - writer.WritePropertyName("Version"u8); - writer.WriteStringValue(Version); - } + writer.WritePropertyName("Id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("VaultName"u8); + writer.WriteStringValue(VaultName); + writer.WritePropertyName("ObjectType"u8); + writer.WriteStringValue(ObjectType); + writer.WritePropertyName("ObjectName"u8); + writer.WriteStringValue(ObjectName); + writer.WritePropertyName("Version"u8); + writer.WriteStringValue(Version); if (Optional.IsDefined(NBF)) { writer.WritePropertyName("NBF"u8); 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 a80db5eef3f0..0873ff5d4ef9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretNearExpiryEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretNearExpiryEventData.cs @@ -46,8 +46,25 @@ public partial class KeyVaultSecretNearExpiryEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal KeyVaultSecretNearExpiryEventData() + /// 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. + /// 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; + ObjectName = objectName; + Version = version; } /// Initializes a new instance of . @@ -71,6 +88,11 @@ internal KeyVaultSecretNearExpiryEventData(string id, string vaultName, string o _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal KeyVaultSecretNearExpiryEventData() + { + } + /// The id of the object that triggered this event. public string Id { get; } /// Key vault name of the object that triggered this event. 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 867bf49c9495..faaff8834115 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 @@ -34,31 +34,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(KeyVaultSecretNewVersionCreatedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("Id"u8); - writer.WriteStringValue(Id); - } - if (Optional.IsDefined(VaultName)) - { - writer.WritePropertyName("VaultName"u8); - writer.WriteStringValue(VaultName); - } - if (Optional.IsDefined(ObjectType)) - { - writer.WritePropertyName("ObjectType"u8); - writer.WriteStringValue(ObjectType); - } - if (Optional.IsDefined(ObjectName)) - { - writer.WritePropertyName("ObjectName"u8); - writer.WriteStringValue(ObjectName); - } - if (Optional.IsDefined(Version)) - { - writer.WritePropertyName("Version"u8); - writer.WriteStringValue(Version); - } + writer.WritePropertyName("Id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("VaultName"u8); + writer.WriteStringValue(VaultName); + writer.WritePropertyName("ObjectType"u8); + writer.WriteStringValue(ObjectType); + writer.WritePropertyName("ObjectName"u8); + writer.WriteStringValue(ObjectName); + writer.WritePropertyName("Version"u8); + writer.WriteStringValue(Version); if (Optional.IsDefined(NBF)) { writer.WritePropertyName("NBF"u8); 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 b3c890bb7462..0f75d5c352f5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretNewVersionCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/KeyVaultSecretNewVersionCreatedEventData.cs @@ -46,8 +46,25 @@ public partial class KeyVaultSecretNewVersionCreatedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal KeyVaultSecretNewVersionCreatedEventData() + /// 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. + /// 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; + ObjectName = objectName; + Version = version; } /// Initializes a new instance of . @@ -71,6 +88,11 @@ internal KeyVaultSecretNewVersionCreatedEventData(string id, string vaultName, s _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal KeyVaultSecretNewVersionCreatedEventData() + { + } + /// The id of the object that triggered this event. public string Id { get; } /// Key vault name of the object that triggered this event. 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 09b738ad26da..6e567f69cca0 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 @@ -64,10 +64,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("driftCoefficient"u8); writer.WriteNumberValue(DriftCoefficient.Value); } - writer.WritePropertyName("startTime"u8); - writer.WriteStringValue(StartTime, "O"); - writer.WritePropertyName("endTime"u8); - writer.WriteStringValue(EndTime, "O"); + if (Optional.IsDefined(StartTime)) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartTime.Value, "O"); + } + if (Optional.IsDefined(EndTime)) + { + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndTime.Value, "O"); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -111,8 +117,8 @@ internal static MachineLearningServicesDatasetDriftDetectedEventData Deserialize string baseDatasetId = default; string targetDatasetId = default; double? driftCoefficient = default; - DateTimeOffset startTime = default; - DateTimeOffset endTime = default; + DateTimeOffset? startTime = default; + DateTimeOffset? endTime = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -153,11 +159,19 @@ internal static MachineLearningServicesDatasetDriftDetectedEventData Deserialize } if (property.NameEquals("startTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } startTime = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("endTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } endTime = property.Value.GetDateTimeOffset("O"); continue; } 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 9027d0c37322..f86f30e006be 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesDatasetDriftDetectedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesDatasetDriftDetectedEventData.cs @@ -46,12 +46,8 @@ public partial class MachineLearningServicesDatasetDriftDetectedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// 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. - internal MachineLearningServicesDatasetDriftDetectedEventData(DateTimeOffset startTime, DateTimeOffset endTime) + internal MachineLearningServicesDatasetDriftDetectedEventData() { - StartTime = startTime; - EndTime = endTime; } /// Initializes a new instance of . @@ -64,7 +60,7 @@ internal MachineLearningServicesDatasetDriftDetectedEventData(DateTimeOffset sta /// 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) + internal MachineLearningServicesDatasetDriftDetectedEventData(string dataDriftId, string dataDriftName, string runId, string baseDatasetId, string targetDatasetId, double? driftCoefficient, DateTimeOffset? startTime, DateTimeOffset? endTime, IDictionary serializedAdditionalRawData) { DataDriftId = dataDriftId; DataDriftName = dataDriftName; @@ -77,11 +73,6 @@ internal MachineLearningServicesDatasetDriftDetectedEventData(string dataDriftId _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal MachineLearningServicesDatasetDriftDetectedEventData() - { - } - /// 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. @@ -95,8 +86,8 @@ internal MachineLearningServicesDatasetDriftDetectedEventData() /// 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; } + public DateTimeOffset? StartTime { get; } /// The end time of the target dataset time series that resulted in drift detection. - public DateTimeOffset EndTime { get; } + public DateTimeOffset? EndTime { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCanceledEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCanceledEventData.cs deleted file mode 100644 index 953505804d20..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCanceledEventData.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// - /// Job canceled event data. Schema of the data property of an EventGridEvent for a - /// Microsoft.Media.JobCanceled event. - /// - public partial class MediaJobCanceledEventData : MediaJobStateChangeEventData - { - /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. - /// Gets the Job correlation data. - /// - /// Gets the Job outputs. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// or is null. - internal MediaJobCanceledEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IEnumerable outputs) : base(previousState, state, correlationData) - { - Argument.AssertNotNull(correlationData, nameof(correlationData)); - Argument.AssertNotNull(outputs, nameof(outputs)); - - Outputs = outputs.ToList(); - } - - /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. - /// Gets the Job correlation data. - /// Keeps track of any properties unknown to the library. - /// - /// Gets the Job outputs. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - internal MediaJobCanceledEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData, IReadOnlyList outputs) : base(previousState, state, correlationData, serializedAdditionalRawData) - { - Outputs = outputs; - } - - /// Initializes a new instance of for deserialization. - internal MediaJobCanceledEventData() - { - } - - /// - /// Gets the Job outputs. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - public IReadOnlyList Outputs { get; } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCancelingEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCancelingEventData.cs deleted file mode 100644 index c1493f0f200e..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCancelingEventData.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// - /// Job canceling event data. Schema of the data property of an EventGridEvent for - /// a Microsoft.Media.JobCanceling event. - /// - public partial class MediaJobCancelingEventData : MediaJobStateChangeEventData - { - /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. - /// Gets the Job correlation data. - /// is null. - internal MediaJobCancelingEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData) : base(previousState, state, correlationData) - { - Argument.AssertNotNull(correlationData, nameof(correlationData)); - } - - /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. - /// Gets the Job correlation data. - /// Keeps track of any properties unknown to the library. - internal MediaJobCancelingEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData) : base(previousState, state, correlationData, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal MediaJobCancelingEventData() - { - } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobError.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobError.cs deleted file mode 100644 index 751ed7d395fe..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobError.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// Details of JobOutput errors. - public partial class MediaJobError - { - /// - /// 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; - - /// Initializes a new instance of . - /// Error code describing the error. - /// Helps with categorization of errors. - /// Indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact Azure support via Azure Portal. - /// An array of details about specific errors that led to this reported error. - /// is null. - internal MediaJobError(MediaJobErrorCode code, MediaJobErrorCategory category, MediaJobRetry retry, IEnumerable details) - { - Argument.AssertNotNull(details, nameof(details)); - - Code = code; - Category = category; - Retry = retry; - Details = details.ToList(); - } - - /// Initializes a new instance of . - /// Error code describing the error. - /// A human-readable language-dependent representation of the error. - /// Helps with categorization of errors. - /// Indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact Azure support via Azure Portal. - /// An array of details about specific errors that led to this reported error. - /// Keeps track of any properties unknown to the library. - internal MediaJobError(MediaJobErrorCode code, string message, MediaJobErrorCategory category, MediaJobRetry retry, IReadOnlyList details, IDictionary serializedAdditionalRawData) - { - Code = code; - Message = message; - Category = category; - Retry = retry; - Details = details; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal MediaJobError() - { - } - - /// Error code describing the error. - public MediaJobErrorCode Code { get; } - /// A human-readable language-dependent representation of the error. - public string Message { get; } - /// Helps with categorization of errors. - public MediaJobErrorCategory Category { get; } - /// Indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact Azure support via Azure Portal. - public MediaJobRetry Retry { get; } - /// An array of details about specific errors that led to this reported error. - public IReadOnlyList Details { get; } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErrorCategory.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErrorCategory.cs deleted file mode 100644 index 1500025725f5..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErrorCategory.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// Error categories for Media Job Errors. - public readonly partial struct MediaJobErrorCategory : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public MediaJobErrorCategory(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ServiceValue = "Service"; - private const string DownloadValue = "Download"; - private const string UploadValue = "Upload"; - private const string ConfigurationValue = "Configuration"; - private const string ContentValue = "Content"; - private const string AccountValue = "Account"; - - /// The error is service related. - public static MediaJobErrorCategory Service { get; } = new MediaJobErrorCategory(ServiceValue); - /// The error is download related. - public static MediaJobErrorCategory Download { get; } = new MediaJobErrorCategory(DownloadValue); - /// The error is upload related. - public static MediaJobErrorCategory Upload { get; } = new MediaJobErrorCategory(UploadValue); - /// The error is configuration related. - public static MediaJobErrorCategory Configuration { get; } = new MediaJobErrorCategory(ConfigurationValue); - /// The error is related to data in the input files. - public static MediaJobErrorCategory Content { get; } = new MediaJobErrorCategory(ContentValue); - /// The error is related to account information. - public static MediaJobErrorCategory Account { get; } = new MediaJobErrorCategory(AccountValue); - /// Determines if two values are the same. - public static bool operator ==(MediaJobErrorCategory left, MediaJobErrorCategory right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(MediaJobErrorCategory left, MediaJobErrorCategory right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator MediaJobErrorCategory(string value) => new MediaJobErrorCategory(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is MediaJobErrorCategory other && Equals(other); - /// - public bool Equals(MediaJobErrorCategory 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/MediaJobErrorCode.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErrorCode.cs deleted file mode 100644 index a306a0f40470..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErrorCode.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// Media Job Error Codes. - public readonly partial struct MediaJobErrorCode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public MediaJobErrorCode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ServiceErrorValue = "ServiceError"; - private const string ServiceTransientErrorValue = "ServiceTransientError"; - private const string DownloadNotAccessibleValue = "DownloadNotAccessible"; - private const string DownloadTransientErrorValue = "DownloadTransientError"; - private const string UploadNotAccessibleValue = "UploadNotAccessible"; - private const string UploadTransientErrorValue = "UploadTransientError"; - private const string ConfigurationUnsupportedValue = "ConfigurationUnsupported"; - private const string ContentMalformedValue = "ContentMalformed"; - private const string ContentUnsupportedValue = "ContentUnsupported"; - private const string IdentityUnsupportedValue = "IdentityUnsupported"; - - /// Fatal service error, please contact support. - public static MediaJobErrorCode ServiceError { get; } = new MediaJobErrorCode(ServiceErrorValue); - /// Transient error, please retry, if retry is unsuccessful, please contact support. - public static MediaJobErrorCode ServiceTransientError { get; } = new MediaJobErrorCode(ServiceTransientErrorValue); - /// While trying to download the input files, the files were not accessible, please check the availability of the source. - public static MediaJobErrorCode DownloadNotAccessible { get; } = new MediaJobErrorCode(DownloadNotAccessibleValue); - /// While trying to download the input files, there was an issue during transfer (storage service, network errors), see details and check your source. - public static MediaJobErrorCode DownloadTransientError { get; } = new MediaJobErrorCode(DownloadTransientErrorValue); - /// While trying to upload the output files, the destination was not reachable, please check the availability of the destination. - public static MediaJobErrorCode UploadNotAccessible { get; } = new MediaJobErrorCode(UploadNotAccessibleValue); - /// While trying to upload the output files, there was an issue during transfer (storage service, network errors), see details and check your destination. - public static MediaJobErrorCode UploadTransientError { get; } = new MediaJobErrorCode(UploadTransientErrorValue); - /// There was a problem with the combination of input files and the configuration settings applied, fix the configuration settings and retry with the same input, or change input to match the configuration. - public static MediaJobErrorCode ConfigurationUnsupported { get; } = new MediaJobErrorCode(ConfigurationUnsupportedValue); - /// There was a problem with the input content (for example: zero byte files, or corrupt/non-decodable files), check the input files. - public static MediaJobErrorCode ContentMalformed { get; } = new MediaJobErrorCode(ContentMalformedValue); - /// There was a problem with the format of the input (not valid media file, or an unsupported file/codec), check the validity of the input files. - public static MediaJobErrorCode ContentUnsupported { get; } = new MediaJobErrorCode(ContentUnsupportedValue); - /// There is an error verifying to the account identity. Check and fix the identity configurations and retry. If unsuccessful, please contact support. - public static MediaJobErrorCode IdentityUnsupported { get; } = new MediaJobErrorCode(IdentityUnsupportedValue); - /// Determines if two values are the same. - public static bool operator ==(MediaJobErrorCode left, MediaJobErrorCode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(MediaJobErrorCode left, MediaJobErrorCode right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator MediaJobErrorCode(string value) => new MediaJobErrorCode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is MediaJobErrorCode other && Equals(other); - /// - public bool Equals(MediaJobErrorCode 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/MediaJobErroredEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErroredEventData.cs deleted file mode 100644 index 0c76f70e4bc5..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErroredEventData.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// - /// Job error state event data. Schema of the data property of an EventGridEvent - /// for a Microsoft.Media.JobErrored event. - /// - public partial class MediaJobErroredEventData : MediaJobStateChangeEventData - { - /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. - /// Gets the Job correlation data. - /// - /// Gets the Job outputs. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// or is null. - internal MediaJobErroredEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IEnumerable outputs) : base(previousState, state, correlationData) - { - Argument.AssertNotNull(correlationData, nameof(correlationData)); - Argument.AssertNotNull(outputs, nameof(outputs)); - - Outputs = outputs.ToList(); - } - - /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. - /// Gets the Job correlation data. - /// Keeps track of any properties unknown to the library. - /// - /// Gets the Job outputs. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - internal MediaJobErroredEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData, IReadOnlyList outputs) : base(previousState, state, correlationData, serializedAdditionalRawData) - { - Outputs = outputs; - } - - /// Initializes a new instance of for deserialization. - internal MediaJobErroredEventData() - { - } - - /// - /// Gets the Job outputs. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - public IReadOnlyList Outputs { get; } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobFinishedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobFinishedEventData.Serialization.cs deleted file mode 100644 index 5c0168553591..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobFinishedEventData.Serialization.cs +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - public partial class MediaJobFinishedEventData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(MediaJobFinishedEventData)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("outputs"u8); - writer.WriteStartArray(); - foreach (var item in Outputs) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - - MediaJobFinishedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MediaJobFinishedEventData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaJobFinishedEventData(document.RootElement, options); - } - - internal static MediaJobFinishedEventData DeserializeMediaJobFinishedEventData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList outputs = default; - MediaJobState previousState = default; - MediaJobState state = default; - IReadOnlyDictionary correlationData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("outputs"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(MediaJobOutput.DeserializeMediaJobOutput(item, options)); - } - outputs = array; - continue; - } - if (property.NameEquals("previousState"u8)) - { - previousState = new MediaJobState(property.Value.GetString()); - continue; - } - if (property.NameEquals("state"u8)) - { - state = new MediaJobState(property.Value.GetString()); - continue; - } - if (property.NameEquals("correlationData"u8)) - { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - correlationData = dictionary; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MediaJobFinishedEventData(previousState, state, correlationData, serializedAdditionalRawData, outputs); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MediaJobFinishedEventData)} does not support writing '{options.Format}' format."); - } - } - - MediaJobFinishedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaJobFinishedEventData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MediaJobFinishedEventData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new MediaJobFinishedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaJobFinishedEventData(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/MediaJobFinishedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobFinishedEventData.cs deleted file mode 100644 index 64a495eac9b8..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobFinishedEventData.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// - /// Job finished event data. Schema of the data property of an EventGridEvent for a - /// Microsoft.Media.JobFinished event. - /// - public partial class MediaJobFinishedEventData : MediaJobStateChangeEventData - { - /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. - /// Gets the Job correlation data. - /// - /// Gets the Job outputs. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// or is null. - internal MediaJobFinishedEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IEnumerable outputs) : base(previousState, state, correlationData) - { - Argument.AssertNotNull(correlationData, nameof(correlationData)); - Argument.AssertNotNull(outputs, nameof(outputs)); - - Outputs = outputs.ToList(); - } - - /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. - /// Gets the Job correlation data. - /// Keeps track of any properties unknown to the library. - /// - /// Gets the Job outputs. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - internal MediaJobFinishedEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData, IReadOnlyList outputs) : base(previousState, state, correlationData, serializedAdditionalRawData) - { - Outputs = outputs; - } - - /// Initializes a new instance of for deserialization. - internal MediaJobFinishedEventData() - { - } - - /// - /// Gets the Job outputs. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - public IReadOnlyList Outputs { get; } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutput.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutput.cs deleted file mode 100644 index 2a5881ab7ec5..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutput.cs +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// - /// The event data for a Job output. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - public abstract partial class MediaJobOutput - { - /// - /// 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; - - /// Initializes a new instance of . - /// Gets the Job output error. - /// Gets the Job output progress. - /// Gets the Job output state. - /// is null. - protected MediaJobOutput(MediaJobError error, long progress, MediaJobState state) - { - Argument.AssertNotNull(error, nameof(error)); - - Error = error; - Progress = progress; - State = state; - } - - /// Initializes a new instance of . - /// The discriminator for derived types. - /// Gets the Job output error. - /// Gets the Job output label. - /// Gets the Job output progress. - /// Gets the Job output state. - /// Keeps track of any properties unknown to the library. - internal MediaJobOutput(string odataType, MediaJobError error, string label, long progress, MediaJobState state, IDictionary serializedAdditionalRawData) - { - OdataType = odataType; - Error = error; - Label = label; - Progress = progress; - State = state; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal MediaJobOutput() - { - } - - /// The discriminator for derived types. - internal string OdataType { get; set; } - /// Gets the Job output error. - public MediaJobError Error { get; } - /// Gets the Job output label. - public string Label { get; } - /// Gets the Job output progress. - public long Progress { get; } - /// Gets the Job output state. - public MediaJobState State { get; } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputAsset.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputAsset.Serialization.cs deleted file mode 100644 index b9d1022e7fc9..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputAsset.Serialization.cs +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - public partial class MediaJobOutputAsset : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(MediaJobOutputAsset)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(AssetName)) - { - writer.WritePropertyName("assetName"u8); - writer.WriteStringValue(AssetName); - } - } - - MediaJobOutputAsset IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MediaJobOutputAsset)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaJobOutputAsset(document.RootElement, options); - } - - internal static MediaJobOutputAsset DeserializeMediaJobOutputAsset(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string assetName = default; - string odataType = default; - MediaJobError error = default; - string label = default; - long progress = default; - MediaJobState state = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("assetName"u8)) - { - assetName = property.Value.GetString(); - continue; - } - if (property.NameEquals("@odata.type"u8)) - { - odataType = property.Value.GetString(); - continue; - } - if (property.NameEquals("error"u8)) - { - error = MediaJobError.DeserializeMediaJobError(property.Value, options); - continue; - } - if (property.NameEquals("label"u8)) - { - label = property.Value.GetString(); - continue; - } - if (property.NameEquals("progress"u8)) - { - progress = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("state"u8)) - { - state = new MediaJobState(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MediaJobOutputAsset( - odataType, - error, - label, - progress, - state, - serializedAdditionalRawData, - assetName); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MediaJobOutputAsset)} does not support writing '{options.Format}' format."); - } - } - - MediaJobOutputAsset IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaJobOutputAsset(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MediaJobOutputAsset)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new MediaJobOutputAsset FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaJobOutputAsset(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/MediaJobOutputAsset.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputAsset.cs deleted file mode 100644 index b43e0081261b..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputAsset.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// The event data for a Job output asset. - public partial class MediaJobOutputAsset : MediaJobOutput - { - /// Initializes a new instance of . - /// Gets the Job output error. - /// Gets the Job output progress. - /// Gets the Job output state. - /// is null. - internal MediaJobOutputAsset(MediaJobError error, long progress, MediaJobState state) : base(error, progress, state) - { - Argument.AssertNotNull(error, nameof(error)); - - OdataType = "#Microsoft.Media.JobOutputAsset"; - } - - /// Initializes a new instance of . - /// The discriminator for derived types. - /// Gets the Job output error. - /// Gets the Job output label. - /// Gets the Job output progress. - /// Gets the Job output state. - /// Keeps track of any properties unknown to the library. - /// Gets the Job output asset name. - internal MediaJobOutputAsset(string odataType, MediaJobError error, string label, long progress, MediaJobState state, IDictionary serializedAdditionalRawData, string assetName) : base(odataType, error, label, progress, state, serializedAdditionalRawData) - { - AssetName = assetName; - } - - /// Initializes a new instance of for deserialization. - internal MediaJobOutputAsset() - { - } - - /// Gets the Job output asset name. - public string AssetName { get; } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCanceledEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCanceledEventData.cs deleted file mode 100644 index 55ec62b58492..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCanceledEventData.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// - /// Job output canceled event data. Schema of the data property of an - /// EventGridEvent for a Microsoft.Media.JobOutputCanceled event. - /// - public partial class MediaJobOutputCanceledEventData : MediaJobOutputStateChangeEventData - { - /// Initializes a new instance of . - /// The previous state of the Job. - /// - /// Gets the output. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// Gets the Job correlation data. - /// or is null. - internal MediaJobOutputCanceledEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(previousState, output, jobCorrelationData) - { - Argument.AssertNotNull(output, nameof(output)); - Argument.AssertNotNull(jobCorrelationData, nameof(jobCorrelationData)); - } - - /// Initializes a new instance of . - /// The previous state of the Job. - /// - /// Gets the output. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// Gets the Job correlation data. - /// Keeps track of any properties unknown to the library. - internal MediaJobOutputCanceledEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal MediaJobOutputCanceledEventData() - { - } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCancelingEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCancelingEventData.cs deleted file mode 100644 index 30e7d163aaa6..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCancelingEventData.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// - /// Job output canceling event data. Schema of the data property of an - /// EventGridEvent for a Microsoft.Media.JobOutputCanceling event. - /// - public partial class MediaJobOutputCancelingEventData : MediaJobOutputStateChangeEventData - { - /// Initializes a new instance of . - /// The previous state of the Job. - /// - /// Gets the output. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// Gets the Job correlation data. - /// or is null. - internal MediaJobOutputCancelingEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(previousState, output, jobCorrelationData) - { - Argument.AssertNotNull(output, nameof(output)); - Argument.AssertNotNull(jobCorrelationData, nameof(jobCorrelationData)); - } - - /// Initializes a new instance of . - /// The previous state of the Job. - /// - /// Gets the output. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// Gets the Job correlation data. - /// Keeps track of any properties unknown to the library. - internal MediaJobOutputCancelingEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal MediaJobOutputCancelingEventData() - { - } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputErroredEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputErroredEventData.cs deleted file mode 100644 index 22535aa75e81..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputErroredEventData.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// - /// Job output error event data. Schema of the data property of an EventGridEvent - /// for a Microsoft.Media.JobOutputErrored event. - /// - public partial class MediaJobOutputErroredEventData : MediaJobOutputStateChangeEventData - { - /// Initializes a new instance of . - /// The previous state of the Job. - /// - /// Gets the output. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// Gets the Job correlation data. - /// or is null. - internal MediaJobOutputErroredEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(previousState, output, jobCorrelationData) - { - Argument.AssertNotNull(output, nameof(output)); - Argument.AssertNotNull(jobCorrelationData, nameof(jobCorrelationData)); - } - - /// Initializes a new instance of . - /// The previous state of the Job. - /// - /// Gets the output. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// Gets the Job correlation data. - /// Keeps track of any properties unknown to the library. - internal MediaJobOutputErroredEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal MediaJobOutputErroredEventData() - { - } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputFinishedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputFinishedEventData.cs deleted file mode 100644 index 701290e6f1cf..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputFinishedEventData.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// - /// Job output finished event data. Schema of the data property of an - /// EventGridEvent for a Microsoft.Media.JobOutputFinished event. - /// - public partial class MediaJobOutputFinishedEventData : MediaJobOutputStateChangeEventData - { - /// Initializes a new instance of . - /// The previous state of the Job. - /// - /// Gets the output. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// Gets the Job correlation data. - /// or is null. - internal MediaJobOutputFinishedEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(previousState, output, jobCorrelationData) - { - Argument.AssertNotNull(output, nameof(output)); - Argument.AssertNotNull(jobCorrelationData, nameof(jobCorrelationData)); - } - - /// Initializes a new instance of . - /// The previous state of the Job. - /// - /// Gets the output. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// Gets the Job correlation data. - /// Keeps track of any properties unknown to the library. - internal MediaJobOutputFinishedEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal MediaJobOutputFinishedEventData() - { - } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProcessingEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProcessingEventData.cs deleted file mode 100644 index 1d4c4de32283..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProcessingEventData.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// - /// Job output processing event data. Schema of the data property of an - /// EventGridEvent for a Microsoft.Media.JobOutputProcessing event. - /// - public partial class MediaJobOutputProcessingEventData : MediaJobOutputStateChangeEventData - { - /// Initializes a new instance of . - /// The previous state of the Job. - /// - /// Gets the output. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// Gets the Job correlation data. - /// or is null. - internal MediaJobOutputProcessingEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(previousState, output, jobCorrelationData) - { - Argument.AssertNotNull(output, nameof(output)); - Argument.AssertNotNull(jobCorrelationData, nameof(jobCorrelationData)); - } - - /// Initializes a new instance of . - /// The previous state of the Job. - /// - /// Gets the output. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// Gets the Job correlation data. - /// Keeps track of any properties unknown to the library. - internal MediaJobOutputProcessingEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal MediaJobOutputProcessingEventData() - { - } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputScheduledEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputScheduledEventData.cs deleted file mode 100644 index a11011667492..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputScheduledEventData.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// - /// Job output scheduled event data. Schema of the data property of an - /// EventGridEvent for a Microsoft.Media.JobOutputScheduled event. - /// - public partial class MediaJobOutputScheduledEventData : MediaJobOutputStateChangeEventData - { - /// Initializes a new instance of . - /// The previous state of the Job. - /// - /// Gets the output. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// Gets the Job correlation data. - /// or is null. - internal MediaJobOutputScheduledEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(previousState, output, jobCorrelationData) - { - Argument.AssertNotNull(output, nameof(output)); - Argument.AssertNotNull(jobCorrelationData, nameof(jobCorrelationData)); - } - - /// Initializes a new instance of . - /// The previous state of the Job. - /// - /// Gets the output. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// Gets the Job correlation data. - /// Keeps track of any properties unknown to the library. - internal MediaJobOutputScheduledEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal MediaJobOutputScheduledEventData() - { - } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputStateChangeEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputStateChangeEventData.Serialization.cs deleted file mode 100644 index 7cf2827360e4..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputStateChangeEventData.Serialization.cs +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - public partial class MediaJobOutputStateChangeEventData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(MediaJobOutputStateChangeEventData)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); - writer.WritePropertyName("output"u8); - writer.WriteObjectValue(Output, options); - writer.WritePropertyName("jobCorrelationData"u8); - writer.WriteStartObject(); - foreach (var item in JobCorrelationData) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - MediaJobOutputStateChangeEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MediaJobOutputStateChangeEventData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaJobOutputStateChangeEventData(document.RootElement, options); - } - - internal static MediaJobOutputStateChangeEventData DeserializeMediaJobOutputStateChangeEventData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - MediaJobState previousState = default; - MediaJobOutput output = default; - IReadOnlyDictionary jobCorrelationData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("previousState"u8)) - { - previousState = new MediaJobState(property.Value.GetString()); - continue; - } - if (property.NameEquals("output"u8)) - { - output = MediaJobOutput.DeserializeMediaJobOutput(property.Value, options); - continue; - } - if (property.NameEquals("jobCorrelationData"u8)) - { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - jobCorrelationData = dictionary; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MediaJobOutputStateChangeEventData(previousState, output, jobCorrelationData, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MediaJobOutputStateChangeEventData)} does not support writing '{options.Format}' format."); - } - } - - MediaJobOutputStateChangeEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaJobOutputStateChangeEventData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MediaJobOutputStateChangeEventData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static MediaJobOutputStateChangeEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaJobOutputStateChangeEventData(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/MediaJobOutputStateChangeEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputStateChangeEventData.cs deleted file mode 100644 index d647fa5feff2..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputStateChangeEventData.cs +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// - /// Schema of the Data property of an EventGridEvent for a - /// Microsoft.Media.JobOutputStateChange event. - /// - public partial class MediaJobOutputStateChangeEventData - { - /// - /// 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; - - /// Initializes a new instance of . - /// The previous state of the Job. - /// - /// Gets the output. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// Gets the Job correlation data. - /// or is null. - internal MediaJobOutputStateChangeEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) - { - Argument.AssertNotNull(output, nameof(output)); - Argument.AssertNotNull(jobCorrelationData, nameof(jobCorrelationData)); - - PreviousState = previousState; - Output = output; - JobCorrelationData = jobCorrelationData; - } - - /// Initializes a new instance of . - /// The previous state of the Job. - /// - /// Gets the output. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - /// Gets the Job correlation data. - /// Keeps track of any properties unknown to the library. - internal MediaJobOutputStateChangeEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) - { - PreviousState = previousState; - Output = output; - JobCorrelationData = jobCorrelationData; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal MediaJobOutputStateChangeEventData() - { - } - - /// The previous state of the Job. - public MediaJobState PreviousState { get; } - /// - /// Gets the output. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - public MediaJobOutput Output { get; } - /// Gets the Job correlation data. - public IReadOnlyDictionary JobCorrelationData { get; } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobProcessingEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobProcessingEventData.cs deleted file mode 100644 index 1298b135d442..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobProcessingEventData.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// - /// Job processing event data. Schema of the data property of an EventGridEvent for - /// a Microsoft.Media.JobProcessing event. - /// - public partial class MediaJobProcessingEventData : MediaJobStateChangeEventData - { - /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. - /// Gets the Job correlation data. - /// is null. - internal MediaJobProcessingEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData) : base(previousState, state, correlationData) - { - Argument.AssertNotNull(correlationData, nameof(correlationData)); - } - - /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. - /// Gets the Job correlation data. - /// Keeps track of any properties unknown to the library. - internal MediaJobProcessingEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData) : base(previousState, state, correlationData, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal MediaJobProcessingEventData() - { - } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobRetry.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobRetry.cs deleted file mode 100644 index cf01dfb61c9b..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobRetry.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// Media Job Retry Options. - public readonly partial struct MediaJobRetry : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public MediaJobRetry(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DoNotRetryValue = "DoNotRetry"; - private const string MayRetryValue = "MayRetry"; - - /// Issue needs to be investigated and then the job resubmitted with corrections or retried once the underlying issue has been corrected. - public static MediaJobRetry DoNotRetry { get; } = new MediaJobRetry(DoNotRetryValue); - /// Issue may be resolved after waiting for a period of time and resubmitting the same Job. - public static MediaJobRetry MayRetry { get; } = new MediaJobRetry(MayRetryValue); - /// Determines if two values are the same. - public static bool operator ==(MediaJobRetry left, MediaJobRetry right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(MediaJobRetry left, MediaJobRetry right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator MediaJobRetry(string value) => new MediaJobRetry(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is MediaJobRetry other && Equals(other); - /// - public bool Equals(MediaJobRetry 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/MediaJobScheduledEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobScheduledEventData.cs deleted file mode 100644 index f7f96abda48f..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobScheduledEventData.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// - /// Job scheduled event data. Schema of the data property of an EventGridEvent for - /// a Microsoft.Media.JobScheduled event. - /// - public partial class MediaJobScheduledEventData : MediaJobStateChangeEventData - { - /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. - /// Gets the Job correlation data. - /// is null. - internal MediaJobScheduledEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData) : base(previousState, state, correlationData) - { - Argument.AssertNotNull(correlationData, nameof(correlationData)); - } - - /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. - /// Gets the Job correlation data. - /// Keeps track of any properties unknown to the library. - internal MediaJobScheduledEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData) : base(previousState, state, correlationData, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal MediaJobScheduledEventData() - { - } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobState.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobState.cs deleted file mode 100644 index dafd83fecbd1..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobState.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// State of a Media Job. - public readonly partial struct MediaJobState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public MediaJobState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string CanceledValue = "Canceled"; - private const string CancelingValue = "Canceling"; - private const string ErrorValue = "Error"; - private const string FinishedValue = "Finished"; - private const string ProcessingValue = "Processing"; - private const string QueuedValue = "Queued"; - private const string ScheduledValue = "Scheduled"; - - /// The job was canceled. This is a final state for the job. - public static MediaJobState Canceled { get; } = new MediaJobState(CanceledValue); - /// The job is in the process of being canceled. This is a transient state for the job. - public static MediaJobState Canceling { get; } = new MediaJobState(CancelingValue); - /// The job has encountered an error. This is a final state for the job. - public static MediaJobState Error { get; } = new MediaJobState(ErrorValue); - /// The job is finished. This is a final state for the job. - public static MediaJobState Finished { get; } = new MediaJobState(FinishedValue); - /// The job is processing. This is a transient state for the job. - public static MediaJobState Processing { get; } = new MediaJobState(ProcessingValue); - /// The job is in a queued state, waiting for resources to become available. This is a transient state. - public static MediaJobState Queued { get; } = new MediaJobState(QueuedValue); - /// The job is being scheduled to run on an available resource. This is a transient state, between queued and processing states. - public static MediaJobState Scheduled { get; } = new MediaJobState(ScheduledValue); - /// Determines if two values are the same. - public static bool operator ==(MediaJobState left, MediaJobState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(MediaJobState left, MediaJobState right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator MediaJobState(string value) => new MediaJobState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is MediaJobState other && Equals(other); - /// - public bool Equals(MediaJobState 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/MediaJobStateChangeEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobStateChangeEventData.cs deleted file mode 100644 index ce4898df35b8..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobStateChangeEventData.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// - /// Schema of the Data property of an EventGridEvent for a - /// Microsoft.Media.JobStateChange event. - /// - public partial class MediaJobStateChangeEventData - { - /// - /// 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; - - /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. - /// Gets the Job correlation data. - /// is null. - internal MediaJobStateChangeEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData) - { - Argument.AssertNotNull(correlationData, nameof(correlationData)); - - PreviousState = previousState; - State = state; - CorrelationData = correlationData; - } - - /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. - /// Gets the Job correlation data. - /// Keeps track of any properties unknown to the library. - internal MediaJobStateChangeEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData) - { - PreviousState = previousState; - State = state; - CorrelationData = correlationData; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal MediaJobStateChangeEventData() - { - } - - /// The previous state of the Job. - public MediaJobState PreviousState { get; } - /// The new state of the Job. - public MediaJobState State { get; } - /// Gets the Job correlation data. - public IReadOnlyDictionary CorrelationData { get; } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventChannelArchiveHeartbeatEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventChannelArchiveHeartbeatEventData.cs deleted file mode 100644 index 1a2e1674b510..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventChannelArchiveHeartbeatEventData.cs +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// Channel Archive heartbeat event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventChannelArchiveHeartbeat event. - public partial class MediaLiveEventChannelArchiveHeartbeatEventData - { - /// - /// 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; - - /// Initializes a new instance of . - /// Gets the channel latency in ms. - /// Gets the latency result code. - /// or is null. - internal MediaLiveEventChannelArchiveHeartbeatEventData(string channelLatencyMs, string latencyResultCode) - { - Argument.AssertNotNull(channelLatencyMs, nameof(channelLatencyMs)); - Argument.AssertNotNull(latencyResultCode, nameof(latencyResultCode)); - - ChannelLatencyMs = channelLatencyMs; - LatencyResultCode = latencyResultCode; - } - - /// Initializes a new instance of . - /// Gets the channel latency in ms. - /// Gets the latency result code. - /// Keeps track of any properties unknown to the library. - internal MediaLiveEventChannelArchiveHeartbeatEventData(string channelLatencyMs, string latencyResultCode, IDictionary serializedAdditionalRawData) - { - ChannelLatencyMs = channelLatencyMs; - LatencyResultCode = latencyResultCode; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal MediaLiveEventChannelArchiveHeartbeatEventData() - { - } - - /// Gets the channel latency in ms. - public string ChannelLatencyMs { get; } - /// Gets the latency result code. - public string LatencyResultCode { get; } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventConnectionRejectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventConnectionRejectedEventData.Serialization.cs deleted file mode 100644 index 4fb52f66dce3..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventConnectionRejectedEventData.Serialization.cs +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - public partial class MediaLiveEventConnectionRejectedEventData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(MediaLiveEventConnectionRejectedEventData)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(IngestUrl)) - { - writer.WritePropertyName("ingestUrl"u8); - writer.WriteStringValue(IngestUrl); - } - if (Optional.IsDefined(StreamId)) - { - writer.WritePropertyName("streamId"u8); - writer.WriteStringValue(StreamId); - } - if (Optional.IsDefined(EncoderIp)) - { - writer.WritePropertyName("encoderIp"u8); - writer.WriteStringValue(EncoderIp); - } - if (Optional.IsDefined(EncoderPort)) - { - writer.WritePropertyName("encoderPort"u8); - writer.WriteStringValue(EncoderPort); - } - if (Optional.IsDefined(ResultCode)) - { - writer.WritePropertyName("resultCode"u8); - writer.WriteStringValue(ResultCode); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - MediaLiveEventConnectionRejectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MediaLiveEventConnectionRejectedEventData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaLiveEventConnectionRejectedEventData(document.RootElement, options); - } - - internal static MediaLiveEventConnectionRejectedEventData DeserializeMediaLiveEventConnectionRejectedEventData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string ingestUrl = default; - string streamId = default; - string encoderIp = default; - string encoderPort = default; - string resultCode = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("ingestUrl"u8)) - { - ingestUrl = property.Value.GetString(); - continue; - } - if (property.NameEquals("streamId"u8)) - { - streamId = property.Value.GetString(); - continue; - } - if (property.NameEquals("encoderIp"u8)) - { - encoderIp = property.Value.GetString(); - continue; - } - if (property.NameEquals("encoderPort"u8)) - { - encoderPort = property.Value.GetString(); - continue; - } - if (property.NameEquals("resultCode"u8)) - { - resultCode = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MediaLiveEventConnectionRejectedEventData( - ingestUrl, - streamId, - encoderIp, - encoderPort, - resultCode, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MediaLiveEventConnectionRejectedEventData)} does not support writing '{options.Format}' format."); - } - } - - MediaLiveEventConnectionRejectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaLiveEventConnectionRejectedEventData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MediaLiveEventConnectionRejectedEventData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static MediaLiveEventConnectionRejectedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaLiveEventConnectionRejectedEventData(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/MediaLiveEventConnectionRejectedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventConnectionRejectedEventData.cs deleted file mode 100644 index 9e86f61c5768..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventConnectionRejectedEventData.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// Encoder connection rejected event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventConnectionRejected event. - public partial class MediaLiveEventConnectionRejectedEventData - { - /// - /// 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; - - /// Initializes a new instance of . - internal MediaLiveEventConnectionRejectedEventData() - { - } - - /// Initializes a new instance of . - /// Gets the ingest URL provided by the live event. - /// Gets the stream Id. - /// Gets the remote IP. - /// Gets the remote port. - /// Gets the result code. - /// Keeps track of any properties unknown to the library. - internal MediaLiveEventConnectionRejectedEventData(string ingestUrl, string streamId, string encoderIp, string encoderPort, string resultCode, IDictionary serializedAdditionalRawData) - { - IngestUrl = ingestUrl; - StreamId = streamId; - EncoderIp = encoderIp; - EncoderPort = encoderPort; - ResultCode = resultCode; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Gets the ingest URL provided by the live event. - public string IngestUrl { get; } - /// Gets the stream Id. - public string StreamId { get; } - /// Gets the remote IP. - public string EncoderIp { get; } - /// Gets the remote port. - public string EncoderPort { get; } - /// Gets the result code. - public string ResultCode { get; } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventEncoderDisconnectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventEncoderDisconnectedEventData.Serialization.cs deleted file mode 100644 index a568208756a4..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventEncoderDisconnectedEventData.Serialization.cs +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - public partial class MediaLiveEventEncoderDisconnectedEventData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(MediaLiveEventEncoderDisconnectedEventData)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(IngestUrl)) - { - writer.WritePropertyName("ingestUrl"u8); - writer.WriteStringValue(IngestUrl); - } - if (Optional.IsDefined(StreamId)) - { - writer.WritePropertyName("streamId"u8); - writer.WriteStringValue(StreamId); - } - if (Optional.IsDefined(EncoderIp)) - { - writer.WritePropertyName("encoderIp"u8); - writer.WriteStringValue(EncoderIp); - } - if (Optional.IsDefined(EncoderPort)) - { - writer.WritePropertyName("encoderPort"u8); - writer.WriteStringValue(EncoderPort); - } - if (Optional.IsDefined(ResultCode)) - { - writer.WritePropertyName("resultCode"u8); - writer.WriteStringValue(ResultCode); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - MediaLiveEventEncoderDisconnectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MediaLiveEventEncoderDisconnectedEventData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaLiveEventEncoderDisconnectedEventData(document.RootElement, options); - } - - internal static MediaLiveEventEncoderDisconnectedEventData DeserializeMediaLiveEventEncoderDisconnectedEventData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string ingestUrl = default; - string streamId = default; - string encoderIp = default; - string encoderPort = default; - string resultCode = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("ingestUrl"u8)) - { - ingestUrl = property.Value.GetString(); - continue; - } - if (property.NameEquals("streamId"u8)) - { - streamId = property.Value.GetString(); - continue; - } - if (property.NameEquals("encoderIp"u8)) - { - encoderIp = property.Value.GetString(); - continue; - } - if (property.NameEquals("encoderPort"u8)) - { - encoderPort = property.Value.GetString(); - continue; - } - if (property.NameEquals("resultCode"u8)) - { - resultCode = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MediaLiveEventEncoderDisconnectedEventData( - ingestUrl, - streamId, - encoderIp, - encoderPort, - resultCode, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MediaLiveEventEncoderDisconnectedEventData)} does not support writing '{options.Format}' format."); - } - } - - MediaLiveEventEncoderDisconnectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaLiveEventEncoderDisconnectedEventData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MediaLiveEventEncoderDisconnectedEventData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static MediaLiveEventEncoderDisconnectedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaLiveEventEncoderDisconnectedEventData(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/MediaLiveEventEncoderDisconnectedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventEncoderDisconnectedEventData.cs deleted file mode 100644 index 93e701277824..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventEncoderDisconnectedEventData.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// Encoder disconnected event data. Schema of the Data property of an EventGridEvent for a Microsoft.Media.LiveEventEncoderDisconnected event. - public partial class MediaLiveEventEncoderDisconnectedEventData - { - /// - /// 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; - - /// Initializes a new instance of . - internal MediaLiveEventEncoderDisconnectedEventData() - { - } - - /// Initializes a new instance of . - /// Gets the ingest URL provided by the live event. - /// Gets the stream Id. - /// Gets the remote IP. - /// Gets the remote port. - /// Gets the result code. - /// Keeps track of any properties unknown to the library. - internal MediaLiveEventEncoderDisconnectedEventData(string ingestUrl, string streamId, string encoderIp, string encoderPort, string resultCode, IDictionary serializedAdditionalRawData) - { - IngestUrl = ingestUrl; - StreamId = streamId; - EncoderIp = encoderIp; - EncoderPort = encoderPort; - ResultCode = resultCode; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Gets the ingest URL provided by the live event. - public string IngestUrl { get; } - /// Gets the stream Id. - public string StreamId { get; } - /// Gets the remote IP. - public string EncoderIp { get; } - /// Gets the remote port. - public string EncoderPort { get; } - /// Gets the result code. - public string ResultCode { get; } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingDataChunkDroppedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingDataChunkDroppedEventData.Serialization.cs deleted file mode 100644 index 25bb532b0546..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingDataChunkDroppedEventData.Serialization.cs +++ /dev/null @@ -1,211 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - public partial class MediaLiveEventIncomingDataChunkDroppedEventData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(MediaLiveEventIncomingDataChunkDroppedEventData)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(Timestamp)) - { - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp); - } - if (Optional.IsDefined(TrackType)) - { - writer.WritePropertyName("trackType"u8); - writer.WriteStringValue(TrackType); - } - if (Optional.IsDefined(Bitrate)) - { - writer.WritePropertyName("bitrate"u8); - writer.WriteNumberValue(Bitrate.Value); - } - if (Optional.IsDefined(Timescale)) - { - writer.WritePropertyName("timescale"u8); - writer.WriteStringValue(Timescale); - } - if (Optional.IsDefined(ResultCode)) - { - writer.WritePropertyName("resultCode"u8); - writer.WriteStringValue(ResultCode); - } - if (Optional.IsDefined(TrackName)) - { - writer.WritePropertyName("trackName"u8); - writer.WriteStringValue(TrackName); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - MediaLiveEventIncomingDataChunkDroppedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MediaLiveEventIncomingDataChunkDroppedEventData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaLiveEventIncomingDataChunkDroppedEventData(document.RootElement, options); - } - - internal static MediaLiveEventIncomingDataChunkDroppedEventData DeserializeMediaLiveEventIncomingDataChunkDroppedEventData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string timestamp = default; - string trackType = default; - long? bitrate = default; - string timescale = default; - string resultCode = default; - string trackName = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("timestamp"u8)) - { - timestamp = property.Value.GetString(); - continue; - } - if (property.NameEquals("trackType"u8)) - { - trackType = property.Value.GetString(); - continue; - } - if (property.NameEquals("bitrate"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - bitrate = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("timescale"u8)) - { - timescale = property.Value.GetString(); - continue; - } - if (property.NameEquals("resultCode"u8)) - { - resultCode = property.Value.GetString(); - continue; - } - if (property.NameEquals("trackName"u8)) - { - trackName = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MediaLiveEventIncomingDataChunkDroppedEventData( - timestamp, - trackType, - bitrate, - timescale, - resultCode, - trackName, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MediaLiveEventIncomingDataChunkDroppedEventData)} does not support writing '{options.Format}' format."); - } - } - - MediaLiveEventIncomingDataChunkDroppedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaLiveEventIncomingDataChunkDroppedEventData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MediaLiveEventIncomingDataChunkDroppedEventData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static MediaLiveEventIncomingDataChunkDroppedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaLiveEventIncomingDataChunkDroppedEventData(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/MediaLiveEventIncomingDataChunkDroppedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingDataChunkDroppedEventData.cs deleted file mode 100644 index 55ee088b611c..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingDataChunkDroppedEventData.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// Ingest fragment dropped event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIncomingDataChunkDropped event. - public partial class MediaLiveEventIncomingDataChunkDroppedEventData - { - /// - /// 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; - - /// Initializes a new instance of . - internal MediaLiveEventIncomingDataChunkDroppedEventData() - { - } - - /// Initializes a new instance of . - /// Gets the timestamp of the data chunk dropped. - /// Gets the type of the track (Audio / Video). - /// Gets the bitrate of the track. - /// Gets the timescale of the Timestamp. - /// Gets the result code for fragment drop operation. - /// Gets the name of the track for which fragment is dropped. - /// Keeps track of any properties unknown to the library. - internal MediaLiveEventIncomingDataChunkDroppedEventData(string timestamp, string trackType, long? bitrate, string timescale, string resultCode, string trackName, IDictionary serializedAdditionalRawData) - { - Timestamp = timestamp; - TrackType = trackType; - Bitrate = bitrate; - Timescale = timescale; - ResultCode = resultCode; - TrackName = trackName; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Gets the timestamp of the data chunk dropped. - public string Timestamp { get; } - /// Gets the type of the track (Audio / Video). - public string TrackType { get; } - /// Gets the bitrate of the track. - public long? Bitrate { get; } - /// Gets the timescale of the Timestamp. - public string Timescale { get; } - /// Gets the result code for fragment drop operation. - public string ResultCode { get; } - /// Gets the name of the track for which fragment is dropped. - public string TrackName { get; } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingStreamReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingStreamReceivedEventData.Serialization.cs deleted file mode 100644 index be42947c0456..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingStreamReceivedEventData.Serialization.cs +++ /dev/null @@ -1,247 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - public partial class MediaLiveEventIncomingStreamReceivedEventData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(MediaLiveEventIncomingStreamReceivedEventData)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(IngestUrl)) - { - writer.WritePropertyName("ingestUrl"u8); - writer.WriteStringValue(IngestUrl); - } - if (Optional.IsDefined(TrackType)) - { - writer.WritePropertyName("trackType"u8); - writer.WriteStringValue(TrackType); - } - if (Optional.IsDefined(TrackName)) - { - writer.WritePropertyName("trackName"u8); - writer.WriteStringValue(TrackName); - } - if (Optional.IsDefined(Bitrate)) - { - writer.WritePropertyName("bitrate"u8); - writer.WriteNumberValue(Bitrate.Value); - } - if (Optional.IsDefined(EncoderIp)) - { - writer.WritePropertyName("encoderIp"u8); - writer.WriteStringValue(EncoderIp); - } - if (Optional.IsDefined(EncoderPort)) - { - writer.WritePropertyName("encoderPort"u8); - writer.WriteStringValue(EncoderPort); - } - if (Optional.IsDefined(Timestamp)) - { - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp); - } - if (Optional.IsDefined(Duration)) - { - writer.WritePropertyName("duration"u8); - writer.WriteStringValue(Duration); - } - if (Optional.IsDefined(Timescale)) - { - writer.WritePropertyName("timescale"u8); - writer.WriteStringValue(Timescale); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - MediaLiveEventIncomingStreamReceivedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MediaLiveEventIncomingStreamReceivedEventData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaLiveEventIncomingStreamReceivedEventData(document.RootElement, options); - } - - internal static MediaLiveEventIncomingStreamReceivedEventData DeserializeMediaLiveEventIncomingStreamReceivedEventData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string ingestUrl = default; - string trackType = default; - string trackName = default; - long? bitrate = default; - string encoderIp = default; - string encoderPort = default; - string timestamp = default; - string duration = default; - string timescale = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("ingestUrl"u8)) - { - ingestUrl = property.Value.GetString(); - continue; - } - if (property.NameEquals("trackType"u8)) - { - trackType = property.Value.GetString(); - continue; - } - if (property.NameEquals("trackName"u8)) - { - trackName = property.Value.GetString(); - continue; - } - if (property.NameEquals("bitrate"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - bitrate = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("encoderIp"u8)) - { - encoderIp = property.Value.GetString(); - continue; - } - if (property.NameEquals("encoderPort"u8)) - { - encoderPort = property.Value.GetString(); - continue; - } - if (property.NameEquals("timestamp"u8)) - { - timestamp = property.Value.GetString(); - continue; - } - if (property.NameEquals("duration"u8)) - { - duration = property.Value.GetString(); - continue; - } - if (property.NameEquals("timescale"u8)) - { - timescale = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MediaLiveEventIncomingStreamReceivedEventData( - ingestUrl, - trackType, - trackName, - bitrate, - encoderIp, - encoderPort, - timestamp, - duration, - timescale, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MediaLiveEventIncomingStreamReceivedEventData)} does not support writing '{options.Format}' format."); - } - } - - MediaLiveEventIncomingStreamReceivedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaLiveEventIncomingStreamReceivedEventData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MediaLiveEventIncomingStreamReceivedEventData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static MediaLiveEventIncomingStreamReceivedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaLiveEventIncomingStreamReceivedEventData(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/MediaLiveEventIncomingStreamReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingStreamReceivedEventData.cs deleted file mode 100644 index c16535f3a93b..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingStreamReceivedEventData.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// Encoder connect event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIncomingStreamReceived event. - public partial class MediaLiveEventIncomingStreamReceivedEventData - { - /// - /// 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; - - /// Initializes a new instance of . - internal MediaLiveEventIncomingStreamReceivedEventData() - { - } - - /// Initializes a new instance of . - /// Gets the ingest URL provided by the live event. - /// Gets the type of the track (Audio / Video). - /// Gets the track name. - /// Gets the bitrate of the track. - /// Gets the remote IP. - /// Gets the remote port. - /// Gets the first timestamp of the data chunk received. - /// Gets the duration of the first data chunk. - /// Gets the timescale in which timestamp is represented. - /// Keeps track of any properties unknown to the library. - internal MediaLiveEventIncomingStreamReceivedEventData(string ingestUrl, string trackType, string trackName, long? bitrate, string encoderIp, string encoderPort, string timestamp, string duration, string timescale, IDictionary serializedAdditionalRawData) - { - IngestUrl = ingestUrl; - TrackType = trackType; - TrackName = trackName; - Bitrate = bitrate; - EncoderIp = encoderIp; - EncoderPort = encoderPort; - Timestamp = timestamp; - Duration = duration; - Timescale = timescale; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Gets the ingest URL provided by the live event. - public string IngestUrl { get; } - /// Gets the type of the track (Audio / Video). - public string TrackType { get; } - /// Gets the track name. - public string TrackName { get; } - /// Gets the bitrate of the track. - public long? Bitrate { get; } - /// Gets the remote IP. - public string EncoderIp { get; } - /// Gets the remote port. - public string EncoderPort { get; } - /// Gets the first timestamp of the data chunk received. - public string Timestamp { get; } - /// Gets the duration of the first data chunk. - public string Duration { get; } - /// Gets the timescale in which timestamp is represented. - public string Timescale { get; } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingStreamsOutOfSyncEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingStreamsOutOfSyncEventData.Serialization.cs deleted file mode 100644 index dc5a7de96c8d..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingStreamsOutOfSyncEventData.Serialization.cs +++ /dev/null @@ -1,207 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - public partial class MediaLiveEventIncomingStreamsOutOfSyncEventData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(MediaLiveEventIncomingStreamsOutOfSyncEventData)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(MinLastTimestamp)) - { - writer.WritePropertyName("minLastTimestamp"u8); - writer.WriteStringValue(MinLastTimestamp); - } - if (Optional.IsDefined(TypeOfStreamWithMinLastTimestamp)) - { - writer.WritePropertyName("typeOfStreamWithMinLastTimestamp"u8); - writer.WriteStringValue(TypeOfStreamWithMinLastTimestamp); - } - if (Optional.IsDefined(MaxLastTimestamp)) - { - writer.WritePropertyName("maxLastTimestamp"u8); - writer.WriteStringValue(MaxLastTimestamp); - } - if (Optional.IsDefined(TypeOfStreamWithMaxLastTimestamp)) - { - writer.WritePropertyName("typeOfStreamWithMaxLastTimestamp"u8); - writer.WriteStringValue(TypeOfStreamWithMaxLastTimestamp); - } - if (Optional.IsDefined(TimescaleOfMinLastTimestamp)) - { - writer.WritePropertyName("timescaleOfMinLastTimestamp"u8); - writer.WriteStringValue(TimescaleOfMinLastTimestamp); - } - if (Optional.IsDefined(TimescaleOfMaxLastTimestamp)) - { - writer.WritePropertyName("timescaleOfMaxLastTimestamp"u8); - writer.WriteStringValue(TimescaleOfMaxLastTimestamp); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - MediaLiveEventIncomingStreamsOutOfSyncEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MediaLiveEventIncomingStreamsOutOfSyncEventData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaLiveEventIncomingStreamsOutOfSyncEventData(document.RootElement, options); - } - - internal static MediaLiveEventIncomingStreamsOutOfSyncEventData DeserializeMediaLiveEventIncomingStreamsOutOfSyncEventData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string minLastTimestamp = default; - string typeOfStreamWithMinLastTimestamp = default; - string maxLastTimestamp = default; - string typeOfStreamWithMaxLastTimestamp = default; - string timescaleOfMinLastTimestamp = default; - string timescaleOfMaxLastTimestamp = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("minLastTimestamp"u8)) - { - minLastTimestamp = property.Value.GetString(); - continue; - } - if (property.NameEquals("typeOfStreamWithMinLastTimestamp"u8)) - { - typeOfStreamWithMinLastTimestamp = property.Value.GetString(); - continue; - } - if (property.NameEquals("maxLastTimestamp"u8)) - { - maxLastTimestamp = property.Value.GetString(); - continue; - } - if (property.NameEquals("typeOfStreamWithMaxLastTimestamp"u8)) - { - typeOfStreamWithMaxLastTimestamp = property.Value.GetString(); - continue; - } - if (property.NameEquals("timescaleOfMinLastTimestamp"u8)) - { - timescaleOfMinLastTimestamp = property.Value.GetString(); - continue; - } - if (property.NameEquals("timescaleOfMaxLastTimestamp"u8)) - { - timescaleOfMaxLastTimestamp = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MediaLiveEventIncomingStreamsOutOfSyncEventData( - minLastTimestamp, - typeOfStreamWithMinLastTimestamp, - maxLastTimestamp, - typeOfStreamWithMaxLastTimestamp, - timescaleOfMinLastTimestamp, - timescaleOfMaxLastTimestamp, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MediaLiveEventIncomingStreamsOutOfSyncEventData)} does not support writing '{options.Format}' format."); - } - } - - MediaLiveEventIncomingStreamsOutOfSyncEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaLiveEventIncomingStreamsOutOfSyncEventData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MediaLiveEventIncomingStreamsOutOfSyncEventData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static MediaLiveEventIncomingStreamsOutOfSyncEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaLiveEventIncomingStreamsOutOfSyncEventData(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/MediaLiveEventIncomingStreamsOutOfSyncEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingStreamsOutOfSyncEventData.cs deleted file mode 100644 index 48d04136a2fd..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingStreamsOutOfSyncEventData.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// Incoming streams out of sync event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIncomingStreamsOutOfSync event. - public partial class MediaLiveEventIncomingStreamsOutOfSyncEventData - { - /// - /// 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; - - /// Initializes a new instance of . - internal MediaLiveEventIncomingStreamsOutOfSyncEventData() - { - } - - /// Initializes a new instance of . - /// Gets the minimum last timestamp received. - /// Gets the type of stream with minimum last timestamp. - /// Gets the maximum timestamp among all the tracks (audio or video). - /// Gets the type of stream with maximum last timestamp. - /// Gets the timescale in which \"MinLastTimestamp\" is represented. - /// Gets the timescale in which \"MaxLastTimestamp\" is represented. - /// Keeps track of any properties unknown to the library. - internal MediaLiveEventIncomingStreamsOutOfSyncEventData(string minLastTimestamp, string typeOfStreamWithMinLastTimestamp, string maxLastTimestamp, string typeOfStreamWithMaxLastTimestamp, string timescaleOfMinLastTimestamp, string timescaleOfMaxLastTimestamp, IDictionary serializedAdditionalRawData) - { - MinLastTimestamp = minLastTimestamp; - TypeOfStreamWithMinLastTimestamp = typeOfStreamWithMinLastTimestamp; - MaxLastTimestamp = maxLastTimestamp; - TypeOfStreamWithMaxLastTimestamp = typeOfStreamWithMaxLastTimestamp; - TimescaleOfMinLastTimestamp = timescaleOfMinLastTimestamp; - TimescaleOfMaxLastTimestamp = timescaleOfMaxLastTimestamp; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Gets the minimum last timestamp received. - public string MinLastTimestamp { get; } - /// Gets the type of stream with minimum last timestamp. - public string TypeOfStreamWithMinLastTimestamp { get; } - /// Gets the maximum timestamp among all the tracks (audio or video). - public string MaxLastTimestamp { get; } - /// Gets the type of stream with maximum last timestamp. - public string TypeOfStreamWithMaxLastTimestamp { get; } - /// Gets the timescale in which \"MinLastTimestamp\" is represented. - public string TimescaleOfMinLastTimestamp { get; } - /// Gets the timescale in which \"MaxLastTimestamp\" is represented. - public string TimescaleOfMaxLastTimestamp { get; } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingVideoStreamsOutOfSyncEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingVideoStreamsOutOfSyncEventData.Serialization.cs deleted file mode 100644 index cdf63959dbb9..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingVideoStreamsOutOfSyncEventData.Serialization.cs +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - public partial class MediaLiveEventIncomingVideoStreamsOutOfSyncEventData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(MediaLiveEventIncomingVideoStreamsOutOfSyncEventData)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(FirstTimestamp)) - { - writer.WritePropertyName("firstTimestamp"u8); - writer.WriteStringValue(FirstTimestamp); - } - if (Optional.IsDefined(FirstDuration)) - { - writer.WritePropertyName("firstDuration"u8); - writer.WriteStringValue(FirstDuration); - } - if (Optional.IsDefined(SecondTimestamp)) - { - writer.WritePropertyName("secondTimestamp"u8); - writer.WriteStringValue(SecondTimestamp); - } - if (Optional.IsDefined(SecondDuration)) - { - writer.WritePropertyName("secondDuration"u8); - writer.WriteStringValue(SecondDuration); - } - if (Optional.IsDefined(Timescale)) - { - writer.WritePropertyName("timescale"u8); - writer.WriteStringValue(Timescale); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - MediaLiveEventIncomingVideoStreamsOutOfSyncEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MediaLiveEventIncomingVideoStreamsOutOfSyncEventData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaLiveEventIncomingVideoStreamsOutOfSyncEventData(document.RootElement, options); - } - - internal static MediaLiveEventIncomingVideoStreamsOutOfSyncEventData DeserializeMediaLiveEventIncomingVideoStreamsOutOfSyncEventData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string firstTimestamp = default; - string firstDuration = default; - string secondTimestamp = default; - string secondDuration = default; - string timescale = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("firstTimestamp"u8)) - { - firstTimestamp = property.Value.GetString(); - continue; - } - if (property.NameEquals("firstDuration"u8)) - { - firstDuration = property.Value.GetString(); - continue; - } - if (property.NameEquals("secondTimestamp"u8)) - { - secondTimestamp = property.Value.GetString(); - continue; - } - if (property.NameEquals("secondDuration"u8)) - { - secondDuration = property.Value.GetString(); - continue; - } - if (property.NameEquals("timescale"u8)) - { - timescale = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MediaLiveEventIncomingVideoStreamsOutOfSyncEventData( - firstTimestamp, - firstDuration, - secondTimestamp, - secondDuration, - timescale, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MediaLiveEventIncomingVideoStreamsOutOfSyncEventData)} does not support writing '{options.Format}' format."); - } - } - - MediaLiveEventIncomingVideoStreamsOutOfSyncEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaLiveEventIncomingVideoStreamsOutOfSyncEventData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MediaLiveEventIncomingVideoStreamsOutOfSyncEventData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static MediaLiveEventIncomingVideoStreamsOutOfSyncEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaLiveEventIncomingVideoStreamsOutOfSyncEventData(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/MediaLiveEventIncomingVideoStreamsOutOfSyncEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingVideoStreamsOutOfSyncEventData.cs deleted file mode 100644 index 00316740b3de..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingVideoStreamsOutOfSyncEventData.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// Incoming video stream out of sync event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIncomingVideoStreamsOutOfSync event. - public partial class MediaLiveEventIncomingVideoStreamsOutOfSyncEventData - { - /// - /// 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; - - /// Initializes a new instance of . - internal MediaLiveEventIncomingVideoStreamsOutOfSyncEventData() - { - } - - /// Initializes a new instance of . - /// Gets the first timestamp received for one of the quality levels. - /// Gets the duration of the data chunk with first timestamp. - /// Gets the timestamp received for some other quality levels. - /// Gets the duration of the data chunk with second timestamp. - /// Gets the timescale in which both the timestamps and durations are represented. - /// Keeps track of any properties unknown to the library. - internal MediaLiveEventIncomingVideoStreamsOutOfSyncEventData(string firstTimestamp, string firstDuration, string secondTimestamp, string secondDuration, string timescale, IDictionary serializedAdditionalRawData) - { - FirstTimestamp = firstTimestamp; - FirstDuration = firstDuration; - SecondTimestamp = secondTimestamp; - SecondDuration = secondDuration; - Timescale = timescale; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Gets the first timestamp received for one of the quality levels. - public string FirstTimestamp { get; } - /// Gets the duration of the data chunk with first timestamp. - public string FirstDuration { get; } - /// Gets the timestamp received for some other quality levels. - public string SecondTimestamp { get; } - /// Gets the duration of the data chunk with second timestamp. - public string SecondDuration { get; } - /// Gets the timescale in which both the timestamps and durations are represented. - public string Timescale { get; } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIngestHeartbeatEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIngestHeartbeatEventData.Serialization.cs deleted file mode 100644 index 2e196fa43664..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIngestHeartbeatEventData.Serialization.cs +++ /dev/null @@ -1,355 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - public partial class MediaLiveEventIngestHeartbeatEventData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(MediaLiveEventIngestHeartbeatEventData)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(TrackType)) - { - writer.WritePropertyName("trackType"u8); - writer.WriteStringValue(TrackType); - } - if (Optional.IsDefined(TrackName)) - { - writer.WritePropertyName("trackName"u8); - writer.WriteStringValue(TrackName); - } - if (Optional.IsDefined(TranscriptionLanguage)) - { - writer.WritePropertyName("transcriptionLanguage"u8); - writer.WriteStringValue(TranscriptionLanguage); - } - if (Optional.IsDefined(TranscriptionState)) - { - writer.WritePropertyName("transcriptionState"u8); - writer.WriteStringValue(TranscriptionState); - } - if (Optional.IsDefined(Bitrate)) - { - writer.WritePropertyName("bitrate"u8); - writer.WriteNumberValue(Bitrate.Value); - } - if (Optional.IsDefined(IncomingBitrate)) - { - writer.WritePropertyName("incomingBitrate"u8); - writer.WriteNumberValue(IncomingBitrate.Value); - } - if (Optional.IsDefined(IngestDriftValue)) - { - writer.WritePropertyName("ingestDriftValue"u8); - writer.WriteStringValue(IngestDriftValue); - } - if (Optional.IsDefined(LastFragmentArrivalTime)) - { - writer.WritePropertyName("lastFragmentArrivalTime"u8); - writer.WriteStringValue(LastFragmentArrivalTime); - } - if (Optional.IsDefined(LastTimestamp)) - { - writer.WritePropertyName("lastTimestamp"u8); - writer.WriteStringValue(LastTimestamp); - } - if (Optional.IsDefined(Timescale)) - { - writer.WritePropertyName("timescale"u8); - writer.WriteStringValue(Timescale); - } - if (Optional.IsDefined(OverlapCount)) - { - writer.WritePropertyName("overlapCount"u8); - writer.WriteNumberValue(OverlapCount.Value); - } - if (Optional.IsDefined(DiscontinuityCount)) - { - writer.WritePropertyName("discontinuityCount"u8); - writer.WriteNumberValue(DiscontinuityCount.Value); - } - if (Optional.IsDefined(NonincreasingCount)) - { - writer.WritePropertyName("nonincreasingCount"u8); - writer.WriteNumberValue(NonincreasingCount.Value); - } - if (Optional.IsDefined(UnexpectedBitrate)) - { - writer.WritePropertyName("unexpectedBitrate"u8); - writer.WriteBooleanValue(UnexpectedBitrate.Value); - } - if (Optional.IsDefined(State)) - { - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State); - } - if (Optional.IsDefined(Healthy)) - { - writer.WritePropertyName("healthy"u8); - writer.WriteBooleanValue(Healthy.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - MediaLiveEventIngestHeartbeatEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MediaLiveEventIngestHeartbeatEventData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaLiveEventIngestHeartbeatEventData(document.RootElement, options); - } - - internal static MediaLiveEventIngestHeartbeatEventData DeserializeMediaLiveEventIngestHeartbeatEventData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string trackType = default; - string trackName = default; - string transcriptionLanguage = default; - string transcriptionState = default; - long? bitrate = default; - long? incomingBitrate = default; - string ingestDriftValue = default; - string lastFragmentArrivalTime = default; - string lastTimestamp = default; - string timescale = default; - long? overlapCount = default; - long? discontinuityCount = default; - long? nonincreasingCount = default; - bool? unexpectedBitrate = default; - string state = default; - bool? healthy = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("trackType"u8)) - { - trackType = property.Value.GetString(); - continue; - } - if (property.NameEquals("trackName"u8)) - { - trackName = property.Value.GetString(); - continue; - } - if (property.NameEquals("transcriptionLanguage"u8)) - { - transcriptionLanguage = property.Value.GetString(); - continue; - } - if (property.NameEquals("transcriptionState"u8)) - { - transcriptionState = property.Value.GetString(); - continue; - } - if (property.NameEquals("bitrate"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - bitrate = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("incomingBitrate"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - incomingBitrate = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("ingestDriftValue"u8)) - { - ingestDriftValue = property.Value.GetString(); - continue; - } - if (property.NameEquals("lastFragmentArrivalTime"u8)) - { - lastFragmentArrivalTime = property.Value.GetString(); - continue; - } - if (property.NameEquals("lastTimestamp"u8)) - { - lastTimestamp = property.Value.GetString(); - continue; - } - if (property.NameEquals("timescale"u8)) - { - timescale = property.Value.GetString(); - continue; - } - if (property.NameEquals("overlapCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - overlapCount = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("discontinuityCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - discontinuityCount = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("nonincreasingCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - nonincreasingCount = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("unexpectedBitrate"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - unexpectedBitrate = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("state"u8)) - { - state = property.Value.GetString(); - continue; - } - if (property.NameEquals("healthy"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - healthy = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MediaLiveEventIngestHeartbeatEventData( - trackType, - trackName, - transcriptionLanguage, - transcriptionState, - bitrate, - incomingBitrate, - ingestDriftValue, - lastFragmentArrivalTime, - lastTimestamp, - timescale, - overlapCount, - discontinuityCount, - nonincreasingCount, - unexpectedBitrate, - state, - healthy, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MediaLiveEventIngestHeartbeatEventData)} does not support writing '{options.Format}' format."); - } - } - - MediaLiveEventIngestHeartbeatEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaLiveEventIngestHeartbeatEventData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MediaLiveEventIngestHeartbeatEventData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static MediaLiveEventIngestHeartbeatEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaLiveEventIngestHeartbeatEventData(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/MediaLiveEventIngestHeartbeatEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIngestHeartbeatEventData.cs deleted file mode 100644 index 0171662bcace..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIngestHeartbeatEventData.cs +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// Ingest heartbeat event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIngestHeartbeat event. - public partial class MediaLiveEventIngestHeartbeatEventData - { - /// - /// 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; - - /// Initializes a new instance of . - internal MediaLiveEventIngestHeartbeatEventData() - { - } - - /// Initializes a new instance of . - /// Gets the type of the track (Audio / Video). - /// Gets the track name. - /// Gets the Live Transcription language. - /// Gets the Live Transcription state. - /// Gets the bitrate of the track. - /// Gets the incoming bitrate. - /// Gets the track ingest drift value. - /// Gets the arrival UTC time of the last fragment. - /// Gets the last timestamp. - /// Gets the timescale of the last timestamp. - /// Gets the fragment Overlap count. - /// Gets the fragment Discontinuity count. - /// Gets Non increasing count. - /// Gets a value indicating whether unexpected bitrate is present or not. - /// Gets the state of the live event. - /// Gets a value indicating whether preview is healthy or not. - /// Keeps track of any properties unknown to the library. - internal MediaLiveEventIngestHeartbeatEventData(string trackType, string trackName, string transcriptionLanguage, string transcriptionState, long? bitrate, long? incomingBitrate, string ingestDriftValue, string lastFragmentArrivalTime, string lastTimestamp, string timescale, long? overlapCount, long? discontinuityCount, long? nonincreasingCount, bool? unexpectedBitrate, string state, bool? healthy, IDictionary serializedAdditionalRawData) - { - TrackType = trackType; - TrackName = trackName; - TranscriptionLanguage = transcriptionLanguage; - TranscriptionState = transcriptionState; - Bitrate = bitrate; - IncomingBitrate = incomingBitrate; - IngestDriftValue = ingestDriftValue; - LastFragmentArrivalTime = lastFragmentArrivalTime; - LastTimestamp = lastTimestamp; - Timescale = timescale; - OverlapCount = overlapCount; - DiscontinuityCount = discontinuityCount; - NonincreasingCount = nonincreasingCount; - UnexpectedBitrate = unexpectedBitrate; - State = state; - Healthy = healthy; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Gets the type of the track (Audio / Video). - public string TrackType { get; } - /// Gets the track name. - public string TrackName { get; } - /// Gets the Live Transcription language. - public string TranscriptionLanguage { get; } - /// Gets the Live Transcription state. - public string TranscriptionState { get; } - /// Gets the bitrate of the track. - public long? Bitrate { get; } - /// Gets the incoming bitrate. - public long? IncomingBitrate { get; } - /// Gets the track ingest drift value. - public string IngestDriftValue { get; } - /// Gets the arrival UTC time of the last fragment. - public string LastFragmentArrivalTime { get; } - /// Gets the last timestamp. - public string LastTimestamp { get; } - /// Gets the timescale of the last timestamp. - public string Timescale { get; } - /// Gets the fragment Overlap count. - public long? OverlapCount { get; } - /// Gets the fragment Discontinuity count. - public long? DiscontinuityCount { get; } - /// Gets Non increasing count. - public long? NonincreasingCount { get; } - /// Gets a value indicating whether unexpected bitrate is present or not. - public bool? UnexpectedBitrate { get; } - /// Gets the state of the live event. - public string State { get; } - /// Gets a value indicating whether preview is healthy or not. - public bool? Healthy { get; } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventTrackDiscontinuityDetectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventTrackDiscontinuityDetectedEventData.Serialization.cs deleted file mode 100644 index 58ca54e43916..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventTrackDiscontinuityDetectedEventData.Serialization.cs +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - public partial class MediaLiveEventTrackDiscontinuityDetectedEventData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(MediaLiveEventTrackDiscontinuityDetectedEventData)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(TrackType)) - { - writer.WritePropertyName("trackType"u8); - writer.WriteStringValue(TrackType); - } - if (Optional.IsDefined(TrackName)) - { - writer.WritePropertyName("trackName"u8); - writer.WriteStringValue(TrackName); - } - if (Optional.IsDefined(Bitrate)) - { - writer.WritePropertyName("bitrate"u8); - writer.WriteNumberValue(Bitrate.Value); - } - if (Optional.IsDefined(PreviousTimestamp)) - { - writer.WritePropertyName("previousTimestamp"u8); - writer.WriteStringValue(PreviousTimestamp); - } - if (Optional.IsDefined(NewTimestamp)) - { - writer.WritePropertyName("newTimestamp"u8); - writer.WriteStringValue(NewTimestamp); - } - if (Optional.IsDefined(Timescale)) - { - writer.WritePropertyName("timescale"u8); - writer.WriteStringValue(Timescale); - } - if (Optional.IsDefined(DiscontinuityGap)) - { - writer.WritePropertyName("discontinuityGap"u8); - writer.WriteStringValue(DiscontinuityGap); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - MediaLiveEventTrackDiscontinuityDetectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MediaLiveEventTrackDiscontinuityDetectedEventData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaLiveEventTrackDiscontinuityDetectedEventData(document.RootElement, options); - } - - internal static MediaLiveEventTrackDiscontinuityDetectedEventData DeserializeMediaLiveEventTrackDiscontinuityDetectedEventData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string trackType = default; - string trackName = default; - long? bitrate = default; - string previousTimestamp = default; - string newTimestamp = default; - string timescale = default; - string discontinuityGap = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("trackType"u8)) - { - trackType = property.Value.GetString(); - continue; - } - if (property.NameEquals("trackName"u8)) - { - trackName = property.Value.GetString(); - continue; - } - if (property.NameEquals("bitrate"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - bitrate = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("previousTimestamp"u8)) - { - previousTimestamp = property.Value.GetString(); - continue; - } - if (property.NameEquals("newTimestamp"u8)) - { - newTimestamp = property.Value.GetString(); - continue; - } - if (property.NameEquals("timescale"u8)) - { - timescale = property.Value.GetString(); - continue; - } - if (property.NameEquals("discontinuityGap"u8)) - { - discontinuityGap = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MediaLiveEventTrackDiscontinuityDetectedEventData( - trackType, - trackName, - bitrate, - previousTimestamp, - newTimestamp, - timescale, - discontinuityGap, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MediaLiveEventTrackDiscontinuityDetectedEventData)} does not support writing '{options.Format}' format."); - } - } - - MediaLiveEventTrackDiscontinuityDetectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaLiveEventTrackDiscontinuityDetectedEventData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MediaLiveEventTrackDiscontinuityDetectedEventData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static MediaLiveEventTrackDiscontinuityDetectedEventData FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaLiveEventTrackDiscontinuityDetectedEventData(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/MediaLiveEventTrackDiscontinuityDetectedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventTrackDiscontinuityDetectedEventData.cs deleted file mode 100644 index e077f783f04a..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventTrackDiscontinuityDetectedEventData.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// Ingest track discontinuity detected event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventTrackDiscontinuityDetected event. - public partial class MediaLiveEventTrackDiscontinuityDetectedEventData - { - /// - /// 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; - - /// Initializes a new instance of . - internal MediaLiveEventTrackDiscontinuityDetectedEventData() - { - } - - /// Initializes a new instance of . - /// Gets the type of the track (Audio / Video). - /// Gets the track name. - /// Gets the bitrate. - /// Gets the timestamp of the previous fragment. - /// Gets the timestamp of the current fragment. - /// Gets the timescale in which both timestamps and discontinuity gap are represented. - /// Gets the discontinuity gap between PreviousTimestamp and NewTimestamp. - /// Keeps track of any properties unknown to the library. - internal MediaLiveEventTrackDiscontinuityDetectedEventData(string trackType, string trackName, long? bitrate, string previousTimestamp, string newTimestamp, string timescale, string discontinuityGap, IDictionary serializedAdditionalRawData) - { - TrackType = trackType; - TrackName = trackName; - Bitrate = bitrate; - PreviousTimestamp = previousTimestamp; - NewTimestamp = newTimestamp; - Timescale = timescale; - DiscontinuityGap = discontinuityGap; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Gets the type of the track (Audio / Video). - public string TrackType { get; } - /// Gets the track name. - public string TrackName { get; } - /// Gets the bitrate. - public long? Bitrate { get; } - /// Gets the timestamp of the previous fragment. - public string PreviousTimestamp { get; } - /// Gets the timestamp of the current fragment. - public string NewTimestamp { get; } - /// Gets the timescale in which both timestamps and discontinuity gap are represented. - public string Timescale { get; } - /// Gets the discontinuity gap between PreviousTimestamp and NewTimestamp. - public string DiscontinuityGap { get; } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsAppIdentifierModel.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsAppIdentifierModel.Serialization.cs index 3c142425d7d9..af5aafaa512d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsAppIdentifierModel.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsAppIdentifierModel.Serialization.cs @@ -36,8 +36,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("appId"u8); writer.WriteStringValue(AppId); - writer.WritePropertyName("cloud"u8); - writer.WriteStringValue(Cloud.ToString()); + if (Optional.IsDefined(Cloud)) + { + writer.WritePropertyName("cloud"u8); + writer.WriteStringValue(Cloud.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -76,7 +79,7 @@ internal static MicrosoftTeamsAppIdentifierModel DeserializeMicrosoftTeamsAppIde return null; } string appId = default; - CommunicationCloudEnvironmentModel cloud = default; + CommunicationCloudEnvironmentModel? cloud = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -88,6 +91,10 @@ internal static MicrosoftTeamsAppIdentifierModel DeserializeMicrosoftTeamsAppIde } if (property.NameEquals("cloud"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } cloud = new CommunicationCloudEnvironmentModel(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsAppIdentifierModel.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsAppIdentifierModel.cs index 41e1a566a23f..d53a1651e7ce 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsAppIdentifierModel.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsAppIdentifierModel.cs @@ -47,21 +47,19 @@ public partial class MicrosoftTeamsAppIdentifierModel /// 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. /// is null. - internal MicrosoftTeamsAppIdentifierModel(string appId, CommunicationCloudEnvironmentModel cloud) + internal MicrosoftTeamsAppIdentifierModel(string appId) { Argument.AssertNotNull(appId, nameof(appId)); AppId = appId; - Cloud = cloud; } /// 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 MicrosoftTeamsAppIdentifierModel(string appId, CommunicationCloudEnvironmentModel cloud, IDictionary serializedAdditionalRawData) + internal MicrosoftTeamsAppIdentifierModel(string appId, CommunicationCloudEnvironmentModel? cloud, IDictionary serializedAdditionalRawData) { AppId = appId; Cloud = cloud; @@ -76,6 +74,6 @@ internal MicrosoftTeamsAppIdentifierModel() /// 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; } + public CommunicationCloudEnvironmentModel? Cloud { get; } } } 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 954ae03dd03a..ab0c1fd56581 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 @@ -41,8 +41,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("isAnonymous"u8); writer.WriteBooleanValue(IsAnonymous.Value); } - writer.WritePropertyName("cloud"u8); - writer.WriteStringValue(Cloud.ToString()); + if (Optional.IsDefined(Cloud)) + { + writer.WritePropertyName("cloud"u8); + writer.WriteStringValue(Cloud.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -82,7 +85,7 @@ internal static MicrosoftTeamsUserIdentifierModel DeserializeMicrosoftTeamsUserI } string userId = default; bool? isAnonymous = default; - CommunicationCloudEnvironmentModel cloud = default; + CommunicationCloudEnvironmentModel? cloud = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -103,6 +106,10 @@ internal static MicrosoftTeamsUserIdentifierModel DeserializeMicrosoftTeamsUserI } if (property.NameEquals("cloud"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } cloud = new CommunicationCloudEnvironmentModel(property.Value.GetString()); continue; } 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 d8958e4d8035..1678ab0098cf 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsUserIdentifierModel.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsUserIdentifierModel.cs @@ -47,14 +47,12 @@ public partial class MicrosoftTeamsUserIdentifierModel /// Initializes a new instance of . /// The Id of the Microsoft Teams user. If not anonymous, this is the AAD object Id of the user. - /// The cloud that the Microsoft Teams user belongs to. By default 'public' if missing. /// is null. - internal MicrosoftTeamsUserIdentifierModel(string userId, CommunicationCloudEnvironmentModel cloud) + internal MicrosoftTeamsUserIdentifierModel(string userId) { Argument.AssertNotNull(userId, nameof(userId)); UserId = userId; - Cloud = cloud; } /// Initializes a new instance of . @@ -62,7 +60,7 @@ internal MicrosoftTeamsUserIdentifierModel(string userId, CommunicationCloudEnvi /// 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) + internal MicrosoftTeamsUserIdentifierModel(string userId, bool? isAnonymous, CommunicationCloudEnvironmentModel? cloud, IDictionary serializedAdditionalRawData) { UserId = userId; IsAnonymous = isAnonymous; @@ -80,6 +78,6 @@ internal MicrosoftTeamsUserIdentifierModel() /// 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; } + public CommunicationCloudEnvironmentModel? Cloud { get; } } } 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 d0a89e1b3172..cf09cd690d39 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 @@ -34,38 +34,23 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(PolicyInsightsPolicyStateChangedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); - if (Optional.IsDefined(PolicyAssignmentId)) + if (Optional.IsDefined(Timestamp)) { - writer.WritePropertyName("policyAssignmentId"u8); - writer.WriteStringValue(PolicyAssignmentId); - } - if (Optional.IsDefined(PolicyDefinitionId)) - { - writer.WritePropertyName("policyDefinitionId"u8); - writer.WriteStringValue(PolicyDefinitionId); - } - if (Optional.IsDefined(PolicyDefinitionReferenceId)) - { - writer.WritePropertyName("policyDefinitionReferenceId"u8); - writer.WriteStringValue(PolicyDefinitionReferenceId); - } - if (Optional.IsDefined(ComplianceState)) - { - writer.WritePropertyName("complianceState"u8); - writer.WriteStringValue(ComplianceState); - } - if (Optional.IsDefined(SubscriptionId)) - { - writer.WritePropertyName("subscriptionId"u8); - writer.WriteStringValue(SubscriptionId); - } - if (Optional.IsDefined(ComplianceReasonCode)) - { - writer.WritePropertyName("complianceReasonCode"u8); - writer.WriteStringValue(ComplianceReasonCode); + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); } + writer.WritePropertyName("policyAssignmentId"u8); + writer.WriteStringValue(PolicyAssignmentId); + writer.WritePropertyName("policyDefinitionId"u8); + writer.WriteStringValue(PolicyDefinitionId); + writer.WritePropertyName("policyDefinitionReferenceId"u8); + writer.WriteStringValue(PolicyDefinitionReferenceId); + writer.WritePropertyName("complianceState"u8); + writer.WriteStringValue(ComplianceState); + writer.WritePropertyName("subscriptionId"u8); + writer.WriteStringValue(SubscriptionId); + writer.WritePropertyName("complianceReasonCode"u8); + writer.WriteStringValue(ComplianceReasonCode); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -103,7 +88,7 @@ internal static PolicyInsightsPolicyStateChangedEventData DeserializePolicyInsig { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string policyAssignmentId = default; string policyDefinitionId = default; string policyDefinitionReferenceId = default; @@ -116,6 +101,10 @@ internal static PolicyInsightsPolicyStateChangedEventData DeserializePolicyInsig { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } 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 3c38df1b64d7..093ecda00eab 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateChangedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateChangedEventData.cs @@ -46,10 +46,28 @@ public partial class PolicyInsightsPolicyStateChangedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ. - internal PolicyInsightsPolicyStateChangedEventData(DateTimeOffset timestamp) + /// The resource ID of the policy assignment. + /// The resource ID of the policy definition. + /// The reference ID for the policy definition inside the initiative definition, if the policy assignment is for an initiative. May be empty. + /// 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) { - Timestamp = timestamp; + 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; + ComplianceState = complianceState; + SubscriptionId = subscriptionId; + ComplianceReasonCode = complianceReasonCode; } /// Initializes a new instance of . @@ -61,7 +79,7 @@ internal PolicyInsightsPolicyStateChangedEventData(DateTimeOffset timestamp) /// 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) + internal PolicyInsightsPolicyStateChangedEventData(DateTimeOffset? timestamp, string policyAssignmentId, string policyDefinitionId, string policyDefinitionReferenceId, string complianceState, string subscriptionId, string complianceReasonCode, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; PolicyAssignmentId = policyAssignmentId; @@ -79,7 +97,7 @@ internal PolicyInsightsPolicyStateChangedEventData() } /// 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; } + public DateTimeOffset? Timestamp { get; } /// The resource ID of the policy assignment. public string PolicyAssignmentId { get; } /// The resource ID of the policy definition. 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 7300f5a3a9cc..475357d26cb6 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 @@ -34,38 +34,23 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(PolicyInsightsPolicyStateCreatedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); - if (Optional.IsDefined(PolicyAssignmentId)) + if (Optional.IsDefined(Timestamp)) { - writer.WritePropertyName("policyAssignmentId"u8); - writer.WriteStringValue(PolicyAssignmentId); - } - if (Optional.IsDefined(PolicyDefinitionId)) - { - writer.WritePropertyName("policyDefinitionId"u8); - writer.WriteStringValue(PolicyDefinitionId); - } - if (Optional.IsDefined(PolicyDefinitionReferenceId)) - { - writer.WritePropertyName("policyDefinitionReferenceId"u8); - writer.WriteStringValue(PolicyDefinitionReferenceId); - } - if (Optional.IsDefined(ComplianceState)) - { - writer.WritePropertyName("complianceState"u8); - writer.WriteStringValue(ComplianceState); - } - if (Optional.IsDefined(SubscriptionId)) - { - writer.WritePropertyName("subscriptionId"u8); - writer.WriteStringValue(SubscriptionId); - } - if (Optional.IsDefined(ComplianceReasonCode)) - { - writer.WritePropertyName("complianceReasonCode"u8); - writer.WriteStringValue(ComplianceReasonCode); + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); } + writer.WritePropertyName("policyAssignmentId"u8); + writer.WriteStringValue(PolicyAssignmentId); + writer.WritePropertyName("policyDefinitionId"u8); + writer.WriteStringValue(PolicyDefinitionId); + writer.WritePropertyName("policyDefinitionReferenceId"u8); + writer.WriteStringValue(PolicyDefinitionReferenceId); + writer.WritePropertyName("complianceState"u8); + writer.WriteStringValue(ComplianceState); + writer.WritePropertyName("subscriptionId"u8); + writer.WriteStringValue(SubscriptionId); + writer.WritePropertyName("complianceReasonCode"u8); + writer.WriteStringValue(ComplianceReasonCode); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -103,7 +88,7 @@ internal static PolicyInsightsPolicyStateCreatedEventData DeserializePolicyInsig { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string policyAssignmentId = default; string policyDefinitionId = default; string policyDefinitionReferenceId = default; @@ -116,6 +101,10 @@ internal static PolicyInsightsPolicyStateCreatedEventData DeserializePolicyInsig { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } 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 deb18f455881..43813c104c61 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateCreatedEventData.cs @@ -46,10 +46,28 @@ public partial class PolicyInsightsPolicyStateCreatedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ. - internal PolicyInsightsPolicyStateCreatedEventData(DateTimeOffset timestamp) + /// The resource ID of the policy assignment. + /// The resource ID of the policy definition. + /// The reference ID for the policy definition inside the initiative definition, if the policy assignment is for an initiative. May be empty. + /// 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) { - Timestamp = timestamp; + 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; + ComplianceState = complianceState; + SubscriptionId = subscriptionId; + ComplianceReasonCode = complianceReasonCode; } /// Initializes a new instance of . @@ -61,7 +79,7 @@ internal PolicyInsightsPolicyStateCreatedEventData(DateTimeOffset timestamp) /// 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) + internal PolicyInsightsPolicyStateCreatedEventData(DateTimeOffset? timestamp, string policyAssignmentId, string policyDefinitionId, string policyDefinitionReferenceId, string complianceState, string subscriptionId, string complianceReasonCode, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; PolicyAssignmentId = policyAssignmentId; @@ -79,7 +97,7 @@ internal PolicyInsightsPolicyStateCreatedEventData() } /// 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; } + public DateTimeOffset? Timestamp { get; } /// The resource ID of the policy assignment. public string PolicyAssignmentId { get; } /// The resource ID of the policy definition. 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 f7b41e8af79d..8ec634c3c775 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 @@ -34,38 +34,23 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(PolicyInsightsPolicyStateDeletedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); - if (Optional.IsDefined(PolicyAssignmentId)) + if (Optional.IsDefined(Timestamp)) { - writer.WritePropertyName("policyAssignmentId"u8); - writer.WriteStringValue(PolicyAssignmentId); - } - if (Optional.IsDefined(PolicyDefinitionId)) - { - writer.WritePropertyName("policyDefinitionId"u8); - writer.WriteStringValue(PolicyDefinitionId); - } - if (Optional.IsDefined(PolicyDefinitionReferenceId)) - { - writer.WritePropertyName("policyDefinitionReferenceId"u8); - writer.WriteStringValue(PolicyDefinitionReferenceId); - } - if (Optional.IsDefined(ComplianceState)) - { - writer.WritePropertyName("complianceState"u8); - writer.WriteStringValue(ComplianceState); - } - if (Optional.IsDefined(SubscriptionId)) - { - writer.WritePropertyName("subscriptionId"u8); - writer.WriteStringValue(SubscriptionId); - } - if (Optional.IsDefined(ComplianceReasonCode)) - { - writer.WritePropertyName("complianceReasonCode"u8); - writer.WriteStringValue(ComplianceReasonCode); + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); } + writer.WritePropertyName("policyAssignmentId"u8); + writer.WriteStringValue(PolicyAssignmentId); + writer.WritePropertyName("policyDefinitionId"u8); + writer.WriteStringValue(PolicyDefinitionId); + writer.WritePropertyName("policyDefinitionReferenceId"u8); + writer.WriteStringValue(PolicyDefinitionReferenceId); + writer.WritePropertyName("complianceState"u8); + writer.WriteStringValue(ComplianceState); + writer.WritePropertyName("subscriptionId"u8); + writer.WriteStringValue(SubscriptionId); + writer.WritePropertyName("complianceReasonCode"u8); + writer.WriteStringValue(ComplianceReasonCode); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -103,7 +88,7 @@ internal static PolicyInsightsPolicyStateDeletedEventData DeserializePolicyInsig { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string policyAssignmentId = default; string policyDefinitionId = default; string policyDefinitionReferenceId = default; @@ -116,6 +101,10 @@ internal static PolicyInsightsPolicyStateDeletedEventData DeserializePolicyInsig { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } 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 412c1ba32b64..b26dfe458f22 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateDeletedEventData.cs @@ -46,10 +46,28 @@ public partial class PolicyInsightsPolicyStateDeletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ. - internal PolicyInsightsPolicyStateDeletedEventData(DateTimeOffset timestamp) + /// The resource ID of the policy assignment. + /// The resource ID of the policy definition. + /// The reference ID for the policy definition inside the initiative definition, if the policy assignment is for an initiative. May be empty. + /// 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) { - Timestamp = timestamp; + 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; + ComplianceState = complianceState; + SubscriptionId = subscriptionId; + ComplianceReasonCode = complianceReasonCode; } /// Initializes a new instance of . @@ -61,7 +79,7 @@ internal PolicyInsightsPolicyStateDeletedEventData(DateTimeOffset timestamp) /// 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) + internal PolicyInsightsPolicyStateDeletedEventData(DateTimeOffset? timestamp, string policyAssignmentId, string policyDefinitionId, string policyDefinitionReferenceId, string complianceState, string subscriptionId, string complianceReasonCode, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; PolicyAssignmentId = policyAssignmentId; @@ -79,7 +97,7 @@ internal PolicyInsightsPolicyStateDeletedEventData() } /// 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; } + public DateTimeOffset? Timestamp { get; } /// The resource ID of the policy assignment. public string PolicyAssignmentId { get; } /// The resource ID of the policy definition. 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 similarity index 73% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRDBCompletedEventData.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRdbCompletedEventData.Serialization.cs index 371ef947d88d..327a7513568e 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 @@ -13,11 +13,11 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class RedisExportRDBCompletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class RedisExportRdbCompletedEventData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,14 +28,17 @@ 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; + var 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."); + throw new FormatException($"The model {nameof(RedisExportRdbCompletedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -63,19 +66,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - RedisExportRDBCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + RedisExportRdbCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var 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."); + 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); + return DeserializeRedisExportRdbCompletedEventData(document.RootElement, options); } - internal static RedisExportRDBCompletedEventData DeserializeRedisExportRDBCompletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static RedisExportRdbCompletedEventData DeserializeRedisExportRdbCompletedEventData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -83,7 +86,7 @@ internal static RedisExportRDBCompletedEventData DeserializeRedisExportRDBComple { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string name = default; string status = default; IDictionary serializedAdditionalRawData = default; @@ -92,6 +95,10 @@ internal static RedisExportRDBCompletedEventData DeserializeRedisExportRDBComple { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } @@ -111,46 +118,46 @@ internal static RedisExportRDBCompletedEventData DeserializeRedisExportRDBComple } } serializedAdditionalRawData = rawDataDictionary; - return new RedisExportRDBCompletedEventData(timestamp, name, status, serializedAdditionalRawData); + return new RedisExportRdbCompletedEventData(timestamp, name, status, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(RedisExportRDBCompletedEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(RedisExportRdbCompletedEventData)} does not support writing '{options.Format}' format."); } } - RedisExportRDBCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + RedisExportRdbCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRedisExportRDBCompletedEventData(document.RootElement, options); + return DeserializeRedisExportRdbCompletedEventData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(RedisExportRDBCompletedEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(RedisExportRdbCompletedEventData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + 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) + internal static RedisExportRdbCompletedEventData FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeRedisExportRDBCompletedEventData(document.RootElement); + return DeserializeRedisExportRdbCompletedEventData(document.RootElement); } /// Convert into a . diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRDBCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRdbCompletedEventData.cs similarity index 78% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRDBCompletedEventData.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRdbCompletedEventData.cs index 4d02e07eeb4c..f689ff3f1242 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRDBCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRdbCompletedEventData.cs @@ -11,7 +11,7 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ExportRDBCompleted event. - public partial class RedisExportRDBCompletedEventData + public partial class RedisExportRdbCompletedEventData { /// /// Keeps track of any properties unknown to the library. @@ -45,19 +45,17 @@ public partial class RedisExportRDBCompletedEventData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The time at which the event occurred. - internal RedisExportRDBCompletedEventData(DateTimeOffset timestamp) + /// Initializes a new instance of . + internal RedisExportRdbCompletedEventData() { - Timestamp = timestamp; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// 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) + internal RedisExportRdbCompletedEventData(DateTimeOffset? timestamp, string name, string status, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; Name = name; @@ -65,13 +63,8 @@ internal RedisExportRDBCompletedEventData(DateTimeOffset timestamp, string name, _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal RedisExportRDBCompletedEventData() - { - } - /// The time at which the event occurred. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The name of this event. public string Name { get; } /// The status of this event. Failed or succeeded. 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 similarity index 73% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRDBCompletedEventData.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRdbCompletedEventData.Serialization.cs index 1e4a780d09d4..4b84a11d6d3b 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 @@ -13,11 +13,11 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class RedisImportRDBCompletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class RedisImportRdbCompletedEventData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,14 +28,17 @@ 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; + var 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."); + throw new FormatException($"The model {nameof(RedisImportRdbCompletedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -63,19 +66,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - RedisImportRDBCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + RedisImportRdbCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var 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."); + 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); + return DeserializeRedisImportRdbCompletedEventData(document.RootElement, options); } - internal static RedisImportRDBCompletedEventData DeserializeRedisImportRDBCompletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static RedisImportRdbCompletedEventData DeserializeRedisImportRdbCompletedEventData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -83,7 +86,7 @@ internal static RedisImportRDBCompletedEventData DeserializeRedisImportRDBComple { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string name = default; string status = default; IDictionary serializedAdditionalRawData = default; @@ -92,6 +95,10 @@ internal static RedisImportRDBCompletedEventData DeserializeRedisImportRDBComple { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } @@ -111,46 +118,46 @@ internal static RedisImportRDBCompletedEventData DeserializeRedisImportRDBComple } } serializedAdditionalRawData = rawDataDictionary; - return new RedisImportRDBCompletedEventData(timestamp, name, status, serializedAdditionalRawData); + return new RedisImportRdbCompletedEventData(timestamp, name, status, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(RedisImportRDBCompletedEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(RedisImportRdbCompletedEventData)} does not support writing '{options.Format}' format."); } } - RedisImportRDBCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + RedisImportRdbCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRedisImportRDBCompletedEventData(document.RootElement, options); + return DeserializeRedisImportRdbCompletedEventData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(RedisImportRDBCompletedEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(RedisImportRdbCompletedEventData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + 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) + internal static RedisImportRdbCompletedEventData FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeRedisImportRDBCompletedEventData(document.RootElement); + return DeserializeRedisImportRdbCompletedEventData(document.RootElement); } /// Convert into a . diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRDBCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRdbCompletedEventData.cs similarity index 78% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRDBCompletedEventData.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRdbCompletedEventData.cs index 58ca83a77ce3..7381f6f760ab 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRDBCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRdbCompletedEventData.cs @@ -11,7 +11,7 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ImportRDBCompleted event. - public partial class RedisImportRDBCompletedEventData + public partial class RedisImportRdbCompletedEventData { /// /// Keeps track of any properties unknown to the library. @@ -45,19 +45,17 @@ public partial class RedisImportRDBCompletedEventData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The time at which the event occurred. - internal RedisImportRDBCompletedEventData(DateTimeOffset timestamp) + /// Initializes a new instance of . + internal RedisImportRdbCompletedEventData() { - Timestamp = timestamp; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// 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) + internal RedisImportRdbCompletedEventData(DateTimeOffset? timestamp, string name, string status, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; Name = name; @@ -65,13 +63,8 @@ internal RedisImportRDBCompletedEventData(DateTimeOffset timestamp, string name, _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal RedisImportRDBCompletedEventData() - { - } - /// The time at which the event occurred. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The name of this event. public string Name { get; } /// The status of this event. Failed or succeeded. 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 345b18790fea..cd0e5ba95459 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 @@ -34,8 +34,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(RedisPatchingCompletedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -83,7 +86,7 @@ internal static RedisPatchingCompletedEventData DeserializeRedisPatchingComplete { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string name = default; string status = default; IDictionary serializedAdditionalRawData = default; @@ -92,6 +95,10 @@ internal static RedisPatchingCompletedEventData DeserializeRedisPatchingComplete { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } 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 0497287ee8e2..3cc0aee40d81 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisPatchingCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisPatchingCompletedEventData.cs @@ -46,10 +46,8 @@ public partial class RedisPatchingCompletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which the event occurred. - internal RedisPatchingCompletedEventData(DateTimeOffset timestamp) + internal RedisPatchingCompletedEventData() { - Timestamp = timestamp; } /// Initializes a new instance of . @@ -57,7 +55,7 @@ internal RedisPatchingCompletedEventData(DateTimeOffset timestamp) /// 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) + internal RedisPatchingCompletedEventData(DateTimeOffset? timestamp, string name, string status, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; Name = name; @@ -65,13 +63,8 @@ internal RedisPatchingCompletedEventData(DateTimeOffset timestamp, string name, _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal RedisPatchingCompletedEventData() - { - } - /// The time at which the event occurred. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The name of this event. public string Name { get; } /// The status of this event. Failed or succeeded. 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 9fd879604e0f..99dfee48a702 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 @@ -34,8 +34,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(RedisScalingCompletedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -83,7 +86,7 @@ internal static RedisScalingCompletedEventData DeserializeRedisScalingCompletedE { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string name = default; string status = default; IDictionary serializedAdditionalRawData = default; @@ -92,6 +95,10 @@ internal static RedisScalingCompletedEventData DeserializeRedisScalingCompletedE { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } 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 0d7b4896c816..ac341ec49072 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisScalingCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisScalingCompletedEventData.cs @@ -46,10 +46,8 @@ public partial class RedisScalingCompletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which the event occurred. - internal RedisScalingCompletedEventData(DateTimeOffset timestamp) + internal RedisScalingCompletedEventData() { - Timestamp = timestamp; } /// Initializes a new instance of . @@ -57,7 +55,7 @@ internal RedisScalingCompletedEventData(DateTimeOffset timestamp) /// 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) + internal RedisScalingCompletedEventData(DateTimeOffset? timestamp, string name, string status, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; Name = name; @@ -65,13 +63,8 @@ internal RedisScalingCompletedEventData(DateTimeOffset timestamp, string name, s _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal RedisScalingCompletedEventData() - { - } - /// The time at which the event occurred. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The name of this event. public string Name { get; } /// The status of this event. Failed or succeeded. 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 new file mode 100644 index 000000000000..310f71a39f5e --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsContainerServiceEventResourcesScheduledEventData.Serialization.cs @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + public partial class ResourceNotificationsContainerServiceEventResourcesScheduledEventData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + 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) + { + var 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) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceNotificationsResourceUpdatedDetails resourceInfo = default; + ResourceNotificationsOperationalDetails operationalInfo = default; + string apiVersion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceInfo"u8)) + { + resourceInfo = ResourceNotificationsResourceUpdatedDetails.DeserializeResourceNotificationsResourceUpdatedDetails(property.Value, options); + continue; + } + if (property.NameEquals("operationalInfo"u8)) + { + operationalInfo = ResourceNotificationsOperationalDetails.DeserializeResourceNotificationsOperationalDetails(property.Value, options); + continue; + } + if (property.NameEquals("apiVersion"u8)) + { + apiVersion = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ResourceNotificationsContainerServiceEventResourcesScheduledEventData(resourceInfo, operationalInfo, apiVersion, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ResourceNotificationsContainerServiceEventResourcesScheduledEventData)} does not support writing '{options.Format}' format."); + } + } + + ResourceNotificationsContainerServiceEventResourcesScheduledEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeResourceNotificationsContainerServiceEventResourcesScheduledEventData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ResourceNotificationsContainerServiceEventResourcesScheduledEventData)} does not support reading '{options.Format}' format."); + } + } + + 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); + return DeserializeResourceNotificationsContainerServiceEventResourcesScheduledEventData(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/ResourceNotificationsContainerServiceEventResourcesScheduledEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsContainerServiceEventResourcesScheduledEventData.cs new file mode 100644 index 000000000000..8425b15b75fa --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsContainerServiceEventResourcesScheduledEventData.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an event grid event for a Microsoft.ResourceNotifications.ContainerServiceEventResources.ScheduledEventEmitted preview event. + public partial class ResourceNotificationsContainerServiceEventResourcesScheduledEventData : ResourceNotificationsResourceUpdatedEventData + { + /// 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 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() + { + } + } +} 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 f4b757f2f691..514fa2729468 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsHealthResourcesAnnotatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsHealthResourcesAnnotatedEventData.cs @@ -19,11 +19,13 @@ public partial class ResourceNotificationsHealthResourcesAnnotatedEventData : Re /// Initializes a new instance of . /// resourceInfo details for update event. /// details about operational info. - /// or is null. - internal ResourceNotificationsHealthResourcesAnnotatedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails) : base(resourceDetails, operationalDetails) + /// 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 . 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 8bcffeb43c47..69c82e046f26 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData.cs @@ -20,11 +20,13 @@ public partial class ResourceNotificationsHealthResourcesAvailabilityStatusChang /// Initializes a new instance of . /// resourceInfo details for update event. /// details about operational info. - /// or is null. - internal ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails) : base(resourceDetails, operationalDetails) + /// 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 . 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 3c02399992e2..0d8898d3915a 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 @@ -34,8 +34,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ResourceNotificationsOperationalDetails)} does not support writing '{format}' format."); } - writer.WritePropertyName("resourceEventTime"u8); - writer.WriteStringValue(ResourceEventTime, "O"); + if (Optional.IsDefined(ResourceEventTime)) + { + writer.WritePropertyName("resourceEventTime"u8); + writer.WriteStringValue(ResourceEventTime.Value, "O"); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -73,13 +76,17 @@ internal static ResourceNotificationsOperationalDetails DeserializeResourceNotif { return null; } - DateTimeOffset resourceEventTime = default; + DateTimeOffset? resourceEventTime = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("resourceEventTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } resourceEventTime = property.Value.GetDateTimeOffset("O"); continue; } 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 a55f436fa035..d9354209fe26 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsOperationalDetails.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsOperationalDetails.cs @@ -46,27 +46,20 @@ public partial class ResourceNotificationsOperationalDetails private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Date and Time when resource was updated. - internal ResourceNotificationsOperationalDetails(DateTimeOffset resourceEventTime) + internal ResourceNotificationsOperationalDetails() { - ResourceEventTime = resourceEventTime; } /// 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) + internal ResourceNotificationsOperationalDetails(DateTimeOffset? resourceEventTime, IDictionary serializedAdditionalRawData) { ResourceEventTime = resourceEventTime; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ResourceNotificationsOperationalDetails() - { - } - /// Date and Time when resource was updated. - public DateTimeOffset ResourceEventTime { get; } + public DateTimeOffset? ResourceEventTime { get; } } } 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 f55a187c67ac..6c2baac7d820 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 @@ -34,21 +34,12 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ResourceNotificationsResourceDeletedDetails)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(Type)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - } + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) 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 cf7a4a0ccdf0..cb1dc20585ee 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceDeletedDetails.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceDeletedDetails.cs @@ -49,8 +49,19 @@ public partial class ResourceNotificationsResourceDeletedDetails private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal ResourceNotificationsResourceDeletedDetails() + /// 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(string id, string name, string type) { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(type, nameof(type)); + + Id = id; + Name = name; + Type = type; } /// Initializes a new instance of . @@ -66,6 +77,11 @@ internal ResourceNotificationsResourceDeletedDetails(string id, string name, str _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal ResourceNotificationsResourceDeletedDetails() + { + } + /// id of the resource for which the event is being emitted. public string Id { get; } /// name of the resource for which the event is being emitted. 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 6b62866b0201..d4621dbc6f13 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceManagementCreatedOrUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceManagementCreatedOrUpdatedEventData.cs @@ -19,11 +19,13 @@ public partial class ResourceNotificationsResourceManagementCreatedOrUpdatedEven /// Initializes a new instance of . /// resourceInfo details for update event. /// details about operational info. - /// or is null. - internal ResourceNotificationsResourceManagementCreatedOrUpdatedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails) : base(resourceDetails, operationalDetails) + /// 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 . 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 72e405e281d4..e837045be079 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 @@ -34,54 +34,51 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ResourceNotificationsResourceUpdatedDetails)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(Type)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - } + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); if (Optional.IsDefined(Location)) { writer.WritePropertyName("location"u8); writer.WriteStringValue(Location); } - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) + if (Optional.IsCollectionDefined(Tags)) { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); } - writer.WriteEndObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - foreach (var item in Properties) + if (Optional.IsCollectionDefined(Properties)) { - 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; + } #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } #endif + } + writer.WriteEndObject(); } - writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -151,6 +148,10 @@ internal static ResourceNotificationsResourceUpdatedDetails DeserializeResourceN } if (property.NameEquals("tags"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } Dictionary dictionary = new Dictionary(); foreach (var property0 in property.Value.EnumerateObject()) { @@ -161,6 +162,10 @@ internal static ResourceNotificationsResourceUpdatedDetails DeserializeResourceN } if (property.NameEquals("properties"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } Dictionary dictionary = new Dictionary(); foreach (var property0 in property.Value.EnumerateObject()) { @@ -187,8 +192,8 @@ internal static ResourceNotificationsResourceUpdatedDetails DeserializeResourceN name, type, location, - tags, - properties, + tags ?? new ChangeTrackingDictionary(), + properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); } 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 59b8832d8be3..837aa7700a76 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceUpdatedDetails.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceUpdatedDetails.cs @@ -49,16 +49,21 @@ public partial class ResourceNotificationsResourceUpdatedDetails private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// 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. - /// or is null. - internal ResourceNotificationsResourceUpdatedDetails(IReadOnlyDictionary tags, IReadOnlyDictionary properties) + /// 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 type) { - Argument.AssertNotNull(tags, nameof(tags)); - Argument.AssertNotNull(properties, nameof(properties)); + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(type, nameof(type)); - Tags = tags; - Properties = properties; + Id = id; + Name = name; + Type = type; + Tags = new ChangeTrackingDictionary(); + Properties = new ChangeTrackingDictionary(); } /// Initializes a new instance of . 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 bdbca4cbd7fe..dfb986b04630 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 @@ -38,11 +38,8 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteObjectValue(ResourceDetails, options); writer.WritePropertyName("operationalInfo"u8); writer.WriteObjectValue(OperationalDetails, options); - if (Optional.IsDefined(ApiVersion)) - { - writer.WritePropertyName("apiVersion"u8); - writer.WriteStringValue(ApiVersion); - } + writer.WritePropertyName("apiVersion"u8); + writer.WriteStringValue(ApiVersion); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) 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 3bb624a3b0b1..72653d401f46 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsResourceUpdatedEventData.cs @@ -48,14 +48,17 @@ public partial class ResourceNotificationsResourceUpdatedEventData /// Initializes a new instance of . /// resourceInfo details for update event. /// details about operational info. - /// or is null. - internal ResourceNotificationsResourceUpdatedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails) + /// 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; } /// Initializes a new instance of . 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 93f730db151a..2ef933e9f701 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 @@ -34,36 +34,39 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(NamespaceName)) - { - writer.WritePropertyName("namespaceName"u8); - writer.WriteStringValue(NamespaceName); - } - if (Optional.IsDefined(RequestUri)) - { - writer.WritePropertyName("requestUri"u8); - writer.WriteStringValue(RequestUri); - } - if (Optional.IsDefined(EntityType)) - { - writer.WritePropertyName("entityType"u8); - writer.WriteStringValue(EntityType); - } - if (Optional.IsDefined(QueueName)) + writer.WritePropertyName("namespaceName"u8); + writer.WriteStringValue(NamespaceName); + writer.WritePropertyName("requestUri"u8); + writer.WriteStringValue(RequestUri); + writer.WritePropertyName("entityType"u8); + writer.WriteStringValue(EntityType); + if (QueueName != null) { writer.WritePropertyName("queueName"u8); writer.WriteStringValue(QueueName); } - if (Optional.IsDefined(TopicName)) + else + { + writer.WriteNull("queueName"); + } + if (TopicName != null) { writer.WritePropertyName("topicName"u8); writer.WriteStringValue(TopicName); } - if (Optional.IsDefined(SubscriptionName)) + else + { + writer.WriteNull("topicName"); + } + if (SubscriptionName != null) { writer.WritePropertyName("subscriptionName"u8); writer.WriteStringValue(SubscriptionName); } + else + { + writer.WriteNull("subscriptionName"); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -128,16 +131,31 @@ internal static ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData } if (property.NameEquals("queueName"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + queueName = null; + continue; + } queueName = property.Value.GetString(); continue; } if (property.NameEquals("topicName"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + topicName = null; + continue; + } topicName = property.Value.GetString(); continue; } if (property.NameEquals("subscriptionName"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + subscriptionName = null; + continue; + } subscriptionName = property.Value.GetString(); continue; } 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 a5b443e63add..f22d23f2fda6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData.cs @@ -46,8 +46,25 @@ public partial class ServiceBusActiveMessagesAvailablePeriodicNotificationsEvent private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData() + /// 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'. + /// 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; + QueueName = queueName; + TopicName = topicName; + SubscriptionName = subscriptionName; } /// Initializes a new instance of . @@ -69,6 +86,11 @@ internal ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData(string _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData() + { + } + /// The namespace name of the Microsoft.ServiceBus resource. public string NamespaceName { get; } /// The endpoint of the Microsoft.ServiceBus resource. 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 10f23c8c7709..df9b26574131 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 @@ -34,36 +34,39 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ServiceBusActiveMessagesAvailableWithNoListenersEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(NamespaceName)) - { - writer.WritePropertyName("namespaceName"u8); - writer.WriteStringValue(NamespaceName); - } - if (Optional.IsDefined(RequestUri)) - { - writer.WritePropertyName("requestUri"u8); - writer.WriteStringValue(RequestUri); - } - if (Optional.IsDefined(EntityType)) - { - writer.WritePropertyName("entityType"u8); - writer.WriteStringValue(EntityType); - } - if (Optional.IsDefined(QueueName)) + writer.WritePropertyName("namespaceName"u8); + writer.WriteStringValue(NamespaceName); + writer.WritePropertyName("requestUri"u8); + writer.WriteStringValue(RequestUri); + writer.WritePropertyName("entityType"u8); + writer.WriteStringValue(EntityType); + if (QueueName != null) { writer.WritePropertyName("queueName"u8); writer.WriteStringValue(QueueName); } - if (Optional.IsDefined(TopicName)) + else + { + writer.WriteNull("queueName"); + } + if (TopicName != null) { writer.WritePropertyName("topicName"u8); writer.WriteStringValue(TopicName); } - if (Optional.IsDefined(SubscriptionName)) + else + { + writer.WriteNull("topicName"); + } + if (SubscriptionName != null) { writer.WritePropertyName("subscriptionName"u8); writer.WriteStringValue(SubscriptionName); } + else + { + writer.WriteNull("subscriptionName"); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -128,16 +131,31 @@ internal static ServiceBusActiveMessagesAvailableWithNoListenersEventData Deseri } if (property.NameEquals("queueName"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + queueName = null; + continue; + } queueName = property.Value.GetString(); continue; } if (property.NameEquals("topicName"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + topicName = null; + continue; + } topicName = property.Value.GetString(); continue; } if (property.NameEquals("subscriptionName"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + subscriptionName = null; + continue; + } subscriptionName = property.Value.GetString(); continue; } 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 5b06715deecb..a13c94aa72e8 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusActiveMessagesAvailableWithNoListenersEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusActiveMessagesAvailableWithNoListenersEventData.cs @@ -46,8 +46,25 @@ public partial class ServiceBusActiveMessagesAvailableWithNoListenersEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal ServiceBusActiveMessagesAvailableWithNoListenersEventData() + /// 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'. + /// 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; + QueueName = queueName; + TopicName = topicName; + SubscriptionName = subscriptionName; } /// Initializes a new instance of . @@ -69,6 +86,11 @@ internal ServiceBusActiveMessagesAvailableWithNoListenersEventData(string namesp _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal ServiceBusActiveMessagesAvailableWithNoListenersEventData() + { + } + /// The namespace name of the Microsoft.ServiceBus resource. public string NamespaceName { get; } /// The endpoint of the Microsoft.ServiceBus resource. 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 4db6bbbb3307..f9139111dab8 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 @@ -34,36 +34,39 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(NamespaceName)) - { - writer.WritePropertyName("namespaceName"u8); - writer.WriteStringValue(NamespaceName); - } - if (Optional.IsDefined(RequestUri)) - { - writer.WritePropertyName("requestUri"u8); - writer.WriteStringValue(RequestUri); - } - if (Optional.IsDefined(EntityType)) - { - writer.WritePropertyName("entityType"u8); - writer.WriteStringValue(EntityType); - } - if (Optional.IsDefined(QueueName)) + writer.WritePropertyName("namespaceName"u8); + writer.WriteStringValue(NamespaceName); + writer.WritePropertyName("requestUri"u8); + writer.WriteStringValue(RequestUri); + writer.WritePropertyName("entityType"u8); + writer.WriteStringValue(EntityType); + if (QueueName != null) { writer.WritePropertyName("queueName"u8); writer.WriteStringValue(QueueName); } - if (Optional.IsDefined(TopicName)) + else + { + writer.WriteNull("queueName"); + } + if (TopicName != null) { writer.WritePropertyName("topicName"u8); writer.WriteStringValue(TopicName); } - if (Optional.IsDefined(SubscriptionName)) + else + { + writer.WriteNull("topicName"); + } + if (SubscriptionName != null) { writer.WritePropertyName("subscriptionName"u8); writer.WriteStringValue(SubscriptionName); } + else + { + writer.WriteNull("subscriptionName"); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -128,16 +131,31 @@ internal static ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventD } if (property.NameEquals("queueName"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + queueName = null; + continue; + } queueName = property.Value.GetString(); continue; } if (property.NameEquals("topicName"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + topicName = null; + continue; + } topicName = property.Value.GetString(); continue; } if (property.NameEquals("subscriptionName"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + subscriptionName = null; + continue; + } subscriptionName = property.Value.GetString(); continue; } 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 dcbc6d7da593..85e82fe95556 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData.cs @@ -46,8 +46,25 @@ public partial class ServiceBusDeadletterMessagesAvailablePeriodicNotificationsE private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData() + /// 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'. + /// 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; + QueueName = queueName; + TopicName = topicName; + SubscriptionName = subscriptionName; } /// Initializes a new instance of . @@ -69,6 +86,11 @@ internal ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData(str _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData() + { + } + /// The namespace name of the Microsoft.ServiceBus resource. public string NamespaceName { get; } /// The endpoint of the Microsoft.ServiceBus resource. 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 53f8605d54c4..82de74cfc978 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 @@ -34,36 +34,39 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ServiceBusDeadletterMessagesAvailableWithNoListenersEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(NamespaceName)) - { - writer.WritePropertyName("namespaceName"u8); - writer.WriteStringValue(NamespaceName); - } - if (Optional.IsDefined(RequestUri)) - { - writer.WritePropertyName("requestUri"u8); - writer.WriteStringValue(RequestUri); - } - if (Optional.IsDefined(EntityType)) - { - writer.WritePropertyName("entityType"u8); - writer.WriteStringValue(EntityType); - } - if (Optional.IsDefined(QueueName)) + writer.WritePropertyName("namespaceName"u8); + writer.WriteStringValue(NamespaceName); + writer.WritePropertyName("requestUri"u8); + writer.WriteStringValue(RequestUri); + writer.WritePropertyName("entityType"u8); + writer.WriteStringValue(EntityType); + if (QueueName != null) { writer.WritePropertyName("queueName"u8); writer.WriteStringValue(QueueName); } - if (Optional.IsDefined(TopicName)) + else + { + writer.WriteNull("queueName"); + } + if (TopicName != null) { writer.WritePropertyName("topicName"u8); writer.WriteStringValue(TopicName); } - if (Optional.IsDefined(SubscriptionName)) + else + { + writer.WriteNull("topicName"); + } + if (SubscriptionName != null) { writer.WritePropertyName("subscriptionName"u8); writer.WriteStringValue(SubscriptionName); } + else + { + writer.WriteNull("subscriptionName"); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -128,16 +131,31 @@ internal static ServiceBusDeadletterMessagesAvailableWithNoListenersEventData De } if (property.NameEquals("queueName"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + queueName = null; + continue; + } queueName = property.Value.GetString(); continue; } if (property.NameEquals("topicName"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + topicName = null; + continue; + } topicName = property.Value.GetString(); continue; } if (property.NameEquals("subscriptionName"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + subscriptionName = null; + continue; + } subscriptionName = property.Value.GetString(); continue; } 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 ea92138d8a82..530fc9265aee 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusDeadletterMessagesAvailableWithNoListenersEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ServiceBusDeadletterMessagesAvailableWithNoListenersEventData.cs @@ -46,8 +46,25 @@ public partial class ServiceBusDeadletterMessagesAvailableWithNoListenersEventDa private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal ServiceBusDeadletterMessagesAvailableWithNoListenersEventData() + /// 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'. + /// 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; + QueueName = queueName; + TopicName = topicName; + SubscriptionName = subscriptionName; } /// Initializes a new instance of . @@ -69,6 +86,11 @@ internal ServiceBusDeadletterMessagesAvailableWithNoListenersEventData(string na _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal ServiceBusDeadletterMessagesAvailableWithNoListenersEventData() + { + } + /// The namespace name of the Microsoft.ServiceBus resource. public string NamespaceName { get; } /// The endpoint of the Microsoft.ServiceBus resource. 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 13dd8294ddcd..baeb51877242 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 @@ -34,18 +34,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(SignalRServiceClientConnectionConnectedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); - if (Optional.IsDefined(HubName)) + if (Optional.IsDefined(Timestamp)) { - writer.WritePropertyName("hubName"u8); - writer.WriteStringValue(HubName); - } - if (Optional.IsDefined(ConnectionId)) - { - writer.WritePropertyName("connectionId"u8); - writer.WriteStringValue(ConnectionId); + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); } + writer.WritePropertyName("hubName"u8); + writer.WriteStringValue(HubName); + writer.WritePropertyName("connectionId"u8); + writer.WriteStringValue(ConnectionId); if (Optional.IsDefined(UserId)) { writer.WritePropertyName("userId"u8); @@ -88,7 +85,7 @@ internal static SignalRServiceClientConnectionConnectedEventData DeserializeSign { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string hubName = default; string connectionId = default; string userId = default; @@ -98,6 +95,10 @@ internal static SignalRServiceClientConnectionConnectedEventData DeserializeSign { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } 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 dcb093dd889d..71d0f66cf94c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionConnectedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionConnectedEventData.cs @@ -46,10 +46,16 @@ public partial class SignalRServiceClientConnectionConnectedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which the event occurred. - internal SignalRServiceClientConnectionConnectedEventData(DateTimeOffset timestamp) + /// The hub of connected client connection. + /// The connection Id of connected client connection. + /// or is null. + internal SignalRServiceClientConnectionConnectedEventData(string hubName, string connectionId) { - Timestamp = timestamp; + Argument.AssertNotNull(hubName, nameof(hubName)); + Argument.AssertNotNull(connectionId, nameof(connectionId)); + + HubName = hubName; + ConnectionId = connectionId; } /// Initializes a new instance of . @@ -58,7 +64,7 @@ internal SignalRServiceClientConnectionConnectedEventData(DateTimeOffset timesta /// 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) + internal SignalRServiceClientConnectionConnectedEventData(DateTimeOffset? timestamp, string hubName, string connectionId, string userId, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; HubName = hubName; @@ -73,7 +79,7 @@ internal SignalRServiceClientConnectionConnectedEventData() } /// The time at which the event occurred. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The hub of connected client connection. public string HubName { get; } /// The connection Id of connected client connection. 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 33279e9b4fe6..6ad76cbcdf16 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 @@ -34,18 +34,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(SignalRServiceClientConnectionDisconnectedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); - if (Optional.IsDefined(HubName)) + if (Optional.IsDefined(Timestamp)) { - writer.WritePropertyName("hubName"u8); - writer.WriteStringValue(HubName); - } - if (Optional.IsDefined(ConnectionId)) - { - writer.WritePropertyName("connectionId"u8); - writer.WriteStringValue(ConnectionId); + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); } + writer.WritePropertyName("hubName"u8); + writer.WriteStringValue(HubName); + writer.WritePropertyName("connectionId"u8); + writer.WriteStringValue(ConnectionId); if (Optional.IsDefined(UserId)) { writer.WritePropertyName("userId"u8); @@ -93,7 +90,7 @@ internal static SignalRServiceClientConnectionDisconnectedEventData DeserializeS { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string hubName = default; string connectionId = default; string userId = default; @@ -104,6 +101,10 @@ internal static SignalRServiceClientConnectionDisconnectedEventData DeserializeS { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } 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 6a0f3883fc81..1542523c516c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionDisconnectedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionDisconnectedEventData.cs @@ -46,10 +46,16 @@ public partial class SignalRServiceClientConnectionDisconnectedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which the event occurred. - internal SignalRServiceClientConnectionDisconnectedEventData(DateTimeOffset timestamp) + /// The hub of connected client connection. + /// The connection Id of connected client connection. + /// or is null. + internal SignalRServiceClientConnectionDisconnectedEventData(string hubName, string connectionId) { - Timestamp = timestamp; + Argument.AssertNotNull(hubName, nameof(hubName)); + Argument.AssertNotNull(connectionId, nameof(connectionId)); + + HubName = hubName; + ConnectionId = connectionId; } /// Initializes a new instance of . @@ -59,7 +65,7 @@ internal SignalRServiceClientConnectionDisconnectedEventData(DateTimeOffset time /// 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) + internal SignalRServiceClientConnectionDisconnectedEventData(DateTimeOffset? timestamp, string hubName, string connectionId, string userId, string errorMessage, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; HubName = hubName; @@ -75,7 +81,7 @@ internal SignalRServiceClientConnectionDisconnectedEventData() } /// The time at which the event occurred. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The hub of connected client connection. public string HubName { get; } /// The connection Id of connected client connection. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobAccessTier.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobAccessTier.cs new file mode 100644 index 000000000000..60a044fd8b4f --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobAccessTier.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// The access tier of the blob. + public readonly partial struct StorageBlobAccessTier : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public StorageBlobAccessTier(string value) + { + _value = value ?? throw new ArgumentNullException(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"; + + /// 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. + public static bool operator ==(StorageBlobAccessTier left, StorageBlobAccessTier right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(StorageBlobAccessTier left, StorageBlobAccessTier right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator StorageBlobAccessTier(string value) => 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 2612495b4542..1bb9829c4a57 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 @@ -74,6 +74,8 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("blobType"u8); writer.WriteStringValue(BlobType); } + writer.WritePropertyName("accessTier"u8); + writer.WriteStringValue(AccessTier.ToString()); if (Optional.IsDefined(Url)) { writer.WritePropertyName("url"u8); @@ -154,6 +156,7 @@ internal static StorageBlobCreatedEventData DeserializeStorageBlobCreatedEventDa long? contentLength = default; long? contentOffset = default; string blobType = default; + StorageBlobAccessTier accessTier = default; string url = default; string sequencer = default; string identity = default; @@ -210,6 +213,11 @@ internal static StorageBlobCreatedEventData DeserializeStorageBlobCreatedEventDa blobType = property.Value.GetString(); continue; } + if (property.NameEquals("accessTier"u8)) + { + accessTier = new StorageBlobAccessTier(property.Value.GetString()); + continue; + } if (property.NameEquals("url"u8)) { url = property.Value.GetString(); @@ -257,6 +265,7 @@ internal static StorageBlobCreatedEventData DeserializeStorageBlobCreatedEventDa contentLength, contentOffset, blobType, + accessTier, url, sequencer, identity, 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 a1799eea345a..5b97c6b1bddc 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobCreatedEventData.cs @@ -46,12 +46,14 @@ public partial class StorageBlobCreatedEventData private IDictionary _serializedAdditionalRawData; /// 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(IReadOnlyDictionary storageDiagnostics) + internal StorageBlobCreatedEventData(StorageBlobAccessTier accessTier, IReadOnlyDictionary storageDiagnostics) { Argument.AssertNotNull(storageDiagnostics, nameof(storageDiagnostics)); + AccessTier = accessTier; StorageDiagnostics = storageDiagnostics; } @@ -64,12 +66,13 @@ internal StorageBlobCreatedEventData(IReadOnlyDictionary sto /// The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob. /// The offset of the blob in bytes. /// The type of blob. + /// The current tier of the blob. /// The path to the blob. /// 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, string url, string sequencer, string identity, IReadOnlyDictionary storageDiagnostics, IDictionary serializedAdditionalRawData) + 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, IReadOnlyDictionary storageDiagnostics, IDictionary serializedAdditionalRawData) { Api = api; ClientRequestId = clientRequestId; @@ -79,6 +82,7 @@ internal StorageBlobCreatedEventData(string api, string clientRequestId, string ContentLength = contentLength; ContentOffset = contentOffset; BlobType = blobType; + AccessTier = accessTier; Url = url; Sequencer = sequencer; Identity = identity; @@ -107,6 +111,8 @@ internal StorageBlobCreatedEventData() 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. 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 6471e17fc66b..0799095af560 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 @@ -34,8 +34,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(StorageBlobInventoryPolicyCompletedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("scheduleDateTime"u8); - writer.WriteStringValue(ScheduleDateTime, "O"); + if (Optional.IsDefined(ScheduleDateTime)) + { + writer.WritePropertyName("scheduleDateTime"u8); + writer.WriteStringValue(ScheduleDateTime.Value, "O"); + } if (Optional.IsDefined(AccountName)) { writer.WritePropertyName("accountName"u8); @@ -103,7 +106,7 @@ internal static StorageBlobInventoryPolicyCompletedEventData DeserializeStorageB { return null; } - DateTimeOffset scheduleDateTime = default; + DateTimeOffset? scheduleDateTime = default; string accountName = default; string ruleName = default; string policyRunStatus = default; @@ -116,6 +119,10 @@ internal static StorageBlobInventoryPolicyCompletedEventData DeserializeStorageB { if (property.NameEquals("scheduleDateTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } scheduleDateTime = property.Value.GetDateTimeOffset("O"); continue; } 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 97097e7a9b6f..a4eabe105daf 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobInventoryPolicyCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobInventoryPolicyCompletedEventData.cs @@ -46,10 +46,8 @@ public partial class StorageBlobInventoryPolicyCompletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which inventory policy was scheduled. - internal StorageBlobInventoryPolicyCompletedEventData(DateTimeOffset scheduleDateTime) + internal StorageBlobInventoryPolicyCompletedEventData() { - ScheduleDateTime = scheduleDateTime; } /// Initializes a new instance of . @@ -61,7 +59,7 @@ internal StorageBlobInventoryPolicyCompletedEventData(DateTimeOffset scheduleDat /// 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) + internal StorageBlobInventoryPolicyCompletedEventData(DateTimeOffset? scheduleDateTime, string accountName, string ruleName, string policyRunStatus, string policyRunStatusMessage, string policyRunId, string manifestBlobUrl, IDictionary serializedAdditionalRawData) { ScheduleDateTime = scheduleDateTime; AccountName = accountName; @@ -73,13 +71,8 @@ internal StorageBlobInventoryPolicyCompletedEventData(DateTimeOffset scheduleDat _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal StorageBlobInventoryPolicyCompletedEventData() - { - } - /// The time at which inventory policy was scheduled. - public DateTimeOffset ScheduleDateTime { get; } + public DateTimeOffset? ScheduleDateTime { get; } /// The account name for which inventory policy is registered. public string AccountName { get; } /// The rule name for inventory policy. 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 7ecdd6aae802..477263107825 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 @@ -64,6 +64,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("blobType"u8); writer.WriteStringValue(BlobType); } + writer.WritePropertyName("accessTier"u8); + writer.WriteStringValue(AccessTier.ToString()); + writer.WritePropertyName("previousTier"u8); + writer.WriteStringValue(PreviousTier.ToString()); if (Optional.IsDefined(Url)) { writer.WritePropertyName("url"u8); @@ -142,6 +146,8 @@ internal static StorageBlobTierChangedEventData DeserializeStorageBlobTierChange string contentType = default; long? contentLength = default; string blobType = default; + StorageBlobAccessTier accessTier = default; + StorageBlobAccessTier previousTier = default; string url = default; string sequencer = default; string identity = default; @@ -184,6 +190,16 @@ internal static StorageBlobTierChangedEventData DeserializeStorageBlobTierChange blobType = property.Value.GetString(); continue; } + if (property.NameEquals("accessTier"u8)) + { + accessTier = new StorageBlobAccessTier(property.Value.GetString()); + continue; + } + if (property.NameEquals("previousTier"u8)) + { + previousTier = new StorageBlobAccessTier(property.Value.GetString()); + continue; + } if (property.NameEquals("url"u8)) { url = property.Value.GetString(); @@ -229,6 +245,8 @@ internal static StorageBlobTierChangedEventData DeserializeStorageBlobTierChange contentType, contentLength, blobType, + accessTier, + previousTier, url, sequencer, identity, 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 e1f0f18db416..ae0660ee74c4 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobTierChangedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobTierChangedEventData.cs @@ -46,12 +46,16 @@ public partial class StorageBlobTierChangedEventData private IDictionary _serializedAdditionalRawData; /// 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(IReadOnlyDictionary storageDiagnostics) + internal StorageBlobTierChangedEventData(StorageBlobAccessTier accessTier, StorageBlobAccessTier previousTier, IReadOnlyDictionary storageDiagnostics) { Argument.AssertNotNull(storageDiagnostics, nameof(storageDiagnostics)); + AccessTier = accessTier; + PreviousTier = previousTier; StorageDiagnostics = storageDiagnostics; } @@ -62,12 +66,14 @@ internal StorageBlobTierChangedEventData(IReadOnlyDictionary /// The content type of the blob. This is the same as what would be returned in the Content-Type header from the blob. /// The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob. /// The type of blob. + /// The current tier of the blob. + /// The previous tier of the blob. /// The path to the blob. /// 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, string url, string sequencer, string identity, IReadOnlyDictionary storageDiagnostics, IDictionary serializedAdditionalRawData) + internal StorageBlobTierChangedEventData(string api, string clientRequestId, string requestId, string contentType, long? contentLength, string blobType, StorageBlobAccessTier accessTier, StorageBlobAccessTier previousTier, string url, string sequencer, string identity, IReadOnlyDictionary storageDiagnostics, IDictionary serializedAdditionalRawData) { Api = api; ClientRequestId = clientRequestId; @@ -75,6 +81,8 @@ internal StorageBlobTierChangedEventData(string api, string clientRequestId, str ContentType = contentType; ContentLength = contentLength; BlobType = blobType; + AccessTier = accessTier; + PreviousTier = previousTier; Url = url; Sequencer = sequencer; Identity = identity; @@ -99,6 +107,10 @@ internal StorageBlobTierChangedEventData() 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. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecycleCompletionStatus.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecycleCompletionStatus.cs new file mode 100644 index 000000000000..a52a3baab266 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecycleCompletionStatus.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// The status for a LCM policy. + public readonly partial struct StorageLifecycleCompletionStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public StorageLifecycleCompletionStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CompletedValue = "Completed"; + private const string CompletedWithErrorValue = "CompletedWithError"; + private const string IncompleteValue = "Incomplete"; + + /// 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. + public static bool operator ==(StorageLifecycleCompletionStatus left, StorageLifecycleCompletionStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(StorageLifecycleCompletionStatus left, StorageLifecycleCompletionStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator StorageLifecycleCompletionStatus(string value) => 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/StorageLifecyclePolicyCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyCompletedEventData.Serialization.cs index 7101b2b07c72..853459a93bb6 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 @@ -39,12 +39,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("scheduleTime"u8); writer.WriteStringValue(ScheduleTime); } + writer.WritePropertyName("policyRunSummary"u8); + writer.WriteObjectValue(PolicyRunSummary, options); writer.WritePropertyName("deleteSummary"u8); writer.WriteObjectValue(DeleteSummary, options); writer.WritePropertyName("tierToCoolSummary"u8); writer.WriteObjectValue(TierToCoolSummary, options); writer.WritePropertyName("tierToArchiveSummary"u8); writer.WriteObjectValue(TierToArchiveSummary, options); + writer.WritePropertyName("tierToColdSummary"u8); + writer.WriteObjectValue(TierToColdSummary, options); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -83,9 +87,11 @@ internal static StorageLifecyclePolicyCompletedEventData DeserializeStorageLifec return null; } string scheduleTime = default; + StorageLifecyclePolicyRunSummary policyRunSummary = default; StorageLifecyclePolicyActionSummaryDetail deleteSummary = default; StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary = default; StorageLifecyclePolicyActionSummaryDetail tierToArchiveSummary = default; + StorageLifecyclePolicyActionSummaryDetail tierToColdSummary = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -95,6 +101,11 @@ internal static StorageLifecyclePolicyCompletedEventData DeserializeStorageLifec scheduleTime = property.Value.GetString(); continue; } + if (property.NameEquals("policyRunSummary"u8)) + { + policyRunSummary = StorageLifecyclePolicyRunSummary.DeserializeStorageLifecyclePolicyRunSummary(property.Value, options); + continue; + } if (property.NameEquals("deleteSummary"u8)) { deleteSummary = StorageLifecyclePolicyActionSummaryDetail.DeserializeStorageLifecyclePolicyActionSummaryDetail(property.Value, options); @@ -110,13 +121,25 @@ internal static StorageLifecyclePolicyCompletedEventData DeserializeStorageLifec tierToArchiveSummary = StorageLifecyclePolicyActionSummaryDetail.DeserializeStorageLifecyclePolicyActionSummaryDetail(property.Value, options); continue; } + if (property.NameEquals("tierToColdSummary"u8)) + { + tierToColdSummary = StorageLifecyclePolicyActionSummaryDetail.DeserializeStorageLifecyclePolicyActionSummaryDetail(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new StorageLifecyclePolicyCompletedEventData(scheduleTime, deleteSummary, tierToCoolSummary, tierToArchiveSummary, serializedAdditionalRawData); + return new StorageLifecyclePolicyCompletedEventData( + scheduleTime, + policyRunSummary, + deleteSummary, + tierToCoolSummary, + tierToArchiveSummary, + tierToColdSummary, + serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) 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 392cff3c1e1e..9619c44a21f2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyCompletedEventData.cs @@ -46,33 +46,43 @@ public partial class StorageLifecyclePolicyCompletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . + /// Policy execution summary which shows the completion status of a LCM run". /// 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(StorageLifecyclePolicyActionSummaryDetail deleteSummary, StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary, StorageLifecyclePolicyActionSummaryDetail tierToArchiveSummary) + /// 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; TierToArchiveSummary = tierToArchiveSummary; + TierToColdSummary = tierToColdSummary; } /// Initializes a new instance of . /// 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. /// 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, StorageLifecyclePolicyActionSummaryDetail deleteSummary, StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary, StorageLifecyclePolicyActionSummaryDetail tierToArchiveSummary, IDictionary serializedAdditionalRawData) + internal StorageLifecyclePolicyCompletedEventData(string scheduleTime, StorageLifecyclePolicyRunSummary policyRunSummary, StorageLifecyclePolicyActionSummaryDetail deleteSummary, StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary, StorageLifecyclePolicyActionSummaryDetail tierToArchiveSummary, StorageLifecyclePolicyActionSummaryDetail tierToColdSummary, IDictionary serializedAdditionalRawData) { ScheduleTime = scheduleTime; + PolicyRunSummary = policyRunSummary; DeleteSummary = deleteSummary; TierToCoolSummary = tierToCoolSummary; TierToArchiveSummary = tierToArchiveSummary; + TierToColdSummary = tierToColdSummary; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -83,11 +93,15 @@ internal StorageLifecyclePolicyCompletedEventData() /// 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/MediaJobOutputScheduledEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyRunSummary.Serialization.cs similarity index 53% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputScheduledEventData.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyRunSummary.Serialization.cs index 46d2415e5d34..6ffc70a405b2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputScheduledEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyRunSummary.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class MediaJobOutputScheduledEventData : IUtf8JsonSerializable, IJsonModel + public partial class StorageLifecyclePolicyRunSummary : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -26,30 +26,46 @@ void IJsonModel.Write(Utf8JsonWriter writer, M /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobOutputScheduledEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(StorageLifecyclePolicyRunSummary)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("completionStatus"u8); + writer.WriteStringValue(CompletionStatus.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } - MediaJobOutputScheduledEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + StorageLifecyclePolicyRunSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobOutputScheduledEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(StorageLifecyclePolicyRunSummary)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaJobOutputScheduledEventData(document.RootElement, options); + return DeserializeStorageLifecyclePolicyRunSummary(document.RootElement, options); } - internal static MediaJobOutputScheduledEventData DeserializeMediaJobOutputScheduledEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static StorageLifecyclePolicyRunSummary DeserializeStorageLifecyclePolicyRunSummary(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -57,31 +73,14 @@ internal static MediaJobOutputScheduledEventData DeserializeMediaJobOutputSchedu { return null; } - MediaJobState previousState = default; - MediaJobOutput output = default; - IReadOnlyDictionary jobCorrelationData = default; + StorageLifecycleCompletionStatus completionStatus = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("previousState"u8)) - { - previousState = new MediaJobState(property.Value.GetString()); - continue; - } - if (property.NameEquals("output"u8)) + if (property.NameEquals("completionStatus"u8)) { - output = MediaJobOutput.DeserializeMediaJobOutput(property.Value, options); - continue; - } - if (property.NameEquals("jobCorrelationData"u8)) - { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - jobCorrelationData = dictionary; + completionStatus = new StorageLifecycleCompletionStatus(property.Value.GetString()); continue; } if (options.Format != "W") @@ -90,50 +89,50 @@ internal static MediaJobOutputScheduledEventData DeserializeMediaJobOutputSchedu } } serializedAdditionalRawData = rawDataDictionary; - return new MediaJobOutputScheduledEventData(previousState, output, jobCorrelationData, serializedAdditionalRawData); + return new StorageLifecyclePolicyRunSummary(completionStatus, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MediaJobOutputScheduledEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(StorageLifecyclePolicyRunSummary)} does not support writing '{options.Format}' format."); } } - MediaJobOutputScheduledEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + StorageLifecyclePolicyRunSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaJobOutputScheduledEventData(document.RootElement, options); + return DeserializeStorageLifecyclePolicyRunSummary(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MediaJobOutputScheduledEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(StorageLifecyclePolicyRunSummary)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new MediaJobOutputScheduledEventData FromResponse(Response response) + internal static StorageLifecyclePolicyRunSummary FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaJobOutputScheduledEventData(document.RootElement); + return DeserializeStorageLifecyclePolicyRunSummary(document.RootElement); } /// Convert into a . - internal override RequestContent ToRequestContent() + internal virtual RequestContent ToRequestContent() { var content = new Utf8JsonRequestContent(); content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyRunSummary.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyRunSummary.cs new file mode 100644 index 000000000000..11674a6b8cf6 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageLifecyclePolicyRunSummary.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +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; + + /// Initializes a new instance of . + /// Policy status can be Completed/CompletedWithError/Incomplete. + internal StorageLifecyclePolicyRunSummary(StorageLifecycleCompletionStatus completionStatus) + { + CompletionStatus = completionStatus; + } + + /// 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) + { + CompletionStatus = completionStatus; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal StorageLifecyclePolicyRunSummary() + { + } + + /// Policy status can be Completed/CompletedWithError/Incomplete. + public StorageLifecycleCompletionStatus CompletionStatus { get; } + } +} 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 2cea1ef346f1..dd3b1ae8c10f 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 @@ -34,10 +34,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(StorageTaskAssignmentCompletedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.ToString()); - writer.WritePropertyName("completedDateTime"u8); - writer.WriteStringValue(CompletedOn, "O"); + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(CompletedOn)) + { + writer.WritePropertyName("completedDateTime"u8); + writer.WriteStringValue(CompletedOn.Value, "O"); + } if (Optional.IsDefined(TaskExecutionId)) { writer.WritePropertyName("taskExecutionId"u8); @@ -87,8 +93,8 @@ internal static StorageTaskAssignmentCompletedEventData DeserializeStorageTaskAs { return null; } - StorageTaskAssignmentCompletedStatus status = default; - DateTimeOffset completedDateTime = default; + StorageTaskAssignmentCompletedStatus? status = default; + DateTimeOffset? completedDateTime = default; string taskExecutionId = default; string taskName = default; Uri summaryReportBlobUrl = default; @@ -98,11 +104,19 @@ internal static StorageTaskAssignmentCompletedEventData DeserializeStorageTaskAs { if (property.NameEquals("status"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } status = new StorageTaskAssignmentCompletedStatus(property.Value.GetString()); continue; } if (property.NameEquals("completedDateTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } completedDateTime = property.Value.GetDateTimeOffset("O"); continue; } 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 acf2da3e348f..91f49d744b3d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedEventData.cs @@ -46,16 +46,12 @@ public partial class StorageTaskAssignmentCompletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The status for a storage task. - /// The time at which a storage task was completed. /// The summary report blob url for a storage task. /// is null. - internal StorageTaskAssignmentCompletedEventData(StorageTaskAssignmentCompletedStatus status, DateTimeOffset completedOn, Uri summaryReportBlobUri) + internal StorageTaskAssignmentCompletedEventData(Uri summaryReportBlobUri) { Argument.AssertNotNull(summaryReportBlobUri, nameof(summaryReportBlobUri)); - Status = status; - CompletedOn = completedOn; SummaryReportBlobUri = summaryReportBlobUri; } @@ -66,7 +62,7 @@ internal StorageTaskAssignmentCompletedEventData(StorageTaskAssignmentCompletedS /// 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) + internal StorageTaskAssignmentCompletedEventData(StorageTaskAssignmentCompletedStatus? status, DateTimeOffset? completedOn, string taskExecutionId, string taskName, Uri summaryReportBlobUri, IDictionary serializedAdditionalRawData) { Status = status; CompletedOn = completedOn; @@ -82,9 +78,9 @@ internal StorageTaskAssignmentCompletedEventData() } /// The status for a storage task. - public StorageTaskAssignmentCompletedStatus Status { get; } + public StorageTaskAssignmentCompletedStatus? Status { get; } /// The time at which a storage task was completed. - public DateTimeOffset CompletedOn { get; } + public DateTimeOffset? CompletedOn { get; } /// The execution id for a storage task. public string TaskExecutionId { get; } /// The task name for a storage task. 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 bb9d126de7c0..c806023140d7 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 @@ -34,8 +34,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(StorageTaskAssignmentQueuedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("queuedDateTime"u8); - writer.WriteStringValue(QueuedOn, "O"); + if (Optional.IsDefined(QueuedOn)) + { + writer.WritePropertyName("queuedDateTime"u8); + writer.WriteStringValue(QueuedOn.Value, "O"); + } if (Optional.IsDefined(TaskExecutionId)) { writer.WritePropertyName("taskExecutionId"u8); @@ -78,7 +81,7 @@ internal static StorageTaskAssignmentQueuedEventData DeserializeStorageTaskAssig { return null; } - DateTimeOffset queuedDateTime = default; + DateTimeOffset? queuedDateTime = default; string taskExecutionId = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -86,6 +89,10 @@ internal static StorageTaskAssignmentQueuedEventData DeserializeStorageTaskAssig { if (property.NameEquals("queuedDateTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } queuedDateTime = property.Value.GetDateTimeOffset("O"); continue; } 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 629cae0b0418..c03472230485 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentQueuedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentQueuedEventData.cs @@ -46,30 +46,23 @@ public partial class StorageTaskAssignmentQueuedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which a storage task was queued. - internal StorageTaskAssignmentQueuedEventData(DateTimeOffset queuedOn) + internal StorageTaskAssignmentQueuedEventData() { - QueuedOn = queuedOn; } /// 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) + internal StorageTaskAssignmentQueuedEventData(DateTimeOffset? queuedOn, string taskExecutionId, IDictionary serializedAdditionalRawData) { QueuedOn = queuedOn; TaskExecutionId = taskExecutionId; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal StorageTaskAssignmentQueuedEventData() - { - } - /// The time at which a storage task was queued. - public DateTimeOffset QueuedOn { get; } + 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 1e4db6040fab..6cdb0449105f 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 @@ -34,10 +34,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(StorageTaskCompletedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.ToString()); - writer.WritePropertyName("completedDateTime"u8); - writer.WriteStringValue(CompletedDateTime, "O"); + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(CompletedDateTime)) + { + writer.WritePropertyName("completedDateTime"u8); + writer.WriteStringValue(CompletedDateTime.Value, "O"); + } if (Optional.IsDefined(TaskExecutionId)) { writer.WritePropertyName("taskExecutionId"u8); @@ -87,8 +93,8 @@ internal static StorageTaskCompletedEventData DeserializeStorageTaskCompletedEve { return null; } - StorageTaskCompletedStatus status = default; - DateTimeOffset completedDateTime = default; + StorageTaskCompletedStatus? status = default; + DateTimeOffset? completedDateTime = default; string taskExecutionId = default; string taskName = default; Uri summaryReportBlobUrl = default; @@ -98,11 +104,19 @@ internal static StorageTaskCompletedEventData DeserializeStorageTaskCompletedEve { if (property.NameEquals("status"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } status = new StorageTaskCompletedStatus(property.Value.GetString()); continue; } if (property.NameEquals("completedDateTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } completedDateTime = property.Value.GetDateTimeOffset("O"); continue; } 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 a7e3b6af287d..068d575deae8 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedEventData.cs @@ -46,16 +46,12 @@ public partial class StorageTaskCompletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The status for a storage task. - /// The time at which a storage task was completed. /// The summary report blob url for a storage task. /// is null. - internal StorageTaskCompletedEventData(StorageTaskCompletedStatus status, DateTimeOffset completedDateTime, Uri summaryReportBlobUrl) + internal StorageTaskCompletedEventData(Uri summaryReportBlobUrl) { Argument.AssertNotNull(summaryReportBlobUrl, nameof(summaryReportBlobUrl)); - Status = status; - CompletedDateTime = completedDateTime; SummaryReportBlobUrl = summaryReportBlobUrl; } @@ -66,7 +62,7 @@ internal StorageTaskCompletedEventData(StorageTaskCompletedStatus status, DateTi /// 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 summaryReportBlobUrl, IDictionary serializedAdditionalRawData) + internal StorageTaskCompletedEventData(StorageTaskCompletedStatus? status, DateTimeOffset? completedDateTime, string taskExecutionId, string taskName, Uri summaryReportBlobUrl, IDictionary serializedAdditionalRawData) { Status = status; CompletedDateTime = completedDateTime; @@ -82,9 +78,9 @@ internal StorageTaskCompletedEventData() } /// The status for a storage task. - public StorageTaskCompletedStatus Status { get; } + public StorageTaskCompletedStatus? Status { get; } /// The time at which a storage task was completed. - public DateTimeOffset CompletedDateTime { get; } + public DateTimeOffset? CompletedDateTime { get; } /// The execution id for a storage task. public string TaskExecutionId { get; } /// The task name for a storage task. 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 2b6547d43360..607a7d491694 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 @@ -34,8 +34,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(StorageTaskQueuedEventData)} does not support writing '{format}' format."); } - writer.WritePropertyName("queuedDateTime"u8); - writer.WriteStringValue(QueuedDateTime, "O"); + if (Optional.IsDefined(QueuedDateTime)) + { + writer.WritePropertyName("queuedDateTime"u8); + writer.WriteStringValue(QueuedDateTime.Value, "O"); + } if (Optional.IsDefined(TaskExecutionId)) { writer.WritePropertyName("taskExecutionId"u8); @@ -78,7 +81,7 @@ internal static StorageTaskQueuedEventData DeserializeStorageTaskQueuedEventData { return null; } - DateTimeOffset queuedDateTime = default; + DateTimeOffset? queuedDateTime = default; string taskExecutionId = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -86,6 +89,10 @@ internal static StorageTaskQueuedEventData DeserializeStorageTaskQueuedEventData { if (property.NameEquals("queuedDateTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } queuedDateTime = property.Value.GetDateTimeOffset("O"); continue; } 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 0ad77410c7c3..79169b81a03e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskQueuedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskQueuedEventData.cs @@ -46,30 +46,23 @@ public partial class StorageTaskQueuedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which a storage task was queued. - internal StorageTaskQueuedEventData(DateTimeOffset queuedDateTime) + internal StorageTaskQueuedEventData() { - QueuedDateTime = queuedDateTime; } /// 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) + internal StorageTaskQueuedEventData(DateTimeOffset? queuedDateTime, string taskExecutionId, IDictionary serializedAdditionalRawData) { QueuedDateTime = queuedDateTime; TaskExecutionId = taskExecutionId; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal StorageTaskQueuedEventData() - { - } - /// The time at which a storage task was queued. - public DateTimeOffset QueuedDateTime { get; } + 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 118af3e2917b..e91610458fd8 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 @@ -34,11 +34,8 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(SubscriptionDeletedEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(EventSubscriptionId)) - { - writer.WritePropertyName("eventSubscriptionId"u8); - writer.WriteStringValue(EventSubscriptionId); - } + writer.WritePropertyName("eventSubscriptionId"u8); + writer.WriteStringValue(EventSubscriptionId); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) 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 323175400bcf..6056e51310b1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionDeletedEventData.cs @@ -49,8 +49,13 @@ public partial class SubscriptionDeletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal SubscriptionDeletedEventData() + /// 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 . @@ -62,6 +67,11 @@ internal SubscriptionDeletedEventData(string eventSubscriptionId, IDictionary Initializes a new instance of for deserialization. + internal SubscriptionDeletedEventData() + { + } + /// The Azure resource ID of the deleted event subscription. public string EventSubscriptionId { get; } } 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 73797c8a2b8b..f822716e6f12 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 @@ -34,16 +34,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(SubscriptionValidationEventData)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ValidationCode)) - { - writer.WritePropertyName("validationCode"u8); - writer.WriteStringValue(ValidationCode); - } - if (Optional.IsDefined(ValidationUrl)) - { - writer.WritePropertyName("validationUrl"u8); - writer.WriteStringValue(ValidationUrl); - } + writer.WritePropertyName("validationCode"u8); + writer.WriteStringValue(ValidationCode); + writer.WritePropertyName("validationUrl"u8); + writer.WriteStringValue(ValidationUrl); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) 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 78d90aa69318..a9db22f6fe88 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionValidationEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionValidationEventData.cs @@ -46,8 +46,24 @@ public partial class SubscriptionValidationEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal SubscriptionValidationEventData() + /// + /// 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, + /// or perform a GET request on the validationUrl (available starting version 2018-05-01-preview). + /// + /// + /// 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, + /// 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; } /// Initializes a new instance of . @@ -69,6 +85,11 @@ internal SubscriptionValidationEventData(string validationCode, string validatio _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal SubscriptionValidationEventData() + { + } + /// /// 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, 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 5b5ffbe5c353..6312e1f1c734 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 @@ -34,11 +34,8 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(SubscriptionValidationResponse)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ValidationResponse)) - { - writer.WritePropertyName("validationResponse"u8); - writer.WriteStringValue(ValidationResponse); - } + writer.WritePropertyName("validationResponse"u8); + writer.WriteStringValue(ValidationResponse); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) 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 7343bc21df38..af53c93e7db9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionValidationResponse.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SubscriptionValidationResponse.cs @@ -51,8 +51,13 @@ public partial class SubscriptionValidationResponse private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal SubscriptionValidationResponse() + /// 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 . @@ -64,6 +69,11 @@ internal SubscriptionValidationResponse(string validationResponse, IDictionary Initializes a new instance of for deserialization. + internal SubscriptionValidationResponse() + { + } + /// The validation response sent by the subscriber to Azure Event Grid to complete the validation of an event subscription. public string ValidationResponse { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SystemEventsClientOptions.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SystemEventsClientOptions.cs index 0d99553ffa77..17e37e2f9d4b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SystemEventsClientOptions.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SystemEventsClientOptions.cs @@ -13,13 +13,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Client options for SystemEventsClient. internal partial class SystemEventsClientOptions : ClientOptions { - private const ServiceVersion LatestVersion = ServiceVersion.V2024_01_01; + private const ServiceVersion LatestVersion = ServiceVersion.V2018_01_01; /// The version of the service to use. internal enum ServiceVersion { - /// Service version "2024-01-01". - V2024_01_01 = 1, + /// Service version "2018-01-01". + V2018_01_01 = 1, } internal string Version { get; } @@ -29,7 +29,7 @@ public SystemEventsClientOptions(ServiceVersion version = LatestVersion) { Version = version switch { - ServiceVersion.V2024_01_01 => "2024-01-01", + ServiceVersion.V2018_01_01 => "2018-01-01", _ => throw new NotSupportedException() }; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/UnknownMediaJobOutput.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/UnknownMediaJobOutput.Serialization.cs deleted file mode 100644 index 237a41a34578..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/UnknownMediaJobOutput.Serialization.cs +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - internal partial class UnknownMediaJobOutput : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(MediaJobOutput)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - } - - MediaJobOutput IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MediaJobOutput)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaJobOutput(document.RootElement, options); - } - - internal static UnknownMediaJobOutput DeserializeUnknownMediaJobOutput(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string odataType = "Unknown"; - MediaJobError error = default; - string label = default; - long progress = default; - MediaJobState state = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("@odata.type"u8)) - { - odataType = property.Value.GetString(); - continue; - } - if (property.NameEquals("error"u8)) - { - error = MediaJobError.DeserializeMediaJobError(property.Value, options); - continue; - } - if (property.NameEquals("label"u8)) - { - label = property.Value.GetString(); - continue; - } - if (property.NameEquals("progress"u8)) - { - progress = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("state"u8)) - { - state = new MediaJobState(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new UnknownMediaJobOutput( - odataType, - error, - label, - progress, - state, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MediaJobOutput)} does not support writing '{options.Format}' format."); - } - } - - MediaJobOutput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaJobOutput(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MediaJobOutput)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new UnknownMediaJobOutput FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeUnknownMediaJobOutput(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/UnknownMediaJobOutput.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/UnknownMediaJobOutput.cs deleted file mode 100644 index 0bfb2f76e943..000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/UnknownMediaJobOutput.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// Unknown version of MediaJobOutput. - internal partial class UnknownMediaJobOutput : MediaJobOutput - { - /// Initializes a new instance of . - /// The discriminator for derived types. - /// Gets the Job output error. - /// Gets the Job output label. - /// Gets the Job output progress. - /// Gets the Job output state. - /// Keeps track of any properties unknown to the library. - internal UnknownMediaJobOutput(string odataType, MediaJobError error, string label, long progress, MediaJobState state, IDictionary serializedAdditionalRawData) : base(odataType, error, label, progress, state, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal UnknownMediaJobOutput() - { - } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/tsp-location.yaml b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/tsp-location.yaml index e59d0681c201..f4063e14a08d 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 @@ +directory: specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents +commit: 7c52cf4d9a41dd06846b099946e8b85a9504cf1e repo: Azure/azure-rest-api-specs -directory: "specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents" -commit: 9f024124361561030653abd1e8ec6d5ad1080c1a +additionalDirectories: diff --git a/sdk/eventgrid/ci.mgmt.yml b/sdk/eventgrid/ci.mgmt.yml index cb02a1b84e8b..cb08037cedfc 100644 --- a/sdk/eventgrid/ci.mgmt.yml +++ b/sdk/eventgrid/ci.mgmt.yml @@ -2,6 +2,7 @@ # This is for Track 2 managment plane SDK trigger: none + pr: branches: include: @@ -14,6 +15,114 @@ pr: - sdk/eventgrid/ci.mgmt.yml - sdk/eventgrid/Azure.ResourceManager.EventGrid/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/eventgrid/ci.mgmt.yml + - sdk/eventgrid/Azure.ResourceManager.EventGrid/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/eventgrid/ci.mgmt.yml + - sdk/eventgrid/Azure.ResourceManager.EventGrid/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/eventgrid/ci.mgmt.yml + - sdk/eventgrid/Azure.ResourceManager.EventGrid/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/eventgrid/ci.mgmt.yml + - sdk/eventgrid/Azure.ResourceManager.EventGrid/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/eventgrid/ci.mgmt.yml + - sdk/eventgrid/Azure.ResourceManager.EventGrid/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/eventgrid/ci.mgmt.yml + - sdk/eventgrid/Azure.ResourceManager.EventGrid/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/eventgrid/ci.mgmt.yml + - sdk/eventgrid/Azure.ResourceManager.EventGrid/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/eventgrid/ci.mgmt.yml + - sdk/eventgrid/Azure.ResourceManager.EventGrid/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/eventgrid/ci.mgmt.yml + - sdk/eventgrid/Azure.ResourceManager.EventGrid/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/eventhub/ci.mgmt.yml b/sdk/eventhub/ci.mgmt.yml index b7c0045fffb3..58a5cd409b26 100644 --- a/sdk/eventhub/ci.mgmt.yml +++ b/sdk/eventhub/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/eventhub/ci.mgmt.yml - sdk/eventhub/Azure.ResourceManager.EventHubs/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/eventhub/ci.mgmt.yml + - sdk/eventhub/Azure.ResourceManager.EventHubs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/eventhub/ci.mgmt.yml + - sdk/eventhub/Azure.ResourceManager.EventHubs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/eventhub/ci.mgmt.yml + - sdk/eventhub/Azure.ResourceManager.EventHubs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/eventhub/ci.mgmt.yml + - sdk/eventhub/Azure.ResourceManager.EventHubs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/eventhub/ci.mgmt.yml + - sdk/eventhub/Azure.ResourceManager.EventHubs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/eventhub/ci.mgmt.yml + - sdk/eventhub/Azure.ResourceManager.EventHubs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/eventhub/ci.mgmt.yml + - sdk/eventhub/Azure.ResourceManager.EventHubs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/eventhub/ci.mgmt.yml + - sdk/eventhub/Azure.ResourceManager.EventHubs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/eventhub/ci.mgmt.yml + - sdk/eventhub/Azure.ResourceManager.EventHubs/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/extendedlocation/ci.mgmt.yml b/sdk/extendedlocation/ci.mgmt.yml index 4fb53374be74..233090a9825d 100644 --- a/sdk/extendedlocation/ci.mgmt.yml +++ b/sdk/extendedlocation/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/extendedlocation/ci.mgmt.yml - sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/extendedlocation/ci.mgmt.yml + - sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/extendedlocation/ci.mgmt.yml + - sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/extendedlocation/ci.mgmt.yml + - sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/extendedlocation/ci.mgmt.yml + - sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/extendedlocation/ci.mgmt.yml + - sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/extendedlocation/ci.mgmt.yml + - sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/extendedlocation/ci.mgmt.yml + - sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/extendedlocation/ci.mgmt.yml + - sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/extendedlocation/ci.mgmt.yml + - sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/fabric/ci.mgmt.yml b/sdk/fabric/ci.mgmt.yml index d0bc6cea6eb9..77e90671a861 100644 --- a/sdk/fabric/ci.mgmt.yml +++ b/sdk/fabric/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/fabric/ci.mgmt.yml - sdk/fabric/Azure.ResourceManager.Fabric/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fabric/ci.mgmt.yml + - sdk/fabric/Azure.ResourceManager.Fabric/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fabric/ci.mgmt.yml + - sdk/fabric/Azure.ResourceManager.Fabric/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fabric/ci.mgmt.yml + - sdk/fabric/Azure.ResourceManager.Fabric/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fabric/ci.mgmt.yml + - sdk/fabric/Azure.ResourceManager.Fabric/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fabric/ci.mgmt.yml + - sdk/fabric/Azure.ResourceManager.Fabric/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fabric/ci.mgmt.yml + - sdk/fabric/Azure.ResourceManager.Fabric/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fabric/ci.mgmt.yml + - sdk/fabric/Azure.ResourceManager.Fabric/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fabric/ci.mgmt.yml + - sdk/fabric/Azure.ResourceManager.Fabric/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fabric/ci.mgmt.yml + - sdk/fabric/Azure.ResourceManager.Fabric/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/fleet/ci.mgmt.yml b/sdk/fleet/ci.mgmt.yml index 09a225882401..c850304c07f6 100644 --- a/sdk/fleet/ci.mgmt.yml +++ b/sdk/fleet/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/fleet/ci.mgmt.yml - sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fleet/ci.mgmt.yml + - sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fleet/ci.mgmt.yml + - sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fleet/ci.mgmt.yml + - sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fleet/ci.mgmt.yml + - sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fleet/ci.mgmt.yml + - sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fleet/ci.mgmt.yml + - sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fleet/ci.mgmt.yml + - sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fleet/ci.mgmt.yml + - sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fleet/ci.mgmt.yml + - sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/fluidrelay/ci.mgmt.yml b/sdk/fluidrelay/ci.mgmt.yml index d43dfe94d729..01789fa5c009 100644 --- a/sdk/fluidrelay/ci.mgmt.yml +++ b/sdk/fluidrelay/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/fluidrelay/ci.mgmt.yml - sdk/fluidrelay/Azure.ResourceManager.FluidRelay/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fluidrelay/ci.mgmt.yml + - sdk/fluidrelay/Azure.ResourceManager.FluidRelay/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fluidrelay/ci.mgmt.yml + - sdk/fluidrelay/Azure.ResourceManager.FluidRelay/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fluidrelay/ci.mgmt.yml + - sdk/fluidrelay/Azure.ResourceManager.FluidRelay/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fluidrelay/ci.mgmt.yml + - sdk/fluidrelay/Azure.ResourceManager.FluidRelay/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fluidrelay/ci.mgmt.yml + - sdk/fluidrelay/Azure.ResourceManager.FluidRelay/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fluidrelay/ci.mgmt.yml + - sdk/fluidrelay/Azure.ResourceManager.FluidRelay/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fluidrelay/ci.mgmt.yml + - sdk/fluidrelay/Azure.ResourceManager.FluidRelay/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fluidrelay/ci.mgmt.yml + - sdk/fluidrelay/Azure.ResourceManager.FluidRelay/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fluidrelay/ci.mgmt.yml + - sdk/fluidrelay/Azure.ResourceManager.FluidRelay/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/frontdoor/ci.mgmt.yml b/sdk/frontdoor/ci.mgmt.yml index bff9dbcae78c..245036466ee6 100644 --- a/sdk/frontdoor/ci.mgmt.yml +++ b/sdk/frontdoor/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/frontdoor/ci.mgmt.yml - sdk/frontdoor/Azure.ResourceManager.FrontDoor/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/frontdoor/ci.mgmt.yml + - sdk/frontdoor/Azure.ResourceManager.FrontDoor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/frontdoor/ci.mgmt.yml + - sdk/frontdoor/Azure.ResourceManager.FrontDoor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/frontdoor/ci.mgmt.yml + - sdk/frontdoor/Azure.ResourceManager.FrontDoor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/frontdoor/ci.mgmt.yml + - sdk/frontdoor/Azure.ResourceManager.FrontDoor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/frontdoor/ci.mgmt.yml + - sdk/frontdoor/Azure.ResourceManager.FrontDoor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/frontdoor/ci.mgmt.yml + - sdk/frontdoor/Azure.ResourceManager.FrontDoor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/frontdoor/ci.mgmt.yml + - sdk/frontdoor/Azure.ResourceManager.FrontDoor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/frontdoor/ci.mgmt.yml + - sdk/frontdoor/Azure.ResourceManager.FrontDoor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/frontdoor/ci.mgmt.yml + - sdk/frontdoor/Azure.ResourceManager.FrontDoor/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/grafana/ci.mgmt.yml b/sdk/grafana/ci.mgmt.yml index a2f22e6ee33b..fc0abf70b940 100644 --- a/sdk/grafana/ci.mgmt.yml +++ b/sdk/grafana/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/grafana/ci.mgmt.yml - sdk/grafana/Azure.ResourceManager.Grafana/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/grafana/ci.mgmt.yml + - sdk/grafana/Azure.ResourceManager.Grafana/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/grafana/ci.mgmt.yml + - sdk/grafana/Azure.ResourceManager.Grafana/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/grafana/ci.mgmt.yml + - sdk/grafana/Azure.ResourceManager.Grafana/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/grafana/ci.mgmt.yml + - sdk/grafana/Azure.ResourceManager.Grafana/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/grafana/ci.mgmt.yml + - sdk/grafana/Azure.ResourceManager.Grafana/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/grafana/ci.mgmt.yml + - sdk/grafana/Azure.ResourceManager.Grafana/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/grafana/ci.mgmt.yml + - sdk/grafana/Azure.ResourceManager.Grafana/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/grafana/ci.mgmt.yml + - sdk/grafana/Azure.ResourceManager.Grafana/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/grafana/ci.mgmt.yml + - sdk/grafana/Azure.ResourceManager.Grafana/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/graphservices/ci.mgmt.yml b/sdk/graphservices/ci.mgmt.yml index 717a9a4a1963..ae252fd54f7e 100644 --- a/sdk/graphservices/ci.mgmt.yml +++ b/sdk/graphservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/graphservices/ci.mgmt.yml - sdk/graphservices/Azure.ResourceManager.GraphServices/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/graphservices/ci.mgmt.yml + - sdk/graphservices/Azure.ResourceManager.GraphServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/graphservices/ci.mgmt.yml + - sdk/graphservices/Azure.ResourceManager.GraphServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/graphservices/ci.mgmt.yml + - sdk/graphservices/Azure.ResourceManager.GraphServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/graphservices/ci.mgmt.yml + - sdk/graphservices/Azure.ResourceManager.GraphServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/graphservices/ci.mgmt.yml + - sdk/graphservices/Azure.ResourceManager.GraphServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/graphservices/ci.mgmt.yml + - sdk/graphservices/Azure.ResourceManager.GraphServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/graphservices/ci.mgmt.yml + - sdk/graphservices/Azure.ResourceManager.GraphServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/graphservices/ci.mgmt.yml + - sdk/graphservices/Azure.ResourceManager.GraphServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/graphservices/ci.mgmt.yml + - sdk/graphservices/Azure.ResourceManager.GraphServices/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/guestconfiguration/ci.mgmt.yml b/sdk/guestconfiguration/ci.mgmt.yml index 5ebc59550f58..1242ca0a1a2e 100644 --- a/sdk/guestconfiguration/ci.mgmt.yml +++ b/sdk/guestconfiguration/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/guestconfiguration/ci.mgmt.yml - sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/guestconfiguration/ci.mgmt.yml + - sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/guestconfiguration/ci.mgmt.yml + - sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/guestconfiguration/ci.mgmt.yml + - sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/guestconfiguration/ci.mgmt.yml + - sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/guestconfiguration/ci.mgmt.yml + - sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/guestconfiguration/ci.mgmt.yml + - sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/guestconfiguration/ci.mgmt.yml + - sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/guestconfiguration/ci.mgmt.yml + - sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/guestconfiguration/ci.mgmt.yml + - sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/hardwaresecuritymodules/ci.mgmt.yml b/sdk/hardwaresecuritymodules/ci.mgmt.yml index 21778711f99e..cd0f9a7ebe69 100644 --- a/sdk/hardwaresecuritymodules/ci.mgmt.yml +++ b/sdk/hardwaresecuritymodules/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/hardwaresecuritymodules/ci.mgmt.yml - sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hardwaresecuritymodules/ci.mgmt.yml + - sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hardwaresecuritymodules/ci.mgmt.yml + - sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hardwaresecuritymodules/ci.mgmt.yml + - sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hardwaresecuritymodules/ci.mgmt.yml + - sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hardwaresecuritymodules/ci.mgmt.yml + - sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hardwaresecuritymodules/ci.mgmt.yml + - sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hardwaresecuritymodules/ci.mgmt.yml + - sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hardwaresecuritymodules/ci.mgmt.yml + - sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hardwaresecuritymodules/ci.mgmt.yml + - sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/hdinsight/ci.mgmt.yml b/sdk/hdinsight/ci.mgmt.yml index 4df0a02f5c80..290640948ae0 100644 --- a/sdk/hdinsight/ci.mgmt.yml +++ b/sdk/hdinsight/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/hdinsight/ci.mgmt.yml - sdk/hdinsight/Azure.ResourceManager.HDInsight/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hdinsight/ci.mgmt.yml + - sdk/hdinsight/Azure.ResourceManager.HDInsight/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hdinsight/ci.mgmt.yml + - sdk/hdinsight/Azure.ResourceManager.HDInsight/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hdinsight/ci.mgmt.yml + - sdk/hdinsight/Azure.ResourceManager.HDInsight/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hdinsight/ci.mgmt.yml + - sdk/hdinsight/Azure.ResourceManager.HDInsight/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hdinsight/ci.mgmt.yml + - sdk/hdinsight/Azure.ResourceManager.HDInsight/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hdinsight/ci.mgmt.yml + - sdk/hdinsight/Azure.ResourceManager.HDInsight/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hdinsight/ci.mgmt.yml + - sdk/hdinsight/Azure.ResourceManager.HDInsight/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hdinsight/ci.mgmt.yml + - sdk/hdinsight/Azure.ResourceManager.HDInsight/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hdinsight/ci.mgmt.yml + - sdk/hdinsight/Azure.ResourceManager.HDInsight/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/hdinsightcontainers/ci.mgmt.yml b/sdk/hdinsightcontainers/ci.mgmt.yml index 69a7566e0caa..5a950eca9cfc 100644 --- a/sdk/hdinsightcontainers/ci.mgmt.yml +++ b/sdk/hdinsightcontainers/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/hdinsightcontainers/ci.mgmt.yml - sdk/hdinsightcontainers/Azure.ResourceManager.HDInsight.Containers/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hdinsightcontainers/ci.mgmt.yml + - sdk/hdinsightcontainers/Azure.ResourceManager.HDInsight.Containers/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hdinsightcontainers/ci.mgmt.yml + - sdk/hdinsightcontainers/Azure.ResourceManager.HDInsight.Containers/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hdinsightcontainers/ci.mgmt.yml + - sdk/hdinsightcontainers/Azure.ResourceManager.HDInsight.Containers/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hdinsightcontainers/ci.mgmt.yml + - sdk/hdinsightcontainers/Azure.ResourceManager.HDInsight.Containers/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hdinsightcontainers/ci.mgmt.yml + - sdk/hdinsightcontainers/Azure.ResourceManager.HDInsight.Containers/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hdinsightcontainers/ci.mgmt.yml + - sdk/hdinsightcontainers/Azure.ResourceManager.HDInsight.Containers/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hdinsightcontainers/ci.mgmt.yml + - sdk/hdinsightcontainers/Azure.ResourceManager.HDInsight.Containers/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hdinsightcontainers/ci.mgmt.yml + - sdk/hdinsightcontainers/Azure.ResourceManager.HDInsight.Containers/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hdinsightcontainers/ci.mgmt.yml + - sdk/hdinsightcontainers/Azure.ResourceManager.HDInsight.Containers/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/healthbot/ci.mgmt.yml b/sdk/healthbot/ci.mgmt.yml index 14bfc7f855e6..109b46444e22 100644 --- a/sdk/healthbot/ci.mgmt.yml +++ b/sdk/healthbot/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/healthbot/ci.mgmt.yml - sdk/healthbot/Azure.ResourceManager.HealthBot/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthbot/ci.mgmt.yml + - sdk/healthbot/Azure.ResourceManager.HealthBot/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthbot/ci.mgmt.yml + - sdk/healthbot/Azure.ResourceManager.HealthBot/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthbot/ci.mgmt.yml + - sdk/healthbot/Azure.ResourceManager.HealthBot/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthbot/ci.mgmt.yml + - sdk/healthbot/Azure.ResourceManager.HealthBot/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthbot/ci.mgmt.yml + - sdk/healthbot/Azure.ResourceManager.HealthBot/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthbot/ci.mgmt.yml + - sdk/healthbot/Azure.ResourceManager.HealthBot/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthbot/ci.mgmt.yml + - sdk/healthbot/Azure.ResourceManager.HealthBot/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthbot/ci.mgmt.yml + - sdk/healthbot/Azure.ResourceManager.HealthBot/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthbot/ci.mgmt.yml + - sdk/healthbot/Azure.ResourceManager.HealthBot/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/healthcareapis/ci.mgmt.yml b/sdk/healthcareapis/ci.mgmt.yml index 57030df35e56..a9f2af170178 100644 --- a/sdk/healthcareapis/ci.mgmt.yml +++ b/sdk/healthcareapis/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/healthcareapis/ci.mgmt.yml - sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthcareapis/ci.mgmt.yml + - sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthcareapis/ci.mgmt.yml + - sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthcareapis/ci.mgmt.yml + - sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthcareapis/ci.mgmt.yml + - sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthcareapis/ci.mgmt.yml + - sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthcareapis/ci.mgmt.yml + - sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthcareapis/ci.mgmt.yml + - sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthcareapis/ci.mgmt.yml + - sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthcareapis/ci.mgmt.yml + - sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/healthdataaiservices/ci.mgmt.yml b/sdk/healthdataaiservices/ci.mgmt.yml index 016a917c1e19..05fb728a6205 100644 --- a/sdk/healthdataaiservices/ci.mgmt.yml +++ b/sdk/healthdataaiservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/healthdataaiservices/ci.mgmt.yml - sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthdataaiservices/ci.mgmt.yml + - sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthdataaiservices/ci.mgmt.yml + - sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthdataaiservices/ci.mgmt.yml + - sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthdataaiservices/ci.mgmt.yml + - sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthdataaiservices/ci.mgmt.yml + - sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthdataaiservices/ci.mgmt.yml + - sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthdataaiservices/ci.mgmt.yml + - sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthdataaiservices/ci.mgmt.yml + - sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthdataaiservices/ci.mgmt.yml + - sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/hybridaks/ci.mgmt.yml b/sdk/hybridaks/ci.mgmt.yml index 552eb3298d3a..91bd3ba4db0d 100644 --- a/sdk/hybridaks/ci.mgmt.yml +++ b/sdk/hybridaks/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/hybridaks/ci.mgmt.yml - sdk/hybridaks/Azure.ResourceManager.HybridContainerService/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridaks/ci.mgmt.yml + - sdk/hybridaks/Azure.ResourceManager.HybridContainerService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridaks/ci.mgmt.yml + - sdk/hybridaks/Azure.ResourceManager.HybridContainerService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridaks/ci.mgmt.yml + - sdk/hybridaks/Azure.ResourceManager.HybridContainerService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridaks/ci.mgmt.yml + - sdk/hybridaks/Azure.ResourceManager.HybridContainerService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridaks/ci.mgmt.yml + - sdk/hybridaks/Azure.ResourceManager.HybridContainerService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridaks/ci.mgmt.yml + - sdk/hybridaks/Azure.ResourceManager.HybridContainerService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridaks/ci.mgmt.yml + - sdk/hybridaks/Azure.ResourceManager.HybridContainerService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridaks/ci.mgmt.yml + - sdk/hybridaks/Azure.ResourceManager.HybridContainerService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridaks/ci.mgmt.yml + - sdk/hybridaks/Azure.ResourceManager.HybridContainerService/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/hybridcompute/ci.mgmt.yml b/sdk/hybridcompute/ci.mgmt.yml index d163a966512d..2c6cf37351d0 100644 --- a/sdk/hybridcompute/ci.mgmt.yml +++ b/sdk/hybridcompute/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/hybridcompute/ci.mgmt.yml - sdk/hybridcompute/Azure.ResourceManager.HybridCompute/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridcompute/ci.mgmt.yml + - sdk/hybridcompute/Azure.ResourceManager.HybridCompute/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridcompute/ci.mgmt.yml + - sdk/hybridcompute/Azure.ResourceManager.HybridCompute/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridcompute/ci.mgmt.yml + - sdk/hybridcompute/Azure.ResourceManager.HybridCompute/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridcompute/ci.mgmt.yml + - sdk/hybridcompute/Azure.ResourceManager.HybridCompute/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridcompute/ci.mgmt.yml + - sdk/hybridcompute/Azure.ResourceManager.HybridCompute/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridcompute/ci.mgmt.yml + - sdk/hybridcompute/Azure.ResourceManager.HybridCompute/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridcompute/ci.mgmt.yml + - sdk/hybridcompute/Azure.ResourceManager.HybridCompute/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridcompute/ci.mgmt.yml + - sdk/hybridcompute/Azure.ResourceManager.HybridCompute/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridcompute/ci.mgmt.yml + - sdk/hybridcompute/Azure.ResourceManager.HybridCompute/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/hybridconnectivity/ci.mgmt.yml b/sdk/hybridconnectivity/ci.mgmt.yml index 9ccca42ef557..7b62de9a1da8 100644 --- a/sdk/hybridconnectivity/ci.mgmt.yml +++ b/sdk/hybridconnectivity/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/hybridconnectivity/ci.mgmt.yml - sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridconnectivity/ci.mgmt.yml + - sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridconnectivity/ci.mgmt.yml + - sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridconnectivity/ci.mgmt.yml + - sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridconnectivity/ci.mgmt.yml + - sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridconnectivity/ci.mgmt.yml + - sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridconnectivity/ci.mgmt.yml + - sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridconnectivity/ci.mgmt.yml + - sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridconnectivity/ci.mgmt.yml + - sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridconnectivity/ci.mgmt.yml + - sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/hybridkubernetes/ci.mgmt.yml b/sdk/hybridkubernetes/ci.mgmt.yml index fff768430c9d..d369d6dd0e1e 100644 --- a/sdk/hybridkubernetes/ci.mgmt.yml +++ b/sdk/hybridkubernetes/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/hybridkubernetes/ci.mgmt.yml - sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridkubernetes/ci.mgmt.yml + - sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridkubernetes/ci.mgmt.yml + - sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridkubernetes/ci.mgmt.yml + - sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridkubernetes/ci.mgmt.yml + - sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridkubernetes/ci.mgmt.yml + - sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridkubernetes/ci.mgmt.yml + - sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridkubernetes/ci.mgmt.yml + - sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridkubernetes/ci.mgmt.yml + - sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridkubernetes/ci.mgmt.yml + - sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/hybridnetwork/ci.mgmt.yml b/sdk/hybridnetwork/ci.mgmt.yml index 35f71f8ae870..4263a4a8fcd5 100644 --- a/sdk/hybridnetwork/ci.mgmt.yml +++ b/sdk/hybridnetwork/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/hybridnetwork/ci.mgmt.yml - sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridnetwork/ci.mgmt.yml + - sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridnetwork/ci.mgmt.yml + - sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridnetwork/ci.mgmt.yml + - sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridnetwork/ci.mgmt.yml + - sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridnetwork/ci.mgmt.yml + - sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridnetwork/ci.mgmt.yml + - sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridnetwork/ci.mgmt.yml + - sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridnetwork/ci.mgmt.yml + - sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridnetwork/ci.mgmt.yml + - sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/informaticadatamanagement/ci.mgmt.yml b/sdk/informaticadatamanagement/ci.mgmt.yml index 03013cc9c90b..82813b6790b1 100644 --- a/sdk/informaticadatamanagement/ci.mgmt.yml +++ b/sdk/informaticadatamanagement/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/informaticadatamanagement/ci.mgmt.yml - sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/informaticadatamanagement/ci.mgmt.yml + - sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/informaticadatamanagement/ci.mgmt.yml + - sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/informaticadatamanagement/ci.mgmt.yml + - sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/informaticadatamanagement/ci.mgmt.yml + - sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/informaticadatamanagement/ci.mgmt.yml + - sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/informaticadatamanagement/ci.mgmt.yml + - sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/informaticadatamanagement/ci.mgmt.yml + - sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/informaticadatamanagement/ci.mgmt.yml + - sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/informaticadatamanagement/ci.mgmt.yml + - sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/iot/ci.mgmt.yml b/sdk/iot/ci.mgmt.yml index 6260cd0d71f2..4a52c8960665 100644 --- a/sdk/iot/ci.mgmt.yml +++ b/sdk/iot/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/iot/ci.mgmt.yml - sdk/iot/Azure.ResourceManager.IotFirmwareDefense/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iot/ci.mgmt.yml + - sdk/iot/Azure.ResourceManager.IotFirmwareDefense/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iot/ci.mgmt.yml + - sdk/iot/Azure.ResourceManager.IotFirmwareDefense/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iot/ci.mgmt.yml + - sdk/iot/Azure.ResourceManager.IotFirmwareDefense/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iot/ci.mgmt.yml + - sdk/iot/Azure.ResourceManager.IotFirmwareDefense/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iot/ci.mgmt.yml + - sdk/iot/Azure.ResourceManager.IotFirmwareDefense/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iot/ci.mgmt.yml + - sdk/iot/Azure.ResourceManager.IotFirmwareDefense/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iot/ci.mgmt.yml + - sdk/iot/Azure.ResourceManager.IotFirmwareDefense/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iot/ci.mgmt.yml + - sdk/iot/Azure.ResourceManager.IotFirmwareDefense/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iot/ci.mgmt.yml + - sdk/iot/Azure.ResourceManager.IotFirmwareDefense/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/iotcentral/ci.mgmt.yml b/sdk/iotcentral/ci.mgmt.yml index 1702fd71c6dd..ad8c8b2e4445 100644 --- a/sdk/iotcentral/ci.mgmt.yml +++ b/sdk/iotcentral/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/iotcentral/ci.mgmt.yml - sdk/iotcentral/Azure.ResourceManager.IotCentral/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iotcentral/ci.mgmt.yml + - sdk/iotcentral/Azure.ResourceManager.IotCentral/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iotcentral/ci.mgmt.yml + - sdk/iotcentral/Azure.ResourceManager.IotCentral/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iotcentral/ci.mgmt.yml + - sdk/iotcentral/Azure.ResourceManager.IotCentral/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iotcentral/ci.mgmt.yml + - sdk/iotcentral/Azure.ResourceManager.IotCentral/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iotcentral/ci.mgmt.yml + - sdk/iotcentral/Azure.ResourceManager.IotCentral/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iotcentral/ci.mgmt.yml + - sdk/iotcentral/Azure.ResourceManager.IotCentral/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iotcentral/ci.mgmt.yml + - sdk/iotcentral/Azure.ResourceManager.IotCentral/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iotcentral/ci.mgmt.yml + - sdk/iotcentral/Azure.ResourceManager.IotCentral/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iotcentral/ci.mgmt.yml + - sdk/iotcentral/Azure.ResourceManager.IotCentral/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/iothub/ci.mgmt.yml b/sdk/iothub/ci.mgmt.yml index 5eb9e999a89c..fd13635da9ac 100644 --- a/sdk/iothub/ci.mgmt.yml +++ b/sdk/iothub/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/iothub/ci.mgmt.yml - sdk/iothub/Azure.ResourceManager.IotHub/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iothub/ci.mgmt.yml + - sdk/iothub/Azure.ResourceManager.IotHub/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iothub/ci.mgmt.yml + - sdk/iothub/Azure.ResourceManager.IotHub/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iothub/ci.mgmt.yml + - sdk/iothub/Azure.ResourceManager.IotHub/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iothub/ci.mgmt.yml + - sdk/iothub/Azure.ResourceManager.IotHub/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iothub/ci.mgmt.yml + - sdk/iothub/Azure.ResourceManager.IotHub/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iothub/ci.mgmt.yml + - sdk/iothub/Azure.ResourceManager.IotHub/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iothub/ci.mgmt.yml + - sdk/iothub/Azure.ResourceManager.IotHub/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iothub/ci.mgmt.yml + - sdk/iothub/Azure.ResourceManager.IotHub/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iothub/ci.mgmt.yml + - sdk/iothub/Azure.ResourceManager.IotHub/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/Azure.ResourceManager.IoTOperations.sln b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/Azure.ResourceManager.IoTOperations.sln new file mode 100644 index 000000000000..9c90f3857d72 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/Azure.ResourceManager.IoTOperations.sln @@ -0,0 +1,56 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.ResourceManager.IoTOperations.Samples", "samples\Azure.ResourceManager.IoTOperations.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.IoTOperations", "src\Azure.ResourceManager.IoTOperations.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.IoTOperations.Tests", "tests\Azure.ResourceManager.IoTOperations.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/CHANGELOG.md b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes \ No newline at end of file diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/Directory.Build.props b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/README.md b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/README.md new file mode 100644 index 000000000000..fb8985870080 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure IoTOperations management client library for .NET + +**[Describe the service briefly first.]** + +This library follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: + + - Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET. + - Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing. + - HTTP pipeline with custom policies. + - Better error-handling. + - Support uniform telemetry across all languages. + +## Getting started + +### Install the package + +Install the Microsoft Azure IoTOperations management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.IoTOperations --prerelease +``` + +### Prerequisites + +* You must have an [Microsoft Azure subscription](https://azure.microsoft.com/free/dotnet/). + +### Authenticate the Client + +To create an authenticated client and start interacting with Microsoft Azure resources, see the [quickstart guide here](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). + +## Key concepts + +Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html) + +## Documentation + +Documentation is available to help you learn how to use this package: + +- [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). +- [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). + +## Examples + +Code samples for using the management library for .NET can be found in the following locations +- [.NET Management Library Code Samples](https://aka.ms/azuresdk-net-mgmt-samples) + +## Troubleshooting + +- File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-net/issues). +- Check [previous questions](https://stackoverflow.com/questions/tagged/azure+.net) or ask new ones on Stack Overflow using Azure and .NET tags. + +## Next steps + +For more information about Microsoft Azure SDK, see [this website](https://azure.github.io/azure-sdk/). + +## Contributing + +For details on contributing to this repository, see the [contributing +guide][cg]. + +This project welcomes contributions and suggestions. Most contributions +require you to agree to a Contributor License Agreement (CLA) declaring +that you have the right to, and actually do, grant us the rights to use +your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine +whether you need to provide a CLA and decorate the PR appropriately +(for example, label, comment). Follow the instructions provided by the +bot. You'll only need to do this action once across all repositories +using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For +more information, see the [Code of Conduct FAQ][coc_faq] or contact + with any other questions or comments. + + +[cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/assets.json b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/assets.json new file mode 100644 index 000000000000..276a434ae8c1 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/assets.json @@ -0,0 +1,7 @@ + +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/iotoperations/Azure.ResourceManager.IoTOperations", + "Tag": "" +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Azure.ResourceManager.IoTOperations.Samples.csproj b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Azure.ResourceManager.IoTOperations.Samples.csproj new file mode 100644 index 000000000000..ddd55e71afe9 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Azure.ResourceManager.IoTOperations.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerAuthenticationResource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerAuthenticationResource.cs new file mode 100644 index 000000000000..3c1967edca87 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerAuthenticationResource.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IoTOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IoTOperations.Samples +{ + public partial class Sample_BrokerAuthenticationResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BrokerAuthenticationGet() + { + // Generated from example definition: 2024-11-01/BrokerAuthentication_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerAuthenticationResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerAuthenticationResource created on azure + // for more information of creating BrokerAuthenticationResource, please refer to the document of BrokerAuthenticationResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + string authenticationName = "resource-name123"; + ResourceIdentifier brokerAuthenticationResourceId = BrokerAuthenticationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName, authenticationName); + BrokerAuthenticationResource brokerAuthenticationResource = client.GetBrokerAuthenticationResource(brokerAuthenticationResourceId); + + // invoke the operation + BrokerAuthenticationResource result = await brokerAuthenticationResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerAuthenticationResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_BrokerAuthenticationDelete() + { + // Generated from example definition: 2024-11-01/BrokerAuthentication_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerAuthenticationResource_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerAuthenticationResource created on azure + // for more information of creating BrokerAuthenticationResource, please refer to the document of BrokerAuthenticationResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + string authenticationName = "resource-name123"; + ResourceIdentifier brokerAuthenticationResourceId = BrokerAuthenticationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName, authenticationName); + BrokerAuthenticationResource brokerAuthenticationResource = client.GetBrokerAuthenticationResource(brokerAuthenticationResourceId); + + // invoke the operation + await brokerAuthenticationResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_BrokerAuthenticationCreateOrUpdateComplex() + { + // Generated from example definition: 2024-11-01/BrokerAuthentication_CreateOrUpdate_Complex.json + // this example is just showing the usage of "BrokerAuthenticationResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerAuthenticationResource created on azure + // for more information of creating BrokerAuthenticationResource, please refer to the document of BrokerAuthenticationResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + string authenticationName = "resource-name123"; + ResourceIdentifier brokerAuthenticationResourceId = BrokerAuthenticationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName, authenticationName); + BrokerAuthenticationResource brokerAuthenticationResource = client.GetBrokerAuthenticationResource(brokerAuthenticationResourceId); + + // invoke the operation + BrokerAuthenticationResourceData data = new BrokerAuthenticationResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new BrokerAuthenticationProperties(new BrokerAuthenticatorMethods[] + { +new BrokerAuthenticatorMethods(BrokerAuthenticationMethod.ServiceAccountToken) +{ +ServiceAccountTokenAudiences = {"aio-internal"}, +}, +new BrokerAuthenticatorMethods(BrokerAuthenticationMethod.X509) +{ +X509Settings = new BrokerAuthenticatorMethodX509 +{ +AuthorizationAttributes = +{ +["root"] = new BrokerAuthenticatorMethodX509Attributes(new Dictionary +{ +["organization"] = "contoso" +}, "CN = Contoso Root CA Cert, OU = Engineering, C = US"), +["intermediate"] = new BrokerAuthenticatorMethodX509Attributes(new Dictionary +{ +["city"] = "seattle", +["foo"] = "bar" +}, "CN = Contoso Intermediate CA"), +["smart-fan"] = new BrokerAuthenticatorMethodX509Attributes(new Dictionary +{ +["building"] = "17" +}, "CN = smart-fan") +}, +TrustedClientCaCert = "my-ca", +}, +} + }), + }; + ArmOperation lro = await brokerAuthenticationResource.UpdateAsync(WaitUntil.Completed, data); + BrokerAuthenticationResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerAuthenticationResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_BrokerAuthenticationCreateOrUpdate() + { + // Generated from example definition: 2024-11-01/BrokerAuthentication_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerAuthenticationResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerAuthenticationResource created on azure + // for more information of creating BrokerAuthenticationResource, please refer to the document of BrokerAuthenticationResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + string authenticationName = "resource-name123"; + ResourceIdentifier brokerAuthenticationResourceId = BrokerAuthenticationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName, authenticationName); + BrokerAuthenticationResource brokerAuthenticationResource = client.GetBrokerAuthenticationResource(brokerAuthenticationResourceId); + + // invoke the operation + BrokerAuthenticationResourceData data = new BrokerAuthenticationResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new BrokerAuthenticationProperties(new BrokerAuthenticatorMethods[] + { +new BrokerAuthenticatorMethods(BrokerAuthenticationMethod.Custom) +{ +CustomSettings = new BrokerAuthenticatorMethodCustom(new Uri("https://www.example.com")) +{ +X509SecretRef = "secret-name", +CaCertConfigMap = "pdecudefqyolvncbus", +Headers = +{ +["key8518"] = "bwityjy" +}, +}, +ServiceAccountTokenAudiences = {"jqyhyqatuydg"}, +X509Settings = new BrokerAuthenticatorMethodX509 +{ +AuthorizationAttributes = +{ +["key3384"] = new BrokerAuthenticatorMethodX509Attributes(new Dictionary +{ +["key186"] = "ucpajramsz" +}, "jpgwctfeixitptfgfnqhua") +}, +TrustedClientCaCert = "vlctsqddl", +}, +} + }), + }; + ArmOperation lro = await brokerAuthenticationResource.UpdateAsync(WaitUntil.Completed, data); + BrokerAuthenticationResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerAuthenticationResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerAuthenticationResourceCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerAuthenticationResourceCollection.cs new file mode 100644 index 000000000000..ea03e1901a21 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerAuthenticationResourceCollection.cs @@ -0,0 +1,301 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IoTOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IoTOperations.Samples +{ + public partial class Sample_BrokerAuthenticationResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_BrokerAuthenticationCreateOrUpdateComplex() + { + // Generated from example definition: 2024-11-01/BrokerAuthentication_CreateOrUpdate_Complex.json + // this example is just showing the usage of "BrokerAuthenticationResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerResource created on azure + // for more information of creating BrokerResource, please refer to the document of BrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier brokerResourceId = BrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + BrokerResource brokerResource = client.GetBrokerResource(brokerResourceId); + + // get the collection of this BrokerAuthenticationResource + BrokerAuthenticationResourceCollection collection = brokerResource.GetBrokerAuthenticationResources(); + + // invoke the operation + string authenticationName = "resource-name123"; + BrokerAuthenticationResourceData data = new BrokerAuthenticationResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new BrokerAuthenticationProperties(new BrokerAuthenticatorMethods[] + { +new BrokerAuthenticatorMethods(BrokerAuthenticationMethod.ServiceAccountToken) +{ +ServiceAccountTokenAudiences = {"aio-internal"}, +}, +new BrokerAuthenticatorMethods(BrokerAuthenticationMethod.X509) +{ +X509Settings = new BrokerAuthenticatorMethodX509 +{ +AuthorizationAttributes = +{ +["root"] = new BrokerAuthenticatorMethodX509Attributes(new Dictionary +{ +["organization"] = "contoso" +}, "CN = Contoso Root CA Cert, OU = Engineering, C = US"), +["intermediate"] = new BrokerAuthenticatorMethodX509Attributes(new Dictionary +{ +["city"] = "seattle", +["foo"] = "bar" +}, "CN = Contoso Intermediate CA"), +["smart-fan"] = new BrokerAuthenticatorMethodX509Attributes(new Dictionary +{ +["building"] = "17" +}, "CN = smart-fan") +}, +TrustedClientCaCert = "my-ca", +}, +} + }), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, authenticationName, data); + BrokerAuthenticationResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerAuthenticationResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_BrokerAuthenticationCreateOrUpdate() + { + // Generated from example definition: 2024-11-01/BrokerAuthentication_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerAuthenticationResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerResource created on azure + // for more information of creating BrokerResource, please refer to the document of BrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier brokerResourceId = BrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + BrokerResource brokerResource = client.GetBrokerResource(brokerResourceId); + + // get the collection of this BrokerAuthenticationResource + BrokerAuthenticationResourceCollection collection = brokerResource.GetBrokerAuthenticationResources(); + + // invoke the operation + string authenticationName = "resource-name123"; + BrokerAuthenticationResourceData data = new BrokerAuthenticationResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new BrokerAuthenticationProperties(new BrokerAuthenticatorMethods[] + { +new BrokerAuthenticatorMethods(BrokerAuthenticationMethod.Custom) +{ +CustomSettings = new BrokerAuthenticatorMethodCustom(new Uri("https://www.example.com")) +{ +X509SecretRef = "secret-name", +CaCertConfigMap = "pdecudefqyolvncbus", +Headers = +{ +["key8518"] = "bwityjy" +}, +}, +ServiceAccountTokenAudiences = {"jqyhyqatuydg"}, +X509Settings = new BrokerAuthenticatorMethodX509 +{ +AuthorizationAttributes = +{ +["key3384"] = new BrokerAuthenticatorMethodX509Attributes(new Dictionary +{ +["key186"] = "ucpajramsz" +}, "jpgwctfeixitptfgfnqhua") +}, +TrustedClientCaCert = "vlctsqddl", +}, +} + }), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, authenticationName, data); + BrokerAuthenticationResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerAuthenticationResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BrokerAuthenticationGet() + { + // Generated from example definition: 2024-11-01/BrokerAuthentication_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerAuthenticationResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerResource created on azure + // for more information of creating BrokerResource, please refer to the document of BrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier brokerResourceId = BrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + BrokerResource brokerResource = client.GetBrokerResource(brokerResourceId); + + // get the collection of this BrokerAuthenticationResource + BrokerAuthenticationResourceCollection collection = brokerResource.GetBrokerAuthenticationResources(); + + // invoke the operation + string authenticationName = "resource-name123"; + BrokerAuthenticationResource result = await collection.GetAsync(authenticationName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerAuthenticationResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_BrokerAuthenticationListByResourceGroup() + { + // Generated from example definition: 2024-11-01/BrokerAuthentication_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerAuthenticationResource_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerResource created on azure + // for more information of creating BrokerResource, please refer to the document of BrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier brokerResourceId = BrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + BrokerResource brokerResource = client.GetBrokerResource(brokerResourceId); + + // get the collection of this BrokerAuthenticationResource + BrokerAuthenticationResourceCollection collection = brokerResource.GetBrokerAuthenticationResources(); + + // invoke the operation and iterate over the result + await foreach (BrokerAuthenticationResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerAuthenticationResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_BrokerAuthenticationGet() + { + // Generated from example definition: 2024-11-01/BrokerAuthentication_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerAuthenticationResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerResource created on azure + // for more information of creating BrokerResource, please refer to the document of BrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier brokerResourceId = BrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + BrokerResource brokerResource = client.GetBrokerResource(brokerResourceId); + + // get the collection of this BrokerAuthenticationResource + BrokerAuthenticationResourceCollection collection = brokerResource.GetBrokerAuthenticationResources(); + + // invoke the operation + string authenticationName = "resource-name123"; + bool result = await collection.ExistsAsync(authenticationName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_BrokerAuthenticationGet() + { + // Generated from example definition: 2024-11-01/BrokerAuthentication_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerAuthenticationResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerResource created on azure + // for more information of creating BrokerResource, please refer to the document of BrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier brokerResourceId = BrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + BrokerResource brokerResource = client.GetBrokerResource(brokerResourceId); + + // get the collection of this BrokerAuthenticationResource + BrokerAuthenticationResourceCollection collection = brokerResource.GetBrokerAuthenticationResources(); + + // invoke the operation + string authenticationName = "resource-name123"; + NullableResponse response = await collection.GetIfExistsAsync(authenticationName); + BrokerAuthenticationResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerAuthenticationResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerAuthorizationResource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerAuthorizationResource.cs new file mode 100644 index 000000000000..f4e1976e1109 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerAuthorizationResource.cs @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IoTOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IoTOperations.Samples +{ + public partial class Sample_BrokerAuthorizationResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BrokerAuthorizationGet() + { + // Generated from example definition: 2024-11-01/BrokerAuthorization_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerAuthorizationResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerAuthorizationResource created on azure + // for more information of creating BrokerAuthorizationResource, please refer to the document of BrokerAuthorizationResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + string authorizationName = "resource-name123"; + ResourceIdentifier brokerAuthorizationResourceId = BrokerAuthorizationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName, authorizationName); + BrokerAuthorizationResource brokerAuthorizationResource = client.GetBrokerAuthorizationResource(brokerAuthorizationResourceId); + + // invoke the operation + BrokerAuthorizationResource result = await brokerAuthorizationResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerAuthorizationResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_BrokerAuthorizationDelete() + { + // Generated from example definition: 2024-11-01/BrokerAuthorization_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerAuthorizationResource_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerAuthorizationResource created on azure + // for more information of creating BrokerAuthorizationResource, please refer to the document of BrokerAuthorizationResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + string authorizationName = "resource-name123"; + ResourceIdentifier brokerAuthorizationResourceId = BrokerAuthorizationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName, authorizationName); + BrokerAuthorizationResource brokerAuthorizationResource = client.GetBrokerAuthorizationResource(brokerAuthorizationResourceId); + + // invoke the operation + await brokerAuthorizationResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_BrokerAuthorizationCreateOrUpdateComplex() + { + // Generated from example definition: 2024-11-01/BrokerAuthorization_CreateOrUpdate_Complex.json + // this example is just showing the usage of "BrokerAuthorizationResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerAuthorizationResource created on azure + // for more information of creating BrokerAuthorizationResource, please refer to the document of BrokerAuthorizationResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + string authorizationName = "resource-name123"; + ResourceIdentifier brokerAuthorizationResourceId = BrokerAuthorizationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName, authorizationName); + BrokerAuthorizationResource brokerAuthorizationResource = client.GetBrokerAuthorizationResource(brokerAuthorizationResourceId); + + // invoke the operation + BrokerAuthorizationResourceData data = new BrokerAuthorizationResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new BrokerAuthorizationProperties(new AuthorizationConfig + { + Cache = OperationalMode.Enabled, + Rules = {new AuthorizationRule(new BrokerResourceRule[] +{ +new BrokerResourceRule(BrokerResourceDefinitionMethod.Connect) +{ +ClientIds = {"{principal.attributes.building}*"}, +}, +new BrokerResourceRule(BrokerResourceDefinitionMethod.Publish) +{ +Topics = {"sensors/{principal.attributes.building}/{principal.clientId}/telemetry/*"}, +}, +new BrokerResourceRule(BrokerResourceDefinitionMethod.Subscribe) +{ +Topics = {"commands/{principal.attributes.organization}"}, +} +}, new PrincipalConfig +{ +Attributes = { +{ +["building"] = "17", +["organization"] = "contoso" +}}, +Usernames = {"temperature-sensor", "humidity-sensor"}, +}) + { + StateStoreResources = { new StateStoreResourceRule(StateStoreResourceKeyType.Pattern, new string[] { "myreadkey", "myotherkey?", "mynumerickeysuffix[0-9]", "clients:{principal.clientId}:*" }, StateStoreResourceDefinitionMethod.Read), new StateStoreResourceRule(StateStoreResourceKeyType.Binary, new string[] { "MTE2IDEwMSAxMTUgMTE2" }, StateStoreResourceDefinitionMethod.ReadWrite) }, + } + }, + }), +}; + ArmOperation lro = await brokerAuthorizationResource.UpdateAsync(WaitUntil.Completed, data); + BrokerAuthorizationResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerAuthorizationResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); +} + +[Test] +[Ignore("Only validating compilation of examples")] +public async Task Update_BrokerAuthorizationCreateOrUpdate() +{ + // Generated from example definition: 2024-11-01/BrokerAuthorization_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerAuthorizationResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + Azure.ResourceManager.ArmClient client = new Azure.ResourceManager.ArmClient(cred); + + // this example assumes you already have this BrokerAuthorizationResource created on azure + // for more information of creating BrokerAuthorizationResource, please refer to the document of BrokerAuthorizationResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + string authorizationName = "resource-name123"; + ResourceIdentifier brokerAuthorizationResourceId = Azure.ResourceManager.IoTOperations.BrokerAuthorizationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName, authorizationName); + Azure.ResourceManager.IoTOperations.BrokerAuthorizationResource brokerAuthorizationResource = client.GetBrokerAuthorizationResource(brokerAuthorizationResourceId); + + // invoke the operation + Azure.ResourceManager.IoTOperations.BrokerAuthorizationResourceData data = new Azure.ResourceManager.IoTOperations.BrokerAuthorizationResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new BrokerAuthorizationProperties(new AuthorizationConfig + { + Cache = OperationalMode.Enabled, + Rules = {new AuthorizationRule(new BrokerResourceRule[] +{ +new BrokerResourceRule(BrokerResourceDefinitionMethod.Connect) +{ +ClientIds = {"nlc"}, +Topics = {"wvuca"}, +} +}, new PrincipalConfig +{ +Attributes = { +{ +["key5526"] = "nydhzdhbldygqcn" +}}, +ClientIds = {"smopeaeddsygz"}, +Usernames = {"iozngyqndrteikszkbasinzdjtm"}, +}) + { + StateStoreResources = { new StateStoreResourceRule(StateStoreResourceKeyType.Pattern, new string[] { "tkounsqtwvzyaklxjqoerpu" }, StateStoreResourceDefinitionMethod.Read) }, + } + }, +}), +}; +Azure.ResourceManager.ArmOperation lro = await brokerAuthorizationResource.UpdateAsync(Azure.WaitUntil.Completed, data); +Azure.ResourceManager.IoTOperations.BrokerAuthorizationResource result = lro.Value; + +// the variable result is a resource, you could call other operations on this instance as well +// but just for demo, we get its data from this resource instance +Azure.ResourceManager.IoTOperations.BrokerAuthorizationResourceData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); +} + +[Test] +[Ignore("Only validating compilation of examples")] +public async Task Update_BrokerAuthorizationCreateOrUpdateSimple() +{ + // Generated from example definition: 2024-11-01/BrokerAuthorization_CreateOrUpdate_Simple.json + // this example is just showing the usage of "BrokerAuthorizationResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + Azure.ResourceManager.ArmClient client = new Azure.ResourceManager.ArmClient(cred); + + // this example assumes you already have this BrokerAuthorizationResource created on azure + // for more information of creating BrokerAuthorizationResource, please refer to the document of BrokerAuthorizationResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + string authorizationName = "resource-name123"; + ResourceIdentifier brokerAuthorizationResourceId = Azure.ResourceManager.IoTOperations.BrokerAuthorizationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName, authorizationName); + Azure.ResourceManager.IoTOperations.BrokerAuthorizationResource brokerAuthorizationResource = client.GetBrokerAuthorizationResource(brokerAuthorizationResourceId); + + // invoke the operation + Azure.ResourceManager.IoTOperations.BrokerAuthorizationResourceData data = new Azure.ResourceManager.IoTOperations.BrokerAuthorizationResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new BrokerAuthorizationProperties(new AuthorizationConfig + { + Cache = OperationalMode.Enabled, + Rules = {new AuthorizationRule(new BrokerResourceRule[] +{ +new BrokerResourceRule(BrokerResourceDefinitionMethod.Connect), +new BrokerResourceRule(BrokerResourceDefinitionMethod.Subscribe) +{ +Topics = {"topic", "topic/with/wildcard/#"}, +} +}, new PrincipalConfig +{ +Attributes = { +{ +["floor"] = "floor1", +["site"] = "site1" +}}, +ClientIds = {"my-client-id"}, +}) + { + StateStoreResources = { new StateStoreResourceRule(StateStoreResourceKeyType.Pattern, new string[] { "*" }, StateStoreResourceDefinitionMethod.ReadWrite) }, + } + }, +}), +}; +Azure.ResourceManager.ArmOperation lro = await brokerAuthorizationResource.UpdateAsync(Azure.WaitUntil.Completed, data); +Azure.ResourceManager.IoTOperations.BrokerAuthorizationResource result = lro.Value; + +// the variable result is a resource, you could call other operations on this instance as well +// but just for demo, we get its data from this resource instance +Azure.ResourceManager.IoTOperations.BrokerAuthorizationResourceData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); +} +} +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerAuthorizationResourceCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerAuthorizationResourceCollection.cs new file mode 100644 index 000000000000..a219644661d6 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerAuthorizationResourceCollection.cs @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IoTOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IoTOperations.Samples +{ + public partial class Sample_BrokerAuthorizationResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_BrokerAuthorizationCreateOrUpdateComplex() + { + // Generated from example definition: 2024-11-01/BrokerAuthorization_CreateOrUpdate_Complex.json + // this example is just showing the usage of "BrokerAuthorizationResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerResource created on azure + // for more information of creating BrokerResource, please refer to the document of BrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier brokerResourceId = BrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + BrokerResource brokerResource = client.GetBrokerResource(brokerResourceId); + + // get the collection of this BrokerAuthorizationResource + BrokerAuthorizationResourceCollection collection = brokerResource.GetBrokerAuthorizationResources(); + + // invoke the operation + string authorizationName = "resource-name123"; + BrokerAuthorizationResourceData data = new BrokerAuthorizationResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new BrokerAuthorizationProperties(new AuthorizationConfig + { + Cache = OperationalMode.Enabled, + Rules = {new AuthorizationRule(new BrokerResourceRule[] +{ +new BrokerResourceRule(BrokerResourceDefinitionMethod.Connect) +{ +ClientIds = {"{principal.attributes.building}*"}, +}, +new BrokerResourceRule(BrokerResourceDefinitionMethod.Publish) +{ +Topics = {"sensors/{principal.attributes.building}/{principal.clientId}/telemetry/*"}, +}, +new BrokerResourceRule(BrokerResourceDefinitionMethod.Subscribe) +{ +Topics = {"commands/{principal.attributes.organization}"}, +} +}, new PrincipalConfig +{ +Attributes = { +{ +["building"] = "17", +["organization"] = "contoso" +}}, +Usernames = {"temperature-sensor", "humidity-sensor"}, +}) + { + StateStoreResources = { new StateStoreResourceRule(StateStoreResourceKeyType.Pattern, new string[] { "myreadkey", "myotherkey?", "mynumerickeysuffix[0-9]", "clients:{principal.clientId}:*" }, StateStoreResourceDefinitionMethod.Read), new StateStoreResourceRule(StateStoreResourceKeyType.Binary, new string[] { "MTE2IDEwMSAxMTUgMTE2" }, StateStoreResourceDefinitionMethod.ReadWrite) }, + } + }, + }), +}; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, authorizationName, data); + BrokerAuthorizationResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerAuthorizationResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); +} + +[Test] +[Ignore("Only validating compilation of examples")] +public async Task CreateOrUpdate_BrokerAuthorizationCreateOrUpdate() +{ + // Generated from example definition: 2024-11-01/BrokerAuthorization_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerAuthorizationResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + Azure.ResourceManager.ArmClient client = new Azure.ResourceManager.ArmClient(cred); + + // this example assumes you already have this BrokerResource created on azure + // for more information of creating BrokerResource, please refer to the document of BrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier brokerResourceId = Azure.ResourceManager.IoTOperations.BrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + Azure.ResourceManager.IoTOperations.BrokerResource brokerResource = client.GetBrokerResource(brokerResourceId); + + // get the collection of this BrokerAuthorizationResource + Azure.ResourceManager.IoTOperations.BrokerAuthorizationResourceCollection collection = brokerResource.GetBrokerAuthorizationResources(); + + // invoke the operation + string authorizationName = "resource-name123"; + Azure.ResourceManager.IoTOperations.BrokerAuthorizationResourceData data = new Azure.ResourceManager.IoTOperations.BrokerAuthorizationResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new BrokerAuthorizationProperties(new AuthorizationConfig + { + Cache = OperationalMode.Enabled, + Rules = {new AuthorizationRule(new BrokerResourceRule[] +{ +new BrokerResourceRule(BrokerResourceDefinitionMethod.Connect) +{ +ClientIds = {"nlc"}, +Topics = {"wvuca"}, +} +}, new PrincipalConfig +{ +Attributes = { +{ +["key5526"] = "nydhzdhbldygqcn" +}}, +ClientIds = {"smopeaeddsygz"}, +Usernames = {"iozngyqndrteikszkbasinzdjtm"}, +}) + { + StateStoreResources = { new StateStoreResourceRule(StateStoreResourceKeyType.Pattern, new string[] { "tkounsqtwvzyaklxjqoerpu" }, StateStoreResourceDefinitionMethod.Read) }, + } + }, +}), +}; +Azure.ResourceManager.ArmOperation lro = await collection.CreateOrUpdateAsync(Azure.WaitUntil.Completed, authorizationName, data); +Azure.ResourceManager.IoTOperations.BrokerAuthorizationResource result = lro.Value; + +// the variable result is a resource, you could call other operations on this instance as well +// but just for demo, we get its data from this resource instance +Azure.ResourceManager.IoTOperations.BrokerAuthorizationResourceData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); +} + +[Test] +[Ignore("Only validating compilation of examples")] +public async Task CreateOrUpdate_BrokerAuthorizationCreateOrUpdateSimple() +{ + // Generated from example definition: 2024-11-01/BrokerAuthorization_CreateOrUpdate_Simple.json + // this example is just showing the usage of "BrokerAuthorizationResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + Azure.ResourceManager.ArmClient client = new Azure.ResourceManager.ArmClient(cred); + + // this example assumes you already have this BrokerResource created on azure + // for more information of creating BrokerResource, please refer to the document of BrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier brokerResourceId = Azure.ResourceManager.IoTOperations.BrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + Azure.ResourceManager.IoTOperations.BrokerResource brokerResource = client.GetBrokerResource(brokerResourceId); + + // get the collection of this BrokerAuthorizationResource + Azure.ResourceManager.IoTOperations.BrokerAuthorizationResourceCollection collection = brokerResource.GetBrokerAuthorizationResources(); + + // invoke the operation + string authorizationName = "resource-name123"; + Azure.ResourceManager.IoTOperations.BrokerAuthorizationResourceData data = new Azure.ResourceManager.IoTOperations.BrokerAuthorizationResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new BrokerAuthorizationProperties(new AuthorizationConfig + { + Cache = OperationalMode.Enabled, + Rules = {new AuthorizationRule(new BrokerResourceRule[] +{ +new BrokerResourceRule(BrokerResourceDefinitionMethod.Connect), +new BrokerResourceRule(BrokerResourceDefinitionMethod.Subscribe) +{ +Topics = {"topic", "topic/with/wildcard/#"}, +} +}, new PrincipalConfig +{ +Attributes = { +{ +["floor"] = "floor1", +["site"] = "site1" +}}, +ClientIds = {"my-client-id"}, +}) + { + StateStoreResources = { new StateStoreResourceRule(StateStoreResourceKeyType.Pattern, new string[] { "*" }, StateStoreResourceDefinitionMethod.ReadWrite) }, + } + }, +}), +}; +Azure.ResourceManager.ArmOperation lro = await collection.CreateOrUpdateAsync(Azure.WaitUntil.Completed, authorizationName, data); +Azure.ResourceManager.IoTOperations.BrokerAuthorizationResource result = lro.Value; + +// the variable result is a resource, you could call other operations on this instance as well +// but just for demo, we get its data from this resource instance +Azure.ResourceManager.IoTOperations.BrokerAuthorizationResourceData resourceData = result.Data; +// for demo we just print out the id +Console.WriteLine($"Succeeded on id: {resourceData.Id}"); +} + +[Test] +[Ignore("Only validating compilation of examples")] +public async Task Get_BrokerAuthorizationGet() +{ + // Generated from example definition: 2024-11-01/BrokerAuthorization_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerAuthorizationResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + Azure.ResourceManager.ArmClient client = new Azure.ResourceManager.ArmClient(cred); + + // this example assumes you already have this BrokerResource created on azure + // for more information of creating BrokerResource, please refer to the document of BrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier brokerResourceId = Azure.ResourceManager.IoTOperations.BrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + Azure.ResourceManager.IoTOperations.BrokerResource brokerResource = client.GetBrokerResource(brokerResourceId); + + // get the collection of this BrokerAuthorizationResource + Azure.ResourceManager.IoTOperations.BrokerAuthorizationResourceCollection collection = brokerResource.GetBrokerAuthorizationResources(); + + // invoke the operation + string authorizationName = "resource-name123"; + Azure.ResourceManager.IoTOperations.BrokerAuthorizationResource result = await collection.GetAsync(authorizationName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + Azure.ResourceManager.IoTOperations.BrokerAuthorizationResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); +} + +[Test] +[Ignore("Only validating compilation of examples")] +public async Task GetAll_BrokerAuthorizationListByResourceGroup() +{ + // Generated from example definition: 2024-11-01/BrokerAuthorization_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerAuthorizationResource_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + Azure.ResourceManager.ArmClient client = new Azure.ResourceManager.ArmClient(cred); + + // this example assumes you already have this BrokerResource created on azure + // for more information of creating BrokerResource, please refer to the document of BrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier brokerResourceId = Azure.ResourceManager.IoTOperations.BrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + Azure.ResourceManager.IoTOperations.BrokerResource brokerResource = client.GetBrokerResource(brokerResourceId); + + // get the collection of this BrokerAuthorizationResource + Azure.ResourceManager.IoTOperations.BrokerAuthorizationResourceCollection collection = brokerResource.GetBrokerAuthorizationResources(); + + // invoke the operation and iterate over the result + await foreach (Azure.ResourceManager.IoTOperations.BrokerAuthorizationResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + Azure.ResourceManager.IoTOperations.BrokerAuthorizationResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); +} + +[Test] +[Ignore("Only validating compilation of examples")] +public async Task Exists_BrokerAuthorizationGet() +{ + // Generated from example definition: 2024-11-01/BrokerAuthorization_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerAuthorizationResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + Azure.ResourceManager.ArmClient client = new Azure.ResourceManager.ArmClient(cred); + + // this example assumes you already have this BrokerResource created on azure + // for more information of creating BrokerResource, please refer to the document of BrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier brokerResourceId = Azure.ResourceManager.IoTOperations.BrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + Azure.ResourceManager.IoTOperations.BrokerResource brokerResource = client.GetBrokerResource(brokerResourceId); + + // get the collection of this BrokerAuthorizationResource + Azure.ResourceManager.IoTOperations.BrokerAuthorizationResourceCollection collection = brokerResource.GetBrokerAuthorizationResources(); + + // invoke the operation + string authorizationName = "resource-name123"; + bool result = await collection.ExistsAsync(authorizationName); + + Console.WriteLine($"Succeeded: {result}"); +} + +[Test] +[Ignore("Only validating compilation of examples")] +public async Task GetIfExists_BrokerAuthorizationGet() +{ + // Generated from example definition: 2024-11-01/BrokerAuthorization_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerAuthorizationResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + Azure.ResourceManager.ArmClient client = new Azure.ResourceManager.ArmClient(cred); + + // this example assumes you already have this BrokerResource created on azure + // for more information of creating BrokerResource, please refer to the document of BrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier brokerResourceId = Azure.ResourceManager.IoTOperations.BrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + Azure.ResourceManager.IoTOperations.BrokerResource brokerResource = client.GetBrokerResource(brokerResourceId); + + // get the collection of this BrokerAuthorizationResource + Azure.ResourceManager.IoTOperations.BrokerAuthorizationResourceCollection collection = brokerResource.GetBrokerAuthorizationResources(); + + // invoke the operation + string authorizationName = "resource-name123"; + Azure.NullableResponse response = await collection.GetIfExistsAsync(authorizationName); + Azure.ResourceManager.IoTOperations.BrokerAuthorizationResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + Azure.ResourceManager.IoTOperations.BrokerAuthorizationResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } +} +} +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerListenerResource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerListenerResource.cs new file mode 100644 index 000000000000..52405ffd98a3 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerListenerResource.cs @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IoTOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IoTOperations.Samples +{ + public partial class Sample_BrokerListenerResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BrokerListenerGet() + { + // Generated from example definition: 2024-11-01/BrokerListener_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerListenerResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerListenerResource created on azure + // for more information of creating BrokerListenerResource, please refer to the document of BrokerListenerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + string listenerName = "resource-name123"; + ResourceIdentifier brokerListenerResourceId = BrokerListenerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName, listenerName); + BrokerListenerResource brokerListenerResource = client.GetBrokerListenerResource(brokerListenerResourceId); + + // invoke the operation + BrokerListenerResource result = await brokerListenerResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerListenerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_BrokerListenerDelete() + { + // Generated from example definition: 2024-11-01/BrokerListener_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerListenerResource_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerListenerResource created on azure + // for more information of creating BrokerListenerResource, please refer to the document of BrokerListenerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + string listenerName = "resource-name123"; + ResourceIdentifier brokerListenerResourceId = BrokerListenerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName, listenerName); + BrokerListenerResource brokerListenerResource = client.GetBrokerListenerResource(brokerListenerResourceId); + + // invoke the operation + await brokerListenerResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_BrokerListenerCreateOrUpdateComplex() + { + // Generated from example definition: 2024-11-01/BrokerListener_CreateOrUpdate_Complex.json + // this example is just showing the usage of "BrokerListenerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerListenerResource created on azure + // for more information of creating BrokerListenerResource, please refer to the document of BrokerListenerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + string listenerName = "resource-name123"; + ResourceIdentifier brokerListenerResourceId = BrokerListenerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName, listenerName); + BrokerListenerResource brokerListenerResource = client.GetBrokerListenerResource(brokerListenerResourceId); + + // invoke the operation + BrokerListenerResourceData data = new BrokerListenerResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new BrokerListenerProperties(new ListenerPort[] + { +new ListenerPort(8080) +{ +AuthenticationRef = "example-authentication", +Protocol = BrokerProtocolType.WebSockets, +}, +new ListenerPort(8443) +{ +AuthenticationRef = "example-authentication", +Protocol = BrokerProtocolType.WebSockets, +Tls = new TlsCertMethod(TlsCertMethodMode.Automatic) +{ +CertManagerCertificateSpec = new CertManagerCertificateSpec(new CertManagerIssuerRef("jtmuladdkpasfpoyvewekmiy", CertManagerIssuerKind.Issuer, "example-issuer")), +}, +}, +new ListenerPort(1883) +{ +AuthenticationRef = "example-authentication", +}, +new ListenerPort(8883) +{ +AuthenticationRef = "example-authentication", +Tls = new TlsCertMethod(TlsCertMethodMode.Manual) +{ +ManualSecretRef = "example-secret", +}, +} + }) + { + ServiceType = ServiceType.LoadBalancer, + }, + }; + ArmOperation lro = await brokerListenerResource.UpdateAsync(WaitUntil.Completed, data); + BrokerListenerResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerListenerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_BrokerListenerCreateOrUpdate() + { + // Generated from example definition: 2024-11-01/BrokerListener_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerListenerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerListenerResource created on azure + // for more information of creating BrokerListenerResource, please refer to the document of BrokerListenerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + string listenerName = "resource-name123"; + ResourceIdentifier brokerListenerResourceId = BrokerListenerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName, listenerName); + BrokerListenerResource brokerListenerResource = client.GetBrokerListenerResource(brokerListenerResourceId); + + // invoke the operation + BrokerListenerResourceData data = new BrokerListenerResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new BrokerListenerProperties(new ListenerPort[] + { +new ListenerPort(1268) +{ +AuthenticationRef = "tjvdroaqqy", +AuthorizationRef = "inxhvxnwswyrvt", +NodePort = 7281, +Protocol = BrokerProtocolType.Mqtt, +Tls = new TlsCertMethod(TlsCertMethodMode.Automatic) +{ +CertManagerCertificateSpec = new CertManagerCertificateSpec(new CertManagerIssuerRef("jtmuladdkpasfpoyvewekmiy", CertManagerIssuerKind.Issuer, "ocwoqpgucvjrsuudtjhb")) +{ +Duration = "qmpeffoksron", +SecretName = "oagi", +RenewBefore = "hutno", +PrivateKey = new CertManagerPrivateKey(PrivateKeyAlgorithm.Ec256, PrivateKeyRotationPolicy.Always), +San = new SanForCert(new string[]{"xhvmhrrhgfsapocjeebqtnzarlj"}, new string[]{"zbgugfzcgsmegevzktsnibyuyp"}), +}, +ManualSecretRef = "secret-name", +}, +} + }) + { + ServiceName = "tpfiszlapdpxktx", + ServiceType = ServiceType.ClusterIP, + }, + }; + ArmOperation lro = await brokerListenerResource.UpdateAsync(WaitUntil.Completed, data); + BrokerListenerResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerListenerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_BrokerListenerCreateOrUpdateSimple() + { + // Generated from example definition: 2024-11-01/BrokerListener_CreateOrUpdate_Simple.json + // this example is just showing the usage of "BrokerListenerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerListenerResource created on azure + // for more information of creating BrokerListenerResource, please refer to the document of BrokerListenerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + string listenerName = "resource-name123"; + ResourceIdentifier brokerListenerResourceId = BrokerListenerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName, listenerName); + BrokerListenerResource brokerListenerResource = client.GetBrokerListenerResource(brokerListenerResourceId); + + // invoke the operation + BrokerListenerResourceData data = new BrokerListenerResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new BrokerListenerProperties(new ListenerPort[] + { +new ListenerPort(1883) + }), + }; + ArmOperation lro = await brokerListenerResource.UpdateAsync(WaitUntil.Completed, data); + BrokerListenerResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerListenerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerListenerResourceCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerListenerResourceCollection.cs new file mode 100644 index 000000000000..9f78d8b1c2f5 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerListenerResourceCollection.cs @@ -0,0 +1,344 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IoTOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IoTOperations.Samples +{ + public partial class Sample_BrokerListenerResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_BrokerListenerCreateOrUpdateComplex() + { + // Generated from example definition: 2024-11-01/BrokerListener_CreateOrUpdate_Complex.json + // this example is just showing the usage of "BrokerListenerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerResource created on azure + // for more information of creating BrokerResource, please refer to the document of BrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier brokerResourceId = BrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + BrokerResource brokerResource = client.GetBrokerResource(brokerResourceId); + + // get the collection of this BrokerListenerResource + BrokerListenerResourceCollection collection = brokerResource.GetBrokerListenerResources(); + + // invoke the operation + string listenerName = "resource-name123"; + BrokerListenerResourceData data = new BrokerListenerResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new BrokerListenerProperties(new ListenerPort[] + { +new ListenerPort(8080) +{ +AuthenticationRef = "example-authentication", +Protocol = BrokerProtocolType.WebSockets, +}, +new ListenerPort(8443) +{ +AuthenticationRef = "example-authentication", +Protocol = BrokerProtocolType.WebSockets, +Tls = new TlsCertMethod(TlsCertMethodMode.Automatic) +{ +CertManagerCertificateSpec = new CertManagerCertificateSpec(new CertManagerIssuerRef("jtmuladdkpasfpoyvewekmiy", CertManagerIssuerKind.Issuer, "example-issuer")), +}, +}, +new ListenerPort(1883) +{ +AuthenticationRef = "example-authentication", +}, +new ListenerPort(8883) +{ +AuthenticationRef = "example-authentication", +Tls = new TlsCertMethod(TlsCertMethodMode.Manual) +{ +ManualSecretRef = "example-secret", +}, +} + }) + { + ServiceType = ServiceType.LoadBalancer, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, listenerName, data); + BrokerListenerResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerListenerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_BrokerListenerCreateOrUpdate() + { + // Generated from example definition: 2024-11-01/BrokerListener_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerListenerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerResource created on azure + // for more information of creating BrokerResource, please refer to the document of BrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier brokerResourceId = BrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + BrokerResource brokerResource = client.GetBrokerResource(brokerResourceId); + + // get the collection of this BrokerListenerResource + BrokerListenerResourceCollection collection = brokerResource.GetBrokerListenerResources(); + + // invoke the operation + string listenerName = "resource-name123"; + BrokerListenerResourceData data = new BrokerListenerResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new BrokerListenerProperties(new ListenerPort[] + { +new ListenerPort(1268) +{ +AuthenticationRef = "tjvdroaqqy", +AuthorizationRef = "inxhvxnwswyrvt", +NodePort = 7281, +Protocol = BrokerProtocolType.Mqtt, +Tls = new TlsCertMethod(TlsCertMethodMode.Automatic) +{ +CertManagerCertificateSpec = new CertManagerCertificateSpec(new CertManagerIssuerRef("jtmuladdkpasfpoyvewekmiy", CertManagerIssuerKind.Issuer, "ocwoqpgucvjrsuudtjhb")) +{ +Duration = "qmpeffoksron", +SecretName = "oagi", +RenewBefore = "hutno", +PrivateKey = new CertManagerPrivateKey(PrivateKeyAlgorithm.Ec256, PrivateKeyRotationPolicy.Always), +San = new SanForCert(new string[]{"xhvmhrrhgfsapocjeebqtnzarlj"}, new string[]{"zbgugfzcgsmegevzktsnibyuyp"}), +}, +ManualSecretRef = "secret-name", +}, +} + }) + { + ServiceName = "tpfiszlapdpxktx", + ServiceType = ServiceType.ClusterIP, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, listenerName, data); + BrokerListenerResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerListenerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_BrokerListenerCreateOrUpdateSimple() + { + // Generated from example definition: 2024-11-01/BrokerListener_CreateOrUpdate_Simple.json + // this example is just showing the usage of "BrokerListenerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerResource created on azure + // for more information of creating BrokerResource, please refer to the document of BrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier brokerResourceId = BrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + BrokerResource brokerResource = client.GetBrokerResource(brokerResourceId); + + // get the collection of this BrokerListenerResource + BrokerListenerResourceCollection collection = brokerResource.GetBrokerListenerResources(); + + // invoke the operation + string listenerName = "resource-name123"; + BrokerListenerResourceData data = new BrokerListenerResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new BrokerListenerProperties(new ListenerPort[] + { +new ListenerPort(1883) + }), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, listenerName, data); + BrokerListenerResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerListenerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BrokerListenerGet() + { + // Generated from example definition: 2024-11-01/BrokerListener_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerListenerResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerResource created on azure + // for more information of creating BrokerResource, please refer to the document of BrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier brokerResourceId = BrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + BrokerResource brokerResource = client.GetBrokerResource(brokerResourceId); + + // get the collection of this BrokerListenerResource + BrokerListenerResourceCollection collection = brokerResource.GetBrokerListenerResources(); + + // invoke the operation + string listenerName = "resource-name123"; + BrokerListenerResource result = await collection.GetAsync(listenerName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerListenerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_BrokerListenerListByResourceGroup() + { + // Generated from example definition: 2024-11-01/BrokerListener_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerListenerResource_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerResource created on azure + // for more information of creating BrokerResource, please refer to the document of BrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier brokerResourceId = BrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + BrokerResource brokerResource = client.GetBrokerResource(brokerResourceId); + + // get the collection of this BrokerListenerResource + BrokerListenerResourceCollection collection = brokerResource.GetBrokerListenerResources(); + + // invoke the operation and iterate over the result + await foreach (BrokerListenerResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerListenerResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_BrokerListenerGet() + { + // Generated from example definition: 2024-11-01/BrokerListener_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerListenerResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerResource created on azure + // for more information of creating BrokerResource, please refer to the document of BrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier brokerResourceId = BrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + BrokerResource brokerResource = client.GetBrokerResource(brokerResourceId); + + // get the collection of this BrokerListenerResource + BrokerListenerResourceCollection collection = brokerResource.GetBrokerListenerResources(); + + // invoke the operation + string listenerName = "resource-name123"; + bool result = await collection.ExistsAsync(listenerName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_BrokerListenerGet() + { + // Generated from example definition: 2024-11-01/BrokerListener_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerListenerResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerResource created on azure + // for more information of creating BrokerResource, please refer to the document of BrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier brokerResourceId = BrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + BrokerResource brokerResource = client.GetBrokerResource(brokerResourceId); + + // get the collection of this BrokerListenerResource + BrokerListenerResourceCollection collection = brokerResource.GetBrokerListenerResources(); + + // invoke the operation + string listenerName = "resource-name123"; + NullableResponse response = await collection.GetIfExistsAsync(listenerName); + BrokerListenerResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerListenerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerResource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerResource.cs new file mode 100644 index 000000000000..98d0de7be21a --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerResource.cs @@ -0,0 +1,377 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IoTOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IoTOperations.Samples +{ + public partial class Sample_BrokerResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BrokerGet() + { + // Generated from example definition: 2024-11-01/Broker_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerResource created on azure + // for more information of creating BrokerResource, please refer to the document of BrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier brokerResourceId = BrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + BrokerResource brokerResource = client.GetBrokerResource(brokerResourceId); + + // invoke the operation + BrokerResource result = await brokerResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_BrokerDelete() + { + // Generated from example definition: 2024-11-01/Broker_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerResource_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerResource created on azure + // for more information of creating BrokerResource, please refer to the document of BrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier brokerResourceId = BrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + BrokerResource brokerResource = client.GetBrokerResource(brokerResourceId); + + // invoke the operation + await brokerResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_BrokerCreateOrUpdateComplex() + { + // Generated from example definition: 2024-11-01/Broker_CreateOrUpdate_Complex.json + // this example is just showing the usage of "BrokerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerResource created on azure + // for more information of creating BrokerResource, please refer to the document of BrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier brokerResourceId = BrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + BrokerResource brokerResource = client.GetBrokerResource(brokerResourceId); + + // invoke the operation + BrokerResourceData data = new BrokerResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new BrokerProperties + { + Cardinality = new Cardinality(new BackendChain(2, 2) + { + Workers = 2, + }, new Frontend(2) + { + Workers = 2, + }), + DiskBackedMessageBuffer = new DiskBackedMessageBuffer("50M"), + GenerateResourceLimitsCpu = OperationalMode.Enabled, + MemoryProfile = BrokerMemoryProfile.Medium, + }, + }; + ArmOperation lro = await brokerResource.UpdateAsync(WaitUntil.Completed, data); + BrokerResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_BrokerCreateOrUpdate() + { + // Generated from example definition: 2024-11-01/Broker_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerResource created on azure + // for more information of creating BrokerResource, please refer to the document of BrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier brokerResourceId = BrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + BrokerResource brokerResource = client.GetBrokerResource(brokerResourceId); + + // invoke the operation + BrokerResourceData data = new BrokerResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new BrokerProperties + { + Advanced = new AdvancedSettings + { + Clients = new ClientConfig + { + MaxSessionExpirySeconds = 3859, + MaxMessageExpirySeconds = 3263, + MaxPacketSizeBytes = 3029, + SubscriberQueueLimit = new SubscriberQueueLimit + { + Length = 6L, + Strategy = SubscriberMessageDropStrategy.None, + }, + MaxReceiveMaximum = 2365, + MaxKeepAliveSeconds = 3744, + }, + EncryptInternalTraffic = OperationalMode.Enabled, + InternalCerts = new CertManagerCertConfig("bchrc", "xkafmpgjfifkwwrhkswtopdnne", new CertManagerPrivateKey(PrivateKeyAlgorithm.Ec256, PrivateKeyRotationPolicy.Always)), + }, + Cardinality = new Cardinality(new BackendChain(11, 5) + { + Workers = 15, + }, new Frontend(2) + { + Workers = 6, + }), + Diagnostics = new BrokerDiagnostics + { + LogsLevel = "rnmwokumdmebpmfxxxzvvjfdywotav", + MetricsPrometheusPort = 7581, + SelfCheck = new SelfCheck + { + Mode = OperationalMode.Enabled, + IntervalSeconds = 158, + TimeoutSeconds = 14, + }, + Traces = new Traces + { + Mode = OperationalMode.Enabled, + CacheSizeMegabytes = 28, + SelfTracing = new SelfTracing + { + Mode = OperationalMode.Enabled, + IntervalSeconds = 22, + }, + SpanChannelCapacity = 1000, + }, + }, + DiskBackedMessageBuffer = new DiskBackedMessageBuffer("500M") + { + EphemeralVolumeClaimSpec = new VolumeClaimSpec + { + VolumeName = "c", + VolumeMode = "rxvpksjuuugqnqzeiprocknbn", + StorageClassName = "sseyhrjptkhrqvpdpjmornkqvon", + AccessModes = { "nuluhigrbb" }, + DataSource = new LocalKubernetesReference("wazgyb", "cwhsgxxcxsyppoefm") + { + ApiGroup = "npqapyksvvpkohujx", + }, + DataSourceRef = new KubernetesReference("odynqzekfzsnawrctaxg", "envszivbbmixbyddzg") + { + ApiGroup = "mnfnykznjjsoqpfsgdqioupt", + Namespace = "etcfzvxqd", + }, + Resources = new VolumeClaimResourceRequirements + { + Limits = +{ +["key2719"] = "hmphcrgctu" +}, + Requests = +{ +["key2909"] = "txocprnyrsgvhfrg" +}, + }, + Selector = new VolumeClaimSpecSelector + { + MatchExpressions = {new VolumeClaimSpecSelectorMatchExpressions("e", OperatorValue.In) +{ +Values = {"slmpajlywqvuyknipgztsonqyybt"}, +}}, + MatchLabels = +{ +["key6673"] = "wlngfalznwxnurzpgxomcxhbqefpr" +}, + }, + }, + PersistentVolumeClaimSpec = new VolumeClaimSpec + { + VolumeName = "c", + VolumeMode = "rxvpksjuuugqnqzeiprocknbn", + StorageClassName = "sseyhrjptkhrqvpdpjmornkqvon", + AccessModes = { "nuluhigrbb" }, + DataSource = new LocalKubernetesReference("wazgyb", "cwhsgxxcxsyppoefm") + { + ApiGroup = "npqapyksvvpkohujx", + }, + DataSourceRef = new KubernetesReference("odynqzekfzsnawrctaxg", "envszivbbmixbyddzg") + { + ApiGroup = "mnfnykznjjsoqpfsgdqioupt", + Namespace = "etcfzvxqd", + }, + Resources = new VolumeClaimResourceRequirements + { + Limits = +{ +["key2719"] = "hmphcrgctu" +}, + Requests = +{ +["key2909"] = "txocprnyrsgvhfrg" +}, + }, + Selector = new VolumeClaimSpecSelector + { + MatchExpressions = {new VolumeClaimSpecSelectorMatchExpressions("e", OperatorValue.In) +{ +Values = {"slmpajlywqvuyknipgztsonqyybt"}, +}}, + MatchLabels = +{ +["key6673"] = "wlngfalznwxnurzpgxomcxhbqefpr" +}, + }, + }, + }, + GenerateResourceLimitsCpu = OperationalMode.Enabled, + MemoryProfile = BrokerMemoryProfile.Tiny, + }, + }; + ArmOperation lro = await brokerResource.UpdateAsync(WaitUntil.Completed, data); + BrokerResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_BrokerCreateOrUpdateMinimal() + { + // Generated from example definition: 2024-11-01/Broker_CreateOrUpdate_Minimal.json + // this example is just showing the usage of "BrokerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerResource created on azure + // for more information of creating BrokerResource, please refer to the document of BrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier brokerResourceId = BrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + BrokerResource brokerResource = client.GetBrokerResource(brokerResourceId); + + // invoke the operation + BrokerResourceData data = new BrokerResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new BrokerProperties + { + MemoryProfile = BrokerMemoryProfile.Tiny, + }, + }; + ArmOperation lro = await brokerResource.UpdateAsync(WaitUntil.Completed, data); + BrokerResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_BrokerCreateOrUpdateSimple() + { + // Generated from example definition: 2024-11-01/Broker_CreateOrUpdate_Simple.json + // this example is just showing the usage of "BrokerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BrokerResource created on azure + // for more information of creating BrokerResource, please refer to the document of BrokerResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string brokerName = "resource-name123"; + ResourceIdentifier brokerResourceId = BrokerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, brokerName); + BrokerResource brokerResource = client.GetBrokerResource(brokerResourceId); + + // invoke the operation + BrokerResourceData data = new BrokerResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new BrokerProperties + { + Cardinality = new Cardinality(new BackendChain(2, 2) + { + Workers = 2, + }, new Frontend(2) + { + Workers = 2, + }), + GenerateResourceLimitsCpu = OperationalMode.Enabled, + MemoryProfile = BrokerMemoryProfile.Low, + }, + }; + ArmOperation lro = await brokerResource.UpdateAsync(WaitUntil.Completed, data); + BrokerResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerResourceCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerResourceCollection.cs new file mode 100644 index 000000000000..48c45057145e --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_BrokerResourceCollection.cs @@ -0,0 +1,473 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IoTOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IoTOperations.Samples +{ + public partial class Sample_BrokerResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_BrokerCreateOrUpdateComplex() + { + // Generated from example definition: 2024-11-01/Broker_CreateOrUpdate_Complex.json + // this example is just showing the usage of "BrokerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this BrokerResource + BrokerResourceCollection collection = instanceResource.GetBrokerResources(); + + // invoke the operation + string brokerName = "resource-name123"; + BrokerResourceData data = new BrokerResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new BrokerProperties + { + Cardinality = new Cardinality(new BackendChain(2, 2) + { + Workers = 2, + }, new Frontend(2) + { + Workers = 2, + }), + DiskBackedMessageBuffer = new DiskBackedMessageBuffer("50M"), + GenerateResourceLimitsCpu = OperationalMode.Enabled, + MemoryProfile = BrokerMemoryProfile.Medium, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, brokerName, data); + BrokerResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_BrokerCreateOrUpdate() + { + // Generated from example definition: 2024-11-01/Broker_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this BrokerResource + BrokerResourceCollection collection = instanceResource.GetBrokerResources(); + + // invoke the operation + string brokerName = "resource-name123"; + BrokerResourceData data = new BrokerResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new BrokerProperties + { + Advanced = new AdvancedSettings + { + Clients = new ClientConfig + { + MaxSessionExpirySeconds = 3859, + MaxMessageExpirySeconds = 3263, + MaxPacketSizeBytes = 3029, + SubscriberQueueLimit = new SubscriberQueueLimit + { + Length = 6L, + Strategy = SubscriberMessageDropStrategy.None, + }, + MaxReceiveMaximum = 2365, + MaxKeepAliveSeconds = 3744, + }, + EncryptInternalTraffic = OperationalMode.Enabled, + InternalCerts = new CertManagerCertConfig("bchrc", "xkafmpgjfifkwwrhkswtopdnne", new CertManagerPrivateKey(PrivateKeyAlgorithm.Ec256, PrivateKeyRotationPolicy.Always)), + }, + Cardinality = new Cardinality(new BackendChain(11, 5) + { + Workers = 15, + }, new Frontend(2) + { + Workers = 6, + }), + Diagnostics = new BrokerDiagnostics + { + LogsLevel = "rnmwokumdmebpmfxxxzvvjfdywotav", + MetricsPrometheusPort = 7581, + SelfCheck = new SelfCheck + { + Mode = OperationalMode.Enabled, + IntervalSeconds = 158, + TimeoutSeconds = 14, + }, + Traces = new Traces + { + Mode = OperationalMode.Enabled, + CacheSizeMegabytes = 28, + SelfTracing = new SelfTracing + { + Mode = OperationalMode.Enabled, + IntervalSeconds = 22, + }, + SpanChannelCapacity = 1000, + }, + }, + DiskBackedMessageBuffer = new DiskBackedMessageBuffer("500M") + { + EphemeralVolumeClaimSpec = new VolumeClaimSpec + { + VolumeName = "c", + VolumeMode = "rxvpksjuuugqnqzeiprocknbn", + StorageClassName = "sseyhrjptkhrqvpdpjmornkqvon", + AccessModes = { "nuluhigrbb" }, + DataSource = new LocalKubernetesReference("wazgyb", "cwhsgxxcxsyppoefm") + { + ApiGroup = "npqapyksvvpkohujx", + }, + DataSourceRef = new KubernetesReference("odynqzekfzsnawrctaxg", "envszivbbmixbyddzg") + { + ApiGroup = "mnfnykznjjsoqpfsgdqioupt", + Namespace = "etcfzvxqd", + }, + Resources = new VolumeClaimResourceRequirements + { + Limits = +{ +["key2719"] = "hmphcrgctu" +}, + Requests = +{ +["key2909"] = "txocprnyrsgvhfrg" +}, + }, + Selector = new VolumeClaimSpecSelector + { + MatchExpressions = {new VolumeClaimSpecSelectorMatchExpressions("e", OperatorValue.In) +{ +Values = {"slmpajlywqvuyknipgztsonqyybt"}, +}}, + MatchLabels = +{ +["key6673"] = "wlngfalznwxnurzpgxomcxhbqefpr" +}, + }, + }, + PersistentVolumeClaimSpec = new VolumeClaimSpec + { + VolumeName = "c", + VolumeMode = "rxvpksjuuugqnqzeiprocknbn", + StorageClassName = "sseyhrjptkhrqvpdpjmornkqvon", + AccessModes = { "nuluhigrbb" }, + DataSource = new LocalKubernetesReference("wazgyb", "cwhsgxxcxsyppoefm") + { + ApiGroup = "npqapyksvvpkohujx", + }, + DataSourceRef = new KubernetesReference("odynqzekfzsnawrctaxg", "envszivbbmixbyddzg") + { + ApiGroup = "mnfnykznjjsoqpfsgdqioupt", + Namespace = "etcfzvxqd", + }, + Resources = new VolumeClaimResourceRequirements + { + Limits = +{ +["key2719"] = "hmphcrgctu" +}, + Requests = +{ +["key2909"] = "txocprnyrsgvhfrg" +}, + }, + Selector = new VolumeClaimSpecSelector + { + MatchExpressions = {new VolumeClaimSpecSelectorMatchExpressions("e", OperatorValue.In) +{ +Values = {"slmpajlywqvuyknipgztsonqyybt"}, +}}, + MatchLabels = +{ +["key6673"] = "wlngfalznwxnurzpgxomcxhbqefpr" +}, + }, + }, + }, + GenerateResourceLimitsCpu = OperationalMode.Enabled, + MemoryProfile = BrokerMemoryProfile.Tiny, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, brokerName, data); + BrokerResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_BrokerCreateOrUpdateMinimal() + { + // Generated from example definition: 2024-11-01/Broker_CreateOrUpdate_Minimal.json + // this example is just showing the usage of "BrokerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this BrokerResource + BrokerResourceCollection collection = instanceResource.GetBrokerResources(); + + // invoke the operation + string brokerName = "resource-name123"; + BrokerResourceData data = new BrokerResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new BrokerProperties + { + MemoryProfile = BrokerMemoryProfile.Tiny, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, brokerName, data); + BrokerResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_BrokerCreateOrUpdateSimple() + { + // Generated from example definition: 2024-11-01/Broker_CreateOrUpdate_Simple.json + // this example is just showing the usage of "BrokerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this BrokerResource + BrokerResourceCollection collection = instanceResource.GetBrokerResources(); + + // invoke the operation + string brokerName = "resource-name123"; + BrokerResourceData data = new BrokerResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new BrokerProperties + { + Cardinality = new Cardinality(new BackendChain(2, 2) + { + Workers = 2, + }, new Frontend(2) + { + Workers = 2, + }), + GenerateResourceLimitsCpu = OperationalMode.Enabled, + MemoryProfile = BrokerMemoryProfile.Low, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, brokerName, data); + BrokerResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BrokerGet() + { + // Generated from example definition: 2024-11-01/Broker_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this BrokerResource + BrokerResourceCollection collection = instanceResource.GetBrokerResources(); + + // invoke the operation + string brokerName = "resource-name123"; + BrokerResource result = await collection.GetAsync(brokerName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_BrokerListByResourceGroup() + { + // Generated from example definition: 2024-11-01/Broker_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerResource_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this BrokerResource + BrokerResourceCollection collection = instanceResource.GetBrokerResources(); + + // invoke the operation and iterate over the result + await foreach (BrokerResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_BrokerGet() + { + // Generated from example definition: 2024-11-01/Broker_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this BrokerResource + BrokerResourceCollection collection = instanceResource.GetBrokerResources(); + + // invoke the operation + string brokerName = "resource-name123"; + bool result = await collection.ExistsAsync(brokerName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_BrokerGet() + { + // Generated from example definition: 2024-11-01/Broker_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BrokerResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this BrokerResource + BrokerResourceCollection collection = instanceResource.GetBrokerResources(); + + // invoke the operation + string brokerName = "resource-name123"; + NullableResponse response = await collection.GetIfExistsAsync(brokerName); + BrokerResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BrokerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_DataflowEndpointResource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_DataflowEndpointResource.cs new file mode 100644 index 000000000000..8208963516f3 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_DataflowEndpointResource.cs @@ -0,0 +1,642 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IoTOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IoTOperations.Samples +{ + public partial class Sample_DataflowEndpointResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_DataflowEndpointGet() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_Get_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowEndpointResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowEndpointResource created on azure + // for more information of creating DataflowEndpointResource, please refer to the document of DataflowEndpointResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowEndpointName = "resource-name123"; + ResourceIdentifier dataflowEndpointResourceId = DataflowEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + DataflowEndpointResource dataflowEndpointResource = client.GetDataflowEndpointResource(dataflowEndpointResourceId); + + // invoke the operation + DataflowEndpointResource result = await dataflowEndpointResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowEndpointResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DataflowEndpointDelete() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowEndpointResource_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowEndpointResource created on azure + // for more information of creating DataflowEndpointResource, please refer to the document of DataflowEndpointResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowEndpointName = "resource-name123"; + ResourceIdentifier dataflowEndpointResourceId = DataflowEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + DataflowEndpointResource dataflowEndpointResource = client.GetDataflowEndpointResource(dataflowEndpointResourceId); + + // invoke the operation + await dataflowEndpointResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowEndpointCreateOrUpdateADLSv2() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_ADLSv2.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowEndpointResource created on azure + // for more information of creating DataflowEndpointResource, please refer to the document of DataflowEndpointResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowEndpointName = "adlsv2-endpoint"; + ResourceIdentifier dataflowEndpointResourceId = DataflowEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + DataflowEndpointResource dataflowEndpointResource = client.GetDataflowEndpointResource(dataflowEndpointResourceId); + + // invoke the operation + DataflowEndpointResourceData data = new DataflowEndpointResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowEndpointProperties(EndpointType.DataLakeStorage) + { + DataLakeStorageSettings = new DataflowEndpointDataLakeStorage(new DataflowEndpointDataLakeStorageAuthentication(DataLakeStorageAuthMethod.AccessToken) + { + AccessTokenSecretRef = "my-secret", + }, "example.blob.core.windows.net"), + }, + }; + ArmOperation lro = await dataflowEndpointResource.UpdateAsync(WaitUntil.Completed, data); + DataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowEndpointResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowEndpointCreateOrUpdateADX() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_ADX.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowEndpointResource created on azure + // for more information of creating DataflowEndpointResource, please refer to the document of DataflowEndpointResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowEndpointName = "adx-endpoint"; + ResourceIdentifier dataflowEndpointResourceId = DataflowEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + DataflowEndpointResource dataflowEndpointResource = client.GetDataflowEndpointResource(dataflowEndpointResourceId); + + // invoke the operation + DataflowEndpointResourceData data = new DataflowEndpointResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowEndpointProperties(EndpointType.DataExplorer) + { + DataExplorerSettings = new DataflowEndpointDataExplorer(new DataflowEndpointDataExplorerAuthentication(DataExplorerAuthMethod.SystemAssignedManagedIdentity), "example-database", "example.westeurope.kusto.windows.net") + { + Batching = new BatchingConfiguration + { + LatencySeconds = 9312, + MaxMessages = 9028, + }, + }, + }, + }; + ArmOperation lro = await dataflowEndpointResource.UpdateAsync(WaitUntil.Completed, data); + DataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowEndpointResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowEndpointCreateOrUpdateAIO() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_AIO.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowEndpointResource created on azure + // for more information of creating DataflowEndpointResource, please refer to the document of DataflowEndpointResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowEndpointName = "aio-builtin-broker-endpoint"; + ResourceIdentifier dataflowEndpointResourceId = DataflowEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + DataflowEndpointResource dataflowEndpointResource = client.GetDataflowEndpointResource(dataflowEndpointResourceId); + + // invoke the operation + DataflowEndpointResourceData data = new DataflowEndpointResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowEndpointProperties(EndpointType.Mqtt) + { + MqttSettings = new DataflowEndpointMqtt(new DataflowEndpointMqttAuthentication(default) + { + ServiceAccountTokenAudience = "aio-internal", + }) + { + Host = "aio-broker:18883", + Tls = new TlsProperties + { + Mode = OperationalMode.Enabled, + TrustedCaCertificateConfigMapRef = "aio-ca-trust-bundle-test-only", + }, + }, + }, + }; + ArmOperation lro = await dataflowEndpointResource.UpdateAsync(WaitUntil.Completed, data); + DataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowEndpointResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowEndpointCreateOrUpdateEventGrid() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_EventGrid.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowEndpointResource created on azure + // for more information of creating DataflowEndpointResource, please refer to the document of DataflowEndpointResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowEndpointName = "event-grid-endpoint"; + ResourceIdentifier dataflowEndpointResourceId = DataflowEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + DataflowEndpointResource dataflowEndpointResource = client.GetDataflowEndpointResource(dataflowEndpointResourceId); + + // invoke the operation + DataflowEndpointResourceData data = new DataflowEndpointResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowEndpointProperties(EndpointType.Mqtt) + { + MqttSettings = new DataflowEndpointMqtt(new DataflowEndpointMqttAuthentication(MqttAuthMethod.SystemAssignedManagedIdentity)) + { + Host = "example.westeurope-1.ts.eventgrid.azure.net:8883", + Tls = new TlsProperties + { + Mode = OperationalMode.Enabled, + }, + }, + }, + }; + ArmOperation lro = await dataflowEndpointResource.UpdateAsync(WaitUntil.Completed, data); + DataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowEndpointResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowEndpointCreateOrUpdateEventHub() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_EventHub.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowEndpointResource created on azure + // for more information of creating DataflowEndpointResource, please refer to the document of DataflowEndpointResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowEndpointName = "event-hub-endpoint"; + ResourceIdentifier dataflowEndpointResourceId = DataflowEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + DataflowEndpointResource dataflowEndpointResource = client.GetDataflowEndpointResource(dataflowEndpointResourceId); + + // invoke the operation + DataflowEndpointResourceData data = new DataflowEndpointResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowEndpointProperties(EndpointType.Kafka) + { + KafkaSettings = new DataflowEndpointKafka(new DataflowEndpointKafkaAuthentication(KafkaAuthMethod.SystemAssignedManagedIdentity), "example.servicebus.windows.net:9093") + { + ConsumerGroupId = "aiodataflows", + Tls = new TlsProperties + { + Mode = OperationalMode.Enabled, + }, + }, + }, + }; + ArmOperation lro = await dataflowEndpointResource.UpdateAsync(WaitUntil.Completed, data); + DataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowEndpointResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowEndpointCreateOrUpdateFabric() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_Fabric.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowEndpointResource created on azure + // for more information of creating DataflowEndpointResource, please refer to the document of DataflowEndpointResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowEndpointName = "fabric-endpoint"; + ResourceIdentifier dataflowEndpointResourceId = DataflowEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + DataflowEndpointResource dataflowEndpointResource = client.GetDataflowEndpointResource(dataflowEndpointResourceId); + + // invoke the operation + DataflowEndpointResourceData data = new DataflowEndpointResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowEndpointProperties(EndpointType.FabricOneLake) + { + FabricOneLakeSettings = new DataflowEndpointFabricOneLake(new DataflowEndpointFabricOneLakeAuthentication(FabricOneLakeAuthMethod.SystemAssignedManagedIdentity), new DataflowEndpointFabricOneLakeNames("example-lakehouse", "example-workspace"), DataflowEndpointFabricPathType.Tables, "onelake.dfs.fabric.microsoft.com"), + }, + }; + ArmOperation lro = await dataflowEndpointResource.UpdateAsync(WaitUntil.Completed, data); + DataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowEndpointResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowEndpointCreateOrUpdateKafka() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_Kafka.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowEndpointResource created on azure + // for more information of creating DataflowEndpointResource, please refer to the document of DataflowEndpointResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowEndpointName = "generic-kafka-endpoint"; + ResourceIdentifier dataflowEndpointResourceId = DataflowEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + DataflowEndpointResource dataflowEndpointResource = client.GetDataflowEndpointResource(dataflowEndpointResourceId); + + // invoke the operation + DataflowEndpointResourceData data = new DataflowEndpointResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowEndpointProperties(EndpointType.Kafka) + { + KafkaSettings = new DataflowEndpointKafka(new DataflowEndpointKafkaAuthentication(KafkaAuthMethod.Sasl) + { + SaslSettings = new DataflowEndpointAuthenticationSasl(DataflowEndpointAuthenticationSaslType.Plain, "my-secret"), + }, "example.kafka.local:9093") + { + ConsumerGroupId = "dataflows", + Batching = new DataflowEndpointKafkaBatching + { + Mode = OperationalMode.Enabled, + LatencyMs = 5, + MaxBytes = 1000000, + MaxMessages = 100000, + }, + CopyMqttProperties = OperationalMode.Enabled, + Compression = DataflowEndpointKafkaCompression.Gzip, + KafkaAcks = DataflowEndpointKafkaAck.All, + PartitionStrategy = DataflowEndpointKafkaPartitionStrategy.Default, + Tls = new TlsProperties + { + Mode = OperationalMode.Enabled, + TrustedCaCertificateConfigMapRef = "ca-certificates", + }, + CloudEventAttributes = CloudEventAttributeType.Propagate, + }, + }, + }; + ArmOperation lro = await dataflowEndpointResource.UpdateAsync(WaitUntil.Completed, data); + DataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowEndpointResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowEndpointCreateOrUpdateLocalStorage() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_LocalStorage.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowEndpointResource created on azure + // for more information of creating DataflowEndpointResource, please refer to the document of DataflowEndpointResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowEndpointName = "local-storage-endpoint"; + ResourceIdentifier dataflowEndpointResourceId = DataflowEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + DataflowEndpointResource dataflowEndpointResource = client.GetDataflowEndpointResource(dataflowEndpointResourceId); + + // invoke the operation + DataflowEndpointResourceData data = new DataflowEndpointResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowEndpointProperties(EndpointType.LocalStorage) + { + LocalStoragePersistentVolumeClaimRef = "example-pvc", + }, + }; + ArmOperation lro = await dataflowEndpointResource.UpdateAsync(WaitUntil.Completed, data); + DataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowEndpointResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowEndpointCreateOrUpdateMQTT() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_MQTT.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowEndpointResource created on azure + // for more information of creating DataflowEndpointResource, please refer to the document of DataflowEndpointResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowEndpointName = "generic-mqtt-broker-endpoint"; + ResourceIdentifier dataflowEndpointResourceId = DataflowEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + DataflowEndpointResource dataflowEndpointResource = client.GetDataflowEndpointResource(dataflowEndpointResourceId); + + // invoke the operation + DataflowEndpointResourceData data = new DataflowEndpointResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowEndpointProperties(EndpointType.Mqtt) + { + MqttSettings = new DataflowEndpointMqtt(new DataflowEndpointMqttAuthentication(MqttAuthMethod.X509Certificate) + { + X509CertificateSecretRef = "example-secret", + }) + { + ClientIdPrefix = "factory-gateway", + Host = "example.broker.local:1883", + Protocol = BrokerProtocolType.WebSockets, + KeepAliveSeconds = 60, + Retain = MqttRetainType.Keep, + MaxInflightMessages = 100, + Qos = 1, + SessionExpirySeconds = 3600, + Tls = new TlsProperties + { + Mode = OperationalMode.Disabled, + }, + }, + }, + }; + ArmOperation lro = await dataflowEndpointResource.UpdateAsync(WaitUntil.Completed, data); + DataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowEndpointResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowEndpointCreateOrUpdate() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowEndpointResource created on azure + // for more information of creating DataflowEndpointResource, please refer to the document of DataflowEndpointResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowEndpointName = "resource-name123"; + ResourceIdentifier dataflowEndpointResourceId = DataflowEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + DataflowEndpointResource dataflowEndpointResource = client.GetDataflowEndpointResource(dataflowEndpointResourceId); + + // invoke the operation + DataflowEndpointResourceData data = new DataflowEndpointResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowEndpointProperties(EndpointType.DataExplorer) + { + DataExplorerSettings = new DataflowEndpointDataExplorer(new DataflowEndpointDataExplorerAuthentication(DataExplorerAuthMethod.SystemAssignedManagedIdentity) + { + SystemAssignedManagedIdentityAudience = "psxomrfbhoflycm", + UserAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationUserAssignedManagedIdentity("fb90f267-8872-431a-a76a-a1cec5d3c4d2", "ed060aa2-71ff-4d3f-99c4-a9138356fdec") + { + Scope = "zop", + }, + }, "yqcdpjsifm", "..kusto.windows.net") + { + Batching = new BatchingConfiguration + { + LatencySeconds = 9312, + MaxMessages = 9028, + }, + }, + DataLakeStorageSettings = new DataflowEndpointDataLakeStorage(new DataflowEndpointDataLakeStorageAuthentication(DataLakeStorageAuthMethod.SystemAssignedManagedIdentity) + { + AccessTokenSecretRef = "sevriyphcvnlrnfudqzejecwa", + SystemAssignedManagedIdentityAudience = "psxomrfbhoflycm", + UserAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationUserAssignedManagedIdentity("fb90f267-8872-431a-a76a-a1cec5d3c4d2", "ed060aa2-71ff-4d3f-99c4-a9138356fdec") + { + Scope = "zop", + }, + }, ".blob.core.windows.net") + { + Batching = new BatchingConfiguration + { + LatencySeconds = 9312, + MaxMessages = 9028, + }, + }, + FabricOneLakeSettings = new DataflowEndpointFabricOneLake(new DataflowEndpointFabricOneLakeAuthentication(FabricOneLakeAuthMethod.SystemAssignedManagedIdentity) + { + SystemAssignedManagedIdentityAudience = "psxomrfbhoflycm", + UserAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationUserAssignedManagedIdentity("fb90f267-8872-431a-a76a-a1cec5d3c4d2", "ed060aa2-71ff-4d3f-99c4-a9138356fdec") + { + Scope = "zop", + }, + }, new DataflowEndpointFabricOneLakeNames("wpeathi", "nwgmitkbljztgms"), DataflowEndpointFabricPathType.Files, "https://.fabric.microsoft.com") + { + Batching = new BatchingConfiguration + { + LatencySeconds = 9312, + MaxMessages = 9028, + }, + }, + KafkaSettings = new DataflowEndpointKafka(new DataflowEndpointKafkaAuthentication(KafkaAuthMethod.SystemAssignedManagedIdentity) + { + SystemAssignedManagedIdentityAudience = "psxomrfbhoflycm", + UserAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationUserAssignedManagedIdentity("fb90f267-8872-431a-a76a-a1cec5d3c4d2", "ed060aa2-71ff-4d3f-99c4-a9138356fdec") + { + Scope = "zop", + }, + SaslSettings = new DataflowEndpointAuthenticationSasl(DataflowEndpointAuthenticationSaslType.Plain, "visyxoztqnylvbyokhtmpdkwes"), + X509CertificateSecretRef = "afwizrystfslkfqd", + }, "pwcqfiqclcgneolpewnyavoulbip") + { + ConsumerGroupId = "ukkzcjiyenhxokat", + Batching = new DataflowEndpointKafkaBatching + { + Mode = OperationalMode.Enabled, + LatencyMs = 3679, + MaxBytes = 8887, + MaxMessages = 2174, + }, + CopyMqttProperties = OperationalMode.Enabled, + Compression = DataflowEndpointKafkaCompression.None, + KafkaAcks = DataflowEndpointKafkaAck.Zero, + PartitionStrategy = DataflowEndpointKafkaPartitionStrategy.Default, + Tls = new TlsProperties + { + Mode = OperationalMode.Enabled, + TrustedCaCertificateConfigMapRef = "tectjjvukvelsreihwadh", + }, + }, + LocalStoragePersistentVolumeClaimRef = "jjwqwvd", + MqttSettings = new DataflowEndpointMqtt(new DataflowEndpointMqttAuthentication(MqttAuthMethod.SystemAssignedManagedIdentity) + { + SystemAssignedManagedIdentityAudience = "psxomrfbhoflycm", + UserAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationUserAssignedManagedIdentity("fb90f267-8872-431a-a76a-a1cec5d3c4d2", "ed060aa2-71ff-4d3f-99c4-a9138356fdec") + { + Scope = "zop", + }, + ServiceAccountTokenAudience = "ejbklrbxgjaqleoycgpje", + X509CertificateSecretRef = "afwizrystfslkfqd", + }) + { + ClientIdPrefix = "kkljsdxdirfhwxtkavldekeqhv", + Host = "nyhnxqnbspstctl", + Protocol = BrokerProtocolType.Mqtt, + KeepAliveSeconds = 0, + Retain = MqttRetainType.Keep, + MaxInflightMessages = 0, + Qos = 1, + SessionExpirySeconds = 0, + Tls = new TlsProperties + { + Mode = OperationalMode.Enabled, + TrustedCaCertificateConfigMapRef = "tectjjvukvelsreihwadh", + }, + }, + }, + }; + ArmOperation lro = await dataflowEndpointResource.UpdateAsync(WaitUntil.Completed, data); + DataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowEndpointResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_DataflowEndpointResourceCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_DataflowEndpointResourceCollection.cs new file mode 100644 index 000000000000..b8d75a220bc9 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_DataflowEndpointResourceCollection.cs @@ -0,0 +1,756 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IoTOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IoTOperations.Samples +{ + public partial class Sample_DataflowEndpointResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateADLSv2() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_ADLSv2.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this DataflowEndpointResource + DataflowEndpointResourceCollection collection = instanceResource.GetDataflowEndpointResources(); + + // invoke the operation + string dataflowEndpointName = "adlsv2-endpoint"; + DataflowEndpointResourceData data = new DataflowEndpointResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowEndpointProperties(EndpointType.DataLakeStorage) + { + DataLakeStorageSettings = new DataflowEndpointDataLakeStorage(new DataflowEndpointDataLakeStorageAuthentication(DataLakeStorageAuthMethod.AccessToken) + { + AccessTokenSecretRef = "my-secret", + }, "example.blob.core.windows.net"), + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowEndpointName, data); + DataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowEndpointResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateADX() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_ADX.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this DataflowEndpointResource + DataflowEndpointResourceCollection collection = instanceResource.GetDataflowEndpointResources(); + + // invoke the operation + string dataflowEndpointName = "adx-endpoint"; + DataflowEndpointResourceData data = new DataflowEndpointResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowEndpointProperties(EndpointType.DataExplorer) + { + DataExplorerSettings = new DataflowEndpointDataExplorer(new DataflowEndpointDataExplorerAuthentication(DataExplorerAuthMethod.SystemAssignedManagedIdentity), "example-database", "example.westeurope.kusto.windows.net") + { + Batching = new BatchingConfiguration + { + LatencySeconds = 9312, + MaxMessages = 9028, + }, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowEndpointName, data); + DataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowEndpointResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateAIO() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_AIO.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this DataflowEndpointResource + DataflowEndpointResourceCollection collection = instanceResource.GetDataflowEndpointResources(); + + // invoke the operation + string dataflowEndpointName = "aio-builtin-broker-endpoint"; + DataflowEndpointResourceData data = new DataflowEndpointResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowEndpointProperties(EndpointType.Mqtt) + { + MqttSettings = new DataflowEndpointMqtt(new DataflowEndpointMqttAuthentication(default) + { + ServiceAccountTokenAudience = "aio-internal", + }) + { + Host = "aio-broker:18883", + Tls = new TlsProperties + { + Mode = OperationalMode.Enabled, + TrustedCaCertificateConfigMapRef = "aio-ca-trust-bundle-test-only", + }, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowEndpointName, data); + DataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowEndpointResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateEventGrid() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_EventGrid.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this DataflowEndpointResource + DataflowEndpointResourceCollection collection = instanceResource.GetDataflowEndpointResources(); + + // invoke the operation + string dataflowEndpointName = "event-grid-endpoint"; + DataflowEndpointResourceData data = new DataflowEndpointResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowEndpointProperties(EndpointType.Mqtt) + { + MqttSettings = new DataflowEndpointMqtt(new DataflowEndpointMqttAuthentication(MqttAuthMethod.SystemAssignedManagedIdentity)) + { + Host = "example.westeurope-1.ts.eventgrid.azure.net:8883", + Tls = new TlsProperties + { + Mode = OperationalMode.Enabled, + }, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowEndpointName, data); + DataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowEndpointResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateEventHub() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_EventHub.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this DataflowEndpointResource + DataflowEndpointResourceCollection collection = instanceResource.GetDataflowEndpointResources(); + + // invoke the operation + string dataflowEndpointName = "event-hub-endpoint"; + DataflowEndpointResourceData data = new DataflowEndpointResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowEndpointProperties(EndpointType.Kafka) + { + KafkaSettings = new DataflowEndpointKafka(new DataflowEndpointKafkaAuthentication(KafkaAuthMethod.SystemAssignedManagedIdentity), "example.servicebus.windows.net:9093") + { + ConsumerGroupId = "aiodataflows", + Tls = new TlsProperties + { + Mode = OperationalMode.Enabled, + }, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowEndpointName, data); + DataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowEndpointResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateFabric() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_Fabric.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this DataflowEndpointResource + DataflowEndpointResourceCollection collection = instanceResource.GetDataflowEndpointResources(); + + // invoke the operation + string dataflowEndpointName = "fabric-endpoint"; + DataflowEndpointResourceData data = new DataflowEndpointResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowEndpointProperties(EndpointType.FabricOneLake) + { + FabricOneLakeSettings = new DataflowEndpointFabricOneLake(new DataflowEndpointFabricOneLakeAuthentication(FabricOneLakeAuthMethod.SystemAssignedManagedIdentity), new DataflowEndpointFabricOneLakeNames("example-lakehouse", "example-workspace"), DataflowEndpointFabricPathType.Tables, "onelake.dfs.fabric.microsoft.com"), + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowEndpointName, data); + DataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowEndpointResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateKafka() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_Kafka.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this DataflowEndpointResource + DataflowEndpointResourceCollection collection = instanceResource.GetDataflowEndpointResources(); + + // invoke the operation + string dataflowEndpointName = "generic-kafka-endpoint"; + DataflowEndpointResourceData data = new DataflowEndpointResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowEndpointProperties(EndpointType.Kafka) + { + KafkaSettings = new DataflowEndpointKafka(new DataflowEndpointKafkaAuthentication(KafkaAuthMethod.Sasl) + { + SaslSettings = new DataflowEndpointAuthenticationSasl(DataflowEndpointAuthenticationSaslType.Plain, "my-secret"), + }, "example.kafka.local:9093") + { + ConsumerGroupId = "dataflows", + Batching = new DataflowEndpointKafkaBatching + { + Mode = OperationalMode.Enabled, + LatencyMs = 5, + MaxBytes = 1000000, + MaxMessages = 100000, + }, + CopyMqttProperties = OperationalMode.Enabled, + Compression = DataflowEndpointKafkaCompression.Gzip, + KafkaAcks = DataflowEndpointKafkaAck.All, + PartitionStrategy = DataflowEndpointKafkaPartitionStrategy.Default, + Tls = new TlsProperties + { + Mode = OperationalMode.Enabled, + TrustedCaCertificateConfigMapRef = "ca-certificates", + }, + CloudEventAttributes = CloudEventAttributeType.Propagate, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowEndpointName, data); + DataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowEndpointResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateLocalStorage() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_LocalStorage.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this DataflowEndpointResource + DataflowEndpointResourceCollection collection = instanceResource.GetDataflowEndpointResources(); + + // invoke the operation + string dataflowEndpointName = "local-storage-endpoint"; + DataflowEndpointResourceData data = new DataflowEndpointResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowEndpointProperties(EndpointType.LocalStorage) + { + LocalStoragePersistentVolumeClaimRef = "example-pvc", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowEndpointName, data); + DataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowEndpointResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateMQTT() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_MQTT.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this DataflowEndpointResource + DataflowEndpointResourceCollection collection = instanceResource.GetDataflowEndpointResources(); + + // invoke the operation + string dataflowEndpointName = "generic-mqtt-broker-endpoint"; + DataflowEndpointResourceData data = new DataflowEndpointResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowEndpointProperties(EndpointType.Mqtt) + { + MqttSettings = new DataflowEndpointMqtt(new DataflowEndpointMqttAuthentication(MqttAuthMethod.X509Certificate) + { + X509CertificateSecretRef = "example-secret", + }) + { + ClientIdPrefix = "factory-gateway", + Host = "example.broker.local:1883", + Protocol = BrokerProtocolType.WebSockets, + KeepAliveSeconds = 60, + Retain = MqttRetainType.Keep, + MaxInflightMessages = 100, + Qos = 1, + SessionExpirySeconds = 3600, + Tls = new TlsProperties + { + Mode = OperationalMode.Disabled, + }, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowEndpointName, data); + DataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowEndpointResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdate() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowEndpointResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this DataflowEndpointResource + DataflowEndpointResourceCollection collection = instanceResource.GetDataflowEndpointResources(); + + // invoke the operation + string dataflowEndpointName = "resource-name123"; + DataflowEndpointResourceData data = new DataflowEndpointResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowEndpointProperties(EndpointType.DataExplorer) + { + DataExplorerSettings = new DataflowEndpointDataExplorer(new DataflowEndpointDataExplorerAuthentication(DataExplorerAuthMethod.SystemAssignedManagedIdentity) + { + SystemAssignedManagedIdentityAudience = "psxomrfbhoflycm", + UserAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationUserAssignedManagedIdentity("fb90f267-8872-431a-a76a-a1cec5d3c4d2", "ed060aa2-71ff-4d3f-99c4-a9138356fdec") + { + Scope = "zop", + }, + }, "yqcdpjsifm", "..kusto.windows.net") + { + Batching = new BatchingConfiguration + { + LatencySeconds = 9312, + MaxMessages = 9028, + }, + }, + DataLakeStorageSettings = new DataflowEndpointDataLakeStorage(new DataflowEndpointDataLakeStorageAuthentication(DataLakeStorageAuthMethod.SystemAssignedManagedIdentity) + { + AccessTokenSecretRef = "sevriyphcvnlrnfudqzejecwa", + SystemAssignedManagedIdentityAudience = "psxomrfbhoflycm", + UserAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationUserAssignedManagedIdentity("fb90f267-8872-431a-a76a-a1cec5d3c4d2", "ed060aa2-71ff-4d3f-99c4-a9138356fdec") + { + Scope = "zop", + }, + }, ".blob.core.windows.net") + { + Batching = new BatchingConfiguration + { + LatencySeconds = 9312, + MaxMessages = 9028, + }, + }, + FabricOneLakeSettings = new DataflowEndpointFabricOneLake(new DataflowEndpointFabricOneLakeAuthentication(FabricOneLakeAuthMethod.SystemAssignedManagedIdentity) + { + SystemAssignedManagedIdentityAudience = "psxomrfbhoflycm", + UserAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationUserAssignedManagedIdentity("fb90f267-8872-431a-a76a-a1cec5d3c4d2", "ed060aa2-71ff-4d3f-99c4-a9138356fdec") + { + Scope = "zop", + }, + }, new DataflowEndpointFabricOneLakeNames("wpeathi", "nwgmitkbljztgms"), DataflowEndpointFabricPathType.Files, "https://.fabric.microsoft.com") + { + Batching = new BatchingConfiguration + { + LatencySeconds = 9312, + MaxMessages = 9028, + }, + }, + KafkaSettings = new DataflowEndpointKafka(new DataflowEndpointKafkaAuthentication(KafkaAuthMethod.SystemAssignedManagedIdentity) + { + SystemAssignedManagedIdentityAudience = "psxomrfbhoflycm", + UserAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationUserAssignedManagedIdentity("fb90f267-8872-431a-a76a-a1cec5d3c4d2", "ed060aa2-71ff-4d3f-99c4-a9138356fdec") + { + Scope = "zop", + }, + SaslSettings = new DataflowEndpointAuthenticationSasl(DataflowEndpointAuthenticationSaslType.Plain, "visyxoztqnylvbyokhtmpdkwes"), + X509CertificateSecretRef = "afwizrystfslkfqd", + }, "pwcqfiqclcgneolpewnyavoulbip") + { + ConsumerGroupId = "ukkzcjiyenhxokat", + Batching = new DataflowEndpointKafkaBatching + { + Mode = OperationalMode.Enabled, + LatencyMs = 3679, + MaxBytes = 8887, + MaxMessages = 2174, + }, + CopyMqttProperties = OperationalMode.Enabled, + Compression = DataflowEndpointKafkaCompression.None, + KafkaAcks = DataflowEndpointKafkaAck.Zero, + PartitionStrategy = DataflowEndpointKafkaPartitionStrategy.Default, + Tls = new TlsProperties + { + Mode = OperationalMode.Enabled, + TrustedCaCertificateConfigMapRef = "tectjjvukvelsreihwadh", + }, + }, + LocalStoragePersistentVolumeClaimRef = "jjwqwvd", + MqttSettings = new DataflowEndpointMqtt(new DataflowEndpointMqttAuthentication(MqttAuthMethod.SystemAssignedManagedIdentity) + { + SystemAssignedManagedIdentityAudience = "psxomrfbhoflycm", + UserAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationUserAssignedManagedIdentity("fb90f267-8872-431a-a76a-a1cec5d3c4d2", "ed060aa2-71ff-4d3f-99c4-a9138356fdec") + { + Scope = "zop", + }, + ServiceAccountTokenAudience = "ejbklrbxgjaqleoycgpje", + X509CertificateSecretRef = "afwizrystfslkfqd", + }) + { + ClientIdPrefix = "kkljsdxdirfhwxtkavldekeqhv", + Host = "nyhnxqnbspstctl", + Protocol = BrokerProtocolType.Mqtt, + KeepAliveSeconds = 0, + Retain = MqttRetainType.Keep, + MaxInflightMessages = 0, + Qos = 1, + SessionExpirySeconds = 0, + Tls = new TlsProperties + { + Mode = OperationalMode.Enabled, + TrustedCaCertificateConfigMapRef = "tectjjvukvelsreihwadh", + }, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowEndpointName, data); + DataflowEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowEndpointResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_DataflowEndpointGet() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_Get_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowEndpointResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this DataflowEndpointResource + DataflowEndpointResourceCollection collection = instanceResource.GetDataflowEndpointResources(); + + // invoke the operation + string dataflowEndpointName = "resource-name123"; + DataflowEndpointResource result = await collection.GetAsync(dataflowEndpointName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowEndpointResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_DataflowEndpointListByResourceGroup() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowEndpointResource_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this DataflowEndpointResource + DataflowEndpointResourceCollection collection = instanceResource.GetDataflowEndpointResources(); + + // invoke the operation and iterate over the result + await foreach (DataflowEndpointResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowEndpointResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_DataflowEndpointGet() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_Get_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowEndpointResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this DataflowEndpointResource + DataflowEndpointResourceCollection collection = instanceResource.GetDataflowEndpointResources(); + + // invoke the operation + string dataflowEndpointName = "resource-name123"; + bool result = await collection.ExistsAsync(dataflowEndpointName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_DataflowEndpointGet() + { + // Generated from example definition: 2024-11-01/DataflowEndpoint_Get_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowEndpointResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this DataflowEndpointResource + DataflowEndpointResourceCollection collection = instanceResource.GetDataflowEndpointResources(); + + // invoke the operation + string dataflowEndpointName = "resource-name123"; + NullableResponse response = await collection.GetIfExistsAsync(dataflowEndpointName); + DataflowEndpointResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowEndpointResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_DataflowProfileResource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_DataflowProfileResource.cs new file mode 100644 index 000000000000..a511c9a04891 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_DataflowProfileResource.cs @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IoTOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IoTOperations.Samples +{ + public partial class Sample_DataflowProfileResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_DataflowProfileGet() + { + // Generated from example definition: 2024-11-01/DataflowProfile_Get_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowProfileResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowProfileResource created on azure + // for more information of creating DataflowProfileResource, please refer to the document of DataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + ResourceIdentifier dataflowProfileResourceId = DataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + DataflowProfileResource dataflowProfileResource = client.GetDataflowProfileResource(dataflowProfileResourceId); + + // invoke the operation + DataflowProfileResource result = await dataflowProfileResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowProfileResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DataflowProfileDelete() + { + // Generated from example definition: 2024-11-01/DataflowProfile_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowProfileResource_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowProfileResource created on azure + // for more information of creating DataflowProfileResource, please refer to the document of DataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + ResourceIdentifier dataflowProfileResourceId = DataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + DataflowProfileResource dataflowProfileResource = client.GetDataflowProfileResource(dataflowProfileResourceId); + + // invoke the operation + await dataflowProfileResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowProfileCreateOrUpdate() + { + // Generated from example definition: 2024-11-01/DataflowProfile_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowProfileResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowProfileResource created on azure + // for more information of creating DataflowProfileResource, please refer to the document of DataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + ResourceIdentifier dataflowProfileResourceId = DataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + DataflowProfileResource dataflowProfileResource = client.GetDataflowProfileResource(dataflowProfileResourceId); + + // invoke the operation + DataflowProfileResourceData data = new DataflowProfileResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowProfileProperties + { + Diagnostics = new ProfileDiagnostics + { + LogsLevel = "rnmwokumdmebpmfxxxzvvjfdywotav", + MetricsPrometheusPort = 7581, + }, + InstanceCount = 14, + }, + }; + ArmOperation lro = await dataflowProfileResource.UpdateAsync(WaitUntil.Completed, data); + DataflowProfileResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowProfileResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowProfileCreateOrUpdateMinimal() + { + // Generated from example definition: 2024-11-01/DataflowProfile_CreateOrUpdate_Minimal.json + // this example is just showing the usage of "DataflowProfileResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowProfileResource created on azure + // for more information of creating DataflowProfileResource, please refer to the document of DataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "aio-dataflowprofile"; + ResourceIdentifier dataflowProfileResourceId = DataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + DataflowProfileResource dataflowProfileResource = client.GetDataflowProfileResource(dataflowProfileResourceId); + + // invoke the operation + DataflowProfileResourceData data = new DataflowProfileResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowProfileProperties + { + InstanceCount = 1, + }, + }; + ArmOperation lro = await dataflowProfileResource.UpdateAsync(WaitUntil.Completed, data); + DataflowProfileResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowProfileResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowProfileCreateOrUpdateMulti() + { + // Generated from example definition: 2024-11-01/DataflowProfile_CreateOrUpdate_Multi.json + // this example is just showing the usage of "DataflowProfileResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowProfileResource created on azure + // for more information of creating DataflowProfileResource, please refer to the document of DataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "aio-dataflowprofile"; + ResourceIdentifier dataflowProfileResourceId = DataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + DataflowProfileResource dataflowProfileResource = client.GetDataflowProfileResource(dataflowProfileResourceId); + + // invoke the operation + DataflowProfileResourceData data = new DataflowProfileResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowProfileProperties + { + InstanceCount = 3, + }, + }; + ArmOperation lro = await dataflowProfileResource.UpdateAsync(WaitUntil.Completed, data); + DataflowProfileResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowProfileResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_DataflowProfileResourceCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_DataflowProfileResourceCollection.cs new file mode 100644 index 000000000000..643a0d2032fd --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_DataflowProfileResourceCollection.cs @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IoTOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IoTOperations.Samples +{ + public partial class Sample_DataflowProfileResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowProfileCreateOrUpdate() + { + // Generated from example definition: 2024-11-01/DataflowProfile_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowProfileResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this DataflowProfileResource + DataflowProfileResourceCollection collection = instanceResource.GetDataflowProfileResources(); + + // invoke the operation + string dataflowProfileName = "resource-name123"; + DataflowProfileResourceData data = new DataflowProfileResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowProfileProperties + { + Diagnostics = new ProfileDiagnostics + { + LogsLevel = "rnmwokumdmebpmfxxxzvvjfdywotav", + MetricsPrometheusPort = 7581, + }, + InstanceCount = 14, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowProfileName, data); + DataflowProfileResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowProfileResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowProfileCreateOrUpdateMinimal() + { + // Generated from example definition: 2024-11-01/DataflowProfile_CreateOrUpdate_Minimal.json + // this example is just showing the usage of "DataflowProfileResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this DataflowProfileResource + DataflowProfileResourceCollection collection = instanceResource.GetDataflowProfileResources(); + + // invoke the operation + string dataflowProfileName = "aio-dataflowprofile"; + DataflowProfileResourceData data = new DataflowProfileResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowProfileProperties + { + InstanceCount = 1, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowProfileName, data); + DataflowProfileResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowProfileResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowProfileCreateOrUpdateMulti() + { + // Generated from example definition: 2024-11-01/DataflowProfile_CreateOrUpdate_Multi.json + // this example is just showing the usage of "DataflowProfileResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this DataflowProfileResource + DataflowProfileResourceCollection collection = instanceResource.GetDataflowProfileResources(); + + // invoke the operation + string dataflowProfileName = "aio-dataflowprofile"; + DataflowProfileResourceData data = new DataflowProfileResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowProfileProperties + { + InstanceCount = 3, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowProfileName, data); + DataflowProfileResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowProfileResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_DataflowProfileGet() + { + // Generated from example definition: 2024-11-01/DataflowProfile_Get_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowProfileResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this DataflowProfileResource + DataflowProfileResourceCollection collection = instanceResource.GetDataflowProfileResources(); + + // invoke the operation + string dataflowProfileName = "resource-name123"; + DataflowProfileResource result = await collection.GetAsync(dataflowProfileName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowProfileResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_DataflowProfileListByResourceGroup() + { + // Generated from example definition: 2024-11-01/DataflowProfile_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowProfileResource_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this DataflowProfileResource + DataflowProfileResourceCollection collection = instanceResource.GetDataflowProfileResources(); + + // invoke the operation and iterate over the result + await foreach (DataflowProfileResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowProfileResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_DataflowProfileGet() + { + // Generated from example definition: 2024-11-01/DataflowProfile_Get_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowProfileResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this DataflowProfileResource + DataflowProfileResourceCollection collection = instanceResource.GetDataflowProfileResources(); + + // invoke the operation + string dataflowProfileName = "resource-name123"; + bool result = await collection.ExistsAsync(dataflowProfileName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_DataflowProfileGet() + { + // Generated from example definition: 2024-11-01/DataflowProfile_Get_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowProfileResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // get the collection of this DataflowProfileResource + DataflowProfileResourceCollection collection = instanceResource.GetDataflowProfileResources(); + + // invoke the operation + string dataflowProfileName = "resource-name123"; + NullableResponse response = await collection.GetIfExistsAsync(dataflowProfileName); + DataflowProfileResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowProfileResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_DataflowResource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_DataflowResource.cs new file mode 100644 index 000000000000..5007bdc68cb3 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_DataflowResource.cs @@ -0,0 +1,476 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IoTOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IoTOperations.Samples +{ + public partial class Sample_DataflowResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_DataflowGet() + { + // Generated from example definition: 2024-11-01/Dataflow_Get_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowResource created on azure + // for more information of creating DataflowResource, please refer to the document of DataflowResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + string dataflowName = "resource-name123"; + ResourceIdentifier dataflowResourceId = DataflowResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, dataflowName); + DataflowResource dataflowResource = client.GetDataflowResource(dataflowResourceId); + + // invoke the operation + DataflowResource result = await dataflowResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DataflowDelete() + { + // Generated from example definition: 2024-11-01/Dataflow_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowResource_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowResource created on azure + // for more information of creating DataflowResource, please refer to the document of DataflowResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + string dataflowName = "resource-name123"; + ResourceIdentifier dataflowResourceId = DataflowResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, dataflowName); + DataflowResource dataflowResource = client.GetDataflowResource(dataflowResourceId); + + // invoke the operation + await dataflowResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowCreateOrUpdateComplexContextualization() + { + // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_ComplexContextualization.json + // this example is just showing the usage of "DataflowResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowResource created on azure + // for more information of creating DataflowResource, please refer to the document of DataflowResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + string dataflowName = "aio-to-adx-contexualized"; + ResourceIdentifier dataflowResourceId = DataflowResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, dataflowName); + DataflowResource dataflowResource = client.GetDataflowResource(dataflowResourceId); + + // invoke the operation + DataflowResourceData data = new DataflowResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowProperties(new DataflowAction[] + { +new DataflowAction(OperationType.Source) +{ +Name = "source1", +SourceSettings = new DataflowSourceOperationSettings("aio-builtin-broker-endpoint", new string[]{"azure-iot-operations/data/thermostat"}), +}, +new DataflowAction(OperationType.BuiltInTransformation) +{ +Name = "transformation1", +BuiltInTransformationSettings = new DataflowBuiltInTransformationSettings +{ +Datasets = {new DataflowBuiltInTransformationDataset("quality", new string[]{"$source.country", "$context.country"}) +{ +Expression = "$1 == $2", +}}, +Map = {new DataflowBuiltInTransformationMap(new string[]{"*"}, "*"), new DataflowBuiltInTransformationMap(new string[]{"$context(quality).*"}, "enriched.*")}, +}, +}, +new DataflowAction(OperationType.Destination) +{ +Name = "destination1", +DestinationSettings = new DataflowDestinationOperationSettings("adx-endpoint", "mytable"), +} + }) + { + Mode = OperationalMode.Enabled, + }, + }; + ArmOperation lro = await dataflowResource.UpdateAsync(WaitUntil.Completed, data); + DataflowResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowCreateOrUpdateComplexEventHub() + { + // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_ComplexEventHub.json + // this example is just showing the usage of "DataflowResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowResource created on azure + // for more information of creating DataflowResource, please refer to the document of DataflowResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + string dataflowName = "aio-to-event-hub-transformed"; + ResourceIdentifier dataflowResourceId = DataflowResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, dataflowName); + DataflowResource dataflowResource = client.GetDataflowResource(dataflowResourceId); + + // invoke the operation + DataflowResourceData data = new DataflowResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowProperties(new DataflowAction[] + { +new DataflowAction(OperationType.Source) +{ +Name = "source1", +SourceSettings = new DataflowSourceOperationSettings("aio-builtin-broker-endpoint", new string[]{"azure-iot-operations/data/thermostat"}), +}, +new DataflowAction(OperationType.BuiltInTransformation) +{ +BuiltInTransformationSettings = new DataflowBuiltInTransformationSettings +{ +Filter = {new DataflowBuiltInTransformationFilter(new string[]{"temperature.Value", "\"Tag 10\".Value"}, "$1 > 9000 && $2 >= 8000")}, +Map = {new DataflowBuiltInTransformationMap(new string[]{"*"}, "*"), new DataflowBuiltInTransformationMap(new string[]{"temperature.Value", "\"Tag 10\".Value"}, "AvgTemp.Value") +{ +Expression = "($1+$2)/2", +}, new DataflowBuiltInTransformationMap(Array.Empty(), "dataflow-processed") +{ +Expression = "true", +}, new DataflowBuiltInTransformationMap(new string[]{"temperature.SourceTimestamp"}, "") +{ +Expression = "", +}, new DataflowBuiltInTransformationMap(new string[]{"\"Tag 10\""}, "pressure") +{ +Expression = "", +}, new DataflowBuiltInTransformationMap(new string[]{"temperature.Value"}, "temperatureF.Value") +{ +Expression = "cToF($1)", +}, new DataflowBuiltInTransformationMap(new string[]{"\"Tag 10\".Value"}, "\"Scale Tag 10\".Value") +{ +Expression = "scale ($1,0,10,0,100)", +}}, +}, +}, +new DataflowAction(OperationType.Destination) +{ +Name = "destination1", +DestinationSettings = new DataflowDestinationOperationSettings("event-hub-endpoint", "myuniqueeventhub"), +} + }) + { + Mode = OperationalMode.Enabled, + }, + }; + ArmOperation lro = await dataflowResource.UpdateAsync(WaitUntil.Completed, data); + DataflowResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowCreateOrUpdateFilterToTopic() + { + // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_FilterToTopic.json + // this example is just showing the usage of "DataflowResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowResource created on azure + // for more information of creating DataflowResource, please refer to the document of DataflowResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + string dataflowName = "mqtt-filter-to-topic"; + ResourceIdentifier dataflowResourceId = DataflowResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, dataflowName); + DataflowResource dataflowResource = client.GetDataflowResource(dataflowResourceId); + + // invoke the operation + DataflowResourceData data = new DataflowResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowProperties(new DataflowAction[] + { +new DataflowAction(OperationType.Source) +{ +Name = "source1", +SourceSettings = new DataflowSourceOperationSettings("aio-builtin-broker-endpoint", new string[]{"azure-iot-operations/data/thermostat"}), +}, +new DataflowAction(OperationType.BuiltInTransformation) +{ +Name = "transformation1", +BuiltInTransformationSettings = new DataflowBuiltInTransformationSettings +{ +Filter = {new DataflowBuiltInTransformationFilter(new string[]{"temperature.Value", "\"Tag 10\".Value"}, "$1 > 9000 && $2 >= 8000") +{ +Type = FilterType.Filter, +Description = "filter-datapoint", +}}, +Map = {new DataflowBuiltInTransformationMap(new string[]{"*"}, "*") +{ +Type = DataflowMappingType.PassThrough, +}}, +}, +}, +new DataflowAction(OperationType.Destination) +{ +Name = "destination1", +DestinationSettings = new DataflowDestinationOperationSettings("aio-builtin-broker-endpoint", "data/filtered/thermostat"), +} + }) + { + Mode = OperationalMode.Enabled, + }, + }; + ArmOperation lro = await dataflowResource.UpdateAsync(WaitUntil.Completed, data); + DataflowResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowCreateOrUpdate() + { + // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowResource created on azure + // for more information of creating DataflowResource, please refer to the document of DataflowResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + string dataflowName = "resource-name123"; + ResourceIdentifier dataflowResourceId = DataflowResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, dataflowName); + DataflowResource dataflowResource = client.GetDataflowResource(dataflowResourceId); + + // invoke the operation + DataflowResourceData data = new DataflowResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowProperties(new DataflowAction[] + { +new DataflowAction(OperationType.Source) +{ +Name = "knnafvkwoeakm", +SourceSettings = new DataflowSourceOperationSettings("iixotodhvhkkfcfyrkoveslqig", new string[]{"chkkpymxhp"}) +{ +AssetRef = "zayyykwmckaocywdkohmu", +SerializationFormat = SourceSerializationFormat.Json, +SchemaRef = "pknmdzqll", +}, +BuiltInTransformationSettings = new DataflowBuiltInTransformationSettings +{ +SerializationFormat = TransformationSerializationFormat.Delta, +SchemaRef = "mcdc", +Datasets = {new DataflowBuiltInTransformationDataset("qsfqcgxaxnhfumrsdsokwyv", new string[]{"mosffpsslifkq"}) +{ +Description = "Lorem ipsum odor amet, consectetuer adipiscing elit.", +SchemaRef = "n", +Expression = "aatbwomvflemsxialv", +}}, +Filter = {new DataflowBuiltInTransformationFilter(new string[]{"sxmjkbntgb"}, "n") +{ +Type = FilterType.Filter, +Description = "Lorem ipsum odor amet, consectetuer adipiscing elit.", +}}, +Map = {new DataflowBuiltInTransformationMap(new string[]{"xsbxuk"}, "nvgtmkfl") +{ +Type = DataflowMappingType.NewProperties, +Description = "Lorem ipsum odor amet, consectetuer adipiscing elit.", +Expression = "txoiltogsarwkzalsphvlmt", +}}, +}, +DestinationSettings = new DataflowDestinationOperationSettings("kybkchnzimerguekuvqlqiqdvvrt", "cbrh"), +} + }) + { + Mode = OperationalMode.Enabled, + }, + }; + ArmOperation lro = await dataflowResource.UpdateAsync(WaitUntil.Completed, data); + DataflowResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowCreateOrUpdateSimpleEventGrid() + { + // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_SimpleEventGrid.json + // this example is just showing the usage of "DataflowResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowResource created on azure + // for more information of creating DataflowResource, please refer to the document of DataflowResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + string dataflowName = "aio-to-event-grid"; + ResourceIdentifier dataflowResourceId = DataflowResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, dataflowName); + DataflowResource dataflowResource = client.GetDataflowResource(dataflowResourceId); + + // invoke the operation + DataflowResourceData data = new DataflowResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowProperties(new DataflowAction[] + { +new DataflowAction(OperationType.Source) +{ +Name = "source1", +SourceSettings = new DataflowSourceOperationSettings("aio-builtin-broker-endpoint", new string[]{"thermostats/+/telemetry/temperature/#"}), +}, +new DataflowAction(OperationType.Destination) +{ +Name = "destination1", +DestinationSettings = new DataflowDestinationOperationSettings("event-grid-endpoint", "factory/telemetry"), +} + }) + { + Mode = OperationalMode.Enabled, + }, + }; + ArmOperation lro = await dataflowResource.UpdateAsync(WaitUntil.Completed, data); + DataflowResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DataflowCreateOrUpdateSimpleFabric() + { + // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_SimpleFabric.json + // this example is just showing the usage of "DataflowResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowResource created on azure + // for more information of creating DataflowResource, please refer to the document of DataflowResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + string dataflowName = "aio-to-fabric"; + ResourceIdentifier dataflowResourceId = DataflowResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, dataflowName); + DataflowResource dataflowResource = client.GetDataflowResource(dataflowResourceId); + + // invoke the operation + DataflowResourceData data = new DataflowResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowProperties(new DataflowAction[] + { +new DataflowAction(OperationType.Source) +{ +Name = "source1", +SourceSettings = new DataflowSourceOperationSettings("aio-builtin-broker-endpoint", new string[]{"azure-iot-operations/data/thermostat"}), +}, +new DataflowAction(OperationType.BuiltInTransformation) +{ +BuiltInTransformationSettings = new DataflowBuiltInTransformationSettings +{ +SerializationFormat = TransformationSerializationFormat.Parquet, +SchemaRef = "aio-sr://exampleNamespace/exmapleParquetSchema:1.0.0", +}, +}, +new DataflowAction(OperationType.Destination) +{ +Name = "destination1", +DestinationSettings = new DataflowDestinationOperationSettings("fabric-endpoint", "telemetryTable"), +} + }) + { + Mode = OperationalMode.Enabled, + }, + }; + ArmOperation lro = await dataflowResource.UpdateAsync(WaitUntil.Completed, data); + DataflowResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_DataflowResourceCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_DataflowResourceCollection.cs new file mode 100644 index 000000000000..4e112e5b0ddc --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_DataflowResourceCollection.cs @@ -0,0 +1,580 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IoTOperations.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IoTOperations.Samples +{ + public partial class Sample_DataflowResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowCreateOrUpdateComplexContextualization() + { + // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_ComplexContextualization.json + // this example is just showing the usage of "DataflowResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowProfileResource created on azure + // for more information of creating DataflowProfileResource, please refer to the document of DataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + ResourceIdentifier dataflowProfileResourceId = DataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + DataflowProfileResource dataflowProfileResource = client.GetDataflowProfileResource(dataflowProfileResourceId); + + // get the collection of this DataflowResource + DataflowResourceCollection collection = dataflowProfileResource.GetDataflowResources(); + + // invoke the operation + string dataflowName = "aio-to-adx-contexualized"; + DataflowResourceData data = new DataflowResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowProperties(new DataflowAction[] + { +new DataflowAction(OperationType.Source) +{ +Name = "source1", +SourceSettings = new DataflowSourceOperationSettings("aio-builtin-broker-endpoint", new string[]{"azure-iot-operations/data/thermostat"}), +}, +new DataflowAction(OperationType.BuiltInTransformation) +{ +Name = "transformation1", +BuiltInTransformationSettings = new DataflowBuiltInTransformationSettings +{ +Datasets = {new DataflowBuiltInTransformationDataset("quality", new string[]{"$source.country", "$context.country"}) +{ +Expression = "$1 == $2", +}}, +Map = {new DataflowBuiltInTransformationMap(new string[]{"*"}, "*"), new DataflowBuiltInTransformationMap(new string[]{"$context(quality).*"}, "enriched.*")}, +}, +}, +new DataflowAction(OperationType.Destination) +{ +Name = "destination1", +DestinationSettings = new DataflowDestinationOperationSettings("adx-endpoint", "mytable"), +} + }) + { + Mode = OperationalMode.Enabled, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowName, data); + DataflowResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowCreateOrUpdateComplexEventHub() + { + // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_ComplexEventHub.json + // this example is just showing the usage of "DataflowResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowProfileResource created on azure + // for more information of creating DataflowProfileResource, please refer to the document of DataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + ResourceIdentifier dataflowProfileResourceId = DataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + DataflowProfileResource dataflowProfileResource = client.GetDataflowProfileResource(dataflowProfileResourceId); + + // get the collection of this DataflowResource + DataflowResourceCollection collection = dataflowProfileResource.GetDataflowResources(); + + // invoke the operation + string dataflowName = "aio-to-event-hub-transformed"; + DataflowResourceData data = new DataflowResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowProperties(new DataflowAction[] + { +new DataflowAction(OperationType.Source) +{ +Name = "source1", +SourceSettings = new DataflowSourceOperationSettings("aio-builtin-broker-endpoint", new string[]{"azure-iot-operations/data/thermostat"}), +}, +new DataflowAction(OperationType.BuiltInTransformation) +{ +BuiltInTransformationSettings = new DataflowBuiltInTransformationSettings +{ +Filter = {new DataflowBuiltInTransformationFilter(new string[]{"temperature.Value", "\"Tag 10\".Value"}, "$1 > 9000 && $2 >= 8000")}, +Map = {new DataflowBuiltInTransformationMap(new string[]{"*"}, "*"), new DataflowBuiltInTransformationMap(new string[]{"temperature.Value", "\"Tag 10\".Value"}, "AvgTemp.Value") +{ +Expression = "($1+$2)/2", +}, new DataflowBuiltInTransformationMap(Array.Empty(), "dataflow-processed") +{ +Expression = "true", +}, new DataflowBuiltInTransformationMap(new string[]{"temperature.SourceTimestamp"}, "") +{ +Expression = "", +}, new DataflowBuiltInTransformationMap(new string[]{"\"Tag 10\""}, "pressure") +{ +Expression = "", +}, new DataflowBuiltInTransformationMap(new string[]{"temperature.Value"}, "temperatureF.Value") +{ +Expression = "cToF($1)", +}, new DataflowBuiltInTransformationMap(new string[]{"\"Tag 10\".Value"}, "\"Scale Tag 10\".Value") +{ +Expression = "scale ($1,0,10,0,100)", +}}, +}, +}, +new DataflowAction(OperationType.Destination) +{ +Name = "destination1", +DestinationSettings = new DataflowDestinationOperationSettings("event-hub-endpoint", "myuniqueeventhub"), +} + }) + { + Mode = OperationalMode.Enabled, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowName, data); + DataflowResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowCreateOrUpdateFilterToTopic() + { + // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_FilterToTopic.json + // this example is just showing the usage of "DataflowResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowProfileResource created on azure + // for more information of creating DataflowProfileResource, please refer to the document of DataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + ResourceIdentifier dataflowProfileResourceId = DataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + DataflowProfileResource dataflowProfileResource = client.GetDataflowProfileResource(dataflowProfileResourceId); + + // get the collection of this DataflowResource + DataflowResourceCollection collection = dataflowProfileResource.GetDataflowResources(); + + // invoke the operation + string dataflowName = "mqtt-filter-to-topic"; + DataflowResourceData data = new DataflowResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowProperties(new DataflowAction[] + { +new DataflowAction(OperationType.Source) +{ +Name = "source1", +SourceSettings = new DataflowSourceOperationSettings("aio-builtin-broker-endpoint", new string[]{"azure-iot-operations/data/thermostat"}), +}, +new DataflowAction(OperationType.BuiltInTransformation) +{ +Name = "transformation1", +BuiltInTransformationSettings = new DataflowBuiltInTransformationSettings +{ +Filter = {new DataflowBuiltInTransformationFilter(new string[]{"temperature.Value", "\"Tag 10\".Value"}, "$1 > 9000 && $2 >= 8000") +{ +Type = FilterType.Filter, +Description = "filter-datapoint", +}}, +Map = {new DataflowBuiltInTransformationMap(new string[]{"*"}, "*") +{ +Type = DataflowMappingType.PassThrough, +}}, +}, +}, +new DataflowAction(OperationType.Destination) +{ +Name = "destination1", +DestinationSettings = new DataflowDestinationOperationSettings("aio-builtin-broker-endpoint", "data/filtered/thermostat"), +} + }) + { + Mode = OperationalMode.Enabled, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowName, data); + DataflowResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowCreateOrUpdate() + { + // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowProfileResource created on azure + // for more information of creating DataflowProfileResource, please refer to the document of DataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + ResourceIdentifier dataflowProfileResourceId = DataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + DataflowProfileResource dataflowProfileResource = client.GetDataflowProfileResource(dataflowProfileResourceId); + + // get the collection of this DataflowResource + DataflowResourceCollection collection = dataflowProfileResource.GetDataflowResources(); + + // invoke the operation + string dataflowName = "resource-name123"; + DataflowResourceData data = new DataflowResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowProperties(new DataflowAction[] + { +new DataflowAction(OperationType.Source) +{ +Name = "knnafvkwoeakm", +SourceSettings = new DataflowSourceOperationSettings("iixotodhvhkkfcfyrkoveslqig", new string[]{"chkkpymxhp"}) +{ +AssetRef = "zayyykwmckaocywdkohmu", +SerializationFormat = SourceSerializationFormat.Json, +SchemaRef = "pknmdzqll", +}, +BuiltInTransformationSettings = new DataflowBuiltInTransformationSettings +{ +SerializationFormat = TransformationSerializationFormat.Delta, +SchemaRef = "mcdc", +Datasets = {new DataflowBuiltInTransformationDataset("qsfqcgxaxnhfumrsdsokwyv", new string[]{"mosffpsslifkq"}) +{ +Description = "Lorem ipsum odor amet, consectetuer adipiscing elit.", +SchemaRef = "n", +Expression = "aatbwomvflemsxialv", +}}, +Filter = {new DataflowBuiltInTransformationFilter(new string[]{"sxmjkbntgb"}, "n") +{ +Type = FilterType.Filter, +Description = "Lorem ipsum odor amet, consectetuer adipiscing elit.", +}}, +Map = {new DataflowBuiltInTransformationMap(new string[]{"xsbxuk"}, "nvgtmkfl") +{ +Type = DataflowMappingType.NewProperties, +Description = "Lorem ipsum odor amet, consectetuer adipiscing elit.", +Expression = "txoiltogsarwkzalsphvlmt", +}}, +}, +DestinationSettings = new DataflowDestinationOperationSettings("kybkchnzimerguekuvqlqiqdvvrt", "cbrh"), +} + }) + { + Mode = OperationalMode.Enabled, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowName, data); + DataflowResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowCreateOrUpdateSimpleEventGrid() + { + // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_SimpleEventGrid.json + // this example is just showing the usage of "DataflowResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowProfileResource created on azure + // for more information of creating DataflowProfileResource, please refer to the document of DataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + ResourceIdentifier dataflowProfileResourceId = DataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + DataflowProfileResource dataflowProfileResource = client.GetDataflowProfileResource(dataflowProfileResourceId); + + // get the collection of this DataflowResource + DataflowResourceCollection collection = dataflowProfileResource.GetDataflowResources(); + + // invoke the operation + string dataflowName = "aio-to-event-grid"; + DataflowResourceData data = new DataflowResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowProperties(new DataflowAction[] + { +new DataflowAction(OperationType.Source) +{ +Name = "source1", +SourceSettings = new DataflowSourceOperationSettings("aio-builtin-broker-endpoint", new string[]{"thermostats/+/telemetry/temperature/#"}), +}, +new DataflowAction(OperationType.Destination) +{ +Name = "destination1", +DestinationSettings = new DataflowDestinationOperationSettings("event-grid-endpoint", "factory/telemetry"), +} + }) + { + Mode = OperationalMode.Enabled, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowName, data); + DataflowResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DataflowCreateOrUpdateSimpleFabric() + { + // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_SimpleFabric.json + // this example is just showing the usage of "DataflowResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowProfileResource created on azure + // for more information of creating DataflowProfileResource, please refer to the document of DataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + ResourceIdentifier dataflowProfileResourceId = DataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + DataflowProfileResource dataflowProfileResource = client.GetDataflowProfileResource(dataflowProfileResourceId); + + // get the collection of this DataflowResource + DataflowResourceCollection collection = dataflowProfileResource.GetDataflowResources(); + + // invoke the operation + string dataflowName = "aio-to-fabric"; + DataflowResourceData data = new DataflowResourceData(new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new DataflowProperties(new DataflowAction[] + { +new DataflowAction(OperationType.Source) +{ +Name = "source1", +SourceSettings = new DataflowSourceOperationSettings("aio-builtin-broker-endpoint", new string[]{"azure-iot-operations/data/thermostat"}), +}, +new DataflowAction(OperationType.BuiltInTransformation) +{ +BuiltInTransformationSettings = new DataflowBuiltInTransformationSettings +{ +SerializationFormat = TransformationSerializationFormat.Parquet, +SchemaRef = "aio-sr://exampleNamespace/exmapleParquetSchema:1.0.0", +}, +}, +new DataflowAction(OperationType.Destination) +{ +Name = "destination1", +DestinationSettings = new DataflowDestinationOperationSettings("fabric-endpoint", "telemetryTable"), +} + }) + { + Mode = OperationalMode.Enabled, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, dataflowName, data); + DataflowResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_DataflowGet() + { + // Generated from example definition: 2024-11-01/Dataflow_Get_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowProfileResource created on azure + // for more information of creating DataflowProfileResource, please refer to the document of DataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + ResourceIdentifier dataflowProfileResourceId = DataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + DataflowProfileResource dataflowProfileResource = client.GetDataflowProfileResource(dataflowProfileResourceId); + + // get the collection of this DataflowResource + DataflowResourceCollection collection = dataflowProfileResource.GetDataflowResources(); + + // invoke the operation + string dataflowName = "resource-name123"; + DataflowResource result = await collection.GetAsync(dataflowName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_DataflowListByProfileResource() + { + // Generated from example definition: 2024-11-01/Dataflow_ListByProfileResource_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowResource_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowProfileResource created on azure + // for more information of creating DataflowProfileResource, please refer to the document of DataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + ResourceIdentifier dataflowProfileResourceId = DataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + DataflowProfileResource dataflowProfileResource = client.GetDataflowProfileResource(dataflowProfileResourceId); + + // get the collection of this DataflowResource + DataflowResourceCollection collection = dataflowProfileResource.GetDataflowResources(); + + // invoke the operation and iterate over the result + await foreach (DataflowResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_DataflowGet() + { + // Generated from example definition: 2024-11-01/Dataflow_Get_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowProfileResource created on azure + // for more information of creating DataflowProfileResource, please refer to the document of DataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + ResourceIdentifier dataflowProfileResourceId = DataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + DataflowProfileResource dataflowProfileResource = client.GetDataflowProfileResource(dataflowProfileResourceId); + + // get the collection of this DataflowResource + DataflowResourceCollection collection = dataflowProfileResource.GetDataflowResources(); + + // invoke the operation + string dataflowName = "resource-name123"; + bool result = await collection.ExistsAsync(dataflowName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_DataflowGet() + { + // Generated from example definition: 2024-11-01/Dataflow_Get_MaximumSet_Gen.json + // this example is just showing the usage of "DataflowResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataflowProfileResource created on azure + // for more information of creating DataflowProfileResource, please refer to the document of DataflowProfileResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "resource-name123"; + string dataflowProfileName = "resource-name123"; + ResourceIdentifier dataflowProfileResourceId = DataflowProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + DataflowProfileResource dataflowProfileResource = client.GetDataflowProfileResource(dataflowProfileResourceId); + + // get the collection of this DataflowResource + DataflowResourceCollection collection = dataflowProfileResource.GetDataflowResources(); + + // invoke the operation + string dataflowName = "resource-name123"; + NullableResponse response = await collection.GetIfExistsAsync(dataflowName); + DataflowResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataflowResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_InstanceResource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_InstanceResource.cs new file mode 100644 index 000000000000..83313b99e954 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_InstanceResource.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IoTOperations.Models; +using Azure.ResourceManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.IoTOperations.Samples +{ + public partial class Sample_InstanceResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_InstanceGet() + { + // Generated from example definition: 2024-11-01/Instance_Get_MaximumSet_Gen.json + // this example is just showing the usage of "InstanceResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "aio-instance"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // invoke the operation + InstanceResource result = await instanceResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + InstanceResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_InstanceDelete() + { + // Generated from example definition: 2024-11-01/Instance_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "InstanceResource_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "aio-instance"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // invoke the operation + await instanceResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_InstanceUpdate() + { + // Generated from example definition: 2024-11-01/Instance_Update_MaximumSet_Gen.json + // this example is just showing the usage of "InstanceResource_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this InstanceResource created on azure + // for more information of creating InstanceResource, please refer to the document of InstanceResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + string instanceName = "aio-instance"; + ResourceIdentifier instanceResourceId = InstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instanceName); + InstanceResource instanceResource = client.GetInstanceResource(instanceResourceId); + + // invoke the operation + InstanceResourcePatch patch = new InstanceResourcePatch + { + Tags = { }, + Identity = new ManagedServiceIdentity("None") + { + UserAssignedIdentities = { }, + }, + }; + InstanceResource result = await instanceResource.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + InstanceResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_InstanceResourceCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_InstanceResourceCollection.cs new file mode 100644 index 000000000000..61f119d172c7 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_InstanceResourceCollection.cs @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.IoTOperations.Models; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.IoTOperations.Samples +{ + public partial class Sample_InstanceResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_InstanceCreateOrUpdate() + { + // Generated from example definition: 2024-11-01/Instance_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "InstanceResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this InstanceResource + InstanceResourceCollection collection = resourceGroupResource.GetInstanceResources(); + + // invoke the operation + string instanceName = "aio-instance"; + InstanceResourceData data = new InstanceResourceData(new AzureLocation("xvewadyhycrjpu"), new ExtendedLocation("qmbrfwcpwwhggszhrdjv", ExtendedLocationType.CustomLocation)) + { + Properties = new InstanceProperties(new SchemaRegistryRef(new ResourceIdentifier("/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.DeviceRegistry/schemaRegistries/resource-name123"))) + { + Description = "kpqtgocs", + }, + Identity = new ManagedServiceIdentity("None") + { + UserAssignedIdentities = { }, + }, + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, instanceName, data); + InstanceResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + InstanceResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_InstanceGet() + { + // Generated from example definition: 2024-11-01/Instance_Get_MaximumSet_Gen.json + // this example is just showing the usage of "InstanceResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this InstanceResource + InstanceResourceCollection collection = resourceGroupResource.GetInstanceResources(); + + // invoke the operation + string instanceName = "aio-instance"; + InstanceResource result = await collection.GetAsync(instanceName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + InstanceResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_InstanceListByResourceGroup() + { + // Generated from example definition: 2024-11-01/Instance_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "InstanceResource_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this InstanceResource + InstanceResourceCollection collection = resourceGroupResource.GetInstanceResources(); + + // invoke the operation and iterate over the result + await foreach (InstanceResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + InstanceResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_InstanceGet() + { + // Generated from example definition: 2024-11-01/Instance_Get_MaximumSet_Gen.json + // this example is just showing the usage of "InstanceResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this InstanceResource + InstanceResourceCollection collection = resourceGroupResource.GetInstanceResources(); + + // invoke the operation + string instanceName = "aio-instance"; + bool result = await collection.ExistsAsync(instanceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_InstanceGet() + { + // Generated from example definition: 2024-11-01/Instance_Get_MaximumSet_Gen.json + // this example is just showing the usage of "InstanceResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + string resourceGroupName = "rgiotoperations"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this InstanceResource + InstanceResourceCollection collection = resourceGroupResource.GetInstanceResources(); + + // invoke the operation + string instanceName = "aio-instance"; + NullableResponse response = await collection.GetIfExistsAsync(instanceName); + InstanceResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + InstanceResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..93f8bfdc7d44 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.IoTOperations.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetInstanceResources_InstanceListBySubscription() + { + // Generated from example definition: 2024-11-01/Instance_ListBySubscription_MaximumSet_Gen.json + // this example is just showing the usage of "InstanceResource_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "F8C729F9-DF9C-4743-848F-96EE433D8E53"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (InstanceResource item in subscriptionResource.GetInstanceResourcesAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + InstanceResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Azure.ResourceManager.IoTOperations.csproj b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Azure.ResourceManager.IoTOperations.csproj new file mode 100644 index 000000000000..cd7d5b645a95 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Azure.ResourceManager.IoTOperations.csproj @@ -0,0 +1,8 @@ + + + Azure Resource Manager client SDK for Azure resource provider IoTOperations. + 1.0.0-beta.1 + azure;management;arm;resource manager;iotoperations + Azure.ResourceManager.IoTOperations + + diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/ArmIoTOperationsModelFactory.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/ArmIoTOperationsModelFactory.cs new file mode 100644 index 000000000000..41abbbfc092c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/ArmIoTOperationsModelFactory.cs @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Model factory for models. + public static partial class ArmIoTOperationsModelFactory + { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// A new instance for mocking. + public static DataflowEndpointResourceData DataflowEndpointResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataflowEndpointProperties properties = null, ExtendedLocation extendedLocation = null) + { + return new DataflowEndpointResourceData( + id, + name, + resourceType, + systemData, + properties, + extendedLocation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Endpoint Type. + /// Azure Data Explorer endpoint. + /// Azure Data Lake endpoint. + /// Microsoft Fabric endpoint. + /// Kafka endpoint. + /// Local persistent volume endpoint. + /// Broker endpoint. + /// The status of the last operation. + /// A new instance for mocking. + public static DataflowEndpointProperties DataflowEndpointProperties(EndpointType endpointType = default, DataflowEndpointDataExplorer dataExplorerSettings = null, DataflowEndpointDataLakeStorage dataLakeStorageSettings = null, DataflowEndpointFabricOneLake fabricOneLakeSettings = null, DataflowEndpointKafka kafkaSettings = null, string localStoragePersistentVolumeClaimRef = null, DataflowEndpointMqtt mqttSettings = null, ProvisioningState? provisioningState = null) + { + return new DataflowEndpointProperties( + endpointType, + dataExplorerSettings, + dataLakeStorageSettings, + fabricOneLakeSettings, + kafkaSettings, + localStoragePersistentVolumeClaimRef != null ? new DataflowEndpointLocalStorage(localStoragePersistentVolumeClaimRef, serializedAdditionalRawData: null) : null, + mqttSettings, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// A new instance for mocking. + public static DataflowResourceData DataflowResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataflowProperties properties = null, ExtendedLocation extendedLocation = null) + { + return new DataflowResourceData( + id, + name, + resourceType, + systemData, + properties, + extendedLocation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Mode for Dataflow. Optional; defaults to Enabled. + /// List of operations including source and destination references as well as transformation. + /// The status of the last operation. + /// A new instance for mocking. + public static DataflowProperties DataflowProperties(OperationalMode? mode = null, IEnumerable operations = null, ProvisioningState? provisioningState = null) + { + operations ??= new List(); + + return new DataflowProperties(mode, operations?.ToList(), provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// A new instance for mocking. + public static DataflowProfileResourceData DataflowProfileResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataflowProfileProperties properties = null, ExtendedLocation extendedLocation = null) + { + return new DataflowProfileResourceData( + id, + name, + resourceType, + systemData, + properties, + extendedLocation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Spec defines the desired identities of NBC diagnostics settings. + /// To manually scale the dataflow profile, specify the maximum number of instances you want to run. + /// The status of the last operation. + /// A new instance for mocking. + public static DataflowProfileProperties DataflowProfileProperties(ProfileDiagnostics diagnostics = null, int? instanceCount = null, ProvisioningState? provisioningState = null) + { + return new DataflowProfileProperties(diagnostics, instanceCount, provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// A new instance for mocking. + public static BrokerAuthorizationResourceData BrokerAuthorizationResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, BrokerAuthorizationProperties properties = null, ExtendedLocation extendedLocation = null) + { + return new BrokerAuthorizationResourceData( + id, + name, + resourceType, + systemData, + properties, + extendedLocation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The list of authorization policies supported by the Authorization Resource. + /// The status of the last operation. + /// A new instance for mocking. + public static BrokerAuthorizationProperties BrokerAuthorizationProperties(AuthorizationConfig authorizationPolicies = null, ProvisioningState? provisioningState = null) + { + return new BrokerAuthorizationProperties(authorizationPolicies, provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// A new instance for mocking. + public static BrokerAuthenticationResourceData BrokerAuthenticationResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, BrokerAuthenticationProperties properties = null, ExtendedLocation extendedLocation = null) + { + return new BrokerAuthenticationResourceData( + id, + name, + resourceType, + systemData, + properties, + extendedLocation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Defines a set of Broker authentication methods to be used on `BrokerListeners`. For each array element one authenticator type supported. + /// The status of the last operation. + /// A new instance for mocking. + public static BrokerAuthenticationProperties BrokerAuthenticationProperties(IEnumerable authenticationMethods = null, ProvisioningState? provisioningState = null) + { + authenticationMethods ??= new List(); + + return new BrokerAuthenticationProperties(authenticationMethods?.ToList(), provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// A new instance for mocking. + public static BrokerListenerResourceData BrokerListenerResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, BrokerListenerProperties properties = null, ExtendedLocation extendedLocation = null) + { + return new BrokerListenerResourceData( + id, + name, + resourceType, + systemData, + properties, + extendedLocation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Kubernetes Service name of this listener. + /// Ports on which this listener accepts client connections. + /// Kubernetes Service type of this listener. + /// The status of the last operation. + /// A new instance for mocking. + public static BrokerListenerProperties BrokerListenerProperties(string serviceName = null, IEnumerable ports = null, ServiceType? serviceType = null, ProvisioningState? provisioningState = null) + { + ports ??= new List(); + + return new BrokerListenerProperties(serviceName, ports?.ToList(), serviceType, provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// A new instance for mocking. + public static BrokerResourceData BrokerResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, BrokerProperties properties = null, ExtendedLocation extendedLocation = null) + { + return new BrokerResourceData( + id, + name, + resourceType, + systemData, + properties, + extendedLocation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Advanced settings of Broker. + /// The cardinality details of the broker. + /// Spec defines the desired identities of Broker diagnostics settings. + /// Settings of Disk Backed Message Buffer. + /// This setting controls whether Kubernetes CPU resource limits are requested. Increasing the number of replicas or workers proportionally increases the amount of CPU resources requested. If this setting is enabled and there are insufficient CPU resources, an error will be emitted. + /// Memory profile of Broker. + /// The status of the last operation. + /// A new instance for mocking. + public static BrokerProperties BrokerProperties(AdvancedSettings advanced = null, Cardinality cardinality = null, BrokerDiagnostics diagnostics = null, DiskBackedMessageBuffer diskBackedMessageBuffer = null, OperationalMode? generateResourceLimitsCpu = null, BrokerMemoryProfile? memoryProfile = null, ProvisioningState? provisioningState = null) + { + return new BrokerProperties( + advanced, + cardinality, + diagnostics, + diskBackedMessageBuffer, + generateResourceLimitsCpu != null ? new GenerateResourceLimits(generateResourceLimitsCpu, serializedAdditionalRawData: null) : null, + memoryProfile, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// The managed service identities assigned to this resource. + /// A new instance for mocking. + public static InstanceResourceData InstanceResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, InstanceProperties properties = null, ExtendedLocation extendedLocation = null, ManagedServiceIdentity identity = null) + { + tags ??= new Dictionary(); + + return new InstanceResourceData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + extendedLocation, + identity, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Detailed description of the Instance. + /// The status of the last operation. + /// The Azure IoT Operations version. + /// The reference to the Schema Registry for this AIO Instance. + /// A new instance for mocking. + public static InstanceProperties InstanceProperties(string description = null, ProvisioningState? provisioningState = null, string version = null, ResourceIdentifier schemaRegistryRefResourceId = null) + { + return new InstanceProperties(description, provisioningState, version, schemaRegistryRefResourceId != null ? new SchemaRegistryRef(schemaRegistryRefResourceId, serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResource.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResource.Serialization.cs new file mode 100644 index 000000000000..d5475abe9159 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.IoTOperations +{ + public partial class BrokerAuthenticationResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + BrokerAuthenticationResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + BrokerAuthenticationResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResource.cs new file mode 100644 index 000000000000..591b603fc5cc --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResource.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IoTOperations +{ + /// + /// A Class representing a BrokerAuthenticationResource along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetBrokerAuthenticationResource method. + /// Otherwise you can get one from its parent resource using the GetBrokerAuthenticationResource method. + /// + public partial class BrokerAuthenticationResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The instanceName. + /// The brokerName. + /// The authenticationName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics; + private readonly BrokerAuthenticationRestOperations _brokerAuthenticationResourceBrokerAuthenticationRestClient; + private readonly BrokerAuthenticationResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.IoTOperations/instances/brokers/authentications"; + + /// Initializes a new instance of the class for mocking. + protected BrokerAuthenticationResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal BrokerAuthenticationResource(ArmClient client, BrokerAuthenticationResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal BrokerAuthenticationResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IoTOperations", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string brokerAuthenticationResourceBrokerAuthenticationApiVersion); + _brokerAuthenticationResourceBrokerAuthenticationRestClient = new BrokerAuthenticationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, brokerAuthenticationResourceBrokerAuthenticationApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual BrokerAuthenticationResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a BrokerAuthenticationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics.CreateScope("BrokerAuthenticationResource.Get"); + scope.Start(); + try + { + var response = await _brokerAuthenticationResourceBrokerAuthenticationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BrokerAuthenticationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BrokerAuthenticationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics.CreateScope("BrokerAuthenticationResource.Get"); + scope.Start(); + try + { + var response = _brokerAuthenticationResourceBrokerAuthenticationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BrokerAuthenticationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a BrokerAuthenticationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics.CreateScope("BrokerAuthenticationResource.Delete"); + scope.Start(); + try + { + var response = await _brokerAuthenticationResourceBrokerAuthenticationRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new IoTOperationsArmOperation(_brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics, Pipeline, _brokerAuthenticationResourceBrokerAuthenticationRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a BrokerAuthenticationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics.CreateScope("BrokerAuthenticationResource.Delete"); + scope.Start(); + try + { + var response = _brokerAuthenticationResourceBrokerAuthenticationRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new IoTOperationsArmOperation(_brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics, Pipeline, _brokerAuthenticationResourceBrokerAuthenticationRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a BrokerAuthenticationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, BrokerAuthenticationResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics.CreateScope("BrokerAuthenticationResource.Update"); + scope.Start(); + try + { + var response = await _brokerAuthenticationResourceBrokerAuthenticationRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new IoTOperationsArmOperation(new BrokerAuthenticationResourceOperationSource(Client), _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics, Pipeline, _brokerAuthenticationResourceBrokerAuthenticationRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a BrokerAuthenticationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, BrokerAuthenticationResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics.CreateScope("BrokerAuthenticationResource.Update"); + scope.Start(); + try + { + var response = _brokerAuthenticationResourceBrokerAuthenticationRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new IoTOperationsArmOperation(new BrokerAuthenticationResourceOperationSource(Client), _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics, Pipeline, _brokerAuthenticationResourceBrokerAuthenticationRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResourceCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResourceCollection.cs new file mode 100644 index 000000000000..94848cfa4f33 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResourceCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IoTOperations +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetBrokerAuthenticationResources method from an instance of . + /// + public partial class BrokerAuthenticationResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics; + private readonly BrokerAuthenticationRestOperations _brokerAuthenticationResourceBrokerAuthenticationRestClient; + + /// Initializes a new instance of the class for mocking. + protected BrokerAuthenticationResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal BrokerAuthenticationResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IoTOperations", BrokerAuthenticationResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(BrokerAuthenticationResource.ResourceType, out string brokerAuthenticationResourceBrokerAuthenticationApiVersion); + _brokerAuthenticationResourceBrokerAuthenticationRestClient = new BrokerAuthenticationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, brokerAuthenticationResourceBrokerAuthenticationApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != BrokerResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, BrokerResource.ResourceType), nameof(id)); + } + + /// + /// Create a BrokerAuthenticationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of Instance broker authentication resource. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string authenticationName, BrokerAuthenticationResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics.CreateScope("BrokerAuthenticationResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _brokerAuthenticationResourceBrokerAuthenticationRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, data, cancellationToken).ConfigureAwait(false); + var operation = new IoTOperationsArmOperation(new BrokerAuthenticationResourceOperationSource(Client), _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics, Pipeline, _brokerAuthenticationResourceBrokerAuthenticationRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a BrokerAuthenticationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of Instance broker authentication resource. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string authenticationName, BrokerAuthenticationResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics.CreateScope("BrokerAuthenticationResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _brokerAuthenticationResourceBrokerAuthenticationRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, data, cancellationToken); + var operation = new IoTOperationsArmOperation(new BrokerAuthenticationResourceOperationSource(Client), _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics, Pipeline, _brokerAuthenticationResourceBrokerAuthenticationRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BrokerAuthenticationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authentication resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string authenticationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName)); + + using var scope = _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics.CreateScope("BrokerAuthenticationResourceCollection.Get"); + scope.Start(); + try + { + var response = await _brokerAuthenticationResourceBrokerAuthenticationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BrokerAuthenticationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BrokerAuthenticationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authentication resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string authenticationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName)); + + using var scope = _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics.CreateScope("BrokerAuthenticationResourceCollection.Get"); + scope.Start(); + try + { + var response = _brokerAuthenticationResourceBrokerAuthenticationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BrokerAuthenticationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List BrokerAuthenticationResource resources by BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _brokerAuthenticationResourceBrokerAuthenticationRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _brokerAuthenticationResourceBrokerAuthenticationRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BrokerAuthenticationResource(Client, BrokerAuthenticationResourceData.DeserializeBrokerAuthenticationResourceData(e)), _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics, Pipeline, "BrokerAuthenticationResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List BrokerAuthenticationResource resources by BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _brokerAuthenticationResourceBrokerAuthenticationRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _brokerAuthenticationResourceBrokerAuthenticationRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BrokerAuthenticationResource(Client, BrokerAuthenticationResourceData.DeserializeBrokerAuthenticationResourceData(e)), _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics, Pipeline, "BrokerAuthenticationResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authentication resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string authenticationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName)); + + using var scope = _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics.CreateScope("BrokerAuthenticationResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _brokerAuthenticationResourceBrokerAuthenticationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authentication resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string authenticationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName)); + + using var scope = _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics.CreateScope("BrokerAuthenticationResourceCollection.Exists"); + scope.Start(); + try + { + var response = _brokerAuthenticationResourceBrokerAuthenticationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authentication resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string authenticationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName)); + + using var scope = _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics.CreateScope("BrokerAuthenticationResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _brokerAuthenticationResourceBrokerAuthenticationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new BrokerAuthenticationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authentication resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string authenticationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName)); + + using var scope = _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics.CreateScope("BrokerAuthenticationResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _brokerAuthenticationResourceBrokerAuthenticationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new BrokerAuthenticationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResourceData.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResourceData.Serialization.cs new file mode 100644 index 000000000000..c5a83019543b --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResourceData.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.IoTOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IoTOperations +{ + public partial class BrokerAuthenticationResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticationResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + writer.WritePropertyName("extendedLocation"u8); + writer.WriteObjectValue(ExtendedLocation, options); + } + + BrokerAuthenticationResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticationResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerAuthenticationResourceData(document.RootElement, options); + } + + internal static BrokerAuthenticationResourceData DeserializeBrokerAuthenticationResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BrokerAuthenticationProperties properties = default; + ExtendedLocation extendedLocation = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = BrokerAuthenticationProperties.DeserializeBrokerAuthenticationProperties(property.Value, options); + continue; + } + if (property.NameEquals("extendedLocation"u8)) + { + extendedLocation = ExtendedLocation.DeserializeExtendedLocation(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerAuthenticationResourceData( + id, + name, + type, + systemData, + properties, + extendedLocation, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerAuthenticationResourceData)} does not support writing '{options.Format}' format."); + } + } + + BrokerAuthenticationResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerAuthenticationResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerAuthenticationResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResourceData.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResourceData.cs new file mode 100644 index 000000000000..7b6ef1b609e1 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResourceData.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.IoTOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IoTOperations +{ + /// + /// A class representing the BrokerAuthenticationResource data model. + /// Instance broker authentication resource + /// + public partial class BrokerAuthenticationResourceData : ResourceData + { + /// + /// 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; + + /// Initializes a new instance of . + /// Edge location of the resource. + /// is null. + public BrokerAuthenticationResourceData(ExtendedLocation extendedLocation) + { + Argument.AssertNotNull(extendedLocation, nameof(extendedLocation)); + + ExtendedLocation = extendedLocation; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// Keeps track of any properties unknown to the library. + internal BrokerAuthenticationResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, BrokerAuthenticationProperties properties, ExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + ExtendedLocation = extendedLocation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerAuthenticationResourceData() + { + } + + /// The resource-specific properties for this resource. + public BrokerAuthenticationProperties Properties { get; set; } + /// Edge location of the resource. + public ExtendedLocation ExtendedLocation { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResource.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResource.Serialization.cs new file mode 100644 index 000000000000..ee32487ae044 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.IoTOperations +{ + public partial class BrokerAuthorizationResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + BrokerAuthorizationResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + BrokerAuthorizationResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResource.cs new file mode 100644 index 000000000000..58610983e2c1 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResource.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IoTOperations +{ + /// + /// A Class representing a BrokerAuthorizationResource along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetBrokerAuthorizationResource method. + /// Otherwise you can get one from its parent resource using the GetBrokerAuthorizationResource method. + /// + public partial class BrokerAuthorizationResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The instanceName. + /// The brokerName. + /// The authorizationName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics; + private readonly BrokerAuthorizationRestOperations _brokerAuthorizationResourceBrokerAuthorizationRestClient; + private readonly BrokerAuthorizationResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.IoTOperations/instances/brokers/authorizations"; + + /// Initializes a new instance of the class for mocking. + protected BrokerAuthorizationResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal BrokerAuthorizationResource(ArmClient client, BrokerAuthorizationResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal BrokerAuthorizationResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IoTOperations", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string brokerAuthorizationResourceBrokerAuthorizationApiVersion); + _brokerAuthorizationResourceBrokerAuthorizationRestClient = new BrokerAuthorizationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, brokerAuthorizationResourceBrokerAuthorizationApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual BrokerAuthorizationResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a BrokerAuthorizationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics.CreateScope("BrokerAuthorizationResource.Get"); + scope.Start(); + try + { + var response = await _brokerAuthorizationResourceBrokerAuthorizationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BrokerAuthorizationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BrokerAuthorizationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics.CreateScope("BrokerAuthorizationResource.Get"); + scope.Start(); + try + { + var response = _brokerAuthorizationResourceBrokerAuthorizationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BrokerAuthorizationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a BrokerAuthorizationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics.CreateScope("BrokerAuthorizationResource.Delete"); + scope.Start(); + try + { + var response = await _brokerAuthorizationResourceBrokerAuthorizationRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new IoTOperationsArmOperation(_brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics, Pipeline, _brokerAuthorizationResourceBrokerAuthorizationRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a BrokerAuthorizationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics.CreateScope("BrokerAuthorizationResource.Delete"); + scope.Start(); + try + { + var response = _brokerAuthorizationResourceBrokerAuthorizationRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new IoTOperationsArmOperation(_brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics, Pipeline, _brokerAuthorizationResourceBrokerAuthorizationRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a BrokerAuthorizationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, BrokerAuthorizationResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics.CreateScope("BrokerAuthorizationResource.Update"); + scope.Start(); + try + { + var response = await _brokerAuthorizationResourceBrokerAuthorizationRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new IoTOperationsArmOperation(new BrokerAuthorizationResourceOperationSource(Client), _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics, Pipeline, _brokerAuthorizationResourceBrokerAuthorizationRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a BrokerAuthorizationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, BrokerAuthorizationResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics.CreateScope("BrokerAuthorizationResource.Update"); + scope.Start(); + try + { + var response = _brokerAuthorizationResourceBrokerAuthorizationRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new IoTOperationsArmOperation(new BrokerAuthorizationResourceOperationSource(Client), _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics, Pipeline, _brokerAuthorizationResourceBrokerAuthorizationRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResourceCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResourceCollection.cs new file mode 100644 index 000000000000..ebd5264c0151 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResourceCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IoTOperations +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetBrokerAuthorizationResources method from an instance of . + /// + public partial class BrokerAuthorizationResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics; + private readonly BrokerAuthorizationRestOperations _brokerAuthorizationResourceBrokerAuthorizationRestClient; + + /// Initializes a new instance of the class for mocking. + protected BrokerAuthorizationResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal BrokerAuthorizationResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IoTOperations", BrokerAuthorizationResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(BrokerAuthorizationResource.ResourceType, out string brokerAuthorizationResourceBrokerAuthorizationApiVersion); + _brokerAuthorizationResourceBrokerAuthorizationRestClient = new BrokerAuthorizationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, brokerAuthorizationResourceBrokerAuthorizationApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != BrokerResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, BrokerResource.ResourceType), nameof(id)); + } + + /// + /// Create a BrokerAuthorizationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of Instance broker authorization resource. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string authorizationName, BrokerAuthorizationResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics.CreateScope("BrokerAuthorizationResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _brokerAuthorizationResourceBrokerAuthorizationRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, data, cancellationToken).ConfigureAwait(false); + var operation = new IoTOperationsArmOperation(new BrokerAuthorizationResourceOperationSource(Client), _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics, Pipeline, _brokerAuthorizationResourceBrokerAuthorizationRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a BrokerAuthorizationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of Instance broker authorization resource. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string authorizationName, BrokerAuthorizationResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics.CreateScope("BrokerAuthorizationResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _brokerAuthorizationResourceBrokerAuthorizationRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, data, cancellationToken); + var operation = new IoTOperationsArmOperation(new BrokerAuthorizationResourceOperationSource(Client), _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics, Pipeline, _brokerAuthorizationResourceBrokerAuthorizationRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BrokerAuthorizationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authorization resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string authorizationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName)); + + using var scope = _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics.CreateScope("BrokerAuthorizationResourceCollection.Get"); + scope.Start(); + try + { + var response = await _brokerAuthorizationResourceBrokerAuthorizationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BrokerAuthorizationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BrokerAuthorizationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authorization resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string authorizationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName)); + + using var scope = _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics.CreateScope("BrokerAuthorizationResourceCollection.Get"); + scope.Start(); + try + { + var response = _brokerAuthorizationResourceBrokerAuthorizationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BrokerAuthorizationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List BrokerAuthorizationResource resources by BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _brokerAuthorizationResourceBrokerAuthorizationRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _brokerAuthorizationResourceBrokerAuthorizationRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BrokerAuthorizationResource(Client, BrokerAuthorizationResourceData.DeserializeBrokerAuthorizationResourceData(e)), _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics, Pipeline, "BrokerAuthorizationResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List BrokerAuthorizationResource resources by BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _brokerAuthorizationResourceBrokerAuthorizationRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _brokerAuthorizationResourceBrokerAuthorizationRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BrokerAuthorizationResource(Client, BrokerAuthorizationResourceData.DeserializeBrokerAuthorizationResourceData(e)), _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics, Pipeline, "BrokerAuthorizationResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authorization resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string authorizationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName)); + + using var scope = _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics.CreateScope("BrokerAuthorizationResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _brokerAuthorizationResourceBrokerAuthorizationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authorization resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string authorizationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName)); + + using var scope = _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics.CreateScope("BrokerAuthorizationResourceCollection.Exists"); + scope.Start(); + try + { + var response = _brokerAuthorizationResourceBrokerAuthorizationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authorization resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string authorizationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName)); + + using var scope = _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics.CreateScope("BrokerAuthorizationResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _brokerAuthorizationResourceBrokerAuthorizationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new BrokerAuthorizationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authorization resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string authorizationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName)); + + using var scope = _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics.CreateScope("BrokerAuthorizationResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _brokerAuthorizationResourceBrokerAuthorizationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new BrokerAuthorizationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResourceData.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResourceData.Serialization.cs new file mode 100644 index 000000000000..58c713cf6349 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResourceData.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.IoTOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IoTOperations +{ + public partial class BrokerAuthorizationResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthorizationResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + writer.WritePropertyName("extendedLocation"u8); + writer.WriteObjectValue(ExtendedLocation, options); + } + + BrokerAuthorizationResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthorizationResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerAuthorizationResourceData(document.RootElement, options); + } + + internal static BrokerAuthorizationResourceData DeserializeBrokerAuthorizationResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BrokerAuthorizationProperties properties = default; + ExtendedLocation extendedLocation = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = BrokerAuthorizationProperties.DeserializeBrokerAuthorizationProperties(property.Value, options); + continue; + } + if (property.NameEquals("extendedLocation"u8)) + { + extendedLocation = ExtendedLocation.DeserializeExtendedLocation(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerAuthorizationResourceData( + id, + name, + type, + systemData, + properties, + extendedLocation, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerAuthorizationResourceData)} does not support writing '{options.Format}' format."); + } + } + + BrokerAuthorizationResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerAuthorizationResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerAuthorizationResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResourceData.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResourceData.cs new file mode 100644 index 000000000000..006a048e3b06 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResourceData.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.IoTOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IoTOperations +{ + /// + /// A class representing the BrokerAuthorizationResource data model. + /// Instance broker authorizations resource + /// + public partial class BrokerAuthorizationResourceData : ResourceData + { + /// + /// 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; + + /// Initializes a new instance of . + /// Edge location of the resource. + /// is null. + public BrokerAuthorizationResourceData(ExtendedLocation extendedLocation) + { + Argument.AssertNotNull(extendedLocation, nameof(extendedLocation)); + + ExtendedLocation = extendedLocation; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// Keeps track of any properties unknown to the library. + internal BrokerAuthorizationResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, BrokerAuthorizationProperties properties, ExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + ExtendedLocation = extendedLocation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerAuthorizationResourceData() + { + } + + /// The resource-specific properties for this resource. + public BrokerAuthorizationProperties Properties { get; set; } + /// Edge location of the resource. + public ExtendedLocation ExtendedLocation { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResource.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResource.Serialization.cs new file mode 100644 index 000000000000..e2cf75c6f20f --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.IoTOperations +{ + public partial class BrokerListenerResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + BrokerListenerResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + BrokerListenerResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResource.cs new file mode 100644 index 000000000000..8fed3027791e --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResource.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IoTOperations +{ + /// + /// A Class representing a BrokerListenerResource along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetBrokerListenerResource method. + /// Otherwise you can get one from its parent resource using the GetBrokerListenerResource method. + /// + public partial class BrokerListenerResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The instanceName. + /// The brokerName. + /// The listenerName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _brokerListenerResourceBrokerListenerClientDiagnostics; + private readonly BrokerListenerRestOperations _brokerListenerResourceBrokerListenerRestClient; + private readonly BrokerListenerResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.IoTOperations/instances/brokers/listeners"; + + /// Initializes a new instance of the class for mocking. + protected BrokerListenerResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal BrokerListenerResource(ArmClient client, BrokerListenerResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal BrokerListenerResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _brokerListenerResourceBrokerListenerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IoTOperations", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string brokerListenerResourceBrokerListenerApiVersion); + _brokerListenerResourceBrokerListenerRestClient = new BrokerListenerRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, brokerListenerResourceBrokerListenerApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual BrokerListenerResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a BrokerListenerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _brokerListenerResourceBrokerListenerClientDiagnostics.CreateScope("BrokerListenerResource.Get"); + scope.Start(); + try + { + var response = await _brokerListenerResourceBrokerListenerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BrokerListenerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BrokerListenerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _brokerListenerResourceBrokerListenerClientDiagnostics.CreateScope("BrokerListenerResource.Get"); + scope.Start(); + try + { + var response = _brokerListenerResourceBrokerListenerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BrokerListenerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a BrokerListenerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _brokerListenerResourceBrokerListenerClientDiagnostics.CreateScope("BrokerListenerResource.Delete"); + scope.Start(); + try + { + var response = await _brokerListenerResourceBrokerListenerRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new IoTOperationsArmOperation(_brokerListenerResourceBrokerListenerClientDiagnostics, Pipeline, _brokerListenerResourceBrokerListenerRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a BrokerListenerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _brokerListenerResourceBrokerListenerClientDiagnostics.CreateScope("BrokerListenerResource.Delete"); + scope.Start(); + try + { + var response = _brokerListenerResourceBrokerListenerRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new IoTOperationsArmOperation(_brokerListenerResourceBrokerListenerClientDiagnostics, Pipeline, _brokerListenerResourceBrokerListenerRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a BrokerListenerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, BrokerListenerResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _brokerListenerResourceBrokerListenerClientDiagnostics.CreateScope("BrokerListenerResource.Update"); + scope.Start(); + try + { + var response = await _brokerListenerResourceBrokerListenerRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new IoTOperationsArmOperation(new BrokerListenerResourceOperationSource(Client), _brokerListenerResourceBrokerListenerClientDiagnostics, Pipeline, _brokerListenerResourceBrokerListenerRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a BrokerListenerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, BrokerListenerResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _brokerListenerResourceBrokerListenerClientDiagnostics.CreateScope("BrokerListenerResource.Update"); + scope.Start(); + try + { + var response = _brokerListenerResourceBrokerListenerRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new IoTOperationsArmOperation(new BrokerListenerResourceOperationSource(Client), _brokerListenerResourceBrokerListenerClientDiagnostics, Pipeline, _brokerListenerResourceBrokerListenerRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResourceCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResourceCollection.cs new file mode 100644 index 000000000000..487cfe41b51a --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResourceCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IoTOperations +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetBrokerListenerResources method from an instance of . + /// + public partial class BrokerListenerResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _brokerListenerResourceBrokerListenerClientDiagnostics; + private readonly BrokerListenerRestOperations _brokerListenerResourceBrokerListenerRestClient; + + /// Initializes a new instance of the class for mocking. + protected BrokerListenerResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal BrokerListenerResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _brokerListenerResourceBrokerListenerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IoTOperations", BrokerListenerResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(BrokerListenerResource.ResourceType, out string brokerListenerResourceBrokerListenerApiVersion); + _brokerListenerResourceBrokerListenerRestClient = new BrokerListenerRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, brokerListenerResourceBrokerListenerApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != BrokerResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, BrokerResource.ResourceType), nameof(id)); + } + + /// + /// Create a BrokerListenerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of Instance broker listener resource. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string listenerName, BrokerListenerResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _brokerListenerResourceBrokerListenerClientDiagnostics.CreateScope("BrokerListenerResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _brokerListenerResourceBrokerListenerRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, data, cancellationToken).ConfigureAwait(false); + var operation = new IoTOperationsArmOperation(new BrokerListenerResourceOperationSource(Client), _brokerListenerResourceBrokerListenerClientDiagnostics, Pipeline, _brokerListenerResourceBrokerListenerRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a BrokerListenerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of Instance broker listener resource. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string listenerName, BrokerListenerResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _brokerListenerResourceBrokerListenerClientDiagnostics.CreateScope("BrokerListenerResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _brokerListenerResourceBrokerListenerRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, data, cancellationToken); + var operation = new IoTOperationsArmOperation(new BrokerListenerResourceOperationSource(Client), _brokerListenerResourceBrokerListenerClientDiagnostics, Pipeline, _brokerListenerResourceBrokerListenerRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BrokerListenerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker listener resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string listenerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName)); + + using var scope = _brokerListenerResourceBrokerListenerClientDiagnostics.CreateScope("BrokerListenerResourceCollection.Get"); + scope.Start(); + try + { + var response = await _brokerListenerResourceBrokerListenerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BrokerListenerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BrokerListenerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker listener resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string listenerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName)); + + using var scope = _brokerListenerResourceBrokerListenerClientDiagnostics.CreateScope("BrokerListenerResourceCollection.Get"); + scope.Start(); + try + { + var response = _brokerListenerResourceBrokerListenerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BrokerListenerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List BrokerListenerResource resources by BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners + /// + /// + /// Operation Id + /// BrokerListenerResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _brokerListenerResourceBrokerListenerRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _brokerListenerResourceBrokerListenerRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BrokerListenerResource(Client, BrokerListenerResourceData.DeserializeBrokerListenerResourceData(e)), _brokerListenerResourceBrokerListenerClientDiagnostics, Pipeline, "BrokerListenerResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List BrokerListenerResource resources by BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners + /// + /// + /// Operation Id + /// BrokerListenerResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _brokerListenerResourceBrokerListenerRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _brokerListenerResourceBrokerListenerRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BrokerListenerResource(Client, BrokerListenerResourceData.DeserializeBrokerListenerResourceData(e)), _brokerListenerResourceBrokerListenerClientDiagnostics, Pipeline, "BrokerListenerResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker listener resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string listenerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName)); + + using var scope = _brokerListenerResourceBrokerListenerClientDiagnostics.CreateScope("BrokerListenerResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _brokerListenerResourceBrokerListenerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker listener resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string listenerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName)); + + using var scope = _brokerListenerResourceBrokerListenerClientDiagnostics.CreateScope("BrokerListenerResourceCollection.Exists"); + scope.Start(); + try + { + var response = _brokerListenerResourceBrokerListenerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker listener resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string listenerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName)); + + using var scope = _brokerListenerResourceBrokerListenerClientDiagnostics.CreateScope("BrokerListenerResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _brokerListenerResourceBrokerListenerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new BrokerListenerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker listener resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string listenerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName)); + + using var scope = _brokerListenerResourceBrokerListenerClientDiagnostics.CreateScope("BrokerListenerResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _brokerListenerResourceBrokerListenerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new BrokerListenerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResourceData.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResourceData.Serialization.cs new file mode 100644 index 000000000000..25188c8896ac --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResourceData.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.IoTOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IoTOperations +{ + public partial class BrokerListenerResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerListenerResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + writer.WritePropertyName("extendedLocation"u8); + writer.WriteObjectValue(ExtendedLocation, options); + } + + BrokerListenerResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerListenerResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerListenerResourceData(document.RootElement, options); + } + + internal static BrokerListenerResourceData DeserializeBrokerListenerResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BrokerListenerProperties properties = default; + ExtendedLocation extendedLocation = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = BrokerListenerProperties.DeserializeBrokerListenerProperties(property.Value, options); + continue; + } + if (property.NameEquals("extendedLocation"u8)) + { + extendedLocation = ExtendedLocation.DeserializeExtendedLocation(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerListenerResourceData( + id, + name, + type, + systemData, + properties, + extendedLocation, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerListenerResourceData)} does not support writing '{options.Format}' format."); + } + } + + BrokerListenerResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerListenerResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerListenerResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResourceData.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResourceData.cs new file mode 100644 index 000000000000..e78c861ec340 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResourceData.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.IoTOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IoTOperations +{ + /// + /// A class representing the BrokerListenerResource data model. + /// Instance broker resource + /// + public partial class BrokerListenerResourceData : ResourceData + { + /// + /// 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; + + /// Initializes a new instance of . + /// Edge location of the resource. + /// is null. + public BrokerListenerResourceData(ExtendedLocation extendedLocation) + { + Argument.AssertNotNull(extendedLocation, nameof(extendedLocation)); + + ExtendedLocation = extendedLocation; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// Keeps track of any properties unknown to the library. + internal BrokerListenerResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, BrokerListenerProperties properties, ExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + ExtendedLocation = extendedLocation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerListenerResourceData() + { + } + + /// The resource-specific properties for this resource. + public BrokerListenerProperties Properties { get; set; } + /// Edge location of the resource. + public ExtendedLocation ExtendedLocation { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResource.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResource.Serialization.cs new file mode 100644 index 000000000000..1c57df972270 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.IoTOperations +{ + public partial class BrokerResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + BrokerResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + BrokerResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResource.cs new file mode 100644 index 000000000000..5554687cbad8 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResource.cs @@ -0,0 +1,554 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IoTOperations +{ + /// + /// A Class representing a BrokerResource along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetBrokerResource method. + /// Otherwise you can get one from its parent resource using the GetBrokerResource method. + /// + public partial class BrokerResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The instanceName. + /// The brokerName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _brokerResourceBrokerClientDiagnostics; + private readonly BrokerRestOperations _brokerResourceBrokerRestClient; + private readonly BrokerResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.IoTOperations/instances/brokers"; + + /// Initializes a new instance of the class for mocking. + protected BrokerResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal BrokerResource(ArmClient client, BrokerResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal BrokerResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _brokerResourceBrokerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IoTOperations", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string brokerResourceBrokerApiVersion); + _brokerResourceBrokerRestClient = new BrokerRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, brokerResourceBrokerApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual BrokerResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of BrokerListenerResources in the BrokerResource. + /// An object representing collection of BrokerListenerResources and their operations over a BrokerListenerResource. + public virtual BrokerListenerResourceCollection GetBrokerListenerResources() + { + return GetCachedClient(client => new BrokerListenerResourceCollection(client, Id)); + } + + /// + /// Get a BrokerListenerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker listener resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBrokerListenerResourceAsync(string listenerName, CancellationToken cancellationToken = default) + { + return await GetBrokerListenerResources().GetAsync(listenerName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a BrokerListenerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName} + /// + /// + /// Operation Id + /// BrokerListenerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker listener resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBrokerListenerResource(string listenerName, CancellationToken cancellationToken = default) + { + return GetBrokerListenerResources().Get(listenerName, cancellationToken); + } + + /// Gets a collection of BrokerAuthenticationResources in the BrokerResource. + /// An object representing collection of BrokerAuthenticationResources and their operations over a BrokerAuthenticationResource. + public virtual BrokerAuthenticationResourceCollection GetBrokerAuthenticationResources() + { + return GetCachedClient(client => new BrokerAuthenticationResourceCollection(client, Id)); + } + + /// + /// Get a BrokerAuthenticationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authentication resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBrokerAuthenticationResourceAsync(string authenticationName, CancellationToken cancellationToken = default) + { + return await GetBrokerAuthenticationResources().GetAsync(authenticationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a BrokerAuthenticationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName} + /// + /// + /// Operation Id + /// BrokerAuthenticationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authentication resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBrokerAuthenticationResource(string authenticationName, CancellationToken cancellationToken = default) + { + return GetBrokerAuthenticationResources().Get(authenticationName, cancellationToken); + } + + /// Gets a collection of BrokerAuthorizationResources in the BrokerResource. + /// An object representing collection of BrokerAuthorizationResources and their operations over a BrokerAuthorizationResource. + public virtual BrokerAuthorizationResourceCollection GetBrokerAuthorizationResources() + { + return GetCachedClient(client => new BrokerAuthorizationResourceCollection(client, Id)); + } + + /// + /// Get a BrokerAuthorizationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authorization resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBrokerAuthorizationResourceAsync(string authorizationName, CancellationToken cancellationToken = default) + { + return await GetBrokerAuthorizationResources().GetAsync(authorizationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a BrokerAuthorizationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName} + /// + /// + /// Operation Id + /// BrokerAuthorizationResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance broker authorization resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBrokerAuthorizationResource(string authorizationName, CancellationToken cancellationToken = default) + { + return GetBrokerAuthorizationResources().Get(authorizationName, cancellationToken); + } + + /// + /// Get a BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _brokerResourceBrokerClientDiagnostics.CreateScope("BrokerResource.Get"); + scope.Start(); + try + { + var response = await _brokerResourceBrokerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BrokerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _brokerResourceBrokerClientDiagnostics.CreateScope("BrokerResource.Get"); + scope.Start(); + try + { + var response = _brokerResourceBrokerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BrokerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _brokerResourceBrokerClientDiagnostics.CreateScope("BrokerResource.Delete"); + scope.Start(); + try + { + var response = await _brokerResourceBrokerRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new IoTOperationsArmOperation(_brokerResourceBrokerClientDiagnostics, Pipeline, _brokerResourceBrokerRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _brokerResourceBrokerClientDiagnostics.CreateScope("BrokerResource.Delete"); + scope.Start(); + try + { + var response = _brokerResourceBrokerRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new IoTOperationsArmOperation(_brokerResourceBrokerClientDiagnostics, Pipeline, _brokerResourceBrokerRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, BrokerResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _brokerResourceBrokerClientDiagnostics.CreateScope("BrokerResource.Update"); + scope.Start(); + try + { + var response = await _brokerResourceBrokerRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new IoTOperationsArmOperation(new BrokerResourceOperationSource(Client), _brokerResourceBrokerClientDiagnostics, Pipeline, _brokerResourceBrokerRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, BrokerResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _brokerResourceBrokerClientDiagnostics.CreateScope("BrokerResource.Update"); + scope.Start(); + try + { + var response = _brokerResourceBrokerRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new IoTOperationsArmOperation(new BrokerResourceOperationSource(Client), _brokerResourceBrokerClientDiagnostics, Pipeline, _brokerResourceBrokerRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResourceCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResourceCollection.cs new file mode 100644 index 000000000000..1a765171ea32 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResourceCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IoTOperations +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetBrokerResources method from an instance of . + /// + public partial class BrokerResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _brokerResourceBrokerClientDiagnostics; + private readonly BrokerRestOperations _brokerResourceBrokerRestClient; + + /// Initializes a new instance of the class for mocking. + protected BrokerResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal BrokerResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _brokerResourceBrokerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IoTOperations", BrokerResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(BrokerResource.ResourceType, out string brokerResourceBrokerApiVersion); + _brokerResourceBrokerRestClient = new BrokerRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, brokerResourceBrokerApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != InstanceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, InstanceResource.ResourceType), nameof(id)); + } + + /// + /// Create a BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of broker. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string brokerName, BrokerResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _brokerResourceBrokerClientDiagnostics.CreateScope("BrokerResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _brokerResourceBrokerRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, data, cancellationToken).ConfigureAwait(false); + var operation = new IoTOperationsArmOperation(new BrokerResourceOperationSource(Client), _brokerResourceBrokerClientDiagnostics, Pipeline, _brokerResourceBrokerRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of broker. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string brokerName, BrokerResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _brokerResourceBrokerClientDiagnostics.CreateScope("BrokerResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _brokerResourceBrokerRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, data, cancellationToken); + var operation = new IoTOperationsArmOperation(new BrokerResourceOperationSource(Client), _brokerResourceBrokerClientDiagnostics, Pipeline, _brokerResourceBrokerRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of broker. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var scope = _brokerResourceBrokerClientDiagnostics.CreateScope("BrokerResourceCollection.Get"); + scope.Start(); + try + { + var response = await _brokerResourceBrokerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BrokerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of broker. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var scope = _brokerResourceBrokerClientDiagnostics.CreateScope("BrokerResourceCollection.Get"); + scope.Start(); + try + { + var response = _brokerResourceBrokerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BrokerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List BrokerResource resources by InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers + /// + /// + /// Operation Id + /// BrokerResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _brokerResourceBrokerRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _brokerResourceBrokerRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BrokerResource(Client, BrokerResourceData.DeserializeBrokerResourceData(e)), _brokerResourceBrokerClientDiagnostics, Pipeline, "BrokerResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List BrokerResource resources by InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers + /// + /// + /// Operation Id + /// BrokerResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _brokerResourceBrokerRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _brokerResourceBrokerRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BrokerResource(Client, BrokerResourceData.DeserializeBrokerResourceData(e)), _brokerResourceBrokerClientDiagnostics, Pipeline, "BrokerResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of broker. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var scope = _brokerResourceBrokerClientDiagnostics.CreateScope("BrokerResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _brokerResourceBrokerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of broker. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var scope = _brokerResourceBrokerClientDiagnostics.CreateScope("BrokerResourceCollection.Exists"); + scope.Start(); + try + { + var response = _brokerResourceBrokerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of broker. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var scope = _brokerResourceBrokerClientDiagnostics.CreateScope("BrokerResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _brokerResourceBrokerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new BrokerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of broker. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var scope = _brokerResourceBrokerClientDiagnostics.CreateScope("BrokerResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _brokerResourceBrokerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new BrokerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResourceData.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResourceData.Serialization.cs new file mode 100644 index 000000000000..b4fccdeb96f6 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResourceData.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.IoTOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IoTOperations +{ + public partial class BrokerResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + writer.WritePropertyName("extendedLocation"u8); + writer.WriteObjectValue(ExtendedLocation, options); + } + + BrokerResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerResourceData(document.RootElement, options); + } + + internal static BrokerResourceData DeserializeBrokerResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BrokerProperties properties = default; + ExtendedLocation extendedLocation = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = BrokerProperties.DeserializeBrokerProperties(property.Value, options); + continue; + } + if (property.NameEquals("extendedLocation"u8)) + { + extendedLocation = ExtendedLocation.DeserializeExtendedLocation(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerResourceData( + id, + name, + type, + systemData, + properties, + extendedLocation, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerResourceData)} does not support writing '{options.Format}' format."); + } + } + + BrokerResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResourceData.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResourceData.cs new file mode 100644 index 000000000000..f53dd7c8822a --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResourceData.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.IoTOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IoTOperations +{ + /// + /// A class representing the BrokerResource data model. + /// Instance broker resource + /// + public partial class BrokerResourceData : ResourceData + { + /// + /// 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; + + /// Initializes a new instance of . + /// Edge location of the resource. + /// is null. + public BrokerResourceData(ExtendedLocation extendedLocation) + { + Argument.AssertNotNull(extendedLocation, nameof(extendedLocation)); + + ExtendedLocation = extendedLocation; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// Keeps track of any properties unknown to the library. + internal BrokerResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, BrokerProperties properties, ExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + ExtendedLocation = extendedLocation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerResourceData() + { + } + + /// The resource-specific properties for this resource. + public BrokerProperties Properties { get; set; } + /// Edge location of the resource. + public ExtendedLocation ExtendedLocation { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResource.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResource.Serialization.cs new file mode 100644 index 000000000000..f76b1d2fb551 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.IoTOperations +{ + public partial class DataflowEndpointResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataflowEndpointResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DataflowEndpointResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResource.cs new file mode 100644 index 000000000000..856adc1d84e3 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResource.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IoTOperations +{ + /// + /// A Class representing a DataflowEndpointResource along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetDataflowEndpointResource method. + /// Otherwise you can get one from its parent resource using the GetDataflowEndpointResource method. + /// + public partial class DataflowEndpointResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The instanceName. + /// The dataflowEndpointName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dataflowEndpointResourceDataflowEndpointClientDiagnostics; + private readonly DataflowEndpointRestOperations _dataflowEndpointResourceDataflowEndpointRestClient; + private readonly DataflowEndpointResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.IoTOperations/instances/dataflowEndpoints"; + + /// Initializes a new instance of the class for mocking. + protected DataflowEndpointResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DataflowEndpointResource(ArmClient client, DataflowEndpointResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal DataflowEndpointResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataflowEndpointResourceDataflowEndpointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IoTOperations", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataflowEndpointResourceDataflowEndpointApiVersion); + _dataflowEndpointResourceDataflowEndpointRestClient = new DataflowEndpointRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataflowEndpointResourceDataflowEndpointApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DataflowEndpointResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a DataflowEndpointResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dataflowEndpointResourceDataflowEndpointClientDiagnostics.CreateScope("DataflowEndpointResource.Get"); + scope.Start(); + try + { + var response = await _dataflowEndpointResourceDataflowEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataflowEndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DataflowEndpointResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dataflowEndpointResourceDataflowEndpointClientDiagnostics.CreateScope("DataflowEndpointResource.Get"); + scope.Start(); + try + { + var response = _dataflowEndpointResourceDataflowEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataflowEndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a DataflowEndpointResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataflowEndpointResourceDataflowEndpointClientDiagnostics.CreateScope("DataflowEndpointResource.Delete"); + scope.Start(); + try + { + var response = await _dataflowEndpointResourceDataflowEndpointRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new IoTOperationsArmOperation(_dataflowEndpointResourceDataflowEndpointClientDiagnostics, Pipeline, _dataflowEndpointResourceDataflowEndpointRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a DataflowEndpointResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataflowEndpointResourceDataflowEndpointClientDiagnostics.CreateScope("DataflowEndpointResource.Delete"); + scope.Start(); + try + { + var response = _dataflowEndpointResourceDataflowEndpointRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new IoTOperationsArmOperation(_dataflowEndpointResourceDataflowEndpointClientDiagnostics, Pipeline, _dataflowEndpointResourceDataflowEndpointRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a DataflowEndpointResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DataflowEndpointResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataflowEndpointResourceDataflowEndpointClientDiagnostics.CreateScope("DataflowEndpointResource.Update"); + scope.Start(); + try + { + var response = await _dataflowEndpointResourceDataflowEndpointRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new IoTOperationsArmOperation(new DataflowEndpointResourceOperationSource(Client), _dataflowEndpointResourceDataflowEndpointClientDiagnostics, Pipeline, _dataflowEndpointResourceDataflowEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a DataflowEndpointResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DataflowEndpointResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataflowEndpointResourceDataflowEndpointClientDiagnostics.CreateScope("DataflowEndpointResource.Update"); + scope.Start(); + try + { + var response = _dataflowEndpointResourceDataflowEndpointRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new IoTOperationsArmOperation(new DataflowEndpointResourceOperationSource(Client), _dataflowEndpointResourceDataflowEndpointClientDiagnostics, Pipeline, _dataflowEndpointResourceDataflowEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResourceCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResourceCollection.cs new file mode 100644 index 000000000000..abe2074ba8f8 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResourceCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IoTOperations +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetDataflowEndpointResources method from an instance of . + /// + public partial class DataflowEndpointResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataflowEndpointResourceDataflowEndpointClientDiagnostics; + private readonly DataflowEndpointRestOperations _dataflowEndpointResourceDataflowEndpointRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataflowEndpointResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal DataflowEndpointResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataflowEndpointResourceDataflowEndpointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IoTOperations", DataflowEndpointResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataflowEndpointResource.ResourceType, out string dataflowEndpointResourceDataflowEndpointApiVersion); + _dataflowEndpointResourceDataflowEndpointRestClient = new DataflowEndpointRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataflowEndpointResourceDataflowEndpointApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != InstanceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, InstanceResource.ResourceType), nameof(id)); + } + + /// + /// Create a DataflowEndpointResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of Instance dataflowEndpoint resource. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string dataflowEndpointName, DataflowEndpointResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataflowEndpointResourceDataflowEndpointClientDiagnostics.CreateScope("DataflowEndpointResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _dataflowEndpointResourceDataflowEndpointRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowEndpointName, data, cancellationToken).ConfigureAwait(false); + var operation = new IoTOperationsArmOperation(new DataflowEndpointResourceOperationSource(Client), _dataflowEndpointResourceDataflowEndpointClientDiagnostics, Pipeline, _dataflowEndpointResourceDataflowEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowEndpointName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a DataflowEndpointResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of Instance dataflowEndpoint resource. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string dataflowEndpointName, DataflowEndpointResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataflowEndpointResourceDataflowEndpointClientDiagnostics.CreateScope("DataflowEndpointResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _dataflowEndpointResourceDataflowEndpointRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowEndpointName, data, cancellationToken); + var operation = new IoTOperationsArmOperation(new DataflowEndpointResourceOperationSource(Client), _dataflowEndpointResourceDataflowEndpointClientDiagnostics, Pipeline, _dataflowEndpointResourceDataflowEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowEndpointName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DataflowEndpointResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowEndpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string dataflowEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName)); + + using var scope = _dataflowEndpointResourceDataflowEndpointClientDiagnostics.CreateScope("DataflowEndpointResourceCollection.Get"); + scope.Start(); + try + { + var response = await _dataflowEndpointResourceDataflowEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowEndpointName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataflowEndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DataflowEndpointResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowEndpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string dataflowEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName)); + + using var scope = _dataflowEndpointResourceDataflowEndpointClientDiagnostics.CreateScope("DataflowEndpointResourceCollection.Get"); + scope.Start(); + try + { + var response = _dataflowEndpointResourceDataflowEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowEndpointName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataflowEndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List DataflowEndpointResource resources by InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints + /// + /// + /// Operation Id + /// DataflowEndpointResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataflowEndpointResourceDataflowEndpointRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataflowEndpointResourceDataflowEndpointRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataflowEndpointResource(Client, DataflowEndpointResourceData.DeserializeDataflowEndpointResourceData(e)), _dataflowEndpointResourceDataflowEndpointClientDiagnostics, Pipeline, "DataflowEndpointResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List DataflowEndpointResource resources by InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints + /// + /// + /// Operation Id + /// DataflowEndpointResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataflowEndpointResourceDataflowEndpointRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataflowEndpointResourceDataflowEndpointRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataflowEndpointResource(Client, DataflowEndpointResourceData.DeserializeDataflowEndpointResourceData(e)), _dataflowEndpointResourceDataflowEndpointClientDiagnostics, Pipeline, "DataflowEndpointResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowEndpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string dataflowEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName)); + + using var scope = _dataflowEndpointResourceDataflowEndpointClientDiagnostics.CreateScope("DataflowEndpointResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _dataflowEndpointResourceDataflowEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowEndpointName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowEndpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string dataflowEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName)); + + using var scope = _dataflowEndpointResourceDataflowEndpointClientDiagnostics.CreateScope("DataflowEndpointResourceCollection.Exists"); + scope.Start(); + try + { + var response = _dataflowEndpointResourceDataflowEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowEndpointName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowEndpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string dataflowEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName)); + + using var scope = _dataflowEndpointResourceDataflowEndpointClientDiagnostics.CreateScope("DataflowEndpointResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataflowEndpointResourceDataflowEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowEndpointName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataflowEndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowEndpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string dataflowEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName)); + + using var scope = _dataflowEndpointResourceDataflowEndpointClientDiagnostics.CreateScope("DataflowEndpointResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataflowEndpointResourceDataflowEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowEndpointName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataflowEndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResourceData.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResourceData.Serialization.cs new file mode 100644 index 000000000000..09140862d3ba --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResourceData.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.IoTOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IoTOperations +{ + public partial class DataflowEndpointResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + writer.WritePropertyName("extendedLocation"u8); + writer.WriteObjectValue(ExtendedLocation, options); + } + + DataflowEndpointResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointResourceData(document.RootElement, options); + } + + internal static DataflowEndpointResourceData DeserializeDataflowEndpointResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataflowEndpointProperties properties = default; + ExtendedLocation extendedLocation = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataflowEndpointProperties.DeserializeDataflowEndpointProperties(property.Value, options); + continue; + } + if (property.NameEquals("extendedLocation"u8)) + { + extendedLocation = ExtendedLocation.DeserializeExtendedLocation(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointResourceData( + id, + name, + type, + systemData, + properties, + extendedLocation, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointResourceData)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResourceData.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResourceData.cs new file mode 100644 index 000000000000..1ec697dfac10 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResourceData.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.IoTOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IoTOperations +{ + /// + /// A class representing the DataflowEndpointResource data model. + /// Instance dataflowEndpoint resource + /// + public partial class DataflowEndpointResourceData : ResourceData + { + /// + /// 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; + + /// Initializes a new instance of . + /// Edge location of the resource. + /// is null. + public DataflowEndpointResourceData(ExtendedLocation extendedLocation) + { + Argument.AssertNotNull(extendedLocation, nameof(extendedLocation)); + + ExtendedLocation = extendedLocation; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataflowEndpointProperties properties, ExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + ExtendedLocation = extendedLocation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointResourceData() + { + } + + /// The resource-specific properties for this resource. + public DataflowEndpointProperties Properties { get; set; } + /// Edge location of the resource. + public ExtendedLocation ExtendedLocation { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowProfileResource.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowProfileResource.Serialization.cs new file mode 100644 index 000000000000..fb34f9925a03 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowProfileResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.IoTOperations +{ + public partial class DataflowProfileResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataflowProfileResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DataflowProfileResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowProfileResource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowProfileResource.cs new file mode 100644 index 000000000000..bfb6a20b23ee --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowProfileResource.cs @@ -0,0 +1,416 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IoTOperations +{ + /// + /// A Class representing a DataflowProfileResource along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetDataflowProfileResource method. + /// Otherwise you can get one from its parent resource using the GetDataflowProfileResource method. + /// + public partial class DataflowProfileResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The instanceName. + /// The dataflowProfileName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dataflowProfileResourceDataflowProfileClientDiagnostics; + private readonly DataflowProfileRestOperations _dataflowProfileResourceDataflowProfileRestClient; + private readonly DataflowProfileResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.IoTOperations/instances/dataflowProfiles"; + + /// Initializes a new instance of the class for mocking. + protected DataflowProfileResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DataflowProfileResource(ArmClient client, DataflowProfileResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal DataflowProfileResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataflowProfileResourceDataflowProfileClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IoTOperations", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataflowProfileResourceDataflowProfileApiVersion); + _dataflowProfileResourceDataflowProfileRestClient = new DataflowProfileRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataflowProfileResourceDataflowProfileApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DataflowProfileResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of DataflowResources in the DataflowProfileResource. + /// An object representing collection of DataflowResources and their operations over a DataflowResource. + public virtual DataflowResourceCollection GetDataflowResources() + { + return GetCachedClient(client => new DataflowResourceCollection(client, Id)); + } + + /// + /// Get a DataflowResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} + /// + /// + /// Operation Id + /// DataflowResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile dataflow resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataflowResourceAsync(string dataflowName, CancellationToken cancellationToken = default) + { + return await GetDataflowResources().GetAsync(dataflowName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a DataflowResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} + /// + /// + /// Operation Id + /// DataflowResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile dataflow resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataflowResource(string dataflowName, CancellationToken cancellationToken = default) + { + return GetDataflowResources().Get(dataflowName, cancellationToken); + } + + /// + /// Get a DataflowProfileResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dataflowProfileResourceDataflowProfileClientDiagnostics.CreateScope("DataflowProfileResource.Get"); + scope.Start(); + try + { + var response = await _dataflowProfileResourceDataflowProfileRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataflowProfileResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DataflowProfileResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dataflowProfileResourceDataflowProfileClientDiagnostics.CreateScope("DataflowProfileResource.Get"); + scope.Start(); + try + { + var response = _dataflowProfileResourceDataflowProfileRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataflowProfileResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a DataflowProfileResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataflowProfileResourceDataflowProfileClientDiagnostics.CreateScope("DataflowProfileResource.Delete"); + scope.Start(); + try + { + var response = await _dataflowProfileResourceDataflowProfileRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new IoTOperationsArmOperation(_dataflowProfileResourceDataflowProfileClientDiagnostics, Pipeline, _dataflowProfileResourceDataflowProfileRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a DataflowProfileResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataflowProfileResourceDataflowProfileClientDiagnostics.CreateScope("DataflowProfileResource.Delete"); + scope.Start(); + try + { + var response = _dataflowProfileResourceDataflowProfileRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new IoTOperationsArmOperation(_dataflowProfileResourceDataflowProfileClientDiagnostics, Pipeline, _dataflowProfileResourceDataflowProfileRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a DataflowProfileResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DataflowProfileResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataflowProfileResourceDataflowProfileClientDiagnostics.CreateScope("DataflowProfileResource.Update"); + scope.Start(); + try + { + var response = await _dataflowProfileResourceDataflowProfileRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new IoTOperationsArmOperation(new DataflowProfileResourceOperationSource(Client), _dataflowProfileResourceDataflowProfileClientDiagnostics, Pipeline, _dataflowProfileResourceDataflowProfileRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a DataflowProfileResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DataflowProfileResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataflowProfileResourceDataflowProfileClientDiagnostics.CreateScope("DataflowProfileResource.Update"); + scope.Start(); + try + { + var response = _dataflowProfileResourceDataflowProfileRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new IoTOperationsArmOperation(new DataflowProfileResourceOperationSource(Client), _dataflowProfileResourceDataflowProfileClientDiagnostics, Pipeline, _dataflowProfileResourceDataflowProfileRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowProfileResourceCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowProfileResourceCollection.cs new file mode 100644 index 000000000000..fd0382aea4b7 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowProfileResourceCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IoTOperations +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetDataflowProfileResources method from an instance of . + /// + public partial class DataflowProfileResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataflowProfileResourceDataflowProfileClientDiagnostics; + private readonly DataflowProfileRestOperations _dataflowProfileResourceDataflowProfileRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataflowProfileResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal DataflowProfileResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataflowProfileResourceDataflowProfileClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IoTOperations", DataflowProfileResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataflowProfileResource.ResourceType, out string dataflowProfileResourceDataflowProfileApiVersion); + _dataflowProfileResourceDataflowProfileRestClient = new DataflowProfileRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataflowProfileResourceDataflowProfileApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != InstanceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, InstanceResource.ResourceType), nameof(id)); + } + + /// + /// Create a DataflowProfileResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of Instance dataflowProfile resource. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string dataflowProfileName, DataflowProfileResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataflowProfileResourceDataflowProfileClientDiagnostics.CreateScope("DataflowProfileResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _dataflowProfileResourceDataflowProfileRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowProfileName, data, cancellationToken).ConfigureAwait(false); + var operation = new IoTOperationsArmOperation(new DataflowProfileResourceOperationSource(Client), _dataflowProfileResourceDataflowProfileClientDiagnostics, Pipeline, _dataflowProfileResourceDataflowProfileRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowProfileName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a DataflowProfileResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of Instance dataflowProfile resource. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string dataflowProfileName, DataflowProfileResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataflowProfileResourceDataflowProfileClientDiagnostics.CreateScope("DataflowProfileResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _dataflowProfileResourceDataflowProfileRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowProfileName, data, cancellationToken); + var operation = new IoTOperationsArmOperation(new DataflowProfileResourceOperationSource(Client), _dataflowProfileResourceDataflowProfileClientDiagnostics, Pipeline, _dataflowProfileResourceDataflowProfileRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowProfileName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DataflowProfileResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string dataflowProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + + using var scope = _dataflowProfileResourceDataflowProfileClientDiagnostics.CreateScope("DataflowProfileResourceCollection.Get"); + scope.Start(); + try + { + var response = await _dataflowProfileResourceDataflowProfileRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowProfileName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataflowProfileResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DataflowProfileResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string dataflowProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + + using var scope = _dataflowProfileResourceDataflowProfileClientDiagnostics.CreateScope("DataflowProfileResourceCollection.Get"); + scope.Start(); + try + { + var response = _dataflowProfileResourceDataflowProfileRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowProfileName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataflowProfileResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List DataflowProfileResource resources by InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles + /// + /// + /// Operation Id + /// DataflowProfileResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataflowProfileResourceDataflowProfileRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataflowProfileResourceDataflowProfileRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataflowProfileResource(Client, DataflowProfileResourceData.DeserializeDataflowProfileResourceData(e)), _dataflowProfileResourceDataflowProfileClientDiagnostics, Pipeline, "DataflowProfileResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List DataflowProfileResource resources by InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles + /// + /// + /// Operation Id + /// DataflowProfileResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataflowProfileResourceDataflowProfileRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataflowProfileResourceDataflowProfileRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataflowProfileResource(Client, DataflowProfileResourceData.DeserializeDataflowProfileResourceData(e)), _dataflowProfileResourceDataflowProfileClientDiagnostics, Pipeline, "DataflowProfileResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string dataflowProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + + using var scope = _dataflowProfileResourceDataflowProfileClientDiagnostics.CreateScope("DataflowProfileResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _dataflowProfileResourceDataflowProfileRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowProfileName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string dataflowProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + + using var scope = _dataflowProfileResourceDataflowProfileClientDiagnostics.CreateScope("DataflowProfileResourceCollection.Exists"); + scope.Start(); + try + { + var response = _dataflowProfileResourceDataflowProfileRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowProfileName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string dataflowProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + + using var scope = _dataflowProfileResourceDataflowProfileClientDiagnostics.CreateScope("DataflowProfileResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataflowProfileResourceDataflowProfileRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowProfileName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataflowProfileResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string dataflowProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + + using var scope = _dataflowProfileResourceDataflowProfileClientDiagnostics.CreateScope("DataflowProfileResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataflowProfileResourceDataflowProfileRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowProfileName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataflowProfileResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowProfileResourceData.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowProfileResourceData.Serialization.cs new file mode 100644 index 000000000000..c2da85c79547 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowProfileResourceData.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.IoTOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IoTOperations +{ + public partial class DataflowProfileResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowProfileResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + writer.WritePropertyName("extendedLocation"u8); + writer.WriteObjectValue(ExtendedLocation, options); + } + + DataflowProfileResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowProfileResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowProfileResourceData(document.RootElement, options); + } + + internal static DataflowProfileResourceData DeserializeDataflowProfileResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataflowProfileProperties properties = default; + ExtendedLocation extendedLocation = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataflowProfileProperties.DeserializeDataflowProfileProperties(property.Value, options); + continue; + } + if (property.NameEquals("extendedLocation"u8)) + { + extendedLocation = ExtendedLocation.DeserializeExtendedLocation(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowProfileResourceData( + id, + name, + type, + systemData, + properties, + extendedLocation, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowProfileResourceData)} does not support writing '{options.Format}' format."); + } + } + + DataflowProfileResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowProfileResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowProfileResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowProfileResourceData.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowProfileResourceData.cs new file mode 100644 index 000000000000..84ffbdd6b712 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowProfileResourceData.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.IoTOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IoTOperations +{ + /// + /// A class representing the DataflowProfileResource data model. + /// Instance dataflowProfile resource + /// + public partial class DataflowProfileResourceData : ResourceData + { + /// + /// 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; + + /// Initializes a new instance of . + /// Edge location of the resource. + /// is null. + public DataflowProfileResourceData(ExtendedLocation extendedLocation) + { + Argument.AssertNotNull(extendedLocation, nameof(extendedLocation)); + + ExtendedLocation = extendedLocation; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// Keeps track of any properties unknown to the library. + internal DataflowProfileResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataflowProfileProperties properties, ExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + ExtendedLocation = extendedLocation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowProfileResourceData() + { + } + + /// The resource-specific properties for this resource. + public DataflowProfileProperties Properties { get; set; } + /// Edge location of the resource. + public ExtendedLocation ExtendedLocation { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowResource.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowResource.Serialization.cs new file mode 100644 index 000000000000..fc198d94f68a --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.IoTOperations +{ + public partial class DataflowResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataflowResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DataflowResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/AccessPolicyAssignmentResource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowResource.cs similarity index 53% rename from sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/AccessPolicyAssignmentResource.cs rename to sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowResource.cs index f6d4926a44d8..98912f7f5fa9 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/AccessPolicyAssignmentResource.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowResource.cs @@ -12,57 +12,57 @@ using Azure.Core; using Azure.Core.Pipeline; -namespace Azure.ResourceManager.RedisEnterprise +namespace Azure.ResourceManager.IoTOperations { /// - /// A Class representing an AccessPolicyAssignment along with the instance operations that can be performed on it. - /// If you have a you can construct an - /// from an instance of using the GetAccessPolicyAssignmentResource method. - /// Otherwise you can get one from its parent resource using the GetAccessPolicyAssignment method. + /// A Class representing a DataflowResource along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetDataflowResource method. + /// Otherwise you can get one from its parent resource using the GetDataflowResource method. /// - public partial class AccessPolicyAssignmentResource : ArmResource + public partial class DataflowResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The subscriptionId. /// The resourceGroupName. - /// The clusterName. - /// The databaseName. - /// The accessPolicyAssignmentName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string clusterName, string databaseName, string accessPolicyAssignmentName) + /// The instanceName. + /// The dataflowProfileName. + /// The dataflowName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, string dataflowName) { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName}"; + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName}"; return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _accessPolicyAssignmentClientDiagnostics; - private readonly AccessPolicyAssignmentRestOperations _accessPolicyAssignmentRestClient; - private readonly AccessPolicyAssignmentData _data; + private readonly ClientDiagnostics _dataflowResourceDataflowClientDiagnostics; + private readonly DataflowRestOperations _dataflowResourceDataflowRestClient; + private readonly DataflowResourceData _data; /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Cache/redisEnterprise/databases/accessPolicyAssignments"; + public static readonly ResourceType ResourceType = "Microsoft.IoTOperations/instances/dataflowProfiles/dataflows"; - /// Initializes a new instance of the class for mocking. - protected AccessPolicyAssignmentResource() + /// Initializes a new instance of the class for mocking. + protected DataflowResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The resource that is the target of operations. - internal AccessPolicyAssignmentResource(ArmClient client, AccessPolicyAssignmentData data) : this(client, data.Id) + internal DataflowResource(ArmClient client, DataflowResourceData data) : this(client, data.Id) { HasData = true; _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. - internal AccessPolicyAssignmentResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal DataflowResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _accessPolicyAssignmentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RedisEnterprise", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string accessPolicyAssignmentApiVersion); - _accessPolicyAssignmentRestClient = new AccessPolicyAssignmentRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, accessPolicyAssignmentApiVersion); + _dataflowResourceDataflowClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IoTOperations", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataflowResourceDataflowApiVersion); + _dataflowResourceDataflowRestClient = new DataflowRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataflowResourceDataflowApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -73,7 +73,7 @@ internal AccessPolicyAssignmentResource(ArmClient client, ResourceIdentifier id) /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual AccessPolicyAssignmentData Data + public virtual DataflowResourceData Data { get { @@ -90,37 +90,37 @@ internal static void ValidateResourceId(ResourceIdentifier id) } /// - /// Gets information about access policy assignment for database. + /// Get a DataflowResource /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} /// /// /// Operation Id - /// AccessPolicyAssignment_Get + /// DataflowResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _accessPolicyAssignmentClientDiagnostics.CreateScope("AccessPolicyAssignmentResource.Get"); + using var scope = _dataflowResourceDataflowClientDiagnostics.CreateScope("DataflowResource.Get"); scope.Start(); try { - var response = await _accessPolicyAssignmentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _dataflowResourceDataflowRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AccessPolicyAssignmentResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new DataflowResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -130,37 +130,37 @@ public virtual async Task> GetAsync(Can } /// - /// Gets information about access policy assignment for database. + /// Get a DataflowResource /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} /// /// /// Operation Id - /// AccessPolicyAssignment_Get + /// DataflowResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _accessPolicyAssignmentClientDiagnostics.CreateScope("AccessPolicyAssignmentResource.Get"); + using var scope = _dataflowResourceDataflowClientDiagnostics.CreateScope("DataflowResource.Get"); scope.Start(); try { - var response = _accessPolicyAssignmentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var response = _dataflowResourceDataflowRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AccessPolicyAssignmentResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new DataflowResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -170,23 +170,23 @@ public virtual Response Get(CancellationToken ca } /// - /// Deletes a single access policy assignment. + /// Delete a DataflowResource /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} /// /// /// Operation Id - /// AccessPolicyAssignment_Delete + /// DataflowResource_Delete /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource - /// + /// /// /// /// @@ -194,12 +194,12 @@ public virtual Response Get(CancellationToken ca /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _accessPolicyAssignmentClientDiagnostics.CreateScope("AccessPolicyAssignmentResource.Delete"); + using var scope = _dataflowResourceDataflowClientDiagnostics.CreateScope("DataflowResource.Delete"); scope.Start(); try { - var response = await _accessPolicyAssignmentRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new RedisEnterpriseArmOperation(_accessPolicyAssignmentClientDiagnostics, Pipeline, _accessPolicyAssignmentRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = await _dataflowResourceDataflowRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new IoTOperationsArmOperation(_dataflowResourceDataflowClientDiagnostics, Pipeline, _dataflowResourceDataflowRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -212,23 +212,23 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell } /// - /// Deletes a single access policy assignment. + /// Delete a DataflowResource /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} /// /// /// Operation Id - /// AccessPolicyAssignment_Delete + /// DataflowResource_Delete /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource - /// + /// /// /// /// @@ -236,12 +236,12 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _accessPolicyAssignmentClientDiagnostics.CreateScope("AccessPolicyAssignmentResource.Delete"); + using var scope = _dataflowResourceDataflowClientDiagnostics.CreateScope("DataflowResource.Delete"); scope.Start(); try { - var response = _accessPolicyAssignmentRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new RedisEnterpriseArmOperation(_accessPolicyAssignmentClientDiagnostics, Pipeline, _accessPolicyAssignmentRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = _dataflowResourceDataflowRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new IoTOperationsArmOperation(_dataflowResourceDataflowClientDiagnostics, Pipeline, _dataflowResourceDataflowRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -254,40 +254,40 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// Creates/Updates a particular access policy assignment for a database + /// Create a DataflowResource /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} /// /// /// Operation Id - /// AccessPolicyAssignment_CreateUpdate + /// DataflowResource_CreateOrUpdate /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource - /// + /// /// /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Parameters supplied to the create access policy assignment for database. + /// Resource create parameters. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, AccessPolicyAssignmentData data, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DataflowResourceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _accessPolicyAssignmentClientDiagnostics.CreateScope("AccessPolicyAssignmentResource.Update"); + using var scope = _dataflowResourceDataflowClientDiagnostics.CreateScope("DataflowResource.Update"); scope.Start(); try { - var response = await _accessPolicyAssignmentRestClient.CreateUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new RedisEnterpriseArmOperation(new AccessPolicyAssignmentOperationSource(Client), _accessPolicyAssignmentClientDiagnostics, Pipeline, _accessPolicyAssignmentRestClient.CreateCreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.OriginalUri); + var response = await _dataflowResourceDataflowRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new IoTOperationsArmOperation(new DataflowResourceOperationSource(Client), _dataflowResourceDataflowClientDiagnostics, Pipeline, _dataflowResourceDataflowRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -300,40 +300,40 @@ public virtual async Task> UpdateAs } /// - /// Creates/Updates a particular access policy assignment for a database + /// Create a DataflowResource /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} /// /// /// Operation Id - /// AccessPolicyAssignment_CreateUpdate + /// DataflowResource_CreateOrUpdate /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-01 /// /// /// Resource - /// + /// /// /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Parameters supplied to the create access policy assignment for database. + /// Resource create parameters. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, AccessPolicyAssignmentData data, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, DataflowResourceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _accessPolicyAssignmentClientDiagnostics.CreateScope("AccessPolicyAssignmentResource.Update"); + using var scope = _dataflowResourceDataflowClientDiagnostics.CreateScope("DataflowResource.Update"); scope.Start(); try { - var response = _accessPolicyAssignmentRestClient.CreateUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new RedisEnterpriseArmOperation(new AccessPolicyAssignmentOperationSource(Client), _accessPolicyAssignmentClientDiagnostics, Pipeline, _accessPolicyAssignmentRestClient.CreateCreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.OriginalUri); + var response = _dataflowResourceDataflowRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new IoTOperationsArmOperation(new DataflowResourceOperationSource(Client), _dataflowResourceDataflowClientDiagnostics, Pipeline, _dataflowResourceDataflowRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowResourceCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowResourceCollection.cs new file mode 100644 index 000000000000..89b1779de4a0 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowResourceCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IoTOperations +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetDataflowResources method from an instance of . + /// + public partial class DataflowResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataflowResourceDataflowClientDiagnostics; + private readonly DataflowRestOperations _dataflowResourceDataflowRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataflowResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal DataflowResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataflowResourceDataflowClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IoTOperations", DataflowResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataflowResource.ResourceType, out string dataflowResourceDataflowApiVersion); + _dataflowResourceDataflowRestClient = new DataflowRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataflowResourceDataflowApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != DataflowProfileResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DataflowProfileResource.ResourceType), nameof(id)); + } + + /// + /// Create a DataflowResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} + /// + /// + /// Operation Id + /// DataflowResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of Instance dataflowProfile dataflow resource. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string dataflowName, DataflowResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowName, nameof(dataflowName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataflowResourceDataflowClientDiagnostics.CreateScope("DataflowResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _dataflowResourceDataflowRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, dataflowName, data, cancellationToken).ConfigureAwait(false); + var operation = new IoTOperationsArmOperation(new DataflowResourceOperationSource(Client), _dataflowResourceDataflowClientDiagnostics, Pipeline, _dataflowResourceDataflowRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, dataflowName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a DataflowResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} + /// + /// + /// Operation Id + /// DataflowResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of Instance dataflowProfile dataflow resource. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string dataflowName, DataflowResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowName, nameof(dataflowName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataflowResourceDataflowClientDiagnostics.CreateScope("DataflowResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _dataflowResourceDataflowRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, dataflowName, data, cancellationToken); + var operation = new IoTOperationsArmOperation(new DataflowResourceOperationSource(Client), _dataflowResourceDataflowClientDiagnostics, Pipeline, _dataflowResourceDataflowRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, dataflowName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DataflowResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} + /// + /// + /// Operation Id + /// DataflowResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile dataflow resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string dataflowName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowName, nameof(dataflowName)); + + using var scope = _dataflowResourceDataflowClientDiagnostics.CreateScope("DataflowResourceCollection.Get"); + scope.Start(); + try + { + var response = await _dataflowResourceDataflowRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, dataflowName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataflowResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DataflowResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} + /// + /// + /// Operation Id + /// DataflowResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile dataflow resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string dataflowName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowName, nameof(dataflowName)); + + using var scope = _dataflowResourceDataflowClientDiagnostics.CreateScope("DataflowResourceCollection.Get"); + scope.Start(); + try + { + var response = _dataflowResourceDataflowRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, dataflowName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataflowResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List DataflowResource resources by DataflowProfileResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows + /// + /// + /// Operation Id + /// DataflowResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataflowResourceDataflowRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataflowResourceDataflowRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataflowResource(Client, DataflowResourceData.DeserializeDataflowResourceData(e)), _dataflowResourceDataflowClientDiagnostics, Pipeline, "DataflowResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List DataflowResource resources by DataflowProfileResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows + /// + /// + /// Operation Id + /// DataflowResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataflowResourceDataflowRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataflowResourceDataflowRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataflowResource(Client, DataflowResourceData.DeserializeDataflowResourceData(e)), _dataflowResourceDataflowClientDiagnostics, Pipeline, "DataflowResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} + /// + /// + /// Operation Id + /// DataflowResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile dataflow resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string dataflowName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowName, nameof(dataflowName)); + + using var scope = _dataflowResourceDataflowClientDiagnostics.CreateScope("DataflowResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _dataflowResourceDataflowRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, dataflowName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} + /// + /// + /// Operation Id + /// DataflowResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile dataflow resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string dataflowName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowName, nameof(dataflowName)); + + using var scope = _dataflowResourceDataflowClientDiagnostics.CreateScope("DataflowResourceCollection.Exists"); + scope.Start(); + try + { + var response = _dataflowResourceDataflowRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, dataflowName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} + /// + /// + /// Operation Id + /// DataflowResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile dataflow resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string dataflowName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowName, nameof(dataflowName)); + + using var scope = _dataflowResourceDataflowClientDiagnostics.CreateScope("DataflowResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataflowResourceDataflowRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, dataflowName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataflowResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName}/dataflows/{dataflowName} + /// + /// + /// Operation Id + /// DataflowResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile dataflow resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string dataflowName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataflowName, nameof(dataflowName)); + + using var scope = _dataflowResourceDataflowClientDiagnostics.CreateScope("DataflowResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataflowResourceDataflowRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, dataflowName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataflowResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowResourceData.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowResourceData.Serialization.cs new file mode 100644 index 000000000000..e9dd69141122 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowResourceData.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.IoTOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IoTOperations +{ + public partial class DataflowResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + writer.WritePropertyName("extendedLocation"u8); + writer.WriteObjectValue(ExtendedLocation, options); + } + + DataflowResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowResourceData(document.RootElement, options); + } + + internal static DataflowResourceData DeserializeDataflowResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataflowProperties properties = default; + ExtendedLocation extendedLocation = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataflowProperties.DeserializeDataflowProperties(property.Value, options); + continue; + } + if (property.NameEquals("extendedLocation"u8)) + { + extendedLocation = ExtendedLocation.DeserializeExtendedLocation(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowResourceData( + id, + name, + type, + systemData, + properties, + extendedLocation, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowResourceData)} does not support writing '{options.Format}' format."); + } + } + + DataflowResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowResourceData.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowResourceData.cs new file mode 100644 index 000000000000..13f7d477956c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowResourceData.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.IoTOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IoTOperations +{ + /// + /// A class representing the DataflowResource data model. + /// Instance dataflowProfile dataflow resource + /// + public partial class DataflowResourceData : ResourceData + { + /// + /// 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; + + /// Initializes a new instance of . + /// Edge location of the resource. + /// is null. + public DataflowResourceData(ExtendedLocation extendedLocation) + { + Argument.AssertNotNull(extendedLocation, nameof(extendedLocation)); + + ExtendedLocation = extendedLocation; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// Keeps track of any properties unknown to the library. + internal DataflowResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataflowProperties properties, ExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + ExtendedLocation = extendedLocation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowResourceData() + { + } + + /// The resource-specific properties for this resource. + public DataflowProperties Properties { get; set; } + /// Edge location of the resource. + public ExtendedLocation ExtendedLocation { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Extensions/IoTOperationsExtensions.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Extensions/IoTOperationsExtensions.cs new file mode 100644 index 000000000000..d7dd9431b76f --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Extensions/IoTOperationsExtensions.cs @@ -0,0 +1,352 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.IoTOperations.Mocking; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.IoTOperations +{ + /// A class to add extension methods to Azure.ResourceManager.IoTOperations. + public static partial class IoTOperationsExtensions + { + private static MockableIoTOperationsArmClient GetMockableIoTOperationsArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableIoTOperationsArmClient(client0)); + } + + private static MockableIoTOperationsResourceGroupResource GetMockableIoTOperationsResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableIoTOperationsResourceGroupResource(client, resource.Id)); + } + + private static MockableIoTOperationsSubscriptionResource GetMockableIoTOperationsSubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableIoTOperationsSubscriptionResource(client, resource.Id)); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static InstanceResource GetInstanceResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableIoTOperationsArmClient(client).GetInstanceResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static BrokerResource GetBrokerResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableIoTOperationsArmClient(client).GetBrokerResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static BrokerListenerResource GetBrokerListenerResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableIoTOperationsArmClient(client).GetBrokerListenerResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static BrokerAuthenticationResource GetBrokerAuthenticationResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableIoTOperationsArmClient(client).GetBrokerAuthenticationResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static BrokerAuthorizationResource GetBrokerAuthorizationResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableIoTOperationsArmClient(client).GetBrokerAuthorizationResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataflowProfileResource GetDataflowProfileResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableIoTOperationsArmClient(client).GetDataflowProfileResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataflowResource GetDataflowResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableIoTOperationsArmClient(client).GetDataflowResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataflowEndpointResource GetDataflowEndpointResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableIoTOperationsArmClient(client).GetDataflowEndpointResource(id); + } + + /// + /// Gets a collection of InstanceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of InstanceResources and their operations over a InstanceResource. + public static InstanceResourceCollection GetInstanceResources(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableIoTOperationsResourceGroupResource(resourceGroupResource).GetInstanceResources(); + } + + /// + /// Get a InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of instance. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetInstanceResourceAsync(this ResourceGroupResource resourceGroupResource, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableIoTOperationsResourceGroupResource(resourceGroupResource).GetInstanceResourceAsync(instanceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of instance. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetInstanceResource(this ResourceGroupResource resourceGroupResource, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableIoTOperationsResourceGroupResource(resourceGroupResource).GetInstanceResource(instanceName, cancellationToken); + } + + /// + /// List InstanceResource resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.IoTOperations/instances + /// + /// + /// Operation Id + /// InstanceResource_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetInstanceResourcesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableIoTOperationsSubscriptionResource(subscriptionResource).GetInstanceResourcesAsync(cancellationToken); + } + + /// + /// List InstanceResource resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.IoTOperations/instances + /// + /// + /// Operation Id + /// InstanceResource_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetInstanceResources(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableIoTOperationsSubscriptionResource(subscriptionResource).GetInstanceResources(cancellationToken); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Extensions/MockableIoTOperationsArmClient.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Extensions/MockableIoTOperationsArmClient.cs new file mode 100644 index 000000000000..00ca2a20d7e9 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Extensions/MockableIoTOperationsArmClient.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableIoTOperationsArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableIoTOperationsArmClient() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableIoTOperationsArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableIoTOperationsArmClient(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual InstanceResource GetInstanceResource(ResourceIdentifier id) + { + InstanceResource.ValidateResourceId(id); + return new InstanceResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual BrokerResource GetBrokerResource(ResourceIdentifier id) + { + BrokerResource.ValidateResourceId(id); + return new BrokerResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual BrokerListenerResource GetBrokerListenerResource(ResourceIdentifier id) + { + BrokerListenerResource.ValidateResourceId(id); + return new BrokerListenerResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual BrokerAuthenticationResource GetBrokerAuthenticationResource(ResourceIdentifier id) + { + BrokerAuthenticationResource.ValidateResourceId(id); + return new BrokerAuthenticationResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual BrokerAuthorizationResource GetBrokerAuthorizationResource(ResourceIdentifier id) + { + BrokerAuthorizationResource.ValidateResourceId(id); + return new BrokerAuthorizationResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataflowProfileResource GetDataflowProfileResource(ResourceIdentifier id) + { + DataflowProfileResource.ValidateResourceId(id); + return new DataflowProfileResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataflowResource GetDataflowResource(ResourceIdentifier id) + { + DataflowResource.ValidateResourceId(id); + return new DataflowResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataflowEndpointResource GetDataflowEndpointResource(ResourceIdentifier id) + { + DataflowEndpointResource.ValidateResourceId(id); + return new DataflowEndpointResource(Client, id); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Extensions/MockableIoTOperationsResourceGroupResource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Extensions/MockableIoTOperationsResourceGroupResource.cs new file mode 100644 index 000000000000..59476d7c1265 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Extensions/MockableIoTOperationsResourceGroupResource.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableIoTOperationsResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableIoTOperationsResourceGroupResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableIoTOperationsResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of InstanceResources in the ResourceGroupResource. + /// An object representing collection of InstanceResources and their operations over a InstanceResource. + public virtual InstanceResourceCollection GetInstanceResources() + { + return GetCachedClient(client => new InstanceResourceCollection(client, Id)); + } + + /// + /// Get a InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of instance. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetInstanceResourceAsync(string instanceName, CancellationToken cancellationToken = default) + { + return await GetInstanceResources().GetAsync(instanceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of instance. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetInstanceResource(string instanceName, CancellationToken cancellationToken = default) + { + return GetInstanceResources().Get(instanceName, cancellationToken); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Extensions/MockableIoTOperationsSubscriptionResource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Extensions/MockableIoTOperationsSubscriptionResource.cs new file mode 100644 index 000000000000..fbbfc1b50a1e --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Extensions/MockableIoTOperationsSubscriptionResource.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IoTOperations.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockableIoTOperationsSubscriptionResource : ArmResource + { + private ClientDiagnostics _instanceResourceInstanceClientDiagnostics; + private InstanceRestOperations _instanceResourceInstanceRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableIoTOperationsSubscriptionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableIoTOperationsSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics InstanceResourceInstanceClientDiagnostics => _instanceResourceInstanceClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.IoTOperations", InstanceResource.ResourceType.Namespace, Diagnostics); + private InstanceRestOperations InstanceResourceInstanceRestClient => _instanceResourceInstanceRestClient ??= new InstanceRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(InstanceResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// List InstanceResource resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.IoTOperations/instances + /// + /// + /// Operation Id + /// InstanceResource_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetInstanceResourcesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => InstanceResourceInstanceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => InstanceResourceInstanceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new InstanceResource(Client, InstanceResourceData.DeserializeInstanceResourceData(e)), InstanceResourceInstanceClientDiagnostics, Pipeline, "MockableIoTOperationsSubscriptionResource.GetInstanceResources", "value", "nextLink", cancellationToken); + } + + /// + /// List InstanceResource resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.IoTOperations/instances + /// + /// + /// Operation Id + /// InstanceResource_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetInstanceResources(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => InstanceResourceInstanceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => InstanceResourceInstanceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new InstanceResource(Client, InstanceResourceData.DeserializeInstanceResourceData(e)), InstanceResourceInstanceClientDiagnostics, Pipeline, "MockableIoTOperationsSubscriptionResource.GetInstanceResources", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/InstanceResource.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/InstanceResource.Serialization.cs new file mode 100644 index 000000000000..2daa5a465cdc --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/InstanceResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.IoTOperations +{ + public partial class InstanceResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + InstanceResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + InstanceResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/InstanceResource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/InstanceResource.cs new file mode 100644 index 000000000000..49ec5916443b --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/InstanceResource.cs @@ -0,0 +1,906 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.IoTOperations.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.IoTOperations +{ + /// + /// A Class representing an InstanceResource along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetInstanceResource method. + /// Otherwise you can get one from its parent resource using the GetInstanceResource method. + /// + public partial class InstanceResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The instanceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _instanceResourceInstanceClientDiagnostics; + private readonly InstanceRestOperations _instanceResourceInstanceRestClient; + private readonly InstanceResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.IoTOperations/instances"; + + /// Initializes a new instance of the class for mocking. + protected InstanceResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal InstanceResource(ArmClient client, InstanceResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal InstanceResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _instanceResourceInstanceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IoTOperations", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string instanceResourceInstanceApiVersion); + _instanceResourceInstanceRestClient = new InstanceRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, instanceResourceInstanceApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual InstanceResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of BrokerResources in the InstanceResource. + /// An object representing collection of BrokerResources and their operations over a BrokerResource. + public virtual BrokerResourceCollection GetBrokerResources() + { + return GetCachedClient(client => new BrokerResourceCollection(client, Id)); + } + + /// + /// Get a BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of broker. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBrokerResourceAsync(string brokerName, CancellationToken cancellationToken = default) + { + return await GetBrokerResources().GetAsync(brokerName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a BrokerResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName} + /// + /// + /// Operation Id + /// BrokerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of broker. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBrokerResource(string brokerName, CancellationToken cancellationToken = default) + { + return GetBrokerResources().Get(brokerName, cancellationToken); + } + + /// Gets a collection of DataflowProfileResources in the InstanceResource. + /// An object representing collection of DataflowProfileResources and their operations over a DataflowProfileResource. + public virtual DataflowProfileResourceCollection GetDataflowProfileResources() + { + return GetCachedClient(client => new DataflowProfileResourceCollection(client, Id)); + } + + /// + /// Get a DataflowProfileResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataflowProfileResourceAsync(string dataflowProfileName, CancellationToken cancellationToken = default) + { + return await GetDataflowProfileResources().GetAsync(dataflowProfileName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a DataflowProfileResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowProfiles/{dataflowProfileName} + /// + /// + /// Operation Id + /// DataflowProfileResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataflowProfileResource(string dataflowProfileName, CancellationToken cancellationToken = default) + { + return GetDataflowProfileResources().Get(dataflowProfileName, cancellationToken); + } + + /// Gets a collection of DataflowEndpointResources in the InstanceResource. + /// An object representing collection of DataflowEndpointResources and their operations over a DataflowEndpointResource. + public virtual DataflowEndpointResourceCollection GetDataflowEndpointResources() + { + return GetCachedClient(client => new DataflowEndpointResourceCollection(client, Id)); + } + + /// + /// Get a DataflowEndpointResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowEndpoint resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataflowEndpointResourceAsync(string dataflowEndpointName, CancellationToken cancellationToken = default) + { + return await GetDataflowEndpointResources().GetAsync(dataflowEndpointName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a DataflowEndpointResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName} + /// + /// + /// Operation Id + /// DataflowEndpointResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Instance dataflowEndpoint resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataflowEndpointResource(string dataflowEndpointName, CancellationToken cancellationToken = default) + { + return GetDataflowEndpointResources().Get(dataflowEndpointName, cancellationToken); + } + + /// + /// Get a InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _instanceResourceInstanceClientDiagnostics.CreateScope("InstanceResource.Get"); + scope.Start(); + try + { + var response = await _instanceResourceInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new InstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _instanceResourceInstanceClientDiagnostics.CreateScope("InstanceResource.Get"); + scope.Start(); + try + { + var response = _instanceResourceInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new InstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _instanceResourceInstanceClientDiagnostics.CreateScope("InstanceResource.Delete"); + scope.Start(); + try + { + var response = await _instanceResourceInstanceRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new IoTOperationsArmOperation(_instanceResourceInstanceClientDiagnostics, Pipeline, _instanceResourceInstanceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _instanceResourceInstanceClientDiagnostics.CreateScope("InstanceResource.Delete"); + scope.Start(); + try + { + var response = _instanceResourceInstanceRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new IoTOperationsArmOperation(_instanceResourceInstanceClientDiagnostics, Pipeline, _instanceResourceInstanceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Update + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(InstanceResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _instanceResourceInstanceClientDiagnostics.CreateScope("InstanceResource.Update"); + scope.Start(); + try + { + var response = await _instanceResourceInstanceRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new InstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Update + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual Response Update(InstanceResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _instanceResourceInstanceClientDiagnostics.CreateScope("InstanceResource.Update"); + scope.Start(); + try + { + var response = _instanceResourceInstanceRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + return Response.FromValue(new InstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _instanceResourceInstanceClientDiagnostics.CreateScope("InstanceResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _instanceResourceInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new InstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new InstanceResourcePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _instanceResourceInstanceClientDiagnostics.CreateScope("InstanceResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _instanceResourceInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new InstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new InstanceResourcePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _instanceResourceInstanceClientDiagnostics.CreateScope("InstanceResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _instanceResourceInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new InstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new InstanceResourcePatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _instanceResourceInstanceClientDiagnostics.CreateScope("InstanceResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _instanceResourceInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new InstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new InstanceResourcePatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _instanceResourceInstanceClientDiagnostics.CreateScope("InstanceResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _instanceResourceInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new InstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new InstanceResourcePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _instanceResourceInstanceClientDiagnostics.CreateScope("InstanceResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _instanceResourceInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new InstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new InstanceResourcePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/InstanceResourceCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/InstanceResourceCollection.cs new file mode 100644 index 000000000000..f81654aab3b9 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/InstanceResourceCollection.cs @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.IoTOperations +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetInstanceResources method from an instance of . + /// + public partial class InstanceResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _instanceResourceInstanceClientDiagnostics; + private readonly InstanceRestOperations _instanceResourceInstanceRestClient; + + /// Initializes a new instance of the class for mocking. + protected InstanceResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal InstanceResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _instanceResourceInstanceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IoTOperations", InstanceResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(InstanceResource.ResourceType, out string instanceResourceInstanceApiVersion); + _instanceResourceInstanceRestClient = new InstanceRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, instanceResourceInstanceApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Create a InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of instance. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string instanceName, InstanceResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _instanceResourceInstanceClientDiagnostics.CreateScope("InstanceResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _instanceResourceInstanceRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, instanceName, data, cancellationToken).ConfigureAwait(false); + var operation = new IoTOperationsArmOperation(new InstanceResourceOperationSource(Client), _instanceResourceInstanceClientDiagnostics, Pipeline, _instanceResourceInstanceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, instanceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of instance. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string instanceName, InstanceResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _instanceResourceInstanceClientDiagnostics.CreateScope("InstanceResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _instanceResourceInstanceRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, instanceName, data, cancellationToken); + var operation = new IoTOperationsArmOperation(new InstanceResourceOperationSource(Client), _instanceResourceInstanceClientDiagnostics, Pipeline, _instanceResourceInstanceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, instanceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of instance. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var scope = _instanceResourceInstanceClientDiagnostics.CreateScope("InstanceResourceCollection.Get"); + scope.Start(); + try + { + var response = await _instanceResourceInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, instanceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new InstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a InstanceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of instance. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var scope = _instanceResourceInstanceClientDiagnostics.CreateScope("InstanceResourceCollection.Get"); + scope.Start(); + try + { + var response = _instanceResourceInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, instanceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new InstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List InstanceResource resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances + /// + /// + /// Operation Id + /// InstanceResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _instanceResourceInstanceRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _instanceResourceInstanceRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new InstanceResource(Client, InstanceResourceData.DeserializeInstanceResourceData(e)), _instanceResourceInstanceClientDiagnostics, Pipeline, "InstanceResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List InstanceResource resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances + /// + /// + /// Operation Id + /// InstanceResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _instanceResourceInstanceRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _instanceResourceInstanceRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new InstanceResource(Client, InstanceResourceData.DeserializeInstanceResourceData(e)), _instanceResourceInstanceClientDiagnostics, Pipeline, "InstanceResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of instance. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var scope = _instanceResourceInstanceClientDiagnostics.CreateScope("InstanceResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _instanceResourceInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, instanceName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of instance. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var scope = _instanceResourceInstanceClientDiagnostics.CreateScope("InstanceResourceCollection.Exists"); + scope.Start(); + try + { + var response = _instanceResourceInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, instanceName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of instance. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var scope = _instanceResourceInstanceClientDiagnostics.CreateScope("InstanceResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _instanceResourceInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, instanceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new InstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName} + /// + /// + /// Operation Id + /// InstanceResource_Get + /// + /// + /// Default Api Version + /// 2024-11-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of instance. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var scope = _instanceResourceInstanceClientDiagnostics.CreateScope("InstanceResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _instanceResourceInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, instanceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new InstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/InstanceResourceData.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/InstanceResourceData.Serialization.cs new file mode 100644 index 000000000000..b08e0c7d7bbb --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/InstanceResourceData.Serialization.cs @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.IoTOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IoTOperations +{ + public partial class InstanceResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(InstanceResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + writer.WritePropertyName("extendedLocation"u8); + writer.WriteObjectValue(ExtendedLocation, options); + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); + } + } + + InstanceResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InstanceResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInstanceResourceData(document.RootElement, options); + } + + internal static InstanceResourceData DeserializeInstanceResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + InstanceProperties properties = default; + ExtendedLocation extendedLocation = default; + ManagedServiceIdentity identity = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = InstanceProperties.DeserializeInstanceProperties(property.Value, options); + continue; + } + if (property.NameEquals("extendedLocation"u8)) + { + extendedLocation = ExtendedLocation.DeserializeExtendedLocation(property.Value, options); + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); + continue; + } + if (property.NameEquals("tags"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()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InstanceResourceData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + extendedLocation, + identity, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(InstanceResourceData)} does not support writing '{options.Format}' format."); + } + } + + InstanceResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeInstanceResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InstanceResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/InstanceResourceData.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/InstanceResourceData.cs new file mode 100644 index 000000000000..dc09f776f48e --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/InstanceResourceData.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.IoTOperations.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IoTOperations +{ + /// + /// A class representing the InstanceResource data model. + /// A Instance resource is a logical container for a set of child resources. + /// + public partial class InstanceResourceData : TrackedResourceData + { + /// + /// 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; + + /// Initializes a new instance of . + /// The location. + /// Edge location of the resource. + /// is null. + public InstanceResourceData(AzureLocation location, ExtendedLocation extendedLocation) : base(location) + { + Argument.AssertNotNull(extendedLocation, nameof(extendedLocation)); + + ExtendedLocation = extendedLocation; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// Edge location of the resource. + /// The managed service identities assigned to this resource. + /// Keeps track of any properties unknown to the library. + internal InstanceResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, InstanceProperties properties, ExtendedLocation extendedLocation, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + ExtendedLocation = extendedLocation; + Identity = identity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal InstanceResourceData() + { + } + + /// The resource-specific properties for this resource. + public InstanceProperties Properties { get; set; } + /// Edge location of the resource. + public ExtendedLocation ExtendedLocation { get; set; } + /// The managed service identities assigned to this resource. + public ManagedServiceIdentity Identity { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Internal/Argument.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..0ec4444a51f6 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..4b585e4ae23c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Internal/ChangeTrackingList.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..dec119e3255e --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IoTOperations +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..6239700cd422 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations +{ + internal static class ModelSerializationExtensions + { + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var 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(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + 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"); + } + + public static string GetRequiredString(this JsonElement element) + { + var 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}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Internal/Optional.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..2f37e2116697 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.ResourceManager.IoTOperations +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..a829e34d2020 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// 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.ResourceManager.IoTOperations +{ + 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/BrokerAuthenticationResourceOperationSource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/BrokerAuthenticationResourceOperationSource.cs new file mode 100644 index 000000000000..b8f106f34973 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/BrokerAuthenticationResourceOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations +{ + internal class BrokerAuthenticationResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal BrokerAuthenticationResourceOperationSource(ArmClient client) + { + _client = client; + } + + BrokerAuthenticationResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = BrokerAuthenticationResourceData.DeserializeBrokerAuthenticationResourceData(document.RootElement); + return new BrokerAuthenticationResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = BrokerAuthenticationResourceData.DeserializeBrokerAuthenticationResourceData(document.RootElement); + return new BrokerAuthenticationResource(_client, data); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/BrokerAuthorizationResourceOperationSource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/BrokerAuthorizationResourceOperationSource.cs new file mode 100644 index 000000000000..5312441a1085 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/BrokerAuthorizationResourceOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations +{ + internal class BrokerAuthorizationResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal BrokerAuthorizationResourceOperationSource(ArmClient client) + { + _client = client; + } + + BrokerAuthorizationResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = BrokerAuthorizationResourceData.DeserializeBrokerAuthorizationResourceData(document.RootElement); + return new BrokerAuthorizationResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = BrokerAuthorizationResourceData.DeserializeBrokerAuthorizationResourceData(document.RootElement); + return new BrokerAuthorizationResource(_client, data); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/BrokerListenerResourceOperationSource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/BrokerListenerResourceOperationSource.cs new file mode 100644 index 000000000000..c2d9454983fc --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/BrokerListenerResourceOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations +{ + internal class BrokerListenerResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal BrokerListenerResourceOperationSource(ArmClient client) + { + _client = client; + } + + BrokerListenerResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = BrokerListenerResourceData.DeserializeBrokerListenerResourceData(document.RootElement); + return new BrokerListenerResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = BrokerListenerResourceData.DeserializeBrokerListenerResourceData(document.RootElement); + return new BrokerListenerResource(_client, data); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/BrokerResourceOperationSource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/BrokerResourceOperationSource.cs new file mode 100644 index 000000000000..59d7a6f98f32 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/BrokerResourceOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations +{ + internal class BrokerResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal BrokerResourceOperationSource(ArmClient client) + { + _client = client; + } + + BrokerResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = BrokerResourceData.DeserializeBrokerResourceData(document.RootElement); + return new BrokerResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = BrokerResourceData.DeserializeBrokerResourceData(document.RootElement); + return new BrokerResource(_client, data); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/DataflowEndpointResourceOperationSource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/DataflowEndpointResourceOperationSource.cs new file mode 100644 index 000000000000..e90184329f66 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/DataflowEndpointResourceOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations +{ + internal class DataflowEndpointResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DataflowEndpointResourceOperationSource(ArmClient client) + { + _client = client; + } + + DataflowEndpointResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = DataflowEndpointResourceData.DeserializeDataflowEndpointResourceData(document.RootElement); + return new DataflowEndpointResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = DataflowEndpointResourceData.DeserializeDataflowEndpointResourceData(document.RootElement); + return new DataflowEndpointResource(_client, data); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/DataflowProfileResourceOperationSource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/DataflowProfileResourceOperationSource.cs new file mode 100644 index 000000000000..ea2ad439a143 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/DataflowProfileResourceOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations +{ + internal class DataflowProfileResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DataflowProfileResourceOperationSource(ArmClient client) + { + _client = client; + } + + DataflowProfileResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = DataflowProfileResourceData.DeserializeDataflowProfileResourceData(document.RootElement); + return new DataflowProfileResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = DataflowProfileResourceData.DeserializeDataflowProfileResourceData(document.RootElement); + return new DataflowProfileResource(_client, data); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/DataflowResourceOperationSource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/DataflowResourceOperationSource.cs new file mode 100644 index 000000000000..10270263937d --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/DataflowResourceOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations +{ + internal class DataflowResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DataflowResourceOperationSource(ArmClient client) + { + _client = client; + } + + DataflowResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = DataflowResourceData.DeserializeDataflowResourceData(document.RootElement); + return new DataflowResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = DataflowResourceData.DeserializeDataflowResourceData(document.RootElement); + return new DataflowResource(_client, data); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/InstanceResourceOperationSource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/InstanceResourceOperationSource.cs new file mode 100644 index 000000000000..e3e16d0a7f8d --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/InstanceResourceOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations +{ + internal class InstanceResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal InstanceResourceOperationSource(ArmClient client) + { + _client = client; + } + + InstanceResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = InstanceResourceData.DeserializeInstanceResourceData(document.RootElement); + return new InstanceResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = InstanceResourceData.DeserializeInstanceResourceData(document.RootElement); + return new InstanceResource(_client, data); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/IoTOperationsArmOperation.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/IoTOperationsArmOperation.cs new file mode 100644 index 000000000000..1fe85ac9e64e --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/IoTOperationsArmOperation.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IoTOperations +{ +#pragma warning disable SA1649 // File name should match first type name + internal class IoTOperationsArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of IoTOperationsArmOperation for mocking. + protected IoTOperationsArmOperation() + { + } + + internal IoTOperationsArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal IoTOperationsArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "IoTOperationsArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); + + /// + public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/IoTOperationsArmOperationOfT.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/IoTOperationsArmOperationOfT.cs new file mode 100644 index 000000000000..5faed18fa995 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/LongRunningOperation/IoTOperationsArmOperationOfT.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IoTOperations +{ +#pragma warning disable SA1649 // File name should match first type name + internal class IoTOperationsArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of IoTOperationsArmOperation for mocking. + protected IoTOperationsArmOperation() + { + } + + internal IoTOperationsArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal IoTOperationsArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(NextLinkOperationImplementation.Create(source, nextLinkOperation), clientDiagnostics, response, "IoTOperationsArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override T Value => _operation.Value; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); + + /// + public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/AdvancedSettings.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/AdvancedSettings.Serialization.cs new file mode 100644 index 000000000000..c8e2b32be041 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/AdvancedSettings.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class AdvancedSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AdvancedSettings)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Clients)) + { + writer.WritePropertyName("clients"u8); + writer.WriteObjectValue(Clients, options); + } + if (Optional.IsDefined(EncryptInternalTraffic)) + { + writer.WritePropertyName("encryptInternalTraffic"u8); + writer.WriteStringValue(EncryptInternalTraffic.Value.ToString()); + } + if (Optional.IsDefined(InternalCerts)) + { + writer.WritePropertyName("internalCerts"u8); + writer.WriteObjectValue(InternalCerts, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AdvancedSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AdvancedSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAdvancedSettings(document.RootElement, options); + } + + internal static AdvancedSettings DeserializeAdvancedSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ClientConfig clients = default; + OperationalMode? encryptInternalTraffic = default; + CertManagerCertConfig internalCerts = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("clients"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + clients = ClientConfig.DeserializeClientConfig(property.Value, options); + continue; + } + if (property.NameEquals("encryptInternalTraffic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encryptInternalTraffic = new OperationalMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("internalCerts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + internalCerts = CertManagerCertConfig.DeserializeCertManagerCertConfig(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AdvancedSettings(clients, encryptInternalTraffic, internalCerts, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AdvancedSettings)} does not support writing '{options.Format}' format."); + } + } + + AdvancedSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAdvancedSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AdvancedSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/AdvancedSettings.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/AdvancedSettings.cs new file mode 100644 index 000000000000..eb9d5f3f595a --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/AdvancedSettings.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Broker Advanced Settings. + public partial class AdvancedSettings + { + /// + /// 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; + + /// Initializes a new instance of . + public AdvancedSettings() + { + } + + /// Initializes a new instance of . + /// Configurations related to All Clients. + /// The setting to enable or disable encryption of internal Traffic. + /// Certificate rotation and private key configuration. + /// Keeps track of any properties unknown to the library. + internal AdvancedSettings(ClientConfig clients, OperationalMode? encryptInternalTraffic, CertManagerCertConfig internalCerts, IDictionary serializedAdditionalRawData) + { + Clients = clients; + EncryptInternalTraffic = encryptInternalTraffic; + InternalCerts = internalCerts; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Configurations related to All Clients. + public ClientConfig Clients { get; set; } + /// The setting to enable or disable encryption of internal Traffic. + public OperationalMode? EncryptInternalTraffic { get; set; } + /// Certificate rotation and private key configuration. + public CertManagerCertConfig InternalCerts { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/AuthorizationConfig.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/AuthorizationConfig.Serialization.cs new file mode 100644 index 000000000000..2a6baee83fb9 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/AuthorizationConfig.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class AuthorizationConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AuthorizationConfig)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Cache)) + { + writer.WritePropertyName("cache"u8); + writer.WriteStringValue(Cache.Value.ToString()); + } + if (Optional.IsCollectionDefined(Rules)) + { + writer.WritePropertyName("rules"u8); + writer.WriteStartArray(); + foreach (var item in Rules) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AuthorizationConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AuthorizationConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAuthorizationConfig(document.RootElement, options); + } + + internal static AuthorizationConfig DeserializeAuthorizationConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OperationalMode? cache = default; + IList rules = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("cache"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cache = new OperationalMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("rules"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuthorizationRule.DeserializeAuthorizationRule(item, options)); + } + rules = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AuthorizationConfig(cache, rules ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AuthorizationConfig)} does not support writing '{options.Format}' format."); + } + } + + AuthorizationConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAuthorizationConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AuthorizationConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/AccessPolicyAssignmentList.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/AuthorizationConfig.cs similarity index 65% rename from sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/AccessPolicyAssignmentList.cs rename to sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/AuthorizationConfig.cs index d7d7c332c37c..07b0d0a02bb6 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/AccessPolicyAssignmentList.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/AuthorizationConfig.cs @@ -8,10 +8,10 @@ using System; using System.Collections.Generic; -namespace Azure.ResourceManager.RedisEnterprise.Models +namespace Azure.ResourceManager.IoTOperations.Models { - /// The response of a list-all operation. - internal partial class AccessPolicyAssignmentList + /// Broker AuthorizationConfig properties. + public partial class AuthorizationConfig { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,26 @@ internal partial class AccessPolicyAssignmentList /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal AccessPolicyAssignmentList() + /// Initializes a new instance of . + public AuthorizationConfig() { - Value = new ChangeTrackingList(); + Rules = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// List of access policy assignments. - /// The URI to fetch the next page of results. + /// Initializes a new instance of . + /// Enable caching of the authorization rules. + /// The authorization rules to follow. If no rule is set, but Authorization Resource is used that would mean DenyAll. /// Keeps track of any properties unknown to the library. - internal AccessPolicyAssignmentList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal AuthorizationConfig(OperationalMode? cache, IList rules, IDictionary serializedAdditionalRawData) { - Value = value; - NextLink = nextLink; + Cache = cache; + Rules = rules; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of access policy assignments. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page of results. - public string NextLink { get; } + /// Enable caching of the authorization rules. + public OperationalMode? Cache { get; set; } + /// The authorization rules to follow. If no rule is set, but Authorization Resource is used that would mean DenyAll. + public IList Rules { get; } } } diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/AuthorizationRule.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/AuthorizationRule.Serialization.cs new file mode 100644 index 000000000000..804dbf00d3f2 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/AuthorizationRule.Serialization.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class AuthorizationRule : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AuthorizationRule)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("brokerResources"u8); + writer.WriteStartArray(); + foreach (var item in BrokerResources) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("principals"u8); + writer.WriteObjectValue(Principals, options); + if (Optional.IsCollectionDefined(StateStoreResources)) + { + writer.WritePropertyName("stateStoreResources"u8); + writer.WriteStartArray(); + foreach (var item in StateStoreResources) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AuthorizationRule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AuthorizationRule)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAuthorizationRule(document.RootElement, options); + } + + internal static AuthorizationRule DeserializeAuthorizationRule(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList brokerResources = default; + PrincipalConfig principals = default; + IList stateStoreResources = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("brokerResources"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(BrokerResourceRule.DeserializeBrokerResourceRule(item, options)); + } + brokerResources = array; + continue; + } + if (property.NameEquals("principals"u8)) + { + principals = PrincipalConfig.DeserializePrincipalConfig(property.Value, options); + continue; + } + if (property.NameEquals("stateStoreResources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StateStoreResourceRule.DeserializeStateStoreResourceRule(item, options)); + } + stateStoreResources = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AuthorizationRule(brokerResources, principals, stateStoreResources ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AuthorizationRule)} does not support writing '{options.Format}' format."); + } + } + + AuthorizationRule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAuthorizationRule(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AuthorizationRule)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/AuthorizationRule.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/AuthorizationRule.cs new file mode 100644 index 000000000000..963caf5704b6 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/AuthorizationRule.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// AuthorizationConfig Rule Properties. + public partial class AuthorizationRule + { + /// + /// 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; + + /// Initializes a new instance of . + /// Give access to Broker methods and topics. + /// Give access to clients based on the following properties. + /// or is null. + public AuthorizationRule(IEnumerable brokerResources, PrincipalConfig principals) + { + Argument.AssertNotNull(brokerResources, nameof(brokerResources)); + Argument.AssertNotNull(principals, nameof(principals)); + + BrokerResources = brokerResources.ToList(); + Principals = principals; + StateStoreResources = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Give access to Broker methods and topics. + /// Give access to clients based on the following properties. + /// Give access to state store resources. + /// Keeps track of any properties unknown to the library. + internal AuthorizationRule(IList brokerResources, PrincipalConfig principals, IList stateStoreResources, IDictionary serializedAdditionalRawData) + { + BrokerResources = brokerResources; + Principals = principals; + StateStoreResources = stateStoreResources; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AuthorizationRule() + { + } + + /// Give access to Broker methods and topics. + public IList BrokerResources { get; } + /// Give access to clients based on the following properties. + public PrincipalConfig Principals { get; set; } + /// Give access to state store resources. + public IList StateStoreResources { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BackendChain.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BackendChain.Serialization.cs new file mode 100644 index 000000000000..f0c8f61e1dac --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BackendChain.Serialization.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class BackendChain : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(BackendChain)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("partitions"u8); + writer.WriteNumberValue(Partitions); + writer.WritePropertyName("redundancyFactor"u8); + writer.WriteNumberValue(RedundancyFactor); + if (Optional.IsDefined(Workers)) + { + writer.WritePropertyName("workers"u8); + writer.WriteNumberValue(Workers.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BackendChain IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BackendChain)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBackendChain(document.RootElement, options); + } + + internal static BackendChain DeserializeBackendChain(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int partitions = default; + int redundancyFactor = default; + int? workers = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("partitions"u8)) + { + partitions = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("redundancyFactor"u8)) + { + redundancyFactor = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("workers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + workers = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BackendChain(partitions, redundancyFactor, workers, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BackendChain)} does not support writing '{options.Format}' format."); + } + } + + BackendChain IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBackendChain(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BackendChain)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BackendChain.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BackendChain.cs new file mode 100644 index 000000000000..b0b9f8497ef8 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BackendChain.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Desired properties of the backend instances of the broker. + public partial class BackendChain + { + /// + /// 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; + + /// Initializes a new instance of . + /// The desired number of physical backend partitions. + /// The desired numbers of backend replicas (pods) in a physical partition. + public BackendChain(int partitions, int redundancyFactor) + { + Partitions = partitions; + RedundancyFactor = redundancyFactor; + } + + /// Initializes a new instance of . + /// The desired number of physical backend partitions. + /// The desired numbers of backend replicas (pods) in a physical partition. + /// Number of logical backend workers per replica (pod). + /// Keeps track of any properties unknown to the library. + internal BackendChain(int partitions, int redundancyFactor, int? workers, IDictionary serializedAdditionalRawData) + { + Partitions = partitions; + RedundancyFactor = redundancyFactor; + Workers = workers; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BackendChain() + { + } + + /// The desired number of physical backend partitions. + public int Partitions { get; set; } + /// The desired numbers of backend replicas (pods) in a physical partition. + public int RedundancyFactor { get; set; } + /// Number of logical backend workers per replica (pod). + public int? Workers { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BatchingConfiguration.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BatchingConfiguration.Serialization.cs new file mode 100644 index 000000000000..3aa86397134e --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BatchingConfiguration.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class BatchingConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(BatchingConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(LatencySeconds)) + { + writer.WritePropertyName("latencySeconds"u8); + writer.WriteNumberValue(LatencySeconds.Value); + } + if (Optional.IsDefined(MaxMessages)) + { + writer.WritePropertyName("maxMessages"u8); + writer.WriteNumberValue(MaxMessages.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BatchingConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BatchingConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBatchingConfiguration(document.RootElement, options); + } + + internal static BatchingConfiguration DeserializeBatchingConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? latencySeconds = default; + int? maxMessages = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("latencySeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + latencySeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxMessages"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxMessages = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BatchingConfiguration(latencySeconds, maxMessages, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BatchingConfiguration)} does not support writing '{options.Format}' format."); + } + } + + BatchingConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBatchingConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BatchingConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BatchingConfiguration.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BatchingConfiguration.cs new file mode 100644 index 000000000000..7add4c05aa00 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BatchingConfiguration.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Batching configuration. + public partial class BatchingConfiguration + { + /// + /// 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; + + /// Initializes a new instance of . + public BatchingConfiguration() + { + } + + /// Initializes a new instance of . + /// Batching latency in seconds. + /// Maximum number of messages in a batch. + /// Keeps track of any properties unknown to the library. + internal BatchingConfiguration(int? latencySeconds, int? maxMessages, IDictionary serializedAdditionalRawData) + { + LatencySeconds = latencySeconds; + MaxMessages = maxMessages; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Batching latency in seconds. + public int? LatencySeconds { get; set; } + /// Maximum number of messages in a batch. + public int? MaxMessages { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticationMethod.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticationMethod.cs new file mode 100644 index 000000000000..8d6f045172de --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticationMethod.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Broker Authentication Mode. + public readonly partial struct BrokerAuthenticationMethod : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BrokerAuthenticationMethod(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CustomValue = "Custom"; + private const string ServiceAccountTokenValue = "ServiceAccountToken"; + private const string X509Value = "X509"; + + /// Custom authentication configuration. + public static BrokerAuthenticationMethod Custom { get; } = new BrokerAuthenticationMethod(CustomValue); + /// ServiceAccountToken authentication configuration. + public static BrokerAuthenticationMethod ServiceAccountToken { get; } = new BrokerAuthenticationMethod(ServiceAccountTokenValue); + /// X.509 authentication configuration. + public static BrokerAuthenticationMethod X509 { get; } = new BrokerAuthenticationMethod(X509Value); + /// Determines if two values are the same. + public static bool operator ==(BrokerAuthenticationMethod left, BrokerAuthenticationMethod right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BrokerAuthenticationMethod left, BrokerAuthenticationMethod right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BrokerAuthenticationMethod(string value) => new BrokerAuthenticationMethod(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BrokerAuthenticationMethod other && Equals(other); + /// + public bool Equals(BrokerAuthenticationMethod 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticationProperties.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticationProperties.Serialization.cs new file mode 100644 index 000000000000..f949ccc5e43d --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticationProperties.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class BrokerAuthenticationProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticationProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("authenticationMethods"u8); + writer.WriteStartArray(); + foreach (var item in AuthenticationMethods) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerAuthenticationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticationProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerAuthenticationProperties(document.RootElement, options); + } + + internal static BrokerAuthenticationProperties DeserializeBrokerAuthenticationProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList authenticationMethods = default; + ProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authenticationMethods"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(BrokerAuthenticatorMethods.DeserializeBrokerAuthenticatorMethods(item, options)); + } + authenticationMethods = array; + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerAuthenticationProperties(authenticationMethods, provisioningState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerAuthenticationProperties)} does not support writing '{options.Format}' format."); + } + } + + BrokerAuthenticationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerAuthenticationProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerAuthenticationProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticationProperties.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticationProperties.cs new file mode 100644 index 000000000000..413753cb59e1 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticationProperties.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// BrokerAuthentication Resource properties. + public partial class BrokerAuthenticationProperties + { + /// + /// 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; + + /// Initializes a new instance of . + /// Defines a set of Broker authentication methods to be used on `BrokerListeners`. For each array element one authenticator type supported. + /// is null. + public BrokerAuthenticationProperties(IEnumerable authenticationMethods) + { + Argument.AssertNotNull(authenticationMethods, nameof(authenticationMethods)); + + AuthenticationMethods = authenticationMethods.ToList(); + } + + /// Initializes a new instance of . + /// Defines a set of Broker authentication methods to be used on `BrokerListeners`. For each array element one authenticator type supported. + /// The status of the last operation. + /// Keeps track of any properties unknown to the library. + internal BrokerAuthenticationProperties(IList authenticationMethods, ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + AuthenticationMethods = authenticationMethods; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerAuthenticationProperties() + { + } + + /// Defines a set of Broker authentication methods to be used on `BrokerListeners`. For each array element one authenticator type supported. + public IList AuthenticationMethods { get; } + /// The status of the last operation. + public ProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticationResourceListResult.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticationResourceListResult.Serialization.cs new file mode 100644 index 000000000000..ec74c8c35d81 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticationResourceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + internal partial class BrokerAuthenticationResourceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticationResourceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerAuthenticationResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticationResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerAuthenticationResourceListResult(document.RootElement, options); + } + + internal static BrokerAuthenticationResourceListResult DeserializeBrokerAuthenticationResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(BrokerAuthenticationResourceData.DeserializeBrokerAuthenticationResourceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerAuthenticationResourceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerAuthenticationResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + BrokerAuthenticationResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerAuthenticationResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerAuthenticationResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticationResourceListResult.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticationResourceListResult.cs new file mode 100644 index 000000000000..ba558a4df5b4 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticationResourceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// The response of a BrokerAuthenticationResource list operation. + internal partial class BrokerAuthenticationResourceListResult + { + /// + /// 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; + + /// Initializes a new instance of . + /// The BrokerAuthenticationResource items on this page. + /// is null. + internal BrokerAuthenticationResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The BrokerAuthenticationResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal BrokerAuthenticationResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerAuthenticationResourceListResult() + { + } + + /// The BrokerAuthenticationResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseResourceMoveDefinition.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorCustomAuth.Serialization.cs similarity index 63% rename from sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseResourceMoveDefinition.Serialization.cs rename to sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorCustomAuth.Serialization.cs index 2b0ac8bb9d67..acb8c0adf083 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseResourceMoveDefinition.Serialization.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorCustomAuth.Serialization.cs @@ -11,13 +11,13 @@ using System.Text.Json; using Azure.Core; -namespace Azure.ResourceManager.Synapse.Models +namespace Azure.ResourceManager.IoTOperations.Models { - public partial class SynapseResourceMoveDefinition : IUtf8JsonSerializable, IJsonModel + internal partial class BrokerAuthenticatorCustomAuth : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,14 +28,14 @@ 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(SynapseResourceMoveDefinition)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(BrokerAuthenticatorCustomAuth)} does not support writing '{format}' format."); } - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); + writer.WritePropertyName("x509"u8); + writer.WriteObjectValue(X509, options); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -53,19 +53,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - SynapseResourceMoveDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + BrokerAuthenticatorCustomAuth IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(SynapseResourceMoveDefinition)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(BrokerAuthenticatorCustomAuth)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeSynapseResourceMoveDefinition(document.RootElement, options); + return DeserializeBrokerAuthenticatorCustomAuth(document.RootElement, options); } - internal static SynapseResourceMoveDefinition DeserializeSynapseResourceMoveDefinition(JsonElement element, ModelReaderWriterOptions options = null) + internal static BrokerAuthenticatorCustomAuth DeserializeBrokerAuthenticatorCustomAuth(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -73,14 +73,14 @@ internal static SynapseResourceMoveDefinition DeserializeSynapseResourceMoveDefi { return null; } - ResourceIdentifier id = default; + X509ManualCertificate x509 = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("id"u8)) + if (property.NameEquals("x509"u8)) { - id = new ResourceIdentifier(property.Value.GetString()); + x509 = X509ManualCertificate.DeserializeX509ManualCertificate(property.Value, options); continue; } if (options.Format != "W") @@ -89,38 +89,38 @@ internal static SynapseResourceMoveDefinition DeserializeSynapseResourceMoveDefi } } serializedAdditionalRawData = rawDataDictionary; - return new SynapseResourceMoveDefinition(id, serializedAdditionalRawData); + return new BrokerAuthenticatorCustomAuth(x509, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(SynapseResourceMoveDefinition)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(BrokerAuthenticatorCustomAuth)} does not support writing '{options.Format}' format."); } } - SynapseResourceMoveDefinition IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + BrokerAuthenticatorCustomAuth IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeSynapseResourceMoveDefinition(document.RootElement, options); + return DeserializeBrokerAuthenticatorCustomAuth(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(SynapseResourceMoveDefinition)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(BrokerAuthenticatorCustomAuth)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorCustomAuth.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorCustomAuth.cs new file mode 100644 index 000000000000..f37c7232a43c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorCustomAuth.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Custom Authentication properties. + internal partial class BrokerAuthenticatorCustomAuth + { + /// + /// 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; + + /// Initializes a new instance of . + /// X509 Custom Auth type details. + /// is null. + public BrokerAuthenticatorCustomAuth(X509ManualCertificate x509) + { + Argument.AssertNotNull(x509, nameof(x509)); + + X509 = x509; + } + + /// Initializes a new instance of . + /// X509 Custom Auth type details. + /// Keeps track of any properties unknown to the library. + internal BrokerAuthenticatorCustomAuth(X509ManualCertificate x509, IDictionary serializedAdditionalRawData) + { + X509 = x509; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerAuthenticatorCustomAuth() + { + } + + /// X509 Custom Auth type details. + internal X509ManualCertificate X509 { get; set; } + /// Kubernetes secret containing an X.509 client certificate. This is a reference to the secret through an identifying name, not the secret itself. + public string X509SecretRef + { + get => X509 is null ? default : X509.SecretRef; + set => X509 = new X509ManualCertificate(value); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodCustom.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodCustom.Serialization.cs new file mode 100644 index 000000000000..344557c4956f --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodCustom.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class BrokerAuthenticatorMethodCustom : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodCustom)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Auth)) + { + writer.WritePropertyName("auth"u8); + writer.WriteObjectValue(Auth, options); + } + if (Optional.IsDefined(CaCertConfigMap)) + { + writer.WritePropertyName("caCertConfigMap"u8); + writer.WriteStringValue(CaCertConfigMap); + } + writer.WritePropertyName("endpoint"u8); + writer.WriteStringValue(Endpoint.AbsoluteUri); + if (Optional.IsCollectionDefined(Headers)) + { + writer.WritePropertyName("headers"u8); + writer.WriteStartObject(); + foreach (var item in Headers) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerAuthenticatorMethodCustom IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodCustom)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerAuthenticatorMethodCustom(document.RootElement, options); + } + + internal static BrokerAuthenticatorMethodCustom DeserializeBrokerAuthenticatorMethodCustom(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BrokerAuthenticatorCustomAuth auth = default; + string caCertConfigMap = default; + Uri endpoint = default; + IDictionary headers = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("auth"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + auth = BrokerAuthenticatorCustomAuth.DeserializeBrokerAuthenticatorCustomAuth(property.Value, options); + continue; + } + if (property.NameEquals("caCertConfigMap"u8)) + { + caCertConfigMap = property.Value.GetString(); + continue; + } + if (property.NameEquals("endpoint"u8)) + { + endpoint = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("headers"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()); + } + headers = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerAuthenticatorMethodCustom(auth, caCertConfigMap, endpoint, headers ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodCustom)} does not support writing '{options.Format}' format."); + } + } + + BrokerAuthenticatorMethodCustom IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerAuthenticatorMethodCustom(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodCustom)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodCustom.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodCustom.cs new file mode 100644 index 000000000000..e2d9ff6e5ff3 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodCustom.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Custom method for BrokerAuthentication. + public partial class BrokerAuthenticatorMethodCustom + { + /// + /// 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; + + /// Initializes a new instance of . + /// Endpoint of the custom authentication server. Must be an HTTPS endpoint. + /// is null. + public BrokerAuthenticatorMethodCustom(Uri endpoint) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + + Endpoint = endpoint; + Headers = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Optional authentication needed for authenticating with the custom authentication server. + /// Optional CA certificate for validating the custom authentication server's certificate. + /// Endpoint of the custom authentication server. Must be an HTTPS endpoint. + /// Additional HTTP headers to pass to the custom authentication server. + /// Keeps track of any properties unknown to the library. + internal BrokerAuthenticatorMethodCustom(BrokerAuthenticatorCustomAuth auth, string caCertConfigMap, Uri endpoint, IDictionary headers, IDictionary serializedAdditionalRawData) + { + Auth = auth; + CaCertConfigMap = caCertConfigMap; + Endpoint = endpoint; + Headers = headers; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerAuthenticatorMethodCustom() + { + } + + /// Optional authentication needed for authenticating with the custom authentication server. + internal BrokerAuthenticatorCustomAuth Auth { get; set; } + /// Kubernetes secret containing an X.509 client certificate. This is a reference to the secret through an identifying name, not the secret itself. + public string X509SecretRef + { + get => Auth is null ? default : Auth.X509SecretRef; + set => Auth = new BrokerAuthenticatorCustomAuth(value); + } + + /// Optional CA certificate for validating the custom authentication server's certificate. + public string CaCertConfigMap { get; set; } + /// Endpoint of the custom authentication server. Must be an HTTPS endpoint. + public Uri Endpoint { get; set; } + /// Additional HTTP headers to pass to the custom authentication server. + public IDictionary Headers { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodSat.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodSat.Serialization.cs new file mode 100644 index 000000000000..87463cf3588a --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodSat.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + internal partial class BrokerAuthenticatorMethodSat : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodSat)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("audiences"u8); + writer.WriteStartArray(); + foreach (var item in Audiences) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerAuthenticatorMethodSat IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodSat)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerAuthenticatorMethodSat(document.RootElement, options); + } + + internal static BrokerAuthenticatorMethodSat DeserializeBrokerAuthenticatorMethodSat(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList audiences = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("audiences"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + audiences = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerAuthenticatorMethodSat(audiences, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodSat)} does not support writing '{options.Format}' format."); + } + } + + BrokerAuthenticatorMethodSat IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerAuthenticatorMethodSat(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodSat)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodSat.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodSat.cs new file mode 100644 index 000000000000..8b6667d9fc9d --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodSat.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Service Account Token for BrokerAuthentication. + internal partial class BrokerAuthenticatorMethodSat + { + /// + /// 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; + + /// Initializes a new instance of . + /// List of allowed audience. + /// is null. + public BrokerAuthenticatorMethodSat(IEnumerable audiences) + { + Argument.AssertNotNull(audiences, nameof(audiences)); + + Audiences = audiences.ToList(); + } + + /// Initializes a new instance of . + /// List of allowed audience. + /// Keeps track of any properties unknown to the library. + internal BrokerAuthenticatorMethodSat(IList audiences, IDictionary serializedAdditionalRawData) + { + Audiences = audiences; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerAuthenticatorMethodSat() + { + } + + /// List of allowed audience. + public IList Audiences { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodX509.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodX509.Serialization.cs new file mode 100644 index 000000000000..5bdf454858d8 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodX509.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class BrokerAuthenticatorMethodX509 : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodX509)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(AuthorizationAttributes)) + { + writer.WritePropertyName("authorizationAttributes"u8); + writer.WriteStartObject(); + foreach (var item in AuthorizationAttributes) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(TrustedClientCaCert)) + { + writer.WritePropertyName("trustedClientCaCert"u8); + writer.WriteStringValue(TrustedClientCaCert); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerAuthenticatorMethodX509 IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodX509)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerAuthenticatorMethodX509(document.RootElement, options); + } + + internal static BrokerAuthenticatorMethodX509 DeserializeBrokerAuthenticatorMethodX509(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary authorizationAttributes = default; + string trustedClientCaCert = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authorizationAttributes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, BrokerAuthenticatorMethodX509Attributes.DeserializeBrokerAuthenticatorMethodX509Attributes(property0.Value, options)); + } + authorizationAttributes = dictionary; + continue; + } + if (property.NameEquals("trustedClientCaCert"u8)) + { + trustedClientCaCert = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerAuthenticatorMethodX509(authorizationAttributes ?? new ChangeTrackingDictionary(), trustedClientCaCert, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodX509)} does not support writing '{options.Format}' format."); + } + } + + BrokerAuthenticatorMethodX509 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerAuthenticatorMethodX509(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodX509)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodX509.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodX509.cs new file mode 100644 index 000000000000..d34e965e3ae1 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodX509.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// X509 for BrokerAuthentication. + public partial class BrokerAuthenticatorMethodX509 + { + /// + /// 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; + + /// Initializes a new instance of . + public BrokerAuthenticatorMethodX509() + { + AuthorizationAttributes = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// X509 authorization attributes properties. + /// Name of the trusted client ca cert resource. + /// Keeps track of any properties unknown to the library. + internal BrokerAuthenticatorMethodX509(IDictionary authorizationAttributes, string trustedClientCaCert, IDictionary serializedAdditionalRawData) + { + AuthorizationAttributes = authorizationAttributes; + TrustedClientCaCert = trustedClientCaCert; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// X509 authorization attributes properties. + public IDictionary AuthorizationAttributes { get; } + /// Name of the trusted client ca cert resource. + public string TrustedClientCaCert { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodX509Attributes.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodX509Attributes.Serialization.cs new file mode 100644 index 000000000000..c9e77d0e55cf --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodX509Attributes.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class BrokerAuthenticatorMethodX509Attributes : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodX509Attributes)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("attributes"u8); + writer.WriteStartObject(); + foreach (var item in Attributes) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + writer.WritePropertyName("subject"u8); + writer.WriteStringValue(Subject); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerAuthenticatorMethodX509Attributes IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodX509Attributes)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerAuthenticatorMethodX509Attributes(document.RootElement, options); + } + + internal static BrokerAuthenticatorMethodX509Attributes DeserializeBrokerAuthenticatorMethodX509Attributes(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary attributes = default; + string subject = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("attributes"u8)) + { + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + attributes = dictionary; + continue; + } + if (property.NameEquals("subject"u8)) + { + subject = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerAuthenticatorMethodX509Attributes(attributes, subject, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodX509Attributes)} does not support writing '{options.Format}' format."); + } + } + + BrokerAuthenticatorMethodX509Attributes IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerAuthenticatorMethodX509Attributes(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethodX509Attributes)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodX509Attributes.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodX509Attributes.cs new file mode 100644 index 000000000000..abe670d40495 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethodX509Attributes.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// BrokerAuthenticatorMethodX509Attributes properties. + public partial class BrokerAuthenticatorMethodX509Attributes + { + /// + /// 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; + + /// Initializes a new instance of . + /// Attributes object. + /// Subject of the X509 attribute. + /// or is null. + public BrokerAuthenticatorMethodX509Attributes(IDictionary attributes, string subject) + { + Argument.AssertNotNull(attributes, nameof(attributes)); + Argument.AssertNotNull(subject, nameof(subject)); + + Attributes = attributes; + Subject = subject; + } + + /// Initializes a new instance of . + /// Attributes object. + /// Subject of the X509 attribute. + /// Keeps track of any properties unknown to the library. + internal BrokerAuthenticatorMethodX509Attributes(IDictionary attributes, string subject, IDictionary serializedAdditionalRawData) + { + Attributes = attributes; + Subject = subject; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerAuthenticatorMethodX509Attributes() + { + } + + /// Attributes object. + public IDictionary Attributes { get; } + /// Subject of the X509 attribute. + public string Subject { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethods.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethods.Serialization.cs new file mode 100644 index 000000000000..555221400c12 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethods.Serialization.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class BrokerAuthenticatorMethods : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethods)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("method"u8); + writer.WriteStringValue(Method.ToString()); + if (Optional.IsDefined(CustomSettings)) + { + writer.WritePropertyName("customSettings"u8); + writer.WriteObjectValue(CustomSettings, options); + } + if (Optional.IsDefined(ServiceAccountTokenSettings)) + { + writer.WritePropertyName("serviceAccountTokenSettings"u8); + writer.WriteObjectValue(ServiceAccountTokenSettings, options); + } + if (Optional.IsDefined(X509Settings)) + { + writer.WritePropertyName("x509Settings"u8); + writer.WriteObjectValue(X509Settings, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerAuthenticatorMethods IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethods)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerAuthenticatorMethods(document.RootElement, options); + } + + internal static BrokerAuthenticatorMethods DeserializeBrokerAuthenticatorMethods(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BrokerAuthenticationMethod method = default; + BrokerAuthenticatorMethodCustom customSettings = default; + BrokerAuthenticatorMethodSat serviceAccountTokenSettings = default; + BrokerAuthenticatorMethodX509 x509Settings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("method"u8)) + { + method = new BrokerAuthenticationMethod(property.Value.GetString()); + continue; + } + if (property.NameEquals("customSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customSettings = BrokerAuthenticatorMethodCustom.DeserializeBrokerAuthenticatorMethodCustom(property.Value, options); + continue; + } + if (property.NameEquals("serviceAccountTokenSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceAccountTokenSettings = BrokerAuthenticatorMethodSat.DeserializeBrokerAuthenticatorMethodSat(property.Value, options); + continue; + } + if (property.NameEquals("x509Settings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + x509Settings = BrokerAuthenticatorMethodX509.DeserializeBrokerAuthenticatorMethodX509(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerAuthenticatorMethods(method, customSettings, serviceAccountTokenSettings, x509Settings, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethods)} does not support writing '{options.Format}' format."); + } + } + + BrokerAuthenticatorMethods IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerAuthenticatorMethods(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerAuthenticatorMethods)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethods.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethods.cs new file mode 100644 index 000000000000..1959b155b27c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthenticatorMethods.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Set of broker authentication policies. Only one method is supported for each entry. + public partial class BrokerAuthenticatorMethods + { + /// + /// 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; + + /// Initializes a new instance of . + /// Custom authentication configuration. + public BrokerAuthenticatorMethods(BrokerAuthenticationMethod method) + { + Method = method; + } + + /// Initializes a new instance of . + /// Custom authentication configuration. + /// Custom authentication configuration. + /// ServiceAccountToken authentication configuration. + /// X.509 authentication configuration. + /// Keeps track of any properties unknown to the library. + internal BrokerAuthenticatorMethods(BrokerAuthenticationMethod method, BrokerAuthenticatorMethodCustom customSettings, BrokerAuthenticatorMethodSat serviceAccountTokenSettings, BrokerAuthenticatorMethodX509 x509Settings, IDictionary serializedAdditionalRawData) + { + Method = method; + CustomSettings = customSettings; + ServiceAccountTokenSettings = serviceAccountTokenSettings; + X509Settings = x509Settings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerAuthenticatorMethods() + { + } + + /// Custom authentication configuration. + public BrokerAuthenticationMethod Method { get; set; } + /// Custom authentication configuration. + public BrokerAuthenticatorMethodCustom CustomSettings { get; set; } + /// ServiceAccountToken authentication configuration. + internal BrokerAuthenticatorMethodSat ServiceAccountTokenSettings { get; set; } + /// List of allowed audience. + public IList ServiceAccountTokenAudiences + { + get => ServiceAccountTokenSettings is null ? default : ServiceAccountTokenSettings.Audiences; + set => ServiceAccountTokenSettings = new BrokerAuthenticatorMethodSat(value); + } + + /// X.509 authentication configuration. + public BrokerAuthenticatorMethodX509 X509Settings { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthorizationProperties.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthorizationProperties.Serialization.cs new file mode 100644 index 000000000000..bd670aba5f18 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthorizationProperties.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class BrokerAuthorizationProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthorizationProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("authorizationPolicies"u8); + writer.WriteObjectValue(AuthorizationPolicies, options); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerAuthorizationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthorizationProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerAuthorizationProperties(document.RootElement, options); + } + + internal static BrokerAuthorizationProperties DeserializeBrokerAuthorizationProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AuthorizationConfig authorizationPolicies = default; + ProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authorizationPolicies"u8)) + { + authorizationPolicies = AuthorizationConfig.DeserializeAuthorizationConfig(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerAuthorizationProperties(authorizationPolicies, provisioningState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerAuthorizationProperties)} does not support writing '{options.Format}' format."); + } + } + + BrokerAuthorizationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerAuthorizationProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerAuthorizationProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthorizationProperties.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthorizationProperties.cs new file mode 100644 index 000000000000..760e3a3dac6c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthorizationProperties.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// BrokerAuthorization Resource properties. + public partial class BrokerAuthorizationProperties + { + /// + /// 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; + + /// Initializes a new instance of . + /// The list of authorization policies supported by the Authorization Resource. + /// is null. + public BrokerAuthorizationProperties(AuthorizationConfig authorizationPolicies) + { + Argument.AssertNotNull(authorizationPolicies, nameof(authorizationPolicies)); + + AuthorizationPolicies = authorizationPolicies; + } + + /// Initializes a new instance of . + /// The list of authorization policies supported by the Authorization Resource. + /// The status of the last operation. + /// Keeps track of any properties unknown to the library. + internal BrokerAuthorizationProperties(AuthorizationConfig authorizationPolicies, ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + AuthorizationPolicies = authorizationPolicies; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerAuthorizationProperties() + { + } + + /// The list of authorization policies supported by the Authorization Resource. + public AuthorizationConfig AuthorizationPolicies { get; set; } + /// The status of the last operation. + public ProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthorizationResourceListResult.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthorizationResourceListResult.Serialization.cs new file mode 100644 index 000000000000..e339f8a8e2f5 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthorizationResourceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + internal partial class BrokerAuthorizationResourceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthorizationResourceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerAuthorizationResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerAuthorizationResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerAuthorizationResourceListResult(document.RootElement, options); + } + + internal static BrokerAuthorizationResourceListResult DeserializeBrokerAuthorizationResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(BrokerAuthorizationResourceData.DeserializeBrokerAuthorizationResourceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerAuthorizationResourceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerAuthorizationResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + BrokerAuthorizationResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerAuthorizationResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerAuthorizationResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthorizationResourceListResult.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthorizationResourceListResult.cs new file mode 100644 index 000000000000..faac07e07534 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerAuthorizationResourceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// The response of a BrokerAuthorizationResource list operation. + internal partial class BrokerAuthorizationResourceListResult + { + /// + /// 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; + + /// Initializes a new instance of . + /// The BrokerAuthorizationResource items on this page. + /// is null. + internal BrokerAuthorizationResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The BrokerAuthorizationResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal BrokerAuthorizationResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerAuthorizationResourceListResult() + { + } + + /// The BrokerAuthorizationResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerDiagnostics.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerDiagnostics.Serialization.cs new file mode 100644 index 000000000000..c2f354fcd1b8 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerDiagnostics.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class BrokerDiagnostics : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerDiagnostics)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Logs)) + { + writer.WritePropertyName("logs"u8); + writer.WriteObjectValue(Logs, options); + } + if (Optional.IsDefined(Metrics)) + { + writer.WritePropertyName("metrics"u8); + writer.WriteObjectValue(Metrics, options); + } + if (Optional.IsDefined(SelfCheck)) + { + writer.WritePropertyName("selfCheck"u8); + writer.WriteObjectValue(SelfCheck, options); + } + if (Optional.IsDefined(Traces)) + { + writer.WritePropertyName("traces"u8); + writer.WriteObjectValue(Traces, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerDiagnostics IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerDiagnostics)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerDiagnostics(document.RootElement, options); + } + + internal static BrokerDiagnostics DeserializeBrokerDiagnostics(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DiagnosticsLogs logs = default; + Metrics metrics = default; + SelfCheck selfCheck = default; + Traces traces = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("logs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + logs = DiagnosticsLogs.DeserializeDiagnosticsLogs(property.Value, options); + continue; + } + if (property.NameEquals("metrics"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + metrics = Metrics.DeserializeMetrics(property.Value, options); + continue; + } + if (property.NameEquals("selfCheck"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + selfCheck = SelfCheck.DeserializeSelfCheck(property.Value, options); + continue; + } + if (property.NameEquals("traces"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + traces = Traces.DeserializeTraces(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerDiagnostics(logs, metrics, selfCheck, traces, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerDiagnostics)} does not support writing '{options.Format}' format."); + } + } + + BrokerDiagnostics IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerDiagnostics(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerDiagnostics)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerDiagnostics.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerDiagnostics.cs new file mode 100644 index 000000000000..8e1a7722fd06 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerDiagnostics.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Broker Diagnostic Setting properties. + public partial class BrokerDiagnostics + { + /// + /// 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; + + /// Initializes a new instance of . + public BrokerDiagnostics() + { + } + + /// Initializes a new instance of . + /// Diagnostic log settings for the resource. + /// The metrics settings for the resource. + /// The self check properties. + /// The trace properties. + /// Keeps track of any properties unknown to the library. + internal BrokerDiagnostics(DiagnosticsLogs logs, Metrics metrics, SelfCheck selfCheck, Traces traces, IDictionary serializedAdditionalRawData) + { + Logs = logs; + Metrics = metrics; + SelfCheck = selfCheck; + Traces = traces; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Diagnostic log settings for the resource. + internal DiagnosticsLogs Logs { get; set; } + /// The log level. Examples - 'debug', 'info', 'warn', 'error', 'trace'. + public string LogsLevel + { + get => Logs is null ? default : Logs.Level; + set + { + if (Logs is null) + Logs = new DiagnosticsLogs(); + Logs.Level = value; + } + } + + /// The metrics settings for the resource. + internal Metrics Metrics { get; set; } + /// The prometheus port to expose the metrics. + public int? MetricsPrometheusPort + { + get => Metrics is null ? default : Metrics.PrometheusPort; + set + { + if (Metrics is null) + Metrics = new Metrics(); + Metrics.PrometheusPort = value; + } + } + + /// The self check properties. + public SelfCheck SelfCheck { get; set; } + /// The trace properties. + public Traces Traces { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerListenerProperties.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerListenerProperties.Serialization.cs new file mode 100644 index 000000000000..8c6411ec07f2 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerListenerProperties.Serialization.cs @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class BrokerListenerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerListenerProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ServiceName)) + { + writer.WritePropertyName("serviceName"u8); + writer.WriteStringValue(ServiceName); + } + writer.WritePropertyName("ports"u8); + writer.WriteStartArray(); + foreach (var item in Ports) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(ServiceType)) + { + writer.WritePropertyName("serviceType"u8); + writer.WriteStringValue(ServiceType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerListenerProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerListenerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerListenerProperties(document.RootElement, options); + } + + internal static BrokerListenerProperties DeserializeBrokerListenerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string serviceName = default; + IList ports = default; + ServiceType? serviceType = default; + ProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("serviceName"u8)) + { + serviceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("ports"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ListenerPort.DeserializeListenerPort(item, options)); + } + ports = array; + continue; + } + if (property.NameEquals("serviceType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceType = new ServiceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerListenerProperties(serviceName, ports, serviceType, provisioningState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerListenerProperties)} does not support writing '{options.Format}' format."); + } + } + + BrokerListenerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerListenerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerListenerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerListenerProperties.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerListenerProperties.cs new file mode 100644 index 000000000000..db42f23bfbab --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerListenerProperties.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Defines a Broker listener. A listener is a collection of ports on which the broker accepts connections from clients. + public partial class BrokerListenerProperties + { + /// + /// 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; + + /// Initializes a new instance of . + /// Ports on which this listener accepts client connections. + /// is null. + public BrokerListenerProperties(IEnumerable ports) + { + Argument.AssertNotNull(ports, nameof(ports)); + + Ports = ports.ToList(); + } + + /// Initializes a new instance of . + /// Kubernetes Service name of this listener. + /// Ports on which this listener accepts client connections. + /// Kubernetes Service type of this listener. + /// The status of the last operation. + /// Keeps track of any properties unknown to the library. + internal BrokerListenerProperties(string serviceName, IList ports, ServiceType? serviceType, ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + ServiceName = serviceName; + Ports = ports; + ServiceType = serviceType; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerListenerProperties() + { + } + + /// Kubernetes Service name of this listener. + public string ServiceName { get; set; } + /// Ports on which this listener accepts client connections. + public IList Ports { get; } + /// Kubernetes Service type of this listener. + public ServiceType? ServiceType { get; set; } + /// The status of the last operation. + public ProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerListenerResourceListResult.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerListenerResourceListResult.Serialization.cs new file mode 100644 index 000000000000..e0e694dd041b --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerListenerResourceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + internal partial class BrokerListenerResourceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerListenerResourceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerListenerResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerListenerResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerListenerResourceListResult(document.RootElement, options); + } + + internal static BrokerListenerResourceListResult DeserializeBrokerListenerResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(BrokerListenerResourceData.DeserializeBrokerListenerResourceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerListenerResourceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerListenerResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + BrokerListenerResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerListenerResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerListenerResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerListenerResourceListResult.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerListenerResourceListResult.cs new file mode 100644 index 000000000000..aa31f24de421 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerListenerResourceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// The response of a BrokerListenerResource list operation. + internal partial class BrokerListenerResourceListResult + { + /// + /// 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; + + /// Initializes a new instance of . + /// The BrokerListenerResource items on this page. + /// is null. + internal BrokerListenerResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The BrokerListenerResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal BrokerListenerResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerListenerResourceListResult() + { + } + + /// The BrokerListenerResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerMemoryProfile.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerMemoryProfile.cs new file mode 100644 index 000000000000..c58ee8361f26 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerMemoryProfile.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// The memory profile settings of the Broker. + public readonly partial struct BrokerMemoryProfile : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BrokerMemoryProfile(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string TinyValue = "Tiny"; + private const string LowValue = "Low"; + private const string MediumValue = "Medium"; + private const string HighValue = "High"; + + /// Tiny memory profile. + public static BrokerMemoryProfile Tiny { get; } = new BrokerMemoryProfile(TinyValue); + /// Low memory profile. + public static BrokerMemoryProfile Low { get; } = new BrokerMemoryProfile(LowValue); + /// Medium memory profile. + public static BrokerMemoryProfile Medium { get; } = new BrokerMemoryProfile(MediumValue); + /// High memory profile. + public static BrokerMemoryProfile High { get; } = new BrokerMemoryProfile(HighValue); + /// Determines if two values are the same. + public static bool operator ==(BrokerMemoryProfile left, BrokerMemoryProfile right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BrokerMemoryProfile left, BrokerMemoryProfile right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BrokerMemoryProfile(string value) => new BrokerMemoryProfile(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BrokerMemoryProfile other && Equals(other); + /// + public bool Equals(BrokerMemoryProfile 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerProperties.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerProperties.Serialization.cs new file mode 100644 index 000000000000..0d3d22aacfb8 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerProperties.Serialization.cs @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class BrokerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Advanced)) + { + writer.WritePropertyName("advanced"u8); + writer.WriteObjectValue(Advanced, options); + } + if (Optional.IsDefined(Cardinality)) + { + writer.WritePropertyName("cardinality"u8); + writer.WriteObjectValue(Cardinality, options); + } + if (Optional.IsDefined(Diagnostics)) + { + writer.WritePropertyName("diagnostics"u8); + writer.WriteObjectValue(Diagnostics, options); + } + if (Optional.IsDefined(DiskBackedMessageBuffer)) + { + writer.WritePropertyName("diskBackedMessageBuffer"u8); + writer.WriteObjectValue(DiskBackedMessageBuffer, options); + } + if (Optional.IsDefined(GenerateResourceLimits)) + { + writer.WritePropertyName("generateResourceLimits"u8); + writer.WriteObjectValue(GenerateResourceLimits, options); + } + if (Optional.IsDefined(MemoryProfile)) + { + writer.WritePropertyName("memoryProfile"u8); + writer.WriteStringValue(MemoryProfile.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerProperties(document.RootElement, options); + } + + internal static BrokerProperties DeserializeBrokerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AdvancedSettings advanced = default; + Cardinality cardinality = default; + BrokerDiagnostics diagnostics = default; + DiskBackedMessageBuffer diskBackedMessageBuffer = default; + GenerateResourceLimits generateResourceLimits = default; + BrokerMemoryProfile? memoryProfile = default; + ProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("advanced"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + advanced = AdvancedSettings.DeserializeAdvancedSettings(property.Value, options); + continue; + } + if (property.NameEquals("cardinality"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cardinality = Cardinality.DeserializeCardinality(property.Value, options); + continue; + } + if (property.NameEquals("diagnostics"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diagnostics = BrokerDiagnostics.DeserializeBrokerDiagnostics(property.Value, options); + continue; + } + if (property.NameEquals("diskBackedMessageBuffer"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskBackedMessageBuffer = DiskBackedMessageBuffer.DeserializeDiskBackedMessageBuffer(property.Value, options); + continue; + } + if (property.NameEquals("generateResourceLimits"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + generateResourceLimits = GenerateResourceLimits.DeserializeGenerateResourceLimits(property.Value, options); + continue; + } + if (property.NameEquals("memoryProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + memoryProfile = new BrokerMemoryProfile(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerProperties( + advanced, + cardinality, + diagnostics, + diskBackedMessageBuffer, + generateResourceLimits, + memoryProfile, + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerProperties)} does not support writing '{options.Format}' format."); + } + } + + BrokerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerProperties.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerProperties.cs new file mode 100644 index 000000000000..0c87125f7b86 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerProperties.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Broker Resource properties. + public partial class BrokerProperties + { + /// + /// 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; + + /// Initializes a new instance of . + public BrokerProperties() + { + } + + /// Initializes a new instance of . + /// Advanced settings of Broker. + /// The cardinality details of the broker. + /// Spec defines the desired identities of Broker diagnostics settings. + /// Settings of Disk Backed Message Buffer. + /// This setting controls whether Kubernetes CPU resource limits are requested. Increasing the number of replicas or workers proportionally increases the amount of CPU resources requested. If this setting is enabled and there are insufficient CPU resources, an error will be emitted. + /// Memory profile of Broker. + /// The status of the last operation. + /// Keeps track of any properties unknown to the library. + internal BrokerProperties(AdvancedSettings advanced, Cardinality cardinality, BrokerDiagnostics diagnostics, DiskBackedMessageBuffer diskBackedMessageBuffer, GenerateResourceLimits generateResourceLimits, BrokerMemoryProfile? memoryProfile, ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + Advanced = advanced; + Cardinality = cardinality; + Diagnostics = diagnostics; + DiskBackedMessageBuffer = diskBackedMessageBuffer; + GenerateResourceLimits = generateResourceLimits; + MemoryProfile = memoryProfile; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Advanced settings of Broker. + public AdvancedSettings Advanced { get; set; } + /// The cardinality details of the broker. + public Cardinality Cardinality { get; set; } + /// Spec defines the desired identities of Broker diagnostics settings. + public BrokerDiagnostics Diagnostics { get; set; } + /// Settings of Disk Backed Message Buffer. + public DiskBackedMessageBuffer DiskBackedMessageBuffer { get; set; } + /// This setting controls whether Kubernetes CPU resource limits are requested. Increasing the number of replicas or workers proportionally increases the amount of CPU resources requested. If this setting is enabled and there are insufficient CPU resources, an error will be emitted. + internal GenerateResourceLimits GenerateResourceLimits { get; set; } + /// The toggle to enable/disable cpu resource limits. + public OperationalMode? GenerateResourceLimitsCpu + { + get => GenerateResourceLimits is null ? default : GenerateResourceLimits.Cpu; + set + { + if (GenerateResourceLimits is null) + GenerateResourceLimits = new GenerateResourceLimits(); + GenerateResourceLimits.Cpu = value; + } + } + + /// Memory profile of Broker. + public BrokerMemoryProfile? MemoryProfile { get; set; } + /// The status of the last operation. + public ProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerProtocolType.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerProtocolType.cs new file mode 100644 index 000000000000..93a8e15acaa5 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerProtocolType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Broker Protocol types. + public readonly partial struct BrokerProtocolType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BrokerProtocolType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MqttValue = "Mqtt"; + private const string WebSocketsValue = "WebSockets"; + + /// protocol broker. + public static BrokerProtocolType Mqtt { get; } = new BrokerProtocolType(MqttValue); + /// protocol websocket. + public static BrokerProtocolType WebSockets { get; } = new BrokerProtocolType(WebSocketsValue); + /// Determines if two values are the same. + public static bool operator ==(BrokerProtocolType left, BrokerProtocolType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BrokerProtocolType left, BrokerProtocolType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BrokerProtocolType(string value) => new BrokerProtocolType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BrokerProtocolType other && Equals(other); + /// + public bool Equals(BrokerProtocolType 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerResourceDefinitionMethod.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerResourceDefinitionMethod.cs new file mode 100644 index 000000000000..32bcef3a7c16 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerResourceDefinitionMethod.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// BrokerResourceDefinitionMethods methods allowed. + public readonly partial struct BrokerResourceDefinitionMethod : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BrokerResourceDefinitionMethod(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ConnectValue = "Connect"; + private const string PublishValue = "Publish"; + private const string SubscribeValue = "Subscribe"; + + /// Allowed Connecting to Broker. + public static BrokerResourceDefinitionMethod Connect { get; } = new BrokerResourceDefinitionMethod(ConnectValue); + /// Allowed Publishing to Broker. + public static BrokerResourceDefinitionMethod Publish { get; } = new BrokerResourceDefinitionMethod(PublishValue); + /// Allowed Subscribing to Broker. + public static BrokerResourceDefinitionMethod Subscribe { get; } = new BrokerResourceDefinitionMethod(SubscribeValue); + /// Determines if two values are the same. + public static bool operator ==(BrokerResourceDefinitionMethod left, BrokerResourceDefinitionMethod right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BrokerResourceDefinitionMethod left, BrokerResourceDefinitionMethod right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BrokerResourceDefinitionMethod(string value) => new BrokerResourceDefinitionMethod(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BrokerResourceDefinitionMethod other && Equals(other); + /// + public bool Equals(BrokerResourceDefinitionMethod 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerResourceListResult.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerResourceListResult.Serialization.cs new file mode 100644 index 000000000000..8f231bdd7e0a --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerResourceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + internal partial class BrokerResourceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerResourceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerResourceListResult(document.RootElement, options); + } + + internal static BrokerResourceListResult DeserializeBrokerResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(BrokerResourceData.DeserializeBrokerResourceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerResourceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + BrokerResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerResourceListResult.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerResourceListResult.cs new file mode 100644 index 000000000000..5ca0e501f447 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerResourceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// The response of a BrokerResource list operation. + internal partial class BrokerResourceListResult + { + /// + /// 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; + + /// Initializes a new instance of . + /// The BrokerResource items on this page. + /// is null. + internal BrokerResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The BrokerResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal BrokerResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerResourceListResult() + { + } + + /// The BrokerResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerResourceRule.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerResourceRule.Serialization.cs new file mode 100644 index 000000000000..e2a71afcd226 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerResourceRule.Serialization.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class BrokerResourceRule : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerResourceRule)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("method"u8); + writer.WriteStringValue(Method.ToString()); + if (Optional.IsCollectionDefined(ClientIds)) + { + writer.WritePropertyName("clientIds"u8); + writer.WriteStartArray(); + foreach (var item in ClientIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Topics)) + { + writer.WritePropertyName("topics"u8); + writer.WriteStartArray(); + foreach (var item in Topics) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BrokerResourceRule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerResourceRule)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerResourceRule(document.RootElement, options); + } + + internal static BrokerResourceRule DeserializeBrokerResourceRule(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BrokerResourceDefinitionMethod method = default; + IList clientIds = default; + IList topics = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("method"u8)) + { + method = new BrokerResourceDefinitionMethod(property.Value.GetString()); + continue; + } + if (property.NameEquals("clientIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + clientIds = array; + continue; + } + if (property.NameEquals("topics"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + topics = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerResourceRule(method, clientIds ?? new ChangeTrackingList(), topics ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerResourceRule)} does not support writing '{options.Format}' format."); + } + } + + BrokerResourceRule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerResourceRule(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerResourceRule)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerResourceRule.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerResourceRule.cs new file mode 100644 index 000000000000..a288fbf48e58 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/BrokerResourceRule.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Broker Resource Rule properties. This defines the objects that represent the actions or topics, such as - method.Connect, method.Publish, etc. + public partial class BrokerResourceRule + { + /// + /// 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; + + /// Initializes a new instance of . + /// Give access for a Broker method (i.e., Connect, Subscribe, or Publish). + public BrokerResourceRule(BrokerResourceDefinitionMethod method) + { + Method = method; + ClientIds = new ChangeTrackingList(); + Topics = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Give access for a Broker method (i.e., Connect, Subscribe, or Publish). + /// A list of client IDs that match the clients. The client IDs are case-sensitive and must match the client IDs provided by the clients during connection. This subfield may be set if the method is Connect. + /// A list of topics or topic patterns that match the topics that the clients can publish or subscribe to. This subfield is required if the method is Publish or Subscribe. + /// Keeps track of any properties unknown to the library. + internal BrokerResourceRule(BrokerResourceDefinitionMethod method, IList clientIds, IList topics, IDictionary serializedAdditionalRawData) + { + Method = method; + ClientIds = clientIds; + Topics = topics; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerResourceRule() + { + } + + /// Give access for a Broker method (i.e., Connect, Subscribe, or Publish). + public BrokerResourceDefinitionMethod Method { get; set; } + /// A list of client IDs that match the clients. The client IDs are case-sensitive and must match the client IDs provided by the clients during connection. This subfield may be set if the method is Connect. + public IList ClientIds { get; } + /// A list of topics or topic patterns that match the topics that the clients can publish or subscribe to. This subfield is required if the method is Publish or Subscribe. + public IList Topics { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Cardinality.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Cardinality.Serialization.cs new file mode 100644 index 000000000000..8528595f127d --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Cardinality.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class Cardinality : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(Cardinality)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("backendChain"u8); + writer.WriteObjectValue(BackendChain, options); + writer.WritePropertyName("frontend"u8); + writer.WriteObjectValue(Frontend, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + Cardinality IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Cardinality)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCardinality(document.RootElement, options); + } + + internal static Cardinality DeserializeCardinality(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BackendChain backendChain = default; + Frontend frontend = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("backendChain"u8)) + { + backendChain = BackendChain.DeserializeBackendChain(property.Value, options); + continue; + } + if (property.NameEquals("frontend"u8)) + { + frontend = Frontend.DeserializeFrontend(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Cardinality(backendChain, frontend, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(Cardinality)} does not support writing '{options.Format}' format."); + } + } + + Cardinality IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCardinality(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Cardinality)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSOptionProperty.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Cardinality.cs similarity index 59% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSOptionProperty.cs rename to sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Cardinality.cs index 38edc7fbc43c..7e2d3b673870 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Models/ContainerServiceOSOptionProperty.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Cardinality.cs @@ -8,10 +8,10 @@ using System; using System.Collections.Generic; -namespace Azure.ResourceManager.ContainerService.Models +namespace Azure.ResourceManager.IoTOperations.Models { - /// OS option property. - public partial class ContainerServiceOSOptionProperty + /// Cardinality properties. + public partial class Cardinality { /// /// Keeps track of any properties unknown to the library. @@ -45,39 +45,38 @@ public partial class ContainerServiceOSOptionProperty /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The OS type. - /// Whether the image is FIPS-enabled. - /// is null. - internal ContainerServiceOSOptionProperty(string osType, bool enableFipsImage) + /// Initializes a new instance of . + /// The backend broker desired properties. + /// The frontend desired properties. + /// or is null. + public Cardinality(BackendChain backendChain, Frontend frontend) { - Argument.AssertNotNull(osType, nameof(osType)); + Argument.AssertNotNull(backendChain, nameof(backendChain)); + Argument.AssertNotNull(frontend, nameof(frontend)); - OSType = osType; - EnableFipsImage = enableFipsImage; + BackendChain = backendChain; + Frontend = frontend; } - /// Initializes a new instance of . - /// The OS type. - /// Whether the image is FIPS-enabled. + /// Initializes a new instance of . + /// The backend broker desired properties. + /// The frontend desired properties. /// Keeps track of any properties unknown to the library. - internal ContainerServiceOSOptionProperty(string osType, bool enableFipsImage, IDictionary serializedAdditionalRawData) + internal Cardinality(BackendChain backendChain, Frontend frontend, IDictionary serializedAdditionalRawData) { - OSType = osType; - EnableFipsImage = enableFipsImage; + BackendChain = backendChain; + Frontend = frontend; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ContainerServiceOSOptionProperty() + /// Initializes a new instance of for deserialization. + internal Cardinality() { } - /// The OS type. - [WirePath("os-type")] - public string OSType { get; } - /// Whether the image is FIPS-enabled. - [WirePath("enable-fips-image")] - public bool EnableFipsImage { get; } + /// The backend broker desired properties. + public BackendChain BackendChain { get; set; } + /// The frontend desired properties. + public Frontend Frontend { get; set; } } } diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerCertConfig.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerCertConfig.Serialization.cs new file mode 100644 index 000000000000..a53f3ae9a3bd --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerCertConfig.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class CertManagerCertConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(CertManagerCertConfig)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("duration"u8); + writer.WriteStringValue(Duration); + writer.WritePropertyName("renewBefore"u8); + writer.WriteStringValue(RenewBefore); + writer.WritePropertyName("privateKey"u8); + writer.WriteObjectValue(PrivateKey, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CertManagerCertConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CertManagerCertConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCertManagerCertConfig(document.RootElement, options); + } + + internal static CertManagerCertConfig DeserializeCertManagerCertConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string duration = default; + string renewBefore = default; + CertManagerPrivateKey privateKey = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("duration"u8)) + { + duration = property.Value.GetString(); + continue; + } + if (property.NameEquals("renewBefore"u8)) + { + renewBefore = property.Value.GetString(); + continue; + } + if (property.NameEquals("privateKey"u8)) + { + privateKey = CertManagerPrivateKey.DeserializeCertManagerPrivateKey(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CertManagerCertConfig(duration, renewBefore, privateKey, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CertManagerCertConfig)} does not support writing '{options.Format}' format."); + } + } + + CertManagerCertConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCertManagerCertConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CertManagerCertConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerCertConfig.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerCertConfig.cs new file mode 100644 index 000000000000..694c5389d243 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerCertConfig.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Cert Manager Cert properties. + public partial class CertManagerCertConfig + { + /// + /// 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; + + /// Initializes a new instance of . + /// Lifetime of certificate. Must be specified using a Go time.Duration format (h|m|s). E.g. 240h for 240 hours and 45m for 45 minutes. + /// When to begin renewing certificate. Must be specified using a Go time.Duration format (h|m|s). E.g. 240h for 240 hours and 45m for 45 minutes. + /// Configuration of certificate private key. + /// , or is null. + public CertManagerCertConfig(string duration, string renewBefore, CertManagerPrivateKey privateKey) + { + Argument.AssertNotNull(duration, nameof(duration)); + Argument.AssertNotNull(renewBefore, nameof(renewBefore)); + Argument.AssertNotNull(privateKey, nameof(privateKey)); + + Duration = duration; + RenewBefore = renewBefore; + PrivateKey = privateKey; + } + + /// Initializes a new instance of . + /// Lifetime of certificate. Must be specified using a Go time.Duration format (h|m|s). E.g. 240h for 240 hours and 45m for 45 minutes. + /// When to begin renewing certificate. Must be specified using a Go time.Duration format (h|m|s). E.g. 240h for 240 hours and 45m for 45 minutes. + /// Configuration of certificate private key. + /// Keeps track of any properties unknown to the library. + internal CertManagerCertConfig(string duration, string renewBefore, CertManagerPrivateKey privateKey, IDictionary serializedAdditionalRawData) + { + Duration = duration; + RenewBefore = renewBefore; + PrivateKey = privateKey; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CertManagerCertConfig() + { + } + + /// Lifetime of certificate. Must be specified using a Go time.Duration format (h|m|s). E.g. 240h for 240 hours and 45m for 45 minutes. + public string Duration { get; set; } + /// When to begin renewing certificate. Must be specified using a Go time.Duration format (h|m|s). E.g. 240h for 240 hours and 45m for 45 minutes. + public string RenewBefore { get; set; } + /// Configuration of certificate private key. + public CertManagerPrivateKey PrivateKey { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerCertificateSpec.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerCertificateSpec.Serialization.cs new file mode 100644 index 000000000000..3df840f47648 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerCertificateSpec.Serialization.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class CertManagerCertificateSpec : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(CertManagerCertificateSpec)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Duration)) + { + writer.WritePropertyName("duration"u8); + writer.WriteStringValue(Duration); + } + if (Optional.IsDefined(SecretName)) + { + writer.WritePropertyName("secretName"u8); + writer.WriteStringValue(SecretName); + } + if (Optional.IsDefined(RenewBefore)) + { + writer.WritePropertyName("renewBefore"u8); + writer.WriteStringValue(RenewBefore); + } + writer.WritePropertyName("issuerRef"u8); + writer.WriteObjectValue(IssuerRef, options); + if (Optional.IsDefined(PrivateKey)) + { + writer.WritePropertyName("privateKey"u8); + writer.WriteObjectValue(PrivateKey, options); + } + if (Optional.IsDefined(San)) + { + writer.WritePropertyName("san"u8); + writer.WriteObjectValue(San, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CertManagerCertificateSpec IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CertManagerCertificateSpec)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCertManagerCertificateSpec(document.RootElement, options); + } + + internal static CertManagerCertificateSpec DeserializeCertManagerCertificateSpec(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string duration = default; + string secretName = default; + string renewBefore = default; + CertManagerIssuerRef issuerRef = default; + CertManagerPrivateKey privateKey = default; + SanForCert san = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("duration"u8)) + { + duration = property.Value.GetString(); + continue; + } + if (property.NameEquals("secretName"u8)) + { + secretName = property.Value.GetString(); + continue; + } + if (property.NameEquals("renewBefore"u8)) + { + renewBefore = property.Value.GetString(); + continue; + } + if (property.NameEquals("issuerRef"u8)) + { + issuerRef = CertManagerIssuerRef.DeserializeCertManagerIssuerRef(property.Value, options); + continue; + } + if (property.NameEquals("privateKey"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateKey = CertManagerPrivateKey.DeserializeCertManagerPrivateKey(property.Value, options); + continue; + } + if (property.NameEquals("san"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + san = SanForCert.DeserializeSanForCert(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CertManagerCertificateSpec( + duration, + secretName, + renewBefore, + issuerRef, + privateKey, + san, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CertManagerCertificateSpec)} does not support writing '{options.Format}' format."); + } + } + + CertManagerCertificateSpec IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCertManagerCertificateSpec(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CertManagerCertificateSpec)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerCertificateSpec.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerCertificateSpec.cs new file mode 100644 index 000000000000..dde57dbe48c7 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerCertificateSpec.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Automatic TLS server certificate management with cert-manager. + public partial class CertManagerCertificateSpec + { + /// + /// 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; + + /// Initializes a new instance of . + /// cert-manager issuerRef. + /// is null. + public CertManagerCertificateSpec(CertManagerIssuerRef issuerRef) + { + Argument.AssertNotNull(issuerRef, nameof(issuerRef)); + + IssuerRef = issuerRef; + } + + /// Initializes a new instance of . + /// Lifetime of certificate. Must be specified using a Go time.Duration format (h|m|s). E.g. 240h for 240 hours and 45m for 45 minutes. + /// Secret for storing server certificate. Any existing data will be overwritten. This is a reference to the secret through an identifying name, not the secret itself. + /// When to begin renewing certificate. Must be specified using a Go time.Duration format (h|m|s). E.g. 240h for 240 hours and 45m for 45 minutes. + /// cert-manager issuerRef. + /// Type of certificate private key. + /// Additional Subject Alternative Names (SANs) to include in the certificate. + /// Keeps track of any properties unknown to the library. + internal CertManagerCertificateSpec(string duration, string secretName, string renewBefore, CertManagerIssuerRef issuerRef, CertManagerPrivateKey privateKey, SanForCert san, IDictionary serializedAdditionalRawData) + { + Duration = duration; + SecretName = secretName; + RenewBefore = renewBefore; + IssuerRef = issuerRef; + PrivateKey = privateKey; + San = san; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CertManagerCertificateSpec() + { + } + + /// Lifetime of certificate. Must be specified using a Go time.Duration format (h|m|s). E.g. 240h for 240 hours and 45m for 45 minutes. + public string Duration { get; set; } + /// Secret for storing server certificate. Any existing data will be overwritten. This is a reference to the secret through an identifying name, not the secret itself. + public string SecretName { get; set; } + /// When to begin renewing certificate. Must be specified using a Go time.Duration format (h|m|s). E.g. 240h for 240 hours and 45m for 45 minutes. + public string RenewBefore { get; set; } + /// cert-manager issuerRef. + public CertManagerIssuerRef IssuerRef { get; set; } + /// Type of certificate private key. + public CertManagerPrivateKey PrivateKey { get; set; } + /// Additional Subject Alternative Names (SANs) to include in the certificate. + public SanForCert San { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerIssuerKind.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerIssuerKind.cs new file mode 100644 index 000000000000..3b15b25daea4 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerIssuerKind.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// CertManagerIssuerKind properties. + public readonly partial struct CertManagerIssuerKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CertManagerIssuerKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string IssuerValue = "Issuer"; + private const string ClusterIssuerValue = "ClusterIssuer"; + + /// Issuer kind. + public static CertManagerIssuerKind Issuer { get; } = new CertManagerIssuerKind(IssuerValue); + /// ClusterIssuer kind. + public static CertManagerIssuerKind ClusterIssuer { get; } = new CertManagerIssuerKind(ClusterIssuerValue); + /// Determines if two values are the same. + public static bool operator ==(CertManagerIssuerKind left, CertManagerIssuerKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CertManagerIssuerKind left, CertManagerIssuerKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CertManagerIssuerKind(string value) => new CertManagerIssuerKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CertManagerIssuerKind other && Equals(other); + /// + public bool Equals(CertManagerIssuerKind 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerIssuerRef.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerIssuerRef.Serialization.cs new file mode 100644 index 000000000000..bee8c18c3e3e --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerIssuerRef.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class CertManagerIssuerRef : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(CertManagerIssuerRef)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group); + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.ToString()); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CertManagerIssuerRef IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CertManagerIssuerRef)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCertManagerIssuerRef(document.RootElement, options); + } + + internal static CertManagerIssuerRef DeserializeCertManagerIssuerRef(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string group = default; + CertManagerIssuerKind kind = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("group"u8)) + { + group = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new CertManagerIssuerKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CertManagerIssuerRef(group, kind, name, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CertManagerIssuerRef)} does not support writing '{options.Format}' format."); + } + } + + CertManagerIssuerRef IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCertManagerIssuerRef(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CertManagerIssuerRef)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerIssuerRef.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerIssuerRef.cs new file mode 100644 index 000000000000..1a05a25db0ff --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerIssuerRef.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Cert-Manager issuerRef properties. + public partial class CertManagerIssuerRef + { + /// + /// 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; + + /// Initializes a new instance of . + /// group of issuer. + /// kind of issuer (Issuer or ClusterIssuer). + /// name of issuer. + /// or is null. + public CertManagerIssuerRef(string group, CertManagerIssuerKind kind, string name) + { + Argument.AssertNotNull(group, nameof(group)); + Argument.AssertNotNull(name, nameof(name)); + + Group = group; + Kind = kind; + Name = name; + } + + /// Initializes a new instance of . + /// group of issuer. + /// kind of issuer (Issuer or ClusterIssuer). + /// name of issuer. + /// Keeps track of any properties unknown to the library. + internal CertManagerIssuerRef(string group, CertManagerIssuerKind kind, string name, IDictionary serializedAdditionalRawData) + { + Group = group; + Kind = kind; + Name = name; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CertManagerIssuerRef() + { + } + + /// group of issuer. + public string Group { get; set; } + /// kind of issuer (Issuer or ClusterIssuer). + public CertManagerIssuerKind Kind { get; set; } + /// name of issuer. + public string Name { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerPrivateKey.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerPrivateKey.Serialization.cs new file mode 100644 index 000000000000..cb61666cb083 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerPrivateKey.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class CertManagerPrivateKey : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(CertManagerPrivateKey)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("algorithm"u8); + writer.WriteStringValue(Algorithm.ToString()); + writer.WritePropertyName("rotationPolicy"u8); + writer.WriteStringValue(RotationPolicy.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CertManagerPrivateKey IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CertManagerPrivateKey)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCertManagerPrivateKey(document.RootElement, options); + } + + internal static CertManagerPrivateKey DeserializeCertManagerPrivateKey(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PrivateKeyAlgorithm algorithm = default; + PrivateKeyRotationPolicy rotationPolicy = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("algorithm"u8)) + { + algorithm = new PrivateKeyAlgorithm(property.Value.GetString()); + continue; + } + if (property.NameEquals("rotationPolicy"u8)) + { + rotationPolicy = new PrivateKeyRotationPolicy(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CertManagerPrivateKey(algorithm, rotationPolicy, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CertManagerPrivateKey)} does not support writing '{options.Format}' format."); + } + } + + CertManagerPrivateKey IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCertManagerPrivateKey(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CertManagerPrivateKey)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerPrivateKey.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerPrivateKey.cs new file mode 100644 index 000000000000..35eec05009f0 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CertManagerPrivateKey.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Cert Manager private key properties. + public partial class CertManagerPrivateKey + { + /// + /// 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; + + /// Initializes a new instance of . + /// algorithm for private key. + /// cert-manager private key rotationPolicy. + public CertManagerPrivateKey(PrivateKeyAlgorithm algorithm, PrivateKeyRotationPolicy rotationPolicy) + { + Algorithm = algorithm; + RotationPolicy = rotationPolicy; + } + + /// Initializes a new instance of . + /// algorithm for private key. + /// cert-manager private key rotationPolicy. + /// Keeps track of any properties unknown to the library. + internal CertManagerPrivateKey(PrivateKeyAlgorithm algorithm, PrivateKeyRotationPolicy rotationPolicy, IDictionary serializedAdditionalRawData) + { + Algorithm = algorithm; + RotationPolicy = rotationPolicy; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CertManagerPrivateKey() + { + } + + /// algorithm for private key. + public PrivateKeyAlgorithm Algorithm { get; set; } + /// cert-manager private key rotationPolicy. + public PrivateKeyRotationPolicy RotationPolicy { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ClientConfig.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ClientConfig.Serialization.cs new file mode 100644 index 000000000000..53b7e9916483 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ClientConfig.Serialization.cs @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class ClientConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ClientConfig)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(MaxSessionExpirySeconds)) + { + writer.WritePropertyName("maxSessionExpirySeconds"u8); + writer.WriteNumberValue(MaxSessionExpirySeconds.Value); + } + if (Optional.IsDefined(MaxMessageExpirySeconds)) + { + writer.WritePropertyName("maxMessageExpirySeconds"u8); + writer.WriteNumberValue(MaxMessageExpirySeconds.Value); + } + if (Optional.IsDefined(MaxPacketSizeBytes)) + { + writer.WritePropertyName("maxPacketSizeBytes"u8); + writer.WriteNumberValue(MaxPacketSizeBytes.Value); + } + if (Optional.IsDefined(SubscriberQueueLimit)) + { + writer.WritePropertyName("subscriberQueueLimit"u8); + writer.WriteObjectValue(SubscriberQueueLimit, options); + } + if (Optional.IsDefined(MaxReceiveMaximum)) + { + writer.WritePropertyName("maxReceiveMaximum"u8); + writer.WriteNumberValue(MaxReceiveMaximum.Value); + } + if (Optional.IsDefined(MaxKeepAliveSeconds)) + { + writer.WritePropertyName("maxKeepAliveSeconds"u8); + writer.WriteNumberValue(MaxKeepAliveSeconds.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ClientConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ClientConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeClientConfig(document.RootElement, options); + } + + internal static ClientConfig DeserializeClientConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? maxSessionExpirySeconds = default; + int? maxMessageExpirySeconds = default; + int? maxPacketSizeBytes = default; + SubscriberQueueLimit subscriberQueueLimit = default; + int? maxReceiveMaximum = default; + int? maxKeepAliveSeconds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maxSessionExpirySeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxSessionExpirySeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxMessageExpirySeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxMessageExpirySeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxPacketSizeBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxPacketSizeBytes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("subscriberQueueLimit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + subscriberQueueLimit = SubscriberQueueLimit.DeserializeSubscriberQueueLimit(property.Value, options); + continue; + } + if (property.NameEquals("maxReceiveMaximum"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxReceiveMaximum = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxKeepAliveSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxKeepAliveSeconds = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ClientConfig( + maxSessionExpirySeconds, + maxMessageExpirySeconds, + maxPacketSizeBytes, + subscriberQueueLimit, + maxReceiveMaximum, + maxKeepAliveSeconds, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ClientConfig)} does not support writing '{options.Format}' format."); + } + } + + ClientConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeClientConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ClientConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ClientConfig.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ClientConfig.cs new file mode 100644 index 000000000000..ebfcf5bbd08d --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ClientConfig.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// The settings of Client Config. + public partial class ClientConfig + { + /// + /// 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; + + /// Initializes a new instance of . + public ClientConfig() + { + } + + /// Initializes a new instance of . + /// Upper bound of Session Expiry Interval, in seconds. + /// Upper bound of Message Expiry Interval, in seconds. + /// Max message size for a packet in Bytes. + /// The limit on the number of queued messages for a subscriber. + /// Upper bound of Receive Maximum that a client can request in the CONNECT packet. + /// Upper bound of a client's Keep Alive, in seconds. + /// Keeps track of any properties unknown to the library. + internal ClientConfig(int? maxSessionExpirySeconds, int? maxMessageExpirySeconds, int? maxPacketSizeBytes, SubscriberQueueLimit subscriberQueueLimit, int? maxReceiveMaximum, int? maxKeepAliveSeconds, IDictionary serializedAdditionalRawData) + { + MaxSessionExpirySeconds = maxSessionExpirySeconds; + MaxMessageExpirySeconds = maxMessageExpirySeconds; + MaxPacketSizeBytes = maxPacketSizeBytes; + SubscriberQueueLimit = subscriberQueueLimit; + MaxReceiveMaximum = maxReceiveMaximum; + MaxKeepAliveSeconds = maxKeepAliveSeconds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Upper bound of Session Expiry Interval, in seconds. + public int? MaxSessionExpirySeconds { get; set; } + /// Upper bound of Message Expiry Interval, in seconds. + public int? MaxMessageExpirySeconds { get; set; } + /// Max message size for a packet in Bytes. + public int? MaxPacketSizeBytes { get; set; } + /// The limit on the number of queued messages for a subscriber. + public SubscriberQueueLimit SubscriberQueueLimit { get; set; } + /// Upper bound of Receive Maximum that a client can request in the CONNECT packet. + public int? MaxReceiveMaximum { get; set; } + /// Upper bound of a client's Keep Alive, in seconds. + public int? MaxKeepAliveSeconds { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CloudEventAttributeType.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CloudEventAttributeType.cs new file mode 100644 index 000000000000..07e184c2b88f --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/CloudEventAttributeType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// How to map events to the cloud. + public readonly partial struct CloudEventAttributeType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CloudEventAttributeType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PropagateValue = "Propagate"; + private const string CreateOrRemapValue = "CreateOrRemap"; + + /// Propagate type. + public static CloudEventAttributeType Propagate { get; } = new CloudEventAttributeType(PropagateValue); + /// CreateOrRemap type. + public static CloudEventAttributeType CreateOrRemap { get; } = new CloudEventAttributeType(CreateOrRemapValue); + /// Determines if two values are the same. + public static bool operator ==(CloudEventAttributeType left, CloudEventAttributeType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CloudEventAttributeType left, CloudEventAttributeType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CloudEventAttributeType(string value) => new CloudEventAttributeType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CloudEventAttributeType other && Equals(other); + /// + public bool Equals(CloudEventAttributeType 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataExplorerAuthMethod.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataExplorerAuthMethod.cs new file mode 100644 index 000000000000..497e5a24a524 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataExplorerAuthMethod.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// DataflowEndpoint Data Explorer Authentication Method properties. + public readonly partial struct DataExplorerAuthMethod : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataExplorerAuthMethod(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SystemAssignedManagedIdentityValue = "SystemAssignedManagedIdentity"; + private const string UserAssignedManagedIdentityValue = "UserAssignedManagedIdentity"; + + /// SystemAssignedManagedIdentity type. + public static DataExplorerAuthMethod SystemAssignedManagedIdentity { get; } = new DataExplorerAuthMethod(SystemAssignedManagedIdentityValue); + /// UserAssignedManagedIdentity type. + public static DataExplorerAuthMethod UserAssignedManagedIdentity { get; } = new DataExplorerAuthMethod(UserAssignedManagedIdentityValue); + /// Determines if two values are the same. + public static bool operator ==(DataExplorerAuthMethod left, DataExplorerAuthMethod right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataExplorerAuthMethod left, DataExplorerAuthMethod right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataExplorerAuthMethod(string value) => new DataExplorerAuthMethod(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataExplorerAuthMethod other && Equals(other); + /// + public bool Equals(DataExplorerAuthMethod 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataLakeStorageAuthMethod.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataLakeStorageAuthMethod.cs new file mode 100644 index 000000000000..a922c04fa468 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataLakeStorageAuthMethod.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// DataflowEndpoint Data Lake Storage Authentication Method properties. + public readonly partial struct DataLakeStorageAuthMethod : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataLakeStorageAuthMethod(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SystemAssignedManagedIdentityValue = "SystemAssignedManagedIdentity"; + private const string UserAssignedManagedIdentityValue = "UserAssignedManagedIdentity"; + private const string AccessTokenValue = "AccessToken"; + + /// SystemAssignedManagedIdentity type. + public static DataLakeStorageAuthMethod SystemAssignedManagedIdentity { get; } = new DataLakeStorageAuthMethod(SystemAssignedManagedIdentityValue); + /// UserAssignedManagedIdentity type. + public static DataLakeStorageAuthMethod UserAssignedManagedIdentity { get; } = new DataLakeStorageAuthMethod(UserAssignedManagedIdentityValue); + /// AccessToken Option. + public static DataLakeStorageAuthMethod AccessToken { get; } = new DataLakeStorageAuthMethod(AccessTokenValue); + /// Determines if two values are the same. + public static bool operator ==(DataLakeStorageAuthMethod left, DataLakeStorageAuthMethod right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataLakeStorageAuthMethod left, DataLakeStorageAuthMethod right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataLakeStorageAuthMethod(string value) => new DataLakeStorageAuthMethod(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataLakeStorageAuthMethod other && Equals(other); + /// + public bool Equals(DataLakeStorageAuthMethod 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowAction.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowAction.Serialization.cs new file mode 100644 index 000000000000..399b6945e23c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowAction.Serialization.cs @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class DataflowAction : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowAction)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("operationType"u8); + writer.WriteStringValue(OperationType.ToString()); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(SourceSettings)) + { + writer.WritePropertyName("sourceSettings"u8); + writer.WriteObjectValue(SourceSettings, options); + } + if (Optional.IsDefined(BuiltInTransformationSettings)) + { + writer.WritePropertyName("builtInTransformationSettings"u8); + writer.WriteObjectValue(BuiltInTransformationSettings, options); + } + if (Optional.IsDefined(DestinationSettings)) + { + writer.WritePropertyName("destinationSettings"u8); + writer.WriteObjectValue(DestinationSettings, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowAction IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowAction)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowAction(document.RootElement, options); + } + + internal static DataflowAction DeserializeDataflowAction(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OperationType operationType = default; + string name = default; + DataflowSourceOperationSettings sourceSettings = default; + DataflowBuiltInTransformationSettings builtInTransformationSettings = default; + DataflowDestinationOperationSettings destinationSettings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("operationType"u8)) + { + operationType = new OperationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceSettings = DataflowSourceOperationSettings.DeserializeDataflowSourceOperationSettings(property.Value, options); + continue; + } + if (property.NameEquals("builtInTransformationSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + builtInTransformationSettings = DataflowBuiltInTransformationSettings.DeserializeDataflowBuiltInTransformationSettings(property.Value, options); + continue; + } + if (property.NameEquals("destinationSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + destinationSettings = DataflowDestinationOperationSettings.DeserializeDataflowDestinationOperationSettings(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowAction( + operationType, + name, + sourceSettings, + builtInTransformationSettings, + destinationSettings, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowAction)} does not support writing '{options.Format}' format."); + } + } + + DataflowAction IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowAction(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowAction)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowAction.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowAction.cs new file mode 100644 index 000000000000..5ecb7e082036 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowAction.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Dataflow Operation properties. NOTE - One only method is allowed to be used for one entry. + public partial class DataflowAction + { + /// + /// 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; + + /// Initializes a new instance of . + /// Type of operation. + public DataflowAction(OperationType operationType) + { + OperationType = operationType; + } + + /// Initializes a new instance of . + /// Type of operation. + /// Optional user provided name of the transformation. + /// Source configuration. + /// Built In Transformation configuration. + /// Destination configuration. + /// Keeps track of any properties unknown to the library. + internal DataflowAction(OperationType operationType, string name, DataflowSourceOperationSettings sourceSettings, DataflowBuiltInTransformationSettings builtInTransformationSettings, DataflowDestinationOperationSettings destinationSettings, IDictionary serializedAdditionalRawData) + { + OperationType = operationType; + Name = name; + SourceSettings = sourceSettings; + BuiltInTransformationSettings = builtInTransformationSettings; + DestinationSettings = destinationSettings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowAction() + { + } + + /// Type of operation. + public OperationType OperationType { get; set; } + /// Optional user provided name of the transformation. + public string Name { get; set; } + /// Source configuration. + public DataflowSourceOperationSettings SourceSettings { get; set; } + /// Built In Transformation configuration. + public DataflowBuiltInTransformationSettings BuiltInTransformationSettings { get; set; } + /// Destination configuration. + public DataflowDestinationOperationSettings DestinationSettings { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationDataset.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationDataset.Serialization.cs new file mode 100644 index 000000000000..32fdd41ed448 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationDataset.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class DataflowBuiltInTransformationDataset : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationDataset)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(SchemaRef)) + { + writer.WritePropertyName("schemaRef"u8); + writer.WriteStringValue(SchemaRef); + } + writer.WritePropertyName("inputs"u8); + writer.WriteStartArray(); + foreach (var item in Inputs) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(Expression)) + { + writer.WritePropertyName("expression"u8); + writer.WriteStringValue(Expression); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowBuiltInTransformationDataset IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationDataset)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowBuiltInTransformationDataset(document.RootElement, options); + } + + internal static DataflowBuiltInTransformationDataset DeserializeDataflowBuiltInTransformationDataset(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string key = default; + string description = default; + string schemaRef = default; + IList inputs = default; + string expression = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("key"u8)) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("schemaRef"u8)) + { + schemaRef = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + inputs = array; + continue; + } + if (property.NameEquals("expression"u8)) + { + expression = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowBuiltInTransformationDataset( + key, + description, + schemaRef, + inputs, + expression, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationDataset)} does not support writing '{options.Format}' format."); + } + } + + DataflowBuiltInTransformationDataset IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowBuiltInTransformationDataset(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationDataset)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationDataset.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationDataset.cs new file mode 100644 index 000000000000..0270fee0286a --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationDataset.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Dataflow BuiltIn Transformation dataset properties. + public partial class DataflowBuiltInTransformationDataset + { + /// + /// 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; + + /// Initializes a new instance of . + /// The key of the dataset. + /// List of fields for enriching from the Broker State Store. + /// or is null. + public DataflowBuiltInTransformationDataset(string key, IEnumerable inputs) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(inputs, nameof(inputs)); + + Key = key; + Inputs = inputs.ToList(); + } + + /// Initializes a new instance of . + /// The key of the dataset. + /// A user provided optional description of the dataset. + /// The reference to the schema that describes the dataset. Allowed: JSON Schema/draft-7. + /// List of fields for enriching from the Broker State Store. + /// Condition to enrich data from Broker State Store. Example: $1 < 0 || $1 > $2 (Assuming inputs section $1 and $2 are provided). + /// Keeps track of any properties unknown to the library. + internal DataflowBuiltInTransformationDataset(string key, string description, string schemaRef, IList inputs, string expression, IDictionary serializedAdditionalRawData) + { + Key = key; + Description = description; + SchemaRef = schemaRef; + Inputs = inputs; + Expression = expression; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowBuiltInTransformationDataset() + { + } + + /// The key of the dataset. + public string Key { get; set; } + /// A user provided optional description of the dataset. + public string Description { get; set; } + /// The reference to the schema that describes the dataset. Allowed: JSON Schema/draft-7. + public string SchemaRef { get; set; } + /// List of fields for enriching from the Broker State Store. + public IList Inputs { get; } + /// Condition to enrich data from Broker State Store. Example: $1 < 0 || $1 > $2 (Assuming inputs section $1 and $2 are provided). + public string Expression { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationFilter.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationFilter.Serialization.cs new file mode 100644 index 000000000000..a9df943a83ec --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationFilter.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class DataflowBuiltInTransformationFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationFilter)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.Value.ToString()); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + writer.WritePropertyName("inputs"u8); + writer.WriteStartArray(); + foreach (var item in Inputs) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("expression"u8); + writer.WriteStringValue(Expression); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowBuiltInTransformationFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowBuiltInTransformationFilter(document.RootElement, options); + } + + internal static DataflowBuiltInTransformationFilter DeserializeDataflowBuiltInTransformationFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FilterType? type = default; + string description = default; + IList inputs = default; + string expression = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new FilterType(property.Value.GetString()); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + inputs = array; + continue; + } + if (property.NameEquals("expression"u8)) + { + expression = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowBuiltInTransformationFilter(type, description, inputs, expression, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationFilter)} does not support writing '{options.Format}' format."); + } + } + + DataflowBuiltInTransformationFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowBuiltInTransformationFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationFilter.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationFilter.cs new file mode 100644 index 000000000000..c95447d44c52 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationFilter.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Dataflow BuiltIn Transformation filter properties. + public partial class DataflowBuiltInTransformationFilter + { + /// + /// 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; + + /// Initializes a new instance of . + /// List of fields for filtering in JSON path expression. + /// Condition to filter data. Can reference input fields with {n} where n is the index of the input field starting from 1. Example: $1 < 0 || $1 > $2 (Assuming inputs section $1 and $2 are provided). + /// or is null. + public DataflowBuiltInTransformationFilter(IEnumerable inputs, string expression) + { + Argument.AssertNotNull(inputs, nameof(inputs)); + Argument.AssertNotNull(expression, nameof(expression)); + + Inputs = inputs.ToList(); + Expression = expression; + } + + /// Initializes a new instance of . + /// The type of dataflow operation. + /// A user provided optional description of the filter. + /// List of fields for filtering in JSON path expression. + /// Condition to filter data. Can reference input fields with {n} where n is the index of the input field starting from 1. Example: $1 < 0 || $1 > $2 (Assuming inputs section $1 and $2 are provided). + /// Keeps track of any properties unknown to the library. + internal DataflowBuiltInTransformationFilter(FilterType? type, string description, IList inputs, string expression, IDictionary serializedAdditionalRawData) + { + Type = type; + Description = description; + Inputs = inputs; + Expression = expression; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowBuiltInTransformationFilter() + { + } + + /// The type of dataflow operation. + public FilterType? Type { get; set; } + /// A user provided optional description of the filter. + public string Description { get; set; } + /// List of fields for filtering in JSON path expression. + public IList Inputs { get; } + /// Condition to filter data. Can reference input fields with {n} where n is the index of the input field starting from 1. Example: $1 < 0 || $1 > $2 (Assuming inputs section $1 and $2 are provided). + public string Expression { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationMap.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationMap.Serialization.cs new file mode 100644 index 000000000000..2bd8204665dc --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationMap.Serialization.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class DataflowBuiltInTransformationMap : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationMap)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.Value.ToString()); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + writer.WritePropertyName("inputs"u8); + writer.WriteStartArray(); + foreach (var item in Inputs) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(Expression)) + { + writer.WritePropertyName("expression"u8); + writer.WriteStringValue(Expression); + } + writer.WritePropertyName("output"u8); + writer.WriteStringValue(Output); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowBuiltInTransformationMap IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationMap)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowBuiltInTransformationMap(document.RootElement, options); + } + + internal static DataflowBuiltInTransformationMap DeserializeDataflowBuiltInTransformationMap(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataflowMappingType? type = default; + string description = default; + IList inputs = default; + string expression = default; + string output = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new DataflowMappingType(property.Value.GetString()); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("inputs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + inputs = array; + continue; + } + if (property.NameEquals("expression"u8)) + { + expression = property.Value.GetString(); + continue; + } + if (property.NameEquals("output"u8)) + { + output = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowBuiltInTransformationMap( + type, + description, + inputs, + expression, + output, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationMap)} does not support writing '{options.Format}' format."); + } + } + + DataflowBuiltInTransformationMap IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowBuiltInTransformationMap(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationMap)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationMap.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationMap.cs new file mode 100644 index 000000000000..b8af2195825c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationMap.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Dataflow BuiltIn Transformation map properties. + public partial class DataflowBuiltInTransformationMap + { + /// + /// 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; + + /// Initializes a new instance of . + /// List of fields for mapping in JSON path expression. + /// Where and how the input fields to be organized in the output record. + /// or is null. + public DataflowBuiltInTransformationMap(IEnumerable inputs, string output) + { + Argument.AssertNotNull(inputs, nameof(inputs)); + Argument.AssertNotNull(output, nameof(output)); + + Inputs = inputs.ToList(); + Output = output; + } + + /// Initializes a new instance of . + /// Type of transformation. + /// A user provided optional description of the mapping function. + /// List of fields for mapping in JSON path expression. + /// Modify the inputs field(s) to the final output field. Example: $1 * 2.2 (Assuming inputs section $1 is provided). + /// Where and how the input fields to be organized in the output record. + /// Keeps track of any properties unknown to the library. + internal DataflowBuiltInTransformationMap(DataflowMappingType? type, string description, IList inputs, string expression, string output, IDictionary serializedAdditionalRawData) + { + Type = type; + Description = description; + Inputs = inputs; + Expression = expression; + Output = output; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowBuiltInTransformationMap() + { + } + + /// Type of transformation. + public DataflowMappingType? Type { get; set; } + /// A user provided optional description of the mapping function. + public string Description { get; set; } + /// List of fields for mapping in JSON path expression. + public IList Inputs { get; } + /// Modify the inputs field(s) to the final output field. Example: $1 * 2.2 (Assuming inputs section $1 is provided). + public string Expression { get; set; } + /// Where and how the input fields to be organized in the output record. + public string Output { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationSettings.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationSettings.Serialization.cs new file mode 100644 index 000000000000..d557ce13973f --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationSettings.Serialization.cs @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class DataflowBuiltInTransformationSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationSettings)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(SerializationFormat)) + { + writer.WritePropertyName("serializationFormat"u8); + writer.WriteStringValue(SerializationFormat.Value.ToString()); + } + if (Optional.IsDefined(SchemaRef)) + { + writer.WritePropertyName("schemaRef"u8); + writer.WriteStringValue(SchemaRef); + } + if (Optional.IsCollectionDefined(Datasets)) + { + writer.WritePropertyName("datasets"u8); + writer.WriteStartArray(); + foreach (var item in Datasets) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Filter)) + { + writer.WritePropertyName("filter"u8); + writer.WriteStartArray(); + foreach (var item in Filter) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Map)) + { + writer.WritePropertyName("map"u8); + writer.WriteStartArray(); + foreach (var item in Map) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowBuiltInTransformationSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowBuiltInTransformationSettings(document.RootElement, options); + } + + internal static DataflowBuiltInTransformationSettings DeserializeDataflowBuiltInTransformationSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + TransformationSerializationFormat? serializationFormat = default; + string schemaRef = default; + IList datasets = default; + IList filter = default; + IList map = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("serializationFormat"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serializationFormat = new TransformationSerializationFormat(property.Value.GetString()); + continue; + } + if (property.NameEquals("schemaRef"u8)) + { + schemaRef = property.Value.GetString(); + continue; + } + if (property.NameEquals("datasets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataflowBuiltInTransformationDataset.DeserializeDataflowBuiltInTransformationDataset(item, options)); + } + datasets = array; + continue; + } + if (property.NameEquals("filter"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataflowBuiltInTransformationFilter.DeserializeDataflowBuiltInTransformationFilter(item, options)); + } + filter = array; + continue; + } + if (property.NameEquals("map"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataflowBuiltInTransformationMap.DeserializeDataflowBuiltInTransformationMap(item, options)); + } + map = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowBuiltInTransformationSettings( + serializationFormat, + schemaRef, + datasets ?? new ChangeTrackingList(), + filter ?? new ChangeTrackingList(), + map ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationSettings)} does not support writing '{options.Format}' format."); + } + } + + DataflowBuiltInTransformationSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowBuiltInTransformationSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowBuiltInTransformationSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationSettings.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationSettings.cs new file mode 100644 index 000000000000..a97cbd5a1ea8 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowBuiltInTransformationSettings.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Dataflow BuiltIn Transformation properties. + public partial class DataflowBuiltInTransformationSettings + { + /// + /// 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; + + /// Initializes a new instance of . + public DataflowBuiltInTransformationSettings() + { + Datasets = new ChangeTrackingList(); + Filter = new ChangeTrackingList(); + Map = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Serialization format. Optional; defaults to JSON. Allowed value JSON Schema/draft-7, Parquet. Default: Json. + /// Reference to the schema that describes the output of the transformation. + /// Enrich data from Broker State Store. Dataset references a key in Broker State Store. + /// Filters input record or datapoints based on condition. + /// Maps input to output message. + /// Keeps track of any properties unknown to the library. + internal DataflowBuiltInTransformationSettings(TransformationSerializationFormat? serializationFormat, string schemaRef, IList datasets, IList filter, IList map, IDictionary serializedAdditionalRawData) + { + SerializationFormat = serializationFormat; + SchemaRef = schemaRef; + Datasets = datasets; + Filter = filter; + Map = map; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Serialization format. Optional; defaults to JSON. Allowed value JSON Schema/draft-7, Parquet. Default: Json. + public TransformationSerializationFormat? SerializationFormat { get; set; } + /// Reference to the schema that describes the output of the transformation. + public string SchemaRef { get; set; } + /// Enrich data from Broker State Store. Dataset references a key in Broker State Store. + public IList Datasets { get; } + /// Filters input record or datapoints based on condition. + public IList Filter { get; } + /// Maps input to output message. + public IList Map { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowDestinationOperationSettings.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowDestinationOperationSettings.Serialization.cs new file mode 100644 index 000000000000..757f166251cd --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowDestinationOperationSettings.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class DataflowDestinationOperationSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowDestinationOperationSettings)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("endpointRef"u8); + writer.WriteStringValue(EndpointRef); + writer.WritePropertyName("dataDestination"u8); + writer.WriteStringValue(DataDestination); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowDestinationOperationSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowDestinationOperationSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowDestinationOperationSettings(document.RootElement, options); + } + + internal static DataflowDestinationOperationSettings DeserializeDataflowDestinationOperationSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string endpointRef = default; + string dataDestination = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("endpointRef"u8)) + { + endpointRef = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataDestination"u8)) + { + dataDestination = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowDestinationOperationSettings(endpointRef, dataDestination, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowDestinationOperationSettings)} does not support writing '{options.Format}' format."); + } + } + + DataflowDestinationOperationSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowDestinationOperationSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowDestinationOperationSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowDestinationOperationSettings.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowDestinationOperationSettings.cs new file mode 100644 index 000000000000..288b6a1c4c26 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowDestinationOperationSettings.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Dataflow Destination Operation properties. + public partial class DataflowDestinationOperationSettings + { + /// + /// 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; + + /// Initializes a new instance of . + /// Reference to the Endpoint CR. Can be of Broker, Kafka, Fabric, ADLS, ADX type. + /// Destination location, can be a topic or table name. Supports dynamic values with $topic, $systemProperties, $userProperties, $payload, $context, and $subscription. + /// or is null. + public DataflowDestinationOperationSettings(string endpointRef, string dataDestination) + { + Argument.AssertNotNull(endpointRef, nameof(endpointRef)); + Argument.AssertNotNull(dataDestination, nameof(dataDestination)); + + EndpointRef = endpointRef; + DataDestination = dataDestination; + } + + /// Initializes a new instance of . + /// Reference to the Endpoint CR. Can be of Broker, Kafka, Fabric, ADLS, ADX type. + /// Destination location, can be a topic or table name. Supports dynamic values with $topic, $systemProperties, $userProperties, $payload, $context, and $subscription. + /// Keeps track of any properties unknown to the library. + internal DataflowDestinationOperationSettings(string endpointRef, string dataDestination, IDictionary serializedAdditionalRawData) + { + EndpointRef = endpointRef; + DataDestination = dataDestination; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowDestinationOperationSettings() + { + } + + /// Reference to the Endpoint CR. Can be of Broker, Kafka, Fabric, ADLS, ADX type. + public string EndpointRef { get; set; } + /// Destination location, can be a topic or table name. Supports dynamic values with $topic, $systemProperties, $userProperties, $payload, $context, and $subscription. + public string DataDestination { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationAccessToken.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationAccessToken.Serialization.cs new file mode 100644 index 000000000000..a545c3c3551b --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationAccessToken.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + internal partial class DataflowEndpointAuthenticationAccessToken : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationAccessToken)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("secretRef"u8); + writer.WriteStringValue(SecretRef); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointAuthenticationAccessToken IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationAccessToken)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointAuthenticationAccessToken(document.RootElement, options); + } + + internal static DataflowEndpointAuthenticationAccessToken DeserializeDataflowEndpointAuthenticationAccessToken(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string secretRef = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("secretRef"u8)) + { + secretRef = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointAuthenticationAccessToken(secretRef, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationAccessToken)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointAuthenticationAccessToken IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointAuthenticationAccessToken(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationAccessToken)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationAccessToken.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationAccessToken.cs new file mode 100644 index 000000000000..69bea2335018 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationAccessToken.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// DataflowEndpoint Authentication Access Token properties. + internal partial class DataflowEndpointAuthenticationAccessToken + { + /// + /// 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; + + /// Initializes a new instance of . + /// Token secret name. + /// is null. + public DataflowEndpointAuthenticationAccessToken(string secretRef) + { + Argument.AssertNotNull(secretRef, nameof(secretRef)); + + SecretRef = secretRef; + } + + /// Initializes a new instance of . + /// Token secret name. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointAuthenticationAccessToken(string secretRef, IDictionary serializedAdditionalRawData) + { + SecretRef = secretRef; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointAuthenticationAccessToken() + { + } + + /// Token secret name. + public string SecretRef { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationSasl.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationSasl.Serialization.cs new file mode 100644 index 000000000000..30e1f18b036b --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationSasl.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class DataflowEndpointAuthenticationSasl : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationSasl)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("saslType"u8); + writer.WriteStringValue(SaslType.ToString()); + writer.WritePropertyName("secretRef"u8); + writer.WriteStringValue(SecretRef); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointAuthenticationSasl IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationSasl)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointAuthenticationSasl(document.RootElement, options); + } + + internal static DataflowEndpointAuthenticationSasl DeserializeDataflowEndpointAuthenticationSasl(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataflowEndpointAuthenticationSaslType saslType = default; + string secretRef = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("saslType"u8)) + { + saslType = new DataflowEndpointAuthenticationSaslType(property.Value.GetString()); + continue; + } + if (property.NameEquals("secretRef"u8)) + { + secretRef = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointAuthenticationSasl(saslType, secretRef, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationSasl)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointAuthenticationSasl IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointAuthenticationSasl(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationSasl)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationSasl.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationSasl.cs new file mode 100644 index 000000000000..8fd546f5c26c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationSasl.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// DataflowEndpoint Authentication Sasl properties. + public partial class DataflowEndpointAuthenticationSasl + { + /// + /// 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; + + /// Initializes a new instance of . + /// Type of SASL authentication. Can be PLAIN, SCRAM-SHA-256, or SCRAM-SHA-512. + /// Token secret name. + /// is null. + public DataflowEndpointAuthenticationSasl(DataflowEndpointAuthenticationSaslType saslType, string secretRef) + { + Argument.AssertNotNull(secretRef, nameof(secretRef)); + + SaslType = saslType; + SecretRef = secretRef; + } + + /// Initializes a new instance of . + /// Type of SASL authentication. Can be PLAIN, SCRAM-SHA-256, or SCRAM-SHA-512. + /// Token secret name. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointAuthenticationSasl(DataflowEndpointAuthenticationSaslType saslType, string secretRef, IDictionary serializedAdditionalRawData) + { + SaslType = saslType; + SecretRef = secretRef; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointAuthenticationSasl() + { + } + + /// Type of SASL authentication. Can be PLAIN, SCRAM-SHA-256, or SCRAM-SHA-512. + public DataflowEndpointAuthenticationSaslType SaslType { get; set; } + /// Token secret name. + public string SecretRef { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationSaslType.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationSaslType.cs new file mode 100644 index 000000000000..fadb844f7b05 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationSaslType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// DataflowEndpoint Authentication Sasl Type properties. + public readonly partial struct DataflowEndpointAuthenticationSaslType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataflowEndpointAuthenticationSaslType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PlainValue = "Plain"; + private const string ScramSha256Value = "ScramSha256"; + private const string ScramSha512Value = "ScramSha512"; + + /// PLAIN Type. + public static DataflowEndpointAuthenticationSaslType Plain { get; } = new DataflowEndpointAuthenticationSaslType(PlainValue); + /// SCRAM_SHA_256 Type. + public static DataflowEndpointAuthenticationSaslType ScramSha256 { get; } = new DataflowEndpointAuthenticationSaslType(ScramSha256Value); + /// SCRAM_SHA_512 Type. + public static DataflowEndpointAuthenticationSaslType ScramSha512 { get; } = new DataflowEndpointAuthenticationSaslType(ScramSha512Value); + /// Determines if two values are the same. + public static bool operator ==(DataflowEndpointAuthenticationSaslType left, DataflowEndpointAuthenticationSaslType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataflowEndpointAuthenticationSaslType left, DataflowEndpointAuthenticationSaslType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataflowEndpointAuthenticationSaslType(string value) => new DataflowEndpointAuthenticationSaslType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataflowEndpointAuthenticationSaslType other && Equals(other); + /// + public bool Equals(DataflowEndpointAuthenticationSaslType 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationServiceAccountToken.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationServiceAccountToken.Serialization.cs new file mode 100644 index 000000000000..0713ffa31087 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationServiceAccountToken.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + internal partial class DataflowEndpointAuthenticationServiceAccountToken : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationServiceAccountToken)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("audience"u8); + writer.WriteStringValue(Audience); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointAuthenticationServiceAccountToken IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationServiceAccountToken)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointAuthenticationServiceAccountToken(document.RootElement, options); + } + + internal static DataflowEndpointAuthenticationServiceAccountToken DeserializeDataflowEndpointAuthenticationServiceAccountToken(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string audience = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("audience"u8)) + { + audience = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointAuthenticationServiceAccountToken(audience, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationServiceAccountToken)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointAuthenticationServiceAccountToken IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointAuthenticationServiceAccountToken(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationServiceAccountToken)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationServiceAccountToken.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationServiceAccountToken.cs new file mode 100644 index 000000000000..38bee6a4d38f --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationServiceAccountToken.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Service Account Token for BrokerAuthentication. + internal partial class DataflowEndpointAuthenticationServiceAccountToken + { + /// + /// 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; + + /// Initializes a new instance of . + /// Audience of the service account. Optional, defaults to the broker internal service account audience. + /// is null. + public DataflowEndpointAuthenticationServiceAccountToken(string audience) + { + Argument.AssertNotNull(audience, nameof(audience)); + + Audience = audience; + } + + /// Initializes a new instance of . + /// Audience of the service account. Optional, defaults to the broker internal service account audience. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointAuthenticationServiceAccountToken(string audience, IDictionary serializedAdditionalRawData) + { + Audience = audience; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointAuthenticationServiceAccountToken() + { + } + + /// Audience of the service account. Optional, defaults to the broker internal service account audience. + public string Audience { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationSystemAssignedManagedIdentity.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationSystemAssignedManagedIdentity.Serialization.cs new file mode 100644 index 000000000000..983c2139b52c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationSystemAssignedManagedIdentity.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + internal partial class DataflowEndpointAuthenticationSystemAssignedManagedIdentity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationSystemAssignedManagedIdentity)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Audience)) + { + writer.WritePropertyName("audience"u8); + writer.WriteStringValue(Audience); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointAuthenticationSystemAssignedManagedIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationSystemAssignedManagedIdentity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointAuthenticationSystemAssignedManagedIdentity(document.RootElement, options); + } + + internal static DataflowEndpointAuthenticationSystemAssignedManagedIdentity DeserializeDataflowEndpointAuthenticationSystemAssignedManagedIdentity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string audience = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("audience"u8)) + { + audience = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointAuthenticationSystemAssignedManagedIdentity(audience, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationSystemAssignedManagedIdentity)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointAuthenticationSystemAssignedManagedIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointAuthenticationSystemAssignedManagedIdentity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationSystemAssignedManagedIdentity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationSystemAssignedManagedIdentity.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationSystemAssignedManagedIdentity.cs new file mode 100644 index 000000000000..3cc95969dc1c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationSystemAssignedManagedIdentity.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// DataflowEndpoint Authentication SystemAssignedManagedIdentity properties. + internal partial class DataflowEndpointAuthenticationSystemAssignedManagedIdentity + { + /// + /// 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; + + /// Initializes a new instance of . + public DataflowEndpointAuthenticationSystemAssignedManagedIdentity() + { + } + + /// Initializes a new instance of . + /// Audience of the service to authenticate against. Optional; defaults to the audience for Service host configuration. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointAuthenticationSystemAssignedManagedIdentity(string audience, IDictionary serializedAdditionalRawData) + { + Audience = audience; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Audience of the service to authenticate against. Optional; defaults to the audience for Service host configuration. + public string Audience { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationUserAssignedManagedIdentity.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationUserAssignedManagedIdentity.Serialization.cs new file mode 100644 index 000000000000..637cf7a40d66 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationUserAssignedManagedIdentity.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class DataflowEndpointAuthenticationUserAssignedManagedIdentity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationUserAssignedManagedIdentity)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("clientId"u8); + writer.WriteStringValue(ClientId); + if (Optional.IsDefined(Scope)) + { + writer.WritePropertyName("scope"u8); + writer.WriteStringValue(Scope); + } + writer.WritePropertyName("tenantId"u8); + writer.WriteStringValue(TenantId); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointAuthenticationUserAssignedManagedIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationUserAssignedManagedIdentity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointAuthenticationUserAssignedManagedIdentity(document.RootElement, options); + } + + internal static DataflowEndpointAuthenticationUserAssignedManagedIdentity DeserializeDataflowEndpointAuthenticationUserAssignedManagedIdentity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string clientId = default; + string scope = default; + string tenantId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("clientId"u8)) + { + clientId = property.Value.GetString(); + continue; + } + if (property.NameEquals("scope"u8)) + { + scope = property.Value.GetString(); + continue; + } + if (property.NameEquals("tenantId"u8)) + { + tenantId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointAuthenticationUserAssignedManagedIdentity(clientId, scope, tenantId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationUserAssignedManagedIdentity)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointAuthenticationUserAssignedManagedIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointAuthenticationUserAssignedManagedIdentity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationUserAssignedManagedIdentity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationUserAssignedManagedIdentity.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationUserAssignedManagedIdentity.cs new file mode 100644 index 000000000000..b7f15357a13c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationUserAssignedManagedIdentity.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// DataflowEndpoint Authentication UserAssignedManagedIdentity properties. + public partial class DataflowEndpointAuthenticationUserAssignedManagedIdentity + { + /// + /// 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; + + /// Initializes a new instance of . + /// Client ID for the user-assigned managed identity. + /// Tenant ID. + /// or is null. + public DataflowEndpointAuthenticationUserAssignedManagedIdentity(string clientId, string tenantId) + { + Argument.AssertNotNull(clientId, nameof(clientId)); + Argument.AssertNotNull(tenantId, nameof(tenantId)); + + ClientId = clientId; + TenantId = tenantId; + } + + /// Initializes a new instance of . + /// Client ID for the user-assigned managed identity. + /// Resource identifier (application ID URI) of the resource, affixed with the .default suffix. + /// Tenant ID. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointAuthenticationUserAssignedManagedIdentity(string clientId, string scope, string tenantId, IDictionary serializedAdditionalRawData) + { + ClientId = clientId; + Scope = scope; + TenantId = tenantId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointAuthenticationUserAssignedManagedIdentity() + { + } + + /// Client ID for the user-assigned managed identity. + public string ClientId { get; set; } + /// Resource identifier (application ID URI) of the resource, affixed with the .default suffix. + public string Scope { get; set; } + /// Tenant ID. + public string TenantId { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationX509.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationX509.Serialization.cs new file mode 100644 index 000000000000..c6b0ff0271e2 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationX509.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + internal partial class DataflowEndpointAuthenticationX509 : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationX509)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("secretRef"u8); + writer.WriteStringValue(SecretRef); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointAuthenticationX509 IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationX509)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointAuthenticationX509(document.RootElement, options); + } + + internal static DataflowEndpointAuthenticationX509 DeserializeDataflowEndpointAuthenticationX509(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string secretRef = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("secretRef"u8)) + { + secretRef = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointAuthenticationX509(secretRef, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationX509)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointAuthenticationX509 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointAuthenticationX509(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointAuthenticationX509)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationX509.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationX509.cs new file mode 100644 index 000000000000..f63afc4b2e8b --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointAuthenticationX509.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// DataflowEndpoint Authentication X509 properties. + internal partial class DataflowEndpointAuthenticationX509 + { + /// + /// 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; + + /// Initializes a new instance of . + /// Secret reference of the X.509 certificate. + /// is null. + public DataflowEndpointAuthenticationX509(string secretRef) + { + Argument.AssertNotNull(secretRef, nameof(secretRef)); + + SecretRef = secretRef; + } + + /// Initializes a new instance of . + /// Secret reference of the X.509 certificate. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointAuthenticationX509(string secretRef, IDictionary serializedAdditionalRawData) + { + SecretRef = secretRef; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointAuthenticationX509() + { + } + + /// Secret reference of the X.509 certificate. + public string SecretRef { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataExplorer.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataExplorer.Serialization.cs new file mode 100644 index 000000000000..40a7a40291d0 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataExplorer.Serialization.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class DataflowEndpointDataExplorer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointDataExplorer)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("authentication"u8); + writer.WriteObjectValue(Authentication, options); + writer.WritePropertyName("database"u8); + writer.WriteStringValue(Database); + writer.WritePropertyName("host"u8); + writer.WriteStringValue(Host); + if (Optional.IsDefined(Batching)) + { + writer.WritePropertyName("batching"u8); + writer.WriteObjectValue(Batching, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointDataExplorer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointDataExplorer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointDataExplorer(document.RootElement, options); + } + + internal static DataflowEndpointDataExplorer DeserializeDataflowEndpointDataExplorer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataflowEndpointDataExplorerAuthentication authentication = default; + string database = default; + string host = default; + BatchingConfiguration batching = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authentication"u8)) + { + authentication = DataflowEndpointDataExplorerAuthentication.DeserializeDataflowEndpointDataExplorerAuthentication(property.Value, options); + continue; + } + if (property.NameEquals("database"u8)) + { + database = property.Value.GetString(); + continue; + } + if (property.NameEquals("host"u8)) + { + host = property.Value.GetString(); + continue; + } + if (property.NameEquals("batching"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + batching = BatchingConfiguration.DeserializeBatchingConfiguration(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointDataExplorer(authentication, database, host, batching, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointDataExplorer)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointDataExplorer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointDataExplorer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointDataExplorer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataExplorer.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataExplorer.cs new file mode 100644 index 000000000000..4157303e6339 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataExplorer.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Azure Data Explorer endpoint properties. + public partial class DataflowEndpointDataExplorer + { + /// + /// 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; + + /// Initializes a new instance of . + /// Authentication configuration. NOTE - only authentication property is allowed per entry. + /// Database name. + /// Host of the Azure Data Explorer in the form of <cluster>.<region>.kusto.windows.net . + /// , or is null. + public DataflowEndpointDataExplorer(DataflowEndpointDataExplorerAuthentication authentication, string database, string host) + { + Argument.AssertNotNull(authentication, nameof(authentication)); + Argument.AssertNotNull(database, nameof(database)); + Argument.AssertNotNull(host, nameof(host)); + + Authentication = authentication; + Database = database; + Host = host; + } + + /// Initializes a new instance of . + /// Authentication configuration. NOTE - only authentication property is allowed per entry. + /// Database name. + /// Host of the Azure Data Explorer in the form of <cluster>.<region>.kusto.windows.net . + /// Azure Data Explorer endpoint batching configuration. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointDataExplorer(DataflowEndpointDataExplorerAuthentication authentication, string database, string host, BatchingConfiguration batching, IDictionary serializedAdditionalRawData) + { + Authentication = authentication; + Database = database; + Host = host; + Batching = batching; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointDataExplorer() + { + } + + /// Authentication configuration. NOTE - only authentication property is allowed per entry. + public DataflowEndpointDataExplorerAuthentication Authentication { get; set; } + /// Database name. + public string Database { get; set; } + /// Host of the Azure Data Explorer in the form of <cluster>.<region>.kusto.windows.net . + public string Host { get; set; } + /// Azure Data Explorer endpoint batching configuration. + public BatchingConfiguration Batching { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataExplorerAuthentication.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataExplorerAuthentication.Serialization.cs new file mode 100644 index 000000000000..d880fd96c7b8 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataExplorerAuthentication.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class DataflowEndpointDataExplorerAuthentication : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointDataExplorerAuthentication)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("method"u8); + writer.WriteStringValue(Method.ToString()); + if (Optional.IsDefined(SystemAssignedManagedIdentitySettings)) + { + writer.WritePropertyName("systemAssignedManagedIdentitySettings"u8); + writer.WriteObjectValue(SystemAssignedManagedIdentitySettings, options); + } + if (Optional.IsDefined(UserAssignedManagedIdentitySettings)) + { + writer.WritePropertyName("userAssignedManagedIdentitySettings"u8); + writer.WriteObjectValue(UserAssignedManagedIdentitySettings, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointDataExplorerAuthentication IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointDataExplorerAuthentication)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointDataExplorerAuthentication(document.RootElement, options); + } + + internal static DataflowEndpointDataExplorerAuthentication DeserializeDataflowEndpointDataExplorerAuthentication(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataExplorerAuthMethod method = default; + DataflowEndpointAuthenticationSystemAssignedManagedIdentity systemAssignedManagedIdentitySettings = default; + DataflowEndpointAuthenticationUserAssignedManagedIdentity userAssignedManagedIdentitySettings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("method"u8)) + { + method = new DataExplorerAuthMethod(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemAssignedManagedIdentitySettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemAssignedManagedIdentitySettings = DataflowEndpointAuthenticationSystemAssignedManagedIdentity.DeserializeDataflowEndpointAuthenticationSystemAssignedManagedIdentity(property.Value, options); + continue; + } + if (property.NameEquals("userAssignedManagedIdentitySettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userAssignedManagedIdentitySettings = DataflowEndpointAuthenticationUserAssignedManagedIdentity.DeserializeDataflowEndpointAuthenticationUserAssignedManagedIdentity(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointDataExplorerAuthentication(method, systemAssignedManagedIdentitySettings, userAssignedManagedIdentitySettings, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointDataExplorerAuthentication)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointDataExplorerAuthentication IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointDataExplorerAuthentication(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointDataExplorerAuthentication)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataExplorerAuthentication.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataExplorerAuthentication.cs new file mode 100644 index 000000000000..f3689bcf3d01 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataExplorerAuthentication.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Azure Data Explorer Authentication properties. NOTE - only authentication property is allowed per entry. + public partial class DataflowEndpointDataExplorerAuthentication + { + /// + /// 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; + + /// Initializes a new instance of . + /// Mode of Authentication. + public DataflowEndpointDataExplorerAuthentication(DataExplorerAuthMethod method) + { + Method = method; + } + + /// Initializes a new instance of . + /// Mode of Authentication. + /// System-assigned managed identity authentication. + /// User-assigned managed identity authentication. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointDataExplorerAuthentication(DataExplorerAuthMethod method, DataflowEndpointAuthenticationSystemAssignedManagedIdentity systemAssignedManagedIdentitySettings, DataflowEndpointAuthenticationUserAssignedManagedIdentity userAssignedManagedIdentitySettings, IDictionary serializedAdditionalRawData) + { + Method = method; + SystemAssignedManagedIdentitySettings = systemAssignedManagedIdentitySettings; + UserAssignedManagedIdentitySettings = userAssignedManagedIdentitySettings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointDataExplorerAuthentication() + { + } + + /// Mode of Authentication. + public DataExplorerAuthMethod Method { get; set; } + /// System-assigned managed identity authentication. + internal DataflowEndpointAuthenticationSystemAssignedManagedIdentity SystemAssignedManagedIdentitySettings { get; set; } + /// Audience of the service to authenticate against. Optional; defaults to the audience for Service host configuration. + public string SystemAssignedManagedIdentityAudience + { + get => SystemAssignedManagedIdentitySettings is null ? default : SystemAssignedManagedIdentitySettings.Audience; + set + { + if (SystemAssignedManagedIdentitySettings is null) + SystemAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationSystemAssignedManagedIdentity(); + SystemAssignedManagedIdentitySettings.Audience = value; + } + } + + /// User-assigned managed identity authentication. + public DataflowEndpointAuthenticationUserAssignedManagedIdentity UserAssignedManagedIdentitySettings { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataLakeStorage.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataLakeStorage.Serialization.cs new file mode 100644 index 000000000000..eb39d00d6d60 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataLakeStorage.Serialization.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class DataflowEndpointDataLakeStorage : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointDataLakeStorage)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("authentication"u8); + writer.WriteObjectValue(Authentication, options); + writer.WritePropertyName("host"u8); + writer.WriteStringValue(Host); + if (Optional.IsDefined(Batching)) + { + writer.WritePropertyName("batching"u8); + writer.WriteObjectValue(Batching, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointDataLakeStorage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointDataLakeStorage)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointDataLakeStorage(document.RootElement, options); + } + + internal static DataflowEndpointDataLakeStorage DeserializeDataflowEndpointDataLakeStorage(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataflowEndpointDataLakeStorageAuthentication authentication = default; + string host = default; + BatchingConfiguration batching = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authentication"u8)) + { + authentication = DataflowEndpointDataLakeStorageAuthentication.DeserializeDataflowEndpointDataLakeStorageAuthentication(property.Value, options); + continue; + } + if (property.NameEquals("host"u8)) + { + host = property.Value.GetString(); + continue; + } + if (property.NameEquals("batching"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + batching = BatchingConfiguration.DeserializeBatchingConfiguration(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointDataLakeStorage(authentication, host, batching, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointDataLakeStorage)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointDataLakeStorage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointDataLakeStorage(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointDataLakeStorage)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataLakeStorage.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataLakeStorage.cs new file mode 100644 index 000000000000..fd9b7983bc2a --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataLakeStorage.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Azure Data Lake endpoint properties. + public partial class DataflowEndpointDataLakeStorage + { + /// + /// 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; + + /// Initializes a new instance of . + /// Authentication configuration. NOTE - only authentication property is allowed per entry. + /// Host of the Azure Data Lake in the form of <account>.blob.core.windows.net . + /// or is null. + public DataflowEndpointDataLakeStorage(DataflowEndpointDataLakeStorageAuthentication authentication, string host) + { + Argument.AssertNotNull(authentication, nameof(authentication)); + Argument.AssertNotNull(host, nameof(host)); + + Authentication = authentication; + Host = host; + } + + /// Initializes a new instance of . + /// Authentication configuration. NOTE - only authentication property is allowed per entry. + /// Host of the Azure Data Lake in the form of <account>.blob.core.windows.net . + /// Azure Data Lake endpoint batching configuration. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointDataLakeStorage(DataflowEndpointDataLakeStorageAuthentication authentication, string host, BatchingConfiguration batching, IDictionary serializedAdditionalRawData) + { + Authentication = authentication; + Host = host; + Batching = batching; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointDataLakeStorage() + { + } + + /// Authentication configuration. NOTE - only authentication property is allowed per entry. + public DataflowEndpointDataLakeStorageAuthentication Authentication { get; set; } + /// Host of the Azure Data Lake in the form of <account>.blob.core.windows.net . + public string Host { get; set; } + /// Azure Data Lake endpoint batching configuration. + public BatchingConfiguration Batching { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataLakeStorageAuthentication.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataLakeStorageAuthentication.Serialization.cs new file mode 100644 index 000000000000..c136c71c281e --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataLakeStorageAuthentication.Serialization.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class DataflowEndpointDataLakeStorageAuthentication : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointDataLakeStorageAuthentication)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("method"u8); + writer.WriteStringValue(Method.ToString()); + if (Optional.IsDefined(AccessTokenSettings)) + { + writer.WritePropertyName("accessTokenSettings"u8); + writer.WriteObjectValue(AccessTokenSettings, options); + } + if (Optional.IsDefined(SystemAssignedManagedIdentitySettings)) + { + writer.WritePropertyName("systemAssignedManagedIdentitySettings"u8); + writer.WriteObjectValue(SystemAssignedManagedIdentitySettings, options); + } + if (Optional.IsDefined(UserAssignedManagedIdentitySettings)) + { + writer.WritePropertyName("userAssignedManagedIdentitySettings"u8); + writer.WriteObjectValue(UserAssignedManagedIdentitySettings, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointDataLakeStorageAuthentication IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointDataLakeStorageAuthentication)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointDataLakeStorageAuthentication(document.RootElement, options); + } + + internal static DataflowEndpointDataLakeStorageAuthentication DeserializeDataflowEndpointDataLakeStorageAuthentication(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataLakeStorageAuthMethod method = default; + DataflowEndpointAuthenticationAccessToken accessTokenSettings = default; + DataflowEndpointAuthenticationSystemAssignedManagedIdentity systemAssignedManagedIdentitySettings = default; + DataflowEndpointAuthenticationUserAssignedManagedIdentity userAssignedManagedIdentitySettings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("method"u8)) + { + method = new DataLakeStorageAuthMethod(property.Value.GetString()); + continue; + } + if (property.NameEquals("accessTokenSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + accessTokenSettings = DataflowEndpointAuthenticationAccessToken.DeserializeDataflowEndpointAuthenticationAccessToken(property.Value, options); + continue; + } + if (property.NameEquals("systemAssignedManagedIdentitySettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemAssignedManagedIdentitySettings = DataflowEndpointAuthenticationSystemAssignedManagedIdentity.DeserializeDataflowEndpointAuthenticationSystemAssignedManagedIdentity(property.Value, options); + continue; + } + if (property.NameEquals("userAssignedManagedIdentitySettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userAssignedManagedIdentitySettings = DataflowEndpointAuthenticationUserAssignedManagedIdentity.DeserializeDataflowEndpointAuthenticationUserAssignedManagedIdentity(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointDataLakeStorageAuthentication(method, accessTokenSettings, systemAssignedManagedIdentitySettings, userAssignedManagedIdentitySettings, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointDataLakeStorageAuthentication)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointDataLakeStorageAuthentication IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointDataLakeStorageAuthentication(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointDataLakeStorageAuthentication)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataLakeStorageAuthentication.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataLakeStorageAuthentication.cs new file mode 100644 index 000000000000..71c0da722356 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointDataLakeStorageAuthentication.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Azure Data Lake endpoint Authentication properties. NOTE Enum - Only one method is supported for one entry. + public partial class DataflowEndpointDataLakeStorageAuthentication + { + /// + /// 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; + + /// Initializes a new instance of . + /// Mode of Authentication. + public DataflowEndpointDataLakeStorageAuthentication(DataLakeStorageAuthMethod method) + { + Method = method; + } + + /// Initializes a new instance of . + /// Mode of Authentication. + /// SAS token authentication. + /// System-assigned managed identity authentication. + /// User-assigned managed identity authentication. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointDataLakeStorageAuthentication(DataLakeStorageAuthMethod method, DataflowEndpointAuthenticationAccessToken accessTokenSettings, DataflowEndpointAuthenticationSystemAssignedManagedIdentity systemAssignedManagedIdentitySettings, DataflowEndpointAuthenticationUserAssignedManagedIdentity userAssignedManagedIdentitySettings, IDictionary serializedAdditionalRawData) + { + Method = method; + AccessTokenSettings = accessTokenSettings; + SystemAssignedManagedIdentitySettings = systemAssignedManagedIdentitySettings; + UserAssignedManagedIdentitySettings = userAssignedManagedIdentitySettings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointDataLakeStorageAuthentication() + { + } + + /// Mode of Authentication. + public DataLakeStorageAuthMethod Method { get; set; } + /// SAS token authentication. + internal DataflowEndpointAuthenticationAccessToken AccessTokenSettings { get; set; } + /// Token secret name. + public string AccessTokenSecretRef + { + get => AccessTokenSettings is null ? default : AccessTokenSettings.SecretRef; + set => AccessTokenSettings = new DataflowEndpointAuthenticationAccessToken(value); + } + + /// System-assigned managed identity authentication. + internal DataflowEndpointAuthenticationSystemAssignedManagedIdentity SystemAssignedManagedIdentitySettings { get; set; } + /// Audience of the service to authenticate against. Optional; defaults to the audience for Service host configuration. + public string SystemAssignedManagedIdentityAudience + { + get => SystemAssignedManagedIdentitySettings is null ? default : SystemAssignedManagedIdentitySettings.Audience; + set + { + if (SystemAssignedManagedIdentitySettings is null) + SystemAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationSystemAssignedManagedIdentity(); + SystemAssignedManagedIdentitySettings.Audience = value; + } + } + + /// User-assigned managed identity authentication. + public DataflowEndpointAuthenticationUserAssignedManagedIdentity UserAssignedManagedIdentitySettings { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointFabricOneLake.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointFabricOneLake.Serialization.cs new file mode 100644 index 000000000000..9a36553b36dc --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointFabricOneLake.Serialization.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class DataflowEndpointFabricOneLake : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointFabricOneLake)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("authentication"u8); + writer.WriteObjectValue(Authentication, options); + writer.WritePropertyName("names"u8); + writer.WriteObjectValue(Names, options); + writer.WritePropertyName("oneLakePathType"u8); + writer.WriteStringValue(OneLakePathType.ToString()); + writer.WritePropertyName("host"u8); + writer.WriteStringValue(Host); + if (Optional.IsDefined(Batching)) + { + writer.WritePropertyName("batching"u8); + writer.WriteObjectValue(Batching, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointFabricOneLake IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointFabricOneLake)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointFabricOneLake(document.RootElement, options); + } + + internal static DataflowEndpointFabricOneLake DeserializeDataflowEndpointFabricOneLake(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataflowEndpointFabricOneLakeAuthentication authentication = default; + DataflowEndpointFabricOneLakeNames names = default; + DataflowEndpointFabricPathType oneLakePathType = default; + string host = default; + BatchingConfiguration batching = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authentication"u8)) + { + authentication = DataflowEndpointFabricOneLakeAuthentication.DeserializeDataflowEndpointFabricOneLakeAuthentication(property.Value, options); + continue; + } + if (property.NameEquals("names"u8)) + { + names = DataflowEndpointFabricOneLakeNames.DeserializeDataflowEndpointFabricOneLakeNames(property.Value, options); + continue; + } + if (property.NameEquals("oneLakePathType"u8)) + { + oneLakePathType = new DataflowEndpointFabricPathType(property.Value.GetString()); + continue; + } + if (property.NameEquals("host"u8)) + { + host = property.Value.GetString(); + continue; + } + if (property.NameEquals("batching"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + batching = BatchingConfiguration.DeserializeBatchingConfiguration(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointFabricOneLake( + authentication, + names, + oneLakePathType, + host, + batching, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointFabricOneLake)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointFabricOneLake IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointFabricOneLake(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointFabricOneLake)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointFabricOneLake.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointFabricOneLake.cs new file mode 100644 index 000000000000..04a6ecce7459 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointFabricOneLake.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Microsoft Fabric endpoint properties. + public partial class DataflowEndpointFabricOneLake + { + /// + /// 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; + + /// Initializes a new instance of . + /// Authentication configuration. NOTE - only one authentication property is allowed per entry. + /// Names of the workspace and lakehouse. + /// Type of location of the data in the workspace. Can be either tables or files. + /// Host of the Microsoft Fabric in the form of https://<host>.fabric.microsoft.com. + /// , or is null. + public DataflowEndpointFabricOneLake(DataflowEndpointFabricOneLakeAuthentication authentication, DataflowEndpointFabricOneLakeNames names, DataflowEndpointFabricPathType oneLakePathType, string host) + { + Argument.AssertNotNull(authentication, nameof(authentication)); + Argument.AssertNotNull(names, nameof(names)); + Argument.AssertNotNull(host, nameof(host)); + + Authentication = authentication; + Names = names; + OneLakePathType = oneLakePathType; + Host = host; + } + + /// Initializes a new instance of . + /// Authentication configuration. NOTE - only one authentication property is allowed per entry. + /// Names of the workspace and lakehouse. + /// Type of location of the data in the workspace. Can be either tables or files. + /// Host of the Microsoft Fabric in the form of https://<host>.fabric.microsoft.com. + /// Batching configuration. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointFabricOneLake(DataflowEndpointFabricOneLakeAuthentication authentication, DataflowEndpointFabricOneLakeNames names, DataflowEndpointFabricPathType oneLakePathType, string host, BatchingConfiguration batching, IDictionary serializedAdditionalRawData) + { + Authentication = authentication; + Names = names; + OneLakePathType = oneLakePathType; + Host = host; + Batching = batching; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointFabricOneLake() + { + } + + /// Authentication configuration. NOTE - only one authentication property is allowed per entry. + public DataflowEndpointFabricOneLakeAuthentication Authentication { get; set; } + /// Names of the workspace and lakehouse. + public DataflowEndpointFabricOneLakeNames Names { get; set; } + /// Type of location of the data in the workspace. Can be either tables or files. + public DataflowEndpointFabricPathType OneLakePathType { get; set; } + /// Host of the Microsoft Fabric in the form of https://<host>.fabric.microsoft.com. + public string Host { get; set; } + /// Batching configuration. + public BatchingConfiguration Batching { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointFabricOneLakeAuthentication.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointFabricOneLakeAuthentication.Serialization.cs new file mode 100644 index 000000000000..41526a97e964 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointFabricOneLakeAuthentication.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class DataflowEndpointFabricOneLakeAuthentication : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointFabricOneLakeAuthentication)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("method"u8); + writer.WriteStringValue(Method.ToString()); + if (Optional.IsDefined(SystemAssignedManagedIdentitySettings)) + { + writer.WritePropertyName("systemAssignedManagedIdentitySettings"u8); + writer.WriteObjectValue(SystemAssignedManagedIdentitySettings, options); + } + if (Optional.IsDefined(UserAssignedManagedIdentitySettings)) + { + writer.WritePropertyName("userAssignedManagedIdentitySettings"u8); + writer.WriteObjectValue(UserAssignedManagedIdentitySettings, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointFabricOneLakeAuthentication IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointFabricOneLakeAuthentication)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointFabricOneLakeAuthentication(document.RootElement, options); + } + + internal static DataflowEndpointFabricOneLakeAuthentication DeserializeDataflowEndpointFabricOneLakeAuthentication(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FabricOneLakeAuthMethod method = default; + DataflowEndpointAuthenticationSystemAssignedManagedIdentity systemAssignedManagedIdentitySettings = default; + DataflowEndpointAuthenticationUserAssignedManagedIdentity userAssignedManagedIdentitySettings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("method"u8)) + { + method = new FabricOneLakeAuthMethod(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemAssignedManagedIdentitySettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemAssignedManagedIdentitySettings = DataflowEndpointAuthenticationSystemAssignedManagedIdentity.DeserializeDataflowEndpointAuthenticationSystemAssignedManagedIdentity(property.Value, options); + continue; + } + if (property.NameEquals("userAssignedManagedIdentitySettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userAssignedManagedIdentitySettings = DataflowEndpointAuthenticationUserAssignedManagedIdentity.DeserializeDataflowEndpointAuthenticationUserAssignedManagedIdentity(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointFabricOneLakeAuthentication(method, systemAssignedManagedIdentitySettings, userAssignedManagedIdentitySettings, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointFabricOneLakeAuthentication)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointFabricOneLakeAuthentication IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointFabricOneLakeAuthentication(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointFabricOneLakeAuthentication)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointFabricOneLakeAuthentication.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointFabricOneLakeAuthentication.cs new file mode 100644 index 000000000000..b6c8e597d3cf --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointFabricOneLakeAuthentication.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Microsoft Fabric endpoint. Authentication properties. NOTE - Only one method is supported for one entry. + public partial class DataflowEndpointFabricOneLakeAuthentication + { + /// + /// 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; + + /// Initializes a new instance of . + /// Mode of Authentication. + public DataflowEndpointFabricOneLakeAuthentication(FabricOneLakeAuthMethod method) + { + Method = method; + } + + /// Initializes a new instance of . + /// Mode of Authentication. + /// System-assigned managed identity authentication. + /// User-assigned managed identity authentication. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointFabricOneLakeAuthentication(FabricOneLakeAuthMethod method, DataflowEndpointAuthenticationSystemAssignedManagedIdentity systemAssignedManagedIdentitySettings, DataflowEndpointAuthenticationUserAssignedManagedIdentity userAssignedManagedIdentitySettings, IDictionary serializedAdditionalRawData) + { + Method = method; + SystemAssignedManagedIdentitySettings = systemAssignedManagedIdentitySettings; + UserAssignedManagedIdentitySettings = userAssignedManagedIdentitySettings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointFabricOneLakeAuthentication() + { + } + + /// Mode of Authentication. + public FabricOneLakeAuthMethod Method { get; set; } + /// System-assigned managed identity authentication. + internal DataflowEndpointAuthenticationSystemAssignedManagedIdentity SystemAssignedManagedIdentitySettings { get; set; } + /// Audience of the service to authenticate against. Optional; defaults to the audience for Service host configuration. + public string SystemAssignedManagedIdentityAudience + { + get => SystemAssignedManagedIdentitySettings is null ? default : SystemAssignedManagedIdentitySettings.Audience; + set + { + if (SystemAssignedManagedIdentitySettings is null) + SystemAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationSystemAssignedManagedIdentity(); + SystemAssignedManagedIdentitySettings.Audience = value; + } + } + + /// User-assigned managed identity authentication. + public DataflowEndpointAuthenticationUserAssignedManagedIdentity UserAssignedManagedIdentitySettings { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointFabricOneLakeNames.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointFabricOneLakeNames.Serialization.cs new file mode 100644 index 000000000000..f734203e7aa0 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointFabricOneLakeNames.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class DataflowEndpointFabricOneLakeNames : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointFabricOneLakeNames)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("lakehouseName"u8); + writer.WriteStringValue(LakehouseName); + writer.WritePropertyName("workspaceName"u8); + writer.WriteStringValue(WorkspaceName); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointFabricOneLakeNames IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointFabricOneLakeNames)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointFabricOneLakeNames(document.RootElement, options); + } + + internal static DataflowEndpointFabricOneLakeNames DeserializeDataflowEndpointFabricOneLakeNames(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string lakehouseName = default; + string workspaceName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("lakehouseName"u8)) + { + lakehouseName = property.Value.GetString(); + continue; + } + if (property.NameEquals("workspaceName"u8)) + { + workspaceName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointFabricOneLakeNames(lakehouseName, workspaceName, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointFabricOneLakeNames)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointFabricOneLakeNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointFabricOneLakeNames(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointFabricOneLakeNames)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointFabricOneLakeNames.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointFabricOneLakeNames.cs new file mode 100644 index 000000000000..a7fd35866c65 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointFabricOneLakeNames.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Microsoft Fabric endpoint Names properties. + public partial class DataflowEndpointFabricOneLakeNames + { + /// + /// 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; + + /// Initializes a new instance of . + /// Lakehouse name. + /// Workspace name. + /// or is null. + public DataflowEndpointFabricOneLakeNames(string lakehouseName, string workspaceName) + { + Argument.AssertNotNull(lakehouseName, nameof(lakehouseName)); + Argument.AssertNotNull(workspaceName, nameof(workspaceName)); + + LakehouseName = lakehouseName; + WorkspaceName = workspaceName; + } + + /// Initializes a new instance of . + /// Lakehouse name. + /// Workspace name. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointFabricOneLakeNames(string lakehouseName, string workspaceName, IDictionary serializedAdditionalRawData) + { + LakehouseName = lakehouseName; + WorkspaceName = workspaceName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointFabricOneLakeNames() + { + } + + /// Lakehouse name. + public string LakehouseName { get; set; } + /// Workspace name. + public string WorkspaceName { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointFabricPathType.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointFabricPathType.cs new file mode 100644 index 000000000000..ae7c92f852df --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointFabricPathType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// DataflowEndpoint Fabric Path Type properties. + public readonly partial struct DataflowEndpointFabricPathType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataflowEndpointFabricPathType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string FilesValue = "Files"; + private const string TablesValue = "Tables"; + + /// FILES Type. + public static DataflowEndpointFabricPathType Files { get; } = new DataflowEndpointFabricPathType(FilesValue); + /// TABLES Type. + public static DataflowEndpointFabricPathType Tables { get; } = new DataflowEndpointFabricPathType(TablesValue); + /// Determines if two values are the same. + public static bool operator ==(DataflowEndpointFabricPathType left, DataflowEndpointFabricPathType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataflowEndpointFabricPathType left, DataflowEndpointFabricPathType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataflowEndpointFabricPathType(string value) => new DataflowEndpointFabricPathType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataflowEndpointFabricPathType other && Equals(other); + /// + public bool Equals(DataflowEndpointFabricPathType 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafka.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafka.Serialization.cs new file mode 100644 index 000000000000..4599bad179a6 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafka.Serialization.cs @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class DataflowEndpointKafka : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointKafka)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("authentication"u8); + writer.WriteObjectValue(Authentication, options); + if (Optional.IsDefined(ConsumerGroupId)) + { + writer.WritePropertyName("consumerGroupId"u8); + writer.WriteStringValue(ConsumerGroupId); + } + writer.WritePropertyName("host"u8); + writer.WriteStringValue(Host); + if (Optional.IsDefined(Batching)) + { + writer.WritePropertyName("batching"u8); + writer.WriteObjectValue(Batching, options); + } + if (Optional.IsDefined(CopyMqttProperties)) + { + writer.WritePropertyName("copyMqttProperties"u8); + writer.WriteStringValue(CopyMqttProperties.Value.ToString()); + } + if (Optional.IsDefined(Compression)) + { + writer.WritePropertyName("compression"u8); + writer.WriteStringValue(Compression.Value.ToString()); + } + if (Optional.IsDefined(KafkaAcks)) + { + writer.WritePropertyName("kafkaAcks"u8); + writer.WriteStringValue(KafkaAcks.Value.ToString()); + } + if (Optional.IsDefined(PartitionStrategy)) + { + writer.WritePropertyName("partitionStrategy"u8); + writer.WriteStringValue(PartitionStrategy.Value.ToString()); + } + if (Optional.IsDefined(Tls)) + { + writer.WritePropertyName("tls"u8); + writer.WriteObjectValue(Tls, options); + } + if (Optional.IsDefined(CloudEventAttributes)) + { + writer.WritePropertyName("cloudEventAttributes"u8); + writer.WriteStringValue(CloudEventAttributes.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointKafka IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointKafka)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointKafka(document.RootElement, options); + } + + internal static DataflowEndpointKafka DeserializeDataflowEndpointKafka(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataflowEndpointKafkaAuthentication authentication = default; + string consumerGroupId = default; + string host = default; + DataflowEndpointKafkaBatching batching = default; + OperationalMode? copyMqttProperties = default; + DataflowEndpointKafkaCompression? compression = default; + DataflowEndpointKafkaAck? kafkaAcks = default; + DataflowEndpointKafkaPartitionStrategy? partitionStrategy = default; + TlsProperties tls = default; + CloudEventAttributeType? cloudEventAttributes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authentication"u8)) + { + authentication = DataflowEndpointKafkaAuthentication.DeserializeDataflowEndpointKafkaAuthentication(property.Value, options); + continue; + } + if (property.NameEquals("consumerGroupId"u8)) + { + consumerGroupId = property.Value.GetString(); + continue; + } + if (property.NameEquals("host"u8)) + { + host = property.Value.GetString(); + continue; + } + if (property.NameEquals("batching"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + batching = DataflowEndpointKafkaBatching.DeserializeDataflowEndpointKafkaBatching(property.Value, options); + continue; + } + if (property.NameEquals("copyMqttProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + copyMqttProperties = new OperationalMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("compression"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + compression = new DataflowEndpointKafkaCompression(property.Value.GetString()); + continue; + } + if (property.NameEquals("kafkaAcks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + kafkaAcks = new DataflowEndpointKafkaAck(property.Value.GetString()); + continue; + } + if (property.NameEquals("partitionStrategy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + partitionStrategy = new DataflowEndpointKafkaPartitionStrategy(property.Value.GetString()); + continue; + } + if (property.NameEquals("tls"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tls = TlsProperties.DeserializeTlsProperties(property.Value, options); + continue; + } + if (property.NameEquals("cloudEventAttributes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cloudEventAttributes = new CloudEventAttributeType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointKafka( + authentication, + consumerGroupId, + host, + batching, + copyMqttProperties, + compression, + kafkaAcks, + partitionStrategy, + tls, + cloudEventAttributes, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointKafka)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointKafka IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointKafka(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointKafka)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafka.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafka.cs new file mode 100644 index 000000000000..9fccbcb32cad --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafka.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Kafka endpoint properties. + public partial class DataflowEndpointKafka + { + /// + /// 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; + + /// Initializes a new instance of . + /// Authentication configuration. NOTE - only authentication property is allowed per entry. + /// Kafka endpoint host. + /// or is null. + public DataflowEndpointKafka(DataflowEndpointKafkaAuthentication authentication, string host) + { + Argument.AssertNotNull(authentication, nameof(authentication)); + Argument.AssertNotNull(host, nameof(host)); + + Authentication = authentication; + Host = host; + } + + /// Initializes a new instance of . + /// Authentication configuration. NOTE - only authentication property is allowed per entry. + /// Consumer group ID. + /// Kafka endpoint host. + /// Batching configuration. + /// Copy Broker properties. No effect if the endpoint is used as a source or if the dataflow doesn't have an Broker source. + /// Compression. Can be none, gzip, lz4, or snappy. No effect if the endpoint is used as a source. + /// Kafka acks. Can be all, one, or zero. No effect if the endpoint is used as a source. + /// Partition handling strategy. Can be default or static. No effect if the endpoint is used as a source. + /// TLS configuration. + /// Cloud event mapping config. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointKafka(DataflowEndpointKafkaAuthentication authentication, string consumerGroupId, string host, DataflowEndpointKafkaBatching batching, OperationalMode? copyMqttProperties, DataflowEndpointKafkaCompression? compression, DataflowEndpointKafkaAck? kafkaAcks, DataflowEndpointKafkaPartitionStrategy? partitionStrategy, TlsProperties tls, CloudEventAttributeType? cloudEventAttributes, IDictionary serializedAdditionalRawData) + { + Authentication = authentication; + ConsumerGroupId = consumerGroupId; + Host = host; + Batching = batching; + CopyMqttProperties = copyMqttProperties; + Compression = compression; + KafkaAcks = kafkaAcks; + PartitionStrategy = partitionStrategy; + Tls = tls; + CloudEventAttributes = cloudEventAttributes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointKafka() + { + } + + /// Authentication configuration. NOTE - only authentication property is allowed per entry. + public DataflowEndpointKafkaAuthentication Authentication { get; set; } + /// Consumer group ID. + public string ConsumerGroupId { get; set; } + /// Kafka endpoint host. + public string Host { get; set; } + /// Batching configuration. + public DataflowEndpointKafkaBatching Batching { get; set; } + /// Copy Broker properties. No effect if the endpoint is used as a source or if the dataflow doesn't have an Broker source. + public OperationalMode? CopyMqttProperties { get; set; } + /// Compression. Can be none, gzip, lz4, or snappy. No effect if the endpoint is used as a source. + public DataflowEndpointKafkaCompression? Compression { get; set; } + /// Kafka acks. Can be all, one, or zero. No effect if the endpoint is used as a source. + public DataflowEndpointKafkaAck? KafkaAcks { get; set; } + /// Partition handling strategy. Can be default or static. No effect if the endpoint is used as a source. + public DataflowEndpointKafkaPartitionStrategy? PartitionStrategy { get; set; } + /// TLS configuration. + public TlsProperties Tls { get; set; } + /// Cloud event mapping config. + public CloudEventAttributeType? CloudEventAttributes { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafkaAck.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafkaAck.cs new file mode 100644 index 000000000000..06bfcf506e81 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafkaAck.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// DataflowEndpoint Kafka Acks properties. + public readonly partial struct DataflowEndpointKafkaAck : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataflowEndpointKafkaAck(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ZeroValue = "Zero"; + private const string OneValue = "One"; + private const string AllValue = "All"; + + /// ZERO Option. + public static DataflowEndpointKafkaAck Zero { get; } = new DataflowEndpointKafkaAck(ZeroValue); + /// ONE Option. + public static DataflowEndpointKafkaAck One { get; } = new DataflowEndpointKafkaAck(OneValue); + /// ALL Option. + public static DataflowEndpointKafkaAck All { get; } = new DataflowEndpointKafkaAck(AllValue); + /// Determines if two values are the same. + public static bool operator ==(DataflowEndpointKafkaAck left, DataflowEndpointKafkaAck right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataflowEndpointKafkaAck left, DataflowEndpointKafkaAck right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataflowEndpointKafkaAck(string value) => new DataflowEndpointKafkaAck(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataflowEndpointKafkaAck other && Equals(other); + /// + public bool Equals(DataflowEndpointKafkaAck 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafkaAuthentication.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafkaAuthentication.Serialization.cs new file mode 100644 index 000000000000..71d3026ec584 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafkaAuthentication.Serialization.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class DataflowEndpointKafkaAuthentication : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointKafkaAuthentication)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("method"u8); + writer.WriteStringValue(Method.ToString()); + if (Optional.IsDefined(SystemAssignedManagedIdentitySettings)) + { + writer.WritePropertyName("systemAssignedManagedIdentitySettings"u8); + writer.WriteObjectValue(SystemAssignedManagedIdentitySettings, options); + } + if (Optional.IsDefined(UserAssignedManagedIdentitySettings)) + { + writer.WritePropertyName("userAssignedManagedIdentitySettings"u8); + writer.WriteObjectValue(UserAssignedManagedIdentitySettings, options); + } + if (Optional.IsDefined(SaslSettings)) + { + writer.WritePropertyName("saslSettings"u8); + writer.WriteObjectValue(SaslSettings, options); + } + if (Optional.IsDefined(X509CertificateSettings)) + { + writer.WritePropertyName("x509CertificateSettings"u8); + writer.WriteObjectValue(X509CertificateSettings, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointKafkaAuthentication IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointKafkaAuthentication)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointKafkaAuthentication(document.RootElement, options); + } + + internal static DataflowEndpointKafkaAuthentication DeserializeDataflowEndpointKafkaAuthentication(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + KafkaAuthMethod method = default; + DataflowEndpointAuthenticationSystemAssignedManagedIdentity systemAssignedManagedIdentitySettings = default; + DataflowEndpointAuthenticationUserAssignedManagedIdentity userAssignedManagedIdentitySettings = default; + DataflowEndpointAuthenticationSasl saslSettings = default; + DataflowEndpointAuthenticationX509 x509CertificateSettings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("method"u8)) + { + method = new KafkaAuthMethod(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemAssignedManagedIdentitySettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemAssignedManagedIdentitySettings = DataflowEndpointAuthenticationSystemAssignedManagedIdentity.DeserializeDataflowEndpointAuthenticationSystemAssignedManagedIdentity(property.Value, options); + continue; + } + if (property.NameEquals("userAssignedManagedIdentitySettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userAssignedManagedIdentitySettings = DataflowEndpointAuthenticationUserAssignedManagedIdentity.DeserializeDataflowEndpointAuthenticationUserAssignedManagedIdentity(property.Value, options); + continue; + } + if (property.NameEquals("saslSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + saslSettings = DataflowEndpointAuthenticationSasl.DeserializeDataflowEndpointAuthenticationSasl(property.Value, options); + continue; + } + if (property.NameEquals("x509CertificateSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + x509CertificateSettings = DataflowEndpointAuthenticationX509.DeserializeDataflowEndpointAuthenticationX509(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointKafkaAuthentication( + method, + systemAssignedManagedIdentitySettings, + userAssignedManagedIdentitySettings, + saslSettings, + x509CertificateSettings, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointKafkaAuthentication)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointKafkaAuthentication IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointKafkaAuthentication(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointKafkaAuthentication)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafkaAuthentication.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafkaAuthentication.cs new file mode 100644 index 000000000000..98b439a3d812 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafkaAuthentication.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Kafka endpoint Authentication properties. NOTE - only authentication property is allowed per entry. + public partial class DataflowEndpointKafkaAuthentication + { + /// + /// 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; + + /// Initializes a new instance of . + /// Mode of Authentication. + public DataflowEndpointKafkaAuthentication(KafkaAuthMethod method) + { + Method = method; + } + + /// Initializes a new instance of . + /// Mode of Authentication. + /// System-assigned managed identity authentication. + /// User-assigned managed identity authentication. + /// SASL authentication. + /// X.509 certificate authentication. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointKafkaAuthentication(KafkaAuthMethod method, DataflowEndpointAuthenticationSystemAssignedManagedIdentity systemAssignedManagedIdentitySettings, DataflowEndpointAuthenticationUserAssignedManagedIdentity userAssignedManagedIdentitySettings, DataflowEndpointAuthenticationSasl saslSettings, DataflowEndpointAuthenticationX509 x509CertificateSettings, IDictionary serializedAdditionalRawData) + { + Method = method; + SystemAssignedManagedIdentitySettings = systemAssignedManagedIdentitySettings; + UserAssignedManagedIdentitySettings = userAssignedManagedIdentitySettings; + SaslSettings = saslSettings; + X509CertificateSettings = x509CertificateSettings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointKafkaAuthentication() + { + } + + /// Mode of Authentication. + public KafkaAuthMethod Method { get; set; } + /// System-assigned managed identity authentication. + internal DataflowEndpointAuthenticationSystemAssignedManagedIdentity SystemAssignedManagedIdentitySettings { get; set; } + /// Audience of the service to authenticate against. Optional; defaults to the audience for Service host configuration. + public string SystemAssignedManagedIdentityAudience + { + get => SystemAssignedManagedIdentitySettings is null ? default : SystemAssignedManagedIdentitySettings.Audience; + set + { + if (SystemAssignedManagedIdentitySettings is null) + SystemAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationSystemAssignedManagedIdentity(); + SystemAssignedManagedIdentitySettings.Audience = value; + } + } + + /// User-assigned managed identity authentication. + public DataflowEndpointAuthenticationUserAssignedManagedIdentity UserAssignedManagedIdentitySettings { get; set; } + /// SASL authentication. + public DataflowEndpointAuthenticationSasl SaslSettings { get; set; } + /// X.509 certificate authentication. + internal DataflowEndpointAuthenticationX509 X509CertificateSettings { get; set; } + /// Secret reference of the X.509 certificate. + public string X509CertificateSecretRef + { + get => X509CertificateSettings is null ? default : X509CertificateSettings.SecretRef; + set => X509CertificateSettings = new DataflowEndpointAuthenticationX509(value); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafkaBatching.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafkaBatching.Serialization.cs new file mode 100644 index 000000000000..70106a2f1945 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafkaBatching.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class DataflowEndpointKafkaBatching : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointKafkaBatching)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Mode)) + { + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.Value.ToString()); + } + if (Optional.IsDefined(LatencyMs)) + { + writer.WritePropertyName("latencyMs"u8); + writer.WriteNumberValue(LatencyMs.Value); + } + if (Optional.IsDefined(MaxBytes)) + { + writer.WritePropertyName("maxBytes"u8); + writer.WriteNumberValue(MaxBytes.Value); + } + if (Optional.IsDefined(MaxMessages)) + { + writer.WritePropertyName("maxMessages"u8); + writer.WriteNumberValue(MaxMessages.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointKafkaBatching IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointKafkaBatching)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointKafkaBatching(document.RootElement, options); + } + + internal static DataflowEndpointKafkaBatching DeserializeDataflowEndpointKafkaBatching(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OperationalMode? mode = default; + int? latencyMs = default; + int? maxBytes = default; + int? maxMessages = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mode = new OperationalMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("latencyMs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + latencyMs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxBytes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxMessages"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxMessages = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointKafkaBatching(mode, latencyMs, maxBytes, maxMessages, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointKafkaBatching)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointKafkaBatching IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointKafkaBatching(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointKafkaBatching)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafkaBatching.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafkaBatching.cs new file mode 100644 index 000000000000..93d9b36ddf35 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafkaBatching.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Kafka endpoint Batching properties. + public partial class DataflowEndpointKafkaBatching + { + /// + /// 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; + + /// Initializes a new instance of . + public DataflowEndpointKafkaBatching() + { + } + + /// Initializes a new instance of . + /// Mode for batching. + /// Batching latency in milliseconds. + /// Maximum number of bytes in a batch. + /// Maximum number of messages in a batch. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointKafkaBatching(OperationalMode? mode, int? latencyMs, int? maxBytes, int? maxMessages, IDictionary serializedAdditionalRawData) + { + Mode = mode; + LatencyMs = latencyMs; + MaxBytes = maxBytes; + MaxMessages = maxMessages; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Mode for batching. + public OperationalMode? Mode { get; set; } + /// Batching latency in milliseconds. + public int? LatencyMs { get; set; } + /// Maximum number of bytes in a batch. + public int? MaxBytes { get; set; } + /// Maximum number of messages in a batch. + public int? MaxMessages { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafkaCompression.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafkaCompression.cs new file mode 100644 index 000000000000..09b8d79e1bbe --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafkaCompression.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Kafka endpoint Compression properties. + public readonly partial struct DataflowEndpointKafkaCompression : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataflowEndpointKafkaCompression(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string GzipValue = "Gzip"; + private const string SnappyValue = "Snappy"; + private const string Lz4Value = "Lz4"; + + /// NONE Option. + public static DataflowEndpointKafkaCompression None { get; } = new DataflowEndpointKafkaCompression(NoneValue); + /// Gzip Option. + public static DataflowEndpointKafkaCompression Gzip { get; } = new DataflowEndpointKafkaCompression(GzipValue); + /// SNAPPY Option. + public static DataflowEndpointKafkaCompression Snappy { get; } = new DataflowEndpointKafkaCompression(SnappyValue); + /// LZ4 Option. + public static DataflowEndpointKafkaCompression Lz4 { get; } = new DataflowEndpointKafkaCompression(Lz4Value); + /// Determines if two values are the same. + public static bool operator ==(DataflowEndpointKafkaCompression left, DataflowEndpointKafkaCompression right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataflowEndpointKafkaCompression left, DataflowEndpointKafkaCompression right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataflowEndpointKafkaCompression(string value) => new DataflowEndpointKafkaCompression(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataflowEndpointKafkaCompression other && Equals(other); + /// + public bool Equals(DataflowEndpointKafkaCompression 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafkaPartitionStrategy.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafkaPartitionStrategy.cs new file mode 100644 index 000000000000..77a7900bd131 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointKafkaPartitionStrategy.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// DataflowEndpoint Kafka Partition Strategy properties. + public readonly partial struct DataflowEndpointKafkaPartitionStrategy : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataflowEndpointKafkaPartitionStrategy(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DefaultValue = "Default"; + private const string StaticValue = "Static"; + private const string TopicValue = "Topic"; + private const string PropertyValue = "Property"; + + /// Default: Assigns messages to random partitions, using a round-robin algorithm. + public static DataflowEndpointKafkaPartitionStrategy Default { get; } = new DataflowEndpointKafkaPartitionStrategy(DefaultValue); + /// Static: Assigns messages to a fixed partition number that's derived from the instance ID of the dataflow. + public static DataflowEndpointKafkaPartitionStrategy Static { get; } = new DataflowEndpointKafkaPartitionStrategy(StaticValue); + /// TOPIC Option. + public static DataflowEndpointKafkaPartitionStrategy Topic { get; } = new DataflowEndpointKafkaPartitionStrategy(TopicValue); + /// PROPERTY Option. + public static DataflowEndpointKafkaPartitionStrategy Property { get; } = new DataflowEndpointKafkaPartitionStrategy(PropertyValue); + /// Determines if two values are the same. + public static bool operator ==(DataflowEndpointKafkaPartitionStrategy left, DataflowEndpointKafkaPartitionStrategy right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataflowEndpointKafkaPartitionStrategy left, DataflowEndpointKafkaPartitionStrategy right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataflowEndpointKafkaPartitionStrategy(string value) => new DataflowEndpointKafkaPartitionStrategy(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataflowEndpointKafkaPartitionStrategy other && Equals(other); + /// + public bool Equals(DataflowEndpointKafkaPartitionStrategy 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointLocalStorage.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointLocalStorage.Serialization.cs new file mode 100644 index 000000000000..e353c8a532f3 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointLocalStorage.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + internal partial class DataflowEndpointLocalStorage : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointLocalStorage)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("persistentVolumeClaimRef"u8); + writer.WriteStringValue(PersistentVolumeClaimRef); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointLocalStorage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointLocalStorage)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointLocalStorage(document.RootElement, options); + } + + internal static DataflowEndpointLocalStorage DeserializeDataflowEndpointLocalStorage(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string persistentVolumeClaimRef = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("persistentVolumeClaimRef"u8)) + { + persistentVolumeClaimRef = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointLocalStorage(persistentVolumeClaimRef, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointLocalStorage)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointLocalStorage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointLocalStorage(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointLocalStorage)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointLocalStorage.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointLocalStorage.cs new file mode 100644 index 000000000000..934bc9a780c0 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointLocalStorage.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Local persistent volume endpoint properties. + internal partial class DataflowEndpointLocalStorage + { + /// + /// 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; + + /// Initializes a new instance of . + /// Persistent volume claim name. + /// is null. + public DataflowEndpointLocalStorage(string persistentVolumeClaimRef) + { + Argument.AssertNotNull(persistentVolumeClaimRef, nameof(persistentVolumeClaimRef)); + + PersistentVolumeClaimRef = persistentVolumeClaimRef; + } + + /// Initializes a new instance of . + /// Persistent volume claim name. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointLocalStorage(string persistentVolumeClaimRef, IDictionary serializedAdditionalRawData) + { + PersistentVolumeClaimRef = persistentVolumeClaimRef; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointLocalStorage() + { + } + + /// Persistent volume claim name. + public string PersistentVolumeClaimRef { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointMqtt.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointMqtt.Serialization.cs new file mode 100644 index 000000000000..56785afcc94d --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointMqtt.Serialization.cs @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class DataflowEndpointMqtt : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointMqtt)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("authentication"u8); + writer.WriteObjectValue(Authentication, options); + if (Optional.IsDefined(ClientIdPrefix)) + { + writer.WritePropertyName("clientIdPrefix"u8); + writer.WriteStringValue(ClientIdPrefix); + } + if (Optional.IsDefined(Host)) + { + writer.WritePropertyName("host"u8); + writer.WriteStringValue(Host); + } + if (Optional.IsDefined(Protocol)) + { + writer.WritePropertyName("protocol"u8); + writer.WriteStringValue(Protocol.Value.ToString()); + } + if (Optional.IsDefined(KeepAliveSeconds)) + { + writer.WritePropertyName("keepAliveSeconds"u8); + writer.WriteNumberValue(KeepAliveSeconds.Value); + } + if (Optional.IsDefined(Retain)) + { + writer.WritePropertyName("retain"u8); + writer.WriteStringValue(Retain.Value.ToString()); + } + if (Optional.IsDefined(MaxInflightMessages)) + { + writer.WritePropertyName("maxInflightMessages"u8); + writer.WriteNumberValue(MaxInflightMessages.Value); + } + if (Optional.IsDefined(Qos)) + { + writer.WritePropertyName("qos"u8); + writer.WriteNumberValue(Qos.Value); + } + if (Optional.IsDefined(SessionExpirySeconds)) + { + writer.WritePropertyName("sessionExpirySeconds"u8); + writer.WriteNumberValue(SessionExpirySeconds.Value); + } + if (Optional.IsDefined(Tls)) + { + writer.WritePropertyName("tls"u8); + writer.WriteObjectValue(Tls, options); + } + if (Optional.IsDefined(CloudEventAttributes)) + { + writer.WritePropertyName("cloudEventAttributes"u8); + writer.WriteStringValue(CloudEventAttributes.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointMqtt IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointMqtt)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointMqtt(document.RootElement, options); + } + + internal static DataflowEndpointMqtt DeserializeDataflowEndpointMqtt(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataflowEndpointMqttAuthentication authentication = default; + string clientIdPrefix = default; + string host = default; + BrokerProtocolType? protocol = default; + int? keepAliveSeconds = default; + MqttRetainType? retain = default; + int? maxInflightMessages = default; + int? qos = default; + int? sessionExpirySeconds = default; + TlsProperties tls = default; + CloudEventAttributeType? cloudEventAttributes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authentication"u8)) + { + authentication = DataflowEndpointMqttAuthentication.DeserializeDataflowEndpointMqttAuthentication(property.Value, options); + continue; + } + if (property.NameEquals("clientIdPrefix"u8)) + { + clientIdPrefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("host"u8)) + { + host = property.Value.GetString(); + continue; + } + if (property.NameEquals("protocol"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + protocol = new BrokerProtocolType(property.Value.GetString()); + continue; + } + if (property.NameEquals("keepAliveSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keepAliveSeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("retain"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + retain = new MqttRetainType(property.Value.GetString()); + continue; + } + if (property.NameEquals("maxInflightMessages"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxInflightMessages = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("qos"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + qos = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("sessionExpirySeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sessionExpirySeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("tls"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tls = TlsProperties.DeserializeTlsProperties(property.Value, options); + continue; + } + if (property.NameEquals("cloudEventAttributes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cloudEventAttributes = new CloudEventAttributeType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointMqtt( + authentication, + clientIdPrefix, + host, + protocol, + keepAliveSeconds, + retain, + maxInflightMessages, + qos, + sessionExpirySeconds, + tls, + cloudEventAttributes, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointMqtt)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointMqtt IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointMqtt(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointMqtt)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointMqtt.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointMqtt.cs new file mode 100644 index 000000000000..b5f7c2b5635a --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointMqtt.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Broker endpoint properties. + public partial class DataflowEndpointMqtt + { + /// + /// 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; + + /// Initializes a new instance of . + /// authentication properties. DEFAULT: kubernetes.audience=aio-internal. NOTE - Enum field only property is allowed. + /// is null. + public DataflowEndpointMqtt(DataflowEndpointMqttAuthentication authentication) + { + Argument.AssertNotNull(authentication, nameof(authentication)); + + Authentication = authentication; + } + + /// Initializes a new instance of . + /// authentication properties. DEFAULT: kubernetes.audience=aio-internal. NOTE - Enum field only property is allowed. + /// Client ID prefix. Client ID generated by the dataflow is <prefix>-TBD. Optional; no prefix if omitted. + /// Host of the Broker in the form of <hostname>:<port>. Optional; connects to Broker if omitted. + /// Enable or disable websockets. + /// Broker KeepAlive for connection in seconds. + /// Whether or not to keep the retain setting. + /// The max number of messages to keep in flight. For subscribe, this is the receive maximum. For publish, this is the maximum number of messages to send before waiting for an ack. + /// Qos for Broker connection. + /// Session expiry in seconds. + /// TLS configuration. + /// Cloud event mapping config. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointMqtt(DataflowEndpointMqttAuthentication authentication, string clientIdPrefix, string host, BrokerProtocolType? protocol, int? keepAliveSeconds, MqttRetainType? retain, int? maxInflightMessages, int? qos, int? sessionExpirySeconds, TlsProperties tls, CloudEventAttributeType? cloudEventAttributes, IDictionary serializedAdditionalRawData) + { + Authentication = authentication; + ClientIdPrefix = clientIdPrefix; + Host = host; + Protocol = protocol; + KeepAliveSeconds = keepAliveSeconds; + Retain = retain; + MaxInflightMessages = maxInflightMessages; + Qos = qos; + SessionExpirySeconds = sessionExpirySeconds; + Tls = tls; + CloudEventAttributes = cloudEventAttributes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointMqtt() + { + } + + /// authentication properties. DEFAULT: kubernetes.audience=aio-internal. NOTE - Enum field only property is allowed. + public DataflowEndpointMqttAuthentication Authentication { get; set; } + /// Client ID prefix. Client ID generated by the dataflow is <prefix>-TBD. Optional; no prefix if omitted. + public string ClientIdPrefix { get; set; } + /// Host of the Broker in the form of <hostname>:<port>. Optional; connects to Broker if omitted. + public string Host { get; set; } + /// Enable or disable websockets. + public BrokerProtocolType? Protocol { get; set; } + /// Broker KeepAlive for connection in seconds. + public int? KeepAliveSeconds { get; set; } + /// Whether or not to keep the retain setting. + public MqttRetainType? Retain { get; set; } + /// The max number of messages to keep in flight. For subscribe, this is the receive maximum. For publish, this is the maximum number of messages to send before waiting for an ack. + public int? MaxInflightMessages { get; set; } + /// Qos for Broker connection. + public int? Qos { get; set; } + /// Session expiry in seconds. + public int? SessionExpirySeconds { get; set; } + /// TLS configuration. + public TlsProperties Tls { get; set; } + /// Cloud event mapping config. + public CloudEventAttributeType? CloudEventAttributes { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointMqttAuthentication.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointMqttAuthentication.Serialization.cs new file mode 100644 index 000000000000..18933dcf6958 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointMqttAuthentication.Serialization.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class DataflowEndpointMqttAuthentication : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointMqttAuthentication)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("method"u8); + writer.WriteStringValue(Method.ToString()); + if (Optional.IsDefined(SystemAssignedManagedIdentitySettings)) + { + writer.WritePropertyName("systemAssignedManagedIdentitySettings"u8); + writer.WriteObjectValue(SystemAssignedManagedIdentitySettings, options); + } + if (Optional.IsDefined(UserAssignedManagedIdentitySettings)) + { + writer.WritePropertyName("userAssignedManagedIdentitySettings"u8); + writer.WriteObjectValue(UserAssignedManagedIdentitySettings, options); + } + if (Optional.IsDefined(ServiceAccountTokenSettings)) + { + writer.WritePropertyName("serviceAccountTokenSettings"u8); + writer.WriteObjectValue(ServiceAccountTokenSettings, options); + } + if (Optional.IsDefined(X509CertificateSettings)) + { + writer.WritePropertyName("x509CertificateSettings"u8); + writer.WriteObjectValue(X509CertificateSettings, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointMqttAuthentication IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointMqttAuthentication)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointMqttAuthentication(document.RootElement, options); + } + + internal static DataflowEndpointMqttAuthentication DeserializeDataflowEndpointMqttAuthentication(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MqttAuthMethod method = default; + DataflowEndpointAuthenticationSystemAssignedManagedIdentity systemAssignedManagedIdentitySettings = default; + DataflowEndpointAuthenticationUserAssignedManagedIdentity userAssignedManagedIdentitySettings = default; + DataflowEndpointAuthenticationServiceAccountToken serviceAccountTokenSettings = default; + DataflowEndpointAuthenticationX509 x509CertificateSettings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("method"u8)) + { + method = new MqttAuthMethod(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemAssignedManagedIdentitySettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemAssignedManagedIdentitySettings = DataflowEndpointAuthenticationSystemAssignedManagedIdentity.DeserializeDataflowEndpointAuthenticationSystemAssignedManagedIdentity(property.Value, options); + continue; + } + if (property.NameEquals("userAssignedManagedIdentitySettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userAssignedManagedIdentitySettings = DataflowEndpointAuthenticationUserAssignedManagedIdentity.DeserializeDataflowEndpointAuthenticationUserAssignedManagedIdentity(property.Value, options); + continue; + } + if (property.NameEquals("serviceAccountTokenSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceAccountTokenSettings = DataflowEndpointAuthenticationServiceAccountToken.DeserializeDataflowEndpointAuthenticationServiceAccountToken(property.Value, options); + continue; + } + if (property.NameEquals("x509CertificateSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + x509CertificateSettings = DataflowEndpointAuthenticationX509.DeserializeDataflowEndpointAuthenticationX509(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointMqttAuthentication( + method, + systemAssignedManagedIdentitySettings, + userAssignedManagedIdentitySettings, + serviceAccountTokenSettings, + x509CertificateSettings, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointMqttAuthentication)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointMqttAuthentication IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointMqttAuthentication(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointMqttAuthentication)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointMqttAuthentication.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointMqttAuthentication.cs new file mode 100644 index 000000000000..3510dcee51cc --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointMqttAuthentication.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Mqtt endpoint Authentication properties. NOTE - only authentication property is allowed per entry. + public partial class DataflowEndpointMqttAuthentication + { + /// + /// 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; + + /// Initializes a new instance of . + /// Mode of Authentication. + public DataflowEndpointMqttAuthentication(MqttAuthMethod method) + { + Method = method; + } + + /// Initializes a new instance of . + /// Mode of Authentication. + /// System-assigned managed identity authentication. + /// User-assigned managed identity authentication. + /// Kubernetes service account token authentication. Default audience if not set is aio-internal. + /// X.509 certificate authentication. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointMqttAuthentication(MqttAuthMethod method, DataflowEndpointAuthenticationSystemAssignedManagedIdentity systemAssignedManagedIdentitySettings, DataflowEndpointAuthenticationUserAssignedManagedIdentity userAssignedManagedIdentitySettings, DataflowEndpointAuthenticationServiceAccountToken serviceAccountTokenSettings, DataflowEndpointAuthenticationX509 x509CertificateSettings, IDictionary serializedAdditionalRawData) + { + Method = method; + SystemAssignedManagedIdentitySettings = systemAssignedManagedIdentitySettings; + UserAssignedManagedIdentitySettings = userAssignedManagedIdentitySettings; + ServiceAccountTokenSettings = serviceAccountTokenSettings; + X509CertificateSettings = x509CertificateSettings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointMqttAuthentication() + { + } + + /// Mode of Authentication. + public MqttAuthMethod Method { get; set; } + /// System-assigned managed identity authentication. + internal DataflowEndpointAuthenticationSystemAssignedManagedIdentity SystemAssignedManagedIdentitySettings { get; set; } + /// Audience of the service to authenticate against. Optional; defaults to the audience for Service host configuration. + public string SystemAssignedManagedIdentityAudience + { + get => SystemAssignedManagedIdentitySettings is null ? default : SystemAssignedManagedIdentitySettings.Audience; + set + { + if (SystemAssignedManagedIdentitySettings is null) + SystemAssignedManagedIdentitySettings = new DataflowEndpointAuthenticationSystemAssignedManagedIdentity(); + SystemAssignedManagedIdentitySettings.Audience = value; + } + } + + /// User-assigned managed identity authentication. + public DataflowEndpointAuthenticationUserAssignedManagedIdentity UserAssignedManagedIdentitySettings { get; set; } + /// Kubernetes service account token authentication. Default audience if not set is aio-internal. + internal DataflowEndpointAuthenticationServiceAccountToken ServiceAccountTokenSettings { get; set; } + /// Audience of the service account. Optional, defaults to the broker internal service account audience. + public string ServiceAccountTokenAudience + { + get => ServiceAccountTokenSettings is null ? default : ServiceAccountTokenSettings.Audience; + set => ServiceAccountTokenSettings = new DataflowEndpointAuthenticationServiceAccountToken(value); + } + + /// X.509 certificate authentication. + internal DataflowEndpointAuthenticationX509 X509CertificateSettings { get; set; } + /// Secret reference of the X.509 certificate. + public string X509CertificateSecretRef + { + get => X509CertificateSettings is null ? default : X509CertificateSettings.SecretRef; + set => X509CertificateSettings = new DataflowEndpointAuthenticationX509(value); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointProperties.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointProperties.Serialization.cs new file mode 100644 index 000000000000..188683c85457 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointProperties.Serialization.cs @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class DataflowEndpointProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("endpointType"u8); + writer.WriteStringValue(EndpointType.ToString()); + if (Optional.IsDefined(DataExplorerSettings)) + { + writer.WritePropertyName("dataExplorerSettings"u8); + writer.WriteObjectValue(DataExplorerSettings, options); + } + if (Optional.IsDefined(DataLakeStorageSettings)) + { + writer.WritePropertyName("dataLakeStorageSettings"u8); + writer.WriteObjectValue(DataLakeStorageSettings, options); + } + if (Optional.IsDefined(FabricOneLakeSettings)) + { + writer.WritePropertyName("fabricOneLakeSettings"u8); + writer.WriteObjectValue(FabricOneLakeSettings, options); + } + if (Optional.IsDefined(KafkaSettings)) + { + writer.WritePropertyName("kafkaSettings"u8); + writer.WriteObjectValue(KafkaSettings, options); + } + if (Optional.IsDefined(LocalStorageSettings)) + { + writer.WritePropertyName("localStorageSettings"u8); + writer.WriteObjectValue(LocalStorageSettings, options); + } + if (Optional.IsDefined(MqttSettings)) + { + writer.WritePropertyName("mqttSettings"u8); + writer.WriteObjectValue(MqttSettings, options); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointProperties(document.RootElement, options); + } + + internal static DataflowEndpointProperties DeserializeDataflowEndpointProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EndpointType endpointType = default; + DataflowEndpointDataExplorer dataExplorerSettings = default; + DataflowEndpointDataLakeStorage dataLakeStorageSettings = default; + DataflowEndpointFabricOneLake fabricOneLakeSettings = default; + DataflowEndpointKafka kafkaSettings = default; + DataflowEndpointLocalStorage localStorageSettings = default; + DataflowEndpointMqtt mqttSettings = default; + ProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("endpointType"u8)) + { + endpointType = new EndpointType(property.Value.GetString()); + continue; + } + if (property.NameEquals("dataExplorerSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataExplorerSettings = DataflowEndpointDataExplorer.DeserializeDataflowEndpointDataExplorer(property.Value, options); + continue; + } + if (property.NameEquals("dataLakeStorageSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataLakeStorageSettings = DataflowEndpointDataLakeStorage.DeserializeDataflowEndpointDataLakeStorage(property.Value, options); + continue; + } + if (property.NameEquals("fabricOneLakeSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fabricOneLakeSettings = DataflowEndpointFabricOneLake.DeserializeDataflowEndpointFabricOneLake(property.Value, options); + continue; + } + if (property.NameEquals("kafkaSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + kafkaSettings = DataflowEndpointKafka.DeserializeDataflowEndpointKafka(property.Value, options); + continue; + } + if (property.NameEquals("localStorageSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localStorageSettings = DataflowEndpointLocalStorage.DeserializeDataflowEndpointLocalStorage(property.Value, options); + continue; + } + if (property.NameEquals("mqttSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mqttSettings = DataflowEndpointMqtt.DeserializeDataflowEndpointMqtt(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointProperties( + endpointType, + dataExplorerSettings, + dataLakeStorageSettings, + fabricOneLakeSettings, + kafkaSettings, + localStorageSettings, + mqttSettings, + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointProperties)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointProperties.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointProperties.cs new file mode 100644 index 000000000000..fc165c1a45f0 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointProperties.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// DataflowEndpoint Resource properties. NOTE - Only one type of endpoint is supported for one Resource. + public partial class DataflowEndpointProperties + { + /// + /// 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; + + /// Initializes a new instance of . + /// Endpoint Type. + public DataflowEndpointProperties(EndpointType endpointType) + { + EndpointType = endpointType; + } + + /// Initializes a new instance of . + /// Endpoint Type. + /// Azure Data Explorer endpoint. + /// Azure Data Lake endpoint. + /// Microsoft Fabric endpoint. + /// Kafka endpoint. + /// Local persistent volume endpoint. + /// Broker endpoint. + /// The status of the last operation. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointProperties(EndpointType endpointType, DataflowEndpointDataExplorer dataExplorerSettings, DataflowEndpointDataLakeStorage dataLakeStorageSettings, DataflowEndpointFabricOneLake fabricOneLakeSettings, DataflowEndpointKafka kafkaSettings, DataflowEndpointLocalStorage localStorageSettings, DataflowEndpointMqtt mqttSettings, ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + EndpointType = endpointType; + DataExplorerSettings = dataExplorerSettings; + DataLakeStorageSettings = dataLakeStorageSettings; + FabricOneLakeSettings = fabricOneLakeSettings; + KafkaSettings = kafkaSettings; + LocalStorageSettings = localStorageSettings; + MqttSettings = mqttSettings; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointProperties() + { + } + + /// Endpoint Type. + public EndpointType EndpointType { get; set; } + /// Azure Data Explorer endpoint. + public DataflowEndpointDataExplorer DataExplorerSettings { get; set; } + /// Azure Data Lake endpoint. + public DataflowEndpointDataLakeStorage DataLakeStorageSettings { get; set; } + /// Microsoft Fabric endpoint. + public DataflowEndpointFabricOneLake FabricOneLakeSettings { get; set; } + /// Kafka endpoint. + public DataflowEndpointKafka KafkaSettings { get; set; } + /// Local persistent volume endpoint. + internal DataflowEndpointLocalStorage LocalStorageSettings { get; set; } + /// Persistent volume claim name. + public string LocalStoragePersistentVolumeClaimRef + { + get => LocalStorageSettings is null ? default : LocalStorageSettings.PersistentVolumeClaimRef; + set => LocalStorageSettings = new DataflowEndpointLocalStorage(value); + } + + /// Broker endpoint. + public DataflowEndpointMqtt MqttSettings { get; set; } + /// The status of the last operation. + public ProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointResourceListResult.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointResourceListResult.Serialization.cs new file mode 100644 index 000000000000..fbfe08a64c76 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointResourceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + internal partial class DataflowEndpointResourceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointResourceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowEndpointResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowEndpointResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowEndpointResourceListResult(document.RootElement, options); + } + + internal static DataflowEndpointResourceListResult DeserializeDataflowEndpointResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataflowEndpointResourceData.DeserializeDataflowEndpointResourceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowEndpointResourceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowEndpointResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + DataflowEndpointResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowEndpointResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowEndpointResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointResourceListResult.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointResourceListResult.cs new file mode 100644 index 000000000000..0fb3ab689f95 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowEndpointResourceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// The response of a DataflowEndpointResource list operation. + internal partial class DataflowEndpointResourceListResult + { + /// + /// 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; + + /// Initializes a new instance of . + /// The DataflowEndpointResource items on this page. + /// is null. + internal DataflowEndpointResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The DataflowEndpointResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal DataflowEndpointResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowEndpointResourceListResult() + { + } + + /// The DataflowEndpointResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowMappingType.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowMappingType.cs new file mode 100644 index 000000000000..3bdb13d5a1b5 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowMappingType.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Dataflow type mapping properties. + public readonly partial struct DataflowMappingType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataflowMappingType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NewPropertiesValue = "NewProperties"; + private const string RenameValue = "Rename"; + private const string ComputeValue = "Compute"; + private const string PassThroughValue = "PassThrough"; + private const string BuiltInFunctionValue = "BuiltInFunction"; + + /// New Properties type. + public static DataflowMappingType NewProperties { get; } = new DataflowMappingType(NewPropertiesValue); + /// Rename type. + public static DataflowMappingType Rename { get; } = new DataflowMappingType(RenameValue); + /// Compute type. + public static DataflowMappingType Compute { get; } = new DataflowMappingType(ComputeValue); + /// Pass-through type. + public static DataflowMappingType PassThrough { get; } = new DataflowMappingType(PassThroughValue); + /// Built in function type. + public static DataflowMappingType BuiltInFunction { get; } = new DataflowMappingType(BuiltInFunctionValue); + /// Determines if two values are the same. + public static bool operator ==(DataflowMappingType left, DataflowMappingType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataflowMappingType left, DataflowMappingType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataflowMappingType(string value) => new DataflowMappingType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataflowMappingType other && Equals(other); + /// + public bool Equals(DataflowMappingType 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowProfileProperties.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowProfileProperties.Serialization.cs new file mode 100644 index 000000000000..c82972ff6cdb --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowProfileProperties.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class DataflowProfileProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowProfileProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Diagnostics)) + { + writer.WritePropertyName("diagnostics"u8); + writer.WriteObjectValue(Diagnostics, options); + } + if (Optional.IsDefined(InstanceCount)) + { + writer.WritePropertyName("instanceCount"u8); + writer.WriteNumberValue(InstanceCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowProfileProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowProfileProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowProfileProperties(document.RootElement, options); + } + + internal static DataflowProfileProperties DeserializeDataflowProfileProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProfileDiagnostics diagnostics = default; + int? instanceCount = default; + ProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("diagnostics"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diagnostics = ProfileDiagnostics.DeserializeProfileDiagnostics(property.Value, options); + continue; + } + if (property.NameEquals("instanceCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + instanceCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowProfileProperties(diagnostics, instanceCount, provisioningState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowProfileProperties)} does not support writing '{options.Format}' format."); + } + } + + DataflowProfileProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowProfileProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowProfileProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowProfileProperties.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowProfileProperties.cs new file mode 100644 index 000000000000..4105673e0279 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowProfileProperties.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// DataflowProfile Resource properties. + public partial class DataflowProfileProperties + { + /// + /// 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; + + /// Initializes a new instance of . + public DataflowProfileProperties() + { + } + + /// Initializes a new instance of . + /// Spec defines the desired identities of NBC diagnostics settings. + /// To manually scale the dataflow profile, specify the maximum number of instances you want to run. + /// The status of the last operation. + /// Keeps track of any properties unknown to the library. + internal DataflowProfileProperties(ProfileDiagnostics diagnostics, int? instanceCount, ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + Diagnostics = diagnostics; + InstanceCount = instanceCount; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Spec defines the desired identities of NBC diagnostics settings. + public ProfileDiagnostics Diagnostics { get; set; } + /// To manually scale the dataflow profile, specify the maximum number of instances you want to run. + public int? InstanceCount { get; set; } + /// The status of the last operation. + public ProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowProfileResourceListResult.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowProfileResourceListResult.Serialization.cs new file mode 100644 index 000000000000..65b1a2bfafe1 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowProfileResourceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + internal partial class DataflowProfileResourceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowProfileResourceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowProfileResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowProfileResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowProfileResourceListResult(document.RootElement, options); + } + + internal static DataflowProfileResourceListResult DeserializeDataflowProfileResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataflowProfileResourceData.DeserializeDataflowProfileResourceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowProfileResourceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowProfileResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + DataflowProfileResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowProfileResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowProfileResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowProfileResourceListResult.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowProfileResourceListResult.cs new file mode 100644 index 000000000000..73acf9e2870e --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowProfileResourceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// The response of a DataflowProfileResource list operation. + internal partial class DataflowProfileResourceListResult + { + /// + /// 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; + + /// Initializes a new instance of . + /// The DataflowProfileResource items on this page. + /// is null. + internal DataflowProfileResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The DataflowProfileResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal DataflowProfileResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowProfileResourceListResult() + { + } + + /// The DataflowProfileResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowProperties.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowProperties.Serialization.cs new file mode 100644 index 000000000000..26231f54323c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowProperties.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class DataflowProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Mode)) + { + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.Value.ToString()); + } + writer.WritePropertyName("operations"u8); + writer.WriteStartArray(); + foreach (var item in Operations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowProperties(document.RootElement, options); + } + + internal static DataflowProperties DeserializeDataflowProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OperationalMode? mode = default; + IList operations = default; + ProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mode = new OperationalMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("operations"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataflowAction.DeserializeDataflowAction(item, options)); + } + operations = array; + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowProperties(mode, operations, provisioningState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowProperties)} does not support writing '{options.Format}' format."); + } + } + + DataflowProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowProperties.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowProperties.cs new file mode 100644 index 000000000000..10cc4832778f --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowProperties.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Dataflow Resource properties. + public partial class DataflowProperties + { + /// + /// 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; + + /// Initializes a new instance of . + /// List of operations including source and destination references as well as transformation. + /// is null. + public DataflowProperties(IEnumerable operations) + { + Argument.AssertNotNull(operations, nameof(operations)); + + Operations = operations.ToList(); + } + + /// Initializes a new instance of . + /// Mode for Dataflow. Optional; defaults to Enabled. + /// List of operations including source and destination references as well as transformation. + /// The status of the last operation. + /// Keeps track of any properties unknown to the library. + internal DataflowProperties(OperationalMode? mode, IList operations, ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + Mode = mode; + Operations = operations; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowProperties() + { + } + + /// Mode for Dataflow. Optional; defaults to Enabled. + public OperationalMode? Mode { get; set; } + /// List of operations including source and destination references as well as transformation. + public IList Operations { get; } + /// The status of the last operation. + public ProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowResourceListResult.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowResourceListResult.Serialization.cs new file mode 100644 index 000000000000..416bdbc86364 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowResourceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + internal partial class DataflowResourceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowResourceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowResourceListResult(document.RootElement, options); + } + + internal static DataflowResourceListResult DeserializeDataflowResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataflowResourceData.DeserializeDataflowResourceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowResourceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + DataflowResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowResourceListResult.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowResourceListResult.cs new file mode 100644 index 000000000000..6811403a9a59 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowResourceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// The response of a DataflowResource list operation. + internal partial class DataflowResourceListResult + { + /// + /// 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; + + /// Initializes a new instance of . + /// The DataflowResource items on this page. + /// is null. + internal DataflowResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The DataflowResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal DataflowResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowResourceListResult() + { + } + + /// The DataflowResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowSourceOperationSettings.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowSourceOperationSettings.Serialization.cs new file mode 100644 index 000000000000..4f65f7f215ae --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowSourceOperationSettings.Serialization.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class DataflowSourceOperationSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowSourceOperationSettings)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("endpointRef"u8); + writer.WriteStringValue(EndpointRef); + if (Optional.IsDefined(AssetRef)) + { + writer.WritePropertyName("assetRef"u8); + writer.WriteStringValue(AssetRef); + } + if (Optional.IsDefined(SerializationFormat)) + { + writer.WritePropertyName("serializationFormat"u8); + writer.WriteStringValue(SerializationFormat.Value.ToString()); + } + if (Optional.IsDefined(SchemaRef)) + { + writer.WritePropertyName("schemaRef"u8); + writer.WriteStringValue(SchemaRef); + } + writer.WritePropertyName("dataSources"u8); + writer.WriteStartArray(); + foreach (var item in DataSources) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataflowSourceOperationSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataflowSourceOperationSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataflowSourceOperationSettings(document.RootElement, options); + } + + internal static DataflowSourceOperationSettings DeserializeDataflowSourceOperationSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string endpointRef = default; + string assetRef = default; + SourceSerializationFormat? serializationFormat = default; + string schemaRef = default; + IList dataSources = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("endpointRef"u8)) + { + endpointRef = property.Value.GetString(); + continue; + } + if (property.NameEquals("assetRef"u8)) + { + assetRef = property.Value.GetString(); + continue; + } + if (property.NameEquals("serializationFormat"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serializationFormat = new SourceSerializationFormat(property.Value.GetString()); + continue; + } + if (property.NameEquals("schemaRef"u8)) + { + schemaRef = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataSources"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + dataSources = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataflowSourceOperationSettings( + endpointRef, + assetRef, + serializationFormat, + schemaRef, + dataSources, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataflowSourceOperationSettings)} does not support writing '{options.Format}' format."); + } + } + + DataflowSourceOperationSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataflowSourceOperationSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataflowSourceOperationSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowSourceOperationSettings.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowSourceOperationSettings.cs new file mode 100644 index 000000000000..05d37e0e3541 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DataflowSourceOperationSettings.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Dataflow Source Operation properties. + public partial class DataflowSourceOperationSettings + { + /// + /// 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; + + /// Initializes a new instance of . + /// Reference to the Dataflow Endpoint resource. Can only be of Broker and Kafka type. + /// List of source locations. Can be Broker or Kafka topics. Supports wildcards # and +. + /// or is null. + public DataflowSourceOperationSettings(string endpointRef, IEnumerable dataSources) + { + Argument.AssertNotNull(endpointRef, nameof(endpointRef)); + Argument.AssertNotNull(dataSources, nameof(dataSources)); + + EndpointRef = endpointRef; + DataSources = dataSources.ToList(); + } + + /// Initializes a new instance of . + /// Reference to the Dataflow Endpoint resource. Can only be of Broker and Kafka type. + /// Reference to the resource in Azure Device Registry where the data in the endpoint originates from. + /// Content is a JSON Schema. Allowed: JSON Schema/draft-7. + /// Schema CR reference. Data will be deserialized according to the schema, and dropped if it doesn't match. + /// List of source locations. Can be Broker or Kafka topics. Supports wildcards # and +. + /// Keeps track of any properties unknown to the library. + internal DataflowSourceOperationSettings(string endpointRef, string assetRef, SourceSerializationFormat? serializationFormat, string schemaRef, IList dataSources, IDictionary serializedAdditionalRawData) + { + EndpointRef = endpointRef; + AssetRef = assetRef; + SerializationFormat = serializationFormat; + SchemaRef = schemaRef; + DataSources = dataSources; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataflowSourceOperationSettings() + { + } + + /// Reference to the Dataflow Endpoint resource. Can only be of Broker and Kafka type. + public string EndpointRef { get; set; } + /// Reference to the resource in Azure Device Registry where the data in the endpoint originates from. + public string AssetRef { get; set; } + /// Content is a JSON Schema. Allowed: JSON Schema/draft-7. + public SourceSerializationFormat? SerializationFormat { get; set; } + /// Schema CR reference. Data will be deserialized according to the schema, and dropped if it doesn't match. + public string SchemaRef { get; set; } + /// List of source locations. Can be Broker or Kafka topics. Supports wildcards # and +. + public IList DataSources { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DiagnosticsLogs.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DiagnosticsLogs.Serialization.cs new file mode 100644 index 000000000000..b256ca61ebcc --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DiagnosticsLogs.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + internal partial class DiagnosticsLogs : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiagnosticsLogs)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Level)) + { + writer.WritePropertyName("level"u8); + writer.WriteStringValue(Level); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DiagnosticsLogs IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiagnosticsLogs)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiagnosticsLogs(document.RootElement, options); + } + + internal static DiagnosticsLogs DeserializeDiagnosticsLogs(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string level = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("level"u8)) + { + level = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiagnosticsLogs(level, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DiagnosticsLogs)} does not support writing '{options.Format}' format."); + } + } + + DiagnosticsLogs IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDiagnosticsLogs(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiagnosticsLogs)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DiagnosticsLogs.cs similarity index 62% rename from sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.cs rename to sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DiagnosticsLogs.cs index 60914d91a96c..0dc565ff1aff 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DiagnosticsLogs.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable @@ -5,13 +8,10 @@ using System; using System.Collections.Generic; -namespace Azure.AI.OpenAI.Chat +namespace Azure.ResourceManager.IoTOperations.Models { - /// - /// The AzureChatDataSourceAuthenticationOptions. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - public abstract partial class DataSourceAuthentication + /// Diagnostic Log properties. + internal partial class DiagnosticsLogs { /// /// Keeps track of any properties unknown to the library. @@ -43,22 +43,23 @@ public abstract partial class DataSourceAuthentication /// /// /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - protected DataSourceAuthentication() + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DiagnosticsLogs() { } - /// Initializes a new instance of . - /// Discriminator. + /// Initializes a new instance of . + /// The log level. Examples - 'debug', 'info', 'warn', 'error', 'trace'. /// Keeps track of any properties unknown to the library. - internal DataSourceAuthentication(string type, IDictionary serializedAdditionalRawData) + internal DiagnosticsLogs(string level, IDictionary serializedAdditionalRawData) { - Type = type; - SerializedAdditionalRawData = serializedAdditionalRawData; + Level = level; + _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Discriminator. - internal string Type { get; set; } + /// The log level. Examples - 'debug', 'info', 'warn', 'error', 'trace'. + public string Level { get; set; } } } diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DiskBackedMessageBuffer.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DiskBackedMessageBuffer.Serialization.cs new file mode 100644 index 000000000000..8994cb068b39 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DiskBackedMessageBuffer.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class DiskBackedMessageBuffer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiskBackedMessageBuffer)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("maxSize"u8); + writer.WriteStringValue(MaxSize); + if (Optional.IsDefined(EphemeralVolumeClaimSpec)) + { + writer.WritePropertyName("ephemeralVolumeClaimSpec"u8); + writer.WriteObjectValue(EphemeralVolumeClaimSpec, options); + } + if (Optional.IsDefined(PersistentVolumeClaimSpec)) + { + writer.WritePropertyName("persistentVolumeClaimSpec"u8); + writer.WriteObjectValue(PersistentVolumeClaimSpec, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DiskBackedMessageBuffer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiskBackedMessageBuffer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiskBackedMessageBuffer(document.RootElement, options); + } + + internal static DiskBackedMessageBuffer DeserializeDiskBackedMessageBuffer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string maxSize = default; + VolumeClaimSpec ephemeralVolumeClaimSpec = default; + VolumeClaimSpec persistentVolumeClaimSpec = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maxSize"u8)) + { + maxSize = property.Value.GetString(); + continue; + } + if (property.NameEquals("ephemeralVolumeClaimSpec"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ephemeralVolumeClaimSpec = VolumeClaimSpec.DeserializeVolumeClaimSpec(property.Value, options); + continue; + } + if (property.NameEquals("persistentVolumeClaimSpec"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + persistentVolumeClaimSpec = VolumeClaimSpec.DeserializeVolumeClaimSpec(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiskBackedMessageBuffer(maxSize, ephemeralVolumeClaimSpec, persistentVolumeClaimSpec, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DiskBackedMessageBuffer)} does not support writing '{options.Format}' format."); + } + } + + DiskBackedMessageBuffer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDiskBackedMessageBuffer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiskBackedMessageBuffer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DiskBackedMessageBuffer.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DiskBackedMessageBuffer.cs new file mode 100644 index 000000000000..4888b54b4fbf --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/DiskBackedMessageBuffer.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// DiskBackedMessageBuffer properties. + public partial class DiskBackedMessageBuffer + { + /// + /// 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; + + /// Initializes a new instance of . + /// The max size of the message buffer on disk. If a PVC template is specified using one of ephemeralVolumeClaimSpec or persistentVolumeClaimSpec, then this size is used as the request and limit sizes of that template. If neither ephemeralVolumeClaimSpec nor persistentVolumeClaimSpec are specified, then an emptyDir volume is mounted with this size as its limit. See <https://kubernetes.io/docs/concepts/storage/volumes/#emptydir> for details. + /// is null. + public DiskBackedMessageBuffer(string maxSize) + { + Argument.AssertNotNull(maxSize, nameof(maxSize)); + + MaxSize = maxSize; + } + + /// Initializes a new instance of . + /// The max size of the message buffer on disk. If a PVC template is specified using one of ephemeralVolumeClaimSpec or persistentVolumeClaimSpec, then this size is used as the request and limit sizes of that template. If neither ephemeralVolumeClaimSpec nor persistentVolumeClaimSpec are specified, then an emptyDir volume is mounted with this size as its limit. See <https://kubernetes.io/docs/concepts/storage/volumes/#emptydir> for details. + /// Use the specified persistent volume claim template to mount a "generic ephemeral volume" for the message buffer. See <https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#generic-ephemeral-volumes> for details. + /// Use the specified persistent volume claim template to mount a persistent volume for the message buffer. + /// Keeps track of any properties unknown to the library. + internal DiskBackedMessageBuffer(string maxSize, VolumeClaimSpec ephemeralVolumeClaimSpec, VolumeClaimSpec persistentVolumeClaimSpec, IDictionary serializedAdditionalRawData) + { + MaxSize = maxSize; + EphemeralVolumeClaimSpec = ephemeralVolumeClaimSpec; + PersistentVolumeClaimSpec = persistentVolumeClaimSpec; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DiskBackedMessageBuffer() + { + } + + /// The max size of the message buffer on disk. If a PVC template is specified using one of ephemeralVolumeClaimSpec or persistentVolumeClaimSpec, then this size is used as the request and limit sizes of that template. If neither ephemeralVolumeClaimSpec nor persistentVolumeClaimSpec are specified, then an emptyDir volume is mounted with this size as its limit. See <https://kubernetes.io/docs/concepts/storage/volumes/#emptydir> for details. + public string MaxSize { get; set; } + /// Use the specified persistent volume claim template to mount a "generic ephemeral volume" for the message buffer. See <https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#generic-ephemeral-volumes> for details. + public VolumeClaimSpec EphemeralVolumeClaimSpec { get; set; } + /// Use the specified persistent volume claim template to mount a persistent volume for the message buffer. + public VolumeClaimSpec PersistentVolumeClaimSpec { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/EndpointType.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/EndpointType.cs new file mode 100644 index 000000000000..ebcf7a21be3e --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/EndpointType.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// DataflowEndpoint Type properties. + public readonly partial struct EndpointType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public EndpointType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DataExplorerValue = "DataExplorer"; + private const string DataLakeStorageValue = "DataLakeStorage"; + private const string FabricOneLakeValue = "FabricOneLake"; + private const string KafkaValue = "Kafka"; + private const string LocalStorageValue = "LocalStorage"; + private const string MqttValue = "Mqtt"; + + /// Azure Data Explorer Type. + public static EndpointType DataExplorer { get; } = new EndpointType(DataExplorerValue); + /// Azure Data Lake Type. + public static EndpointType DataLakeStorage { get; } = new EndpointType(DataLakeStorageValue); + /// Microsoft Fabric Type. + public static EndpointType FabricOneLake { get; } = new EndpointType(FabricOneLakeValue); + /// Kafka Type. + public static EndpointType Kafka { get; } = new EndpointType(KafkaValue); + /// Local Storage Type. + public static EndpointType LocalStorage { get; } = new EndpointType(LocalStorageValue); + /// Broker Type. + public static EndpointType Mqtt { get; } = new EndpointType(MqttValue); + /// Determines if two values are the same. + public static bool operator ==(EndpointType left, EndpointType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EndpointType left, EndpointType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator EndpointType(string value) => new EndpointType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EndpointType other && Equals(other); + /// + public bool Equals(EndpointType 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ExtendedLocation.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ExtendedLocation.Serialization.cs new file mode 100644 index 000000000000..7d1c0523e9ea --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ExtendedLocation.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class ExtendedLocation : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExtendedLocation)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExtendedLocation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExtendedLocation)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExtendedLocation(document.RootElement, options); + } + + internal static ExtendedLocation DeserializeExtendedLocation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + ExtendedLocationType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ExtendedLocationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExtendedLocation(name, type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExtendedLocation)} does not support writing '{options.Format}' format."); + } + } + + ExtendedLocation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExtendedLocation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExtendedLocation)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ExtendedLocation.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ExtendedLocation.cs new file mode 100644 index 000000000000..7baef78f7eb6 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ExtendedLocation.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Extended location is an extension of Azure locations. They provide a way to use their Azure ARC enabled Kubernetes clusters as target locations for deploying Azure services instances. + public partial class ExtendedLocation + { + /// + /// 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; + + /// Initializes a new instance of . + /// The name of the extended location. + /// Type of ExtendedLocation. + /// is null. + public ExtendedLocation(string name, ExtendedLocationType type) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + Type = type; + } + + /// Initializes a new instance of . + /// The name of the extended location. + /// Type of ExtendedLocation. + /// Keeps track of any properties unknown to the library. + internal ExtendedLocation(string name, ExtendedLocationType type, IDictionary serializedAdditionalRawData) + { + Name = name; + Type = type; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExtendedLocation() + { + } + + /// The name of the extended location. + public string Name { get; set; } + /// Type of ExtendedLocation. + public ExtendedLocationType Type { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ExtendedLocationType.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ExtendedLocationType.cs new file mode 100644 index 000000000000..580198c7d87b --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ExtendedLocationType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// The enum defining type of ExtendedLocation accepted. + public readonly partial struct ExtendedLocationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ExtendedLocationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CustomLocationValue = "CustomLocation"; + + /// CustomLocation type. + public static ExtendedLocationType CustomLocation { get; } = new ExtendedLocationType(CustomLocationValue); + /// Determines if two values are the same. + public static bool operator ==(ExtendedLocationType left, ExtendedLocationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ExtendedLocationType left, ExtendedLocationType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ExtendedLocationType(string value) => new ExtendedLocationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ExtendedLocationType other && Equals(other); + /// + public bool Equals(ExtendedLocationType 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/FabricOneLakeAuthMethod.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/FabricOneLakeAuthMethod.cs new file mode 100644 index 000000000000..c6afa99c4a18 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/FabricOneLakeAuthMethod.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// DataflowEndpoint Fabric One Lake Authentication Method properties. + public readonly partial struct FabricOneLakeAuthMethod : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FabricOneLakeAuthMethod(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SystemAssignedManagedIdentityValue = "SystemAssignedManagedIdentity"; + private const string UserAssignedManagedIdentityValue = "UserAssignedManagedIdentity"; + + /// SystemAssignedManagedIdentity type. + public static FabricOneLakeAuthMethod SystemAssignedManagedIdentity { get; } = new FabricOneLakeAuthMethod(SystemAssignedManagedIdentityValue); + /// UserAssignedManagedIdentity type. + public static FabricOneLakeAuthMethod UserAssignedManagedIdentity { get; } = new FabricOneLakeAuthMethod(UserAssignedManagedIdentityValue); + /// Determines if two values are the same. + public static bool operator ==(FabricOneLakeAuthMethod left, FabricOneLakeAuthMethod right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FabricOneLakeAuthMethod left, FabricOneLakeAuthMethod right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator FabricOneLakeAuthMethod(string value) => new FabricOneLakeAuthMethod(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FabricOneLakeAuthMethod other && Equals(other); + /// + public bool Equals(FabricOneLakeAuthMethod 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/FilterType.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/FilterType.cs new file mode 100644 index 000000000000..396e4a81b1b1 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/FilterType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Filter Type properties. + public readonly partial struct FilterType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FilterType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string FilterValue = "Filter"; + + /// Filter type. + public static FilterType Filter { get; } = new FilterType(FilterValue); + /// Determines if two values are the same. + public static bool operator ==(FilterType left, FilterType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FilterType left, FilterType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator FilterType(string value) => new FilterType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FilterType other && Equals(other); + /// + public bool Equals(FilterType 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Frontend.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Frontend.Serialization.cs new file mode 100644 index 000000000000..f7ecbcf6db61 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Frontend.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class Frontend : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(Frontend)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("replicas"u8); + writer.WriteNumberValue(Replicas); + if (Optional.IsDefined(Workers)) + { + writer.WritePropertyName("workers"u8); + writer.WriteNumberValue(Workers.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + Frontend IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Frontend)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFrontend(document.RootElement, options); + } + + internal static Frontend DeserializeFrontend(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int replicas = default; + int? workers = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("replicas"u8)) + { + replicas = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("workers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + workers = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Frontend(replicas, workers, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(Frontend)} does not support writing '{options.Format}' format."); + } + } + + Frontend IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFrontend(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Frontend)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Frontend.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Frontend.cs new file mode 100644 index 000000000000..0db1d6c6022f --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Frontend.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// The desired properties of the frontend instances of the Broker. + public partial class Frontend + { + /// + /// 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; + + /// Initializes a new instance of . + /// The desired number of frontend instances (pods). + public Frontend(int replicas) + { + Replicas = replicas; + } + + /// Initializes a new instance of . + /// The desired number of frontend instances (pods). + /// Number of logical frontend workers per instance (pod). + /// Keeps track of any properties unknown to the library. + internal Frontend(int replicas, int? workers, IDictionary serializedAdditionalRawData) + { + Replicas = replicas; + Workers = workers; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal Frontend() + { + } + + /// The desired number of frontend instances (pods). + public int Replicas { get; set; } + /// Number of logical frontend workers per instance (pod). + public int? Workers { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/GenerateResourceLimits.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/GenerateResourceLimits.Serialization.cs new file mode 100644 index 000000000000..6b4aa03c58b9 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/GenerateResourceLimits.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + internal partial class GenerateResourceLimits : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(GenerateResourceLimits)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Cpu)) + { + writer.WritePropertyName("cpu"u8); + writer.WriteStringValue(Cpu.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + GenerateResourceLimits IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GenerateResourceLimits)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGenerateResourceLimits(document.RootElement, options); + } + + internal static GenerateResourceLimits DeserializeGenerateResourceLimits(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OperationalMode? cpu = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("cpu"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cpu = new OperationalMode(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GenerateResourceLimits(cpu, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GenerateResourceLimits)} does not support writing '{options.Format}' format."); + } + } + + GenerateResourceLimits IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGenerateResourceLimits(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GenerateResourceLimits)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/GenerateResourceLimits.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/GenerateResourceLimits.cs new file mode 100644 index 000000000000..762f13aff91f --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/GenerateResourceLimits.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// GenerateResourceLimits properties. + internal partial class GenerateResourceLimits + { + /// + /// 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; + + /// Initializes a new instance of . + public GenerateResourceLimits() + { + } + + /// Initializes a new instance of . + /// The toggle to enable/disable cpu resource limits. + /// Keeps track of any properties unknown to the library. + internal GenerateResourceLimits(OperationalMode? cpu, IDictionary serializedAdditionalRawData) + { + Cpu = cpu; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The toggle to enable/disable cpu resource limits. + public OperationalMode? Cpu { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/InstanceProperties.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/InstanceProperties.Serialization.cs new file mode 100644 index 000000000000..6adfa70b9573 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/InstanceProperties.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class InstanceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(InstanceProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } + writer.WritePropertyName("schemaRegistryRef"u8); + writer.WriteObjectValue(SchemaRegistryRef, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + InstanceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InstanceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInstanceProperties(document.RootElement, options); + } + + internal static InstanceProperties DeserializeInstanceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string description = default; + ProvisioningState? provisioningState = default; + string version = default; + SchemaRegistryRef schemaRegistryRef = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (property.NameEquals("schemaRegistryRef"u8)) + { + schemaRegistryRef = SchemaRegistryRef.DeserializeSchemaRegistryRef(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InstanceProperties(description, provisioningState, version, schemaRegistryRef, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(InstanceProperties)} does not support writing '{options.Format}' format."); + } + } + + InstanceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeInstanceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InstanceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/InstanceProperties.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/InstanceProperties.cs new file mode 100644 index 000000000000..8c3bb37e6515 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/InstanceProperties.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// The properties of the Instance resource. + public partial class InstanceProperties + { + /// + /// 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; + + /// Initializes a new instance of . + /// The reference to the Schema Registry for this AIO Instance. + /// is null. + public InstanceProperties(SchemaRegistryRef schemaRegistryRef) + { + Argument.AssertNotNull(schemaRegistryRef, nameof(schemaRegistryRef)); + + SchemaRegistryRef = schemaRegistryRef; + } + + /// Initializes a new instance of . + /// Detailed description of the Instance. + /// The status of the last operation. + /// The Azure IoT Operations version. + /// The reference to the Schema Registry for this AIO Instance. + /// Keeps track of any properties unknown to the library. + internal InstanceProperties(string description, ProvisioningState? provisioningState, string version, SchemaRegistryRef schemaRegistryRef, IDictionary serializedAdditionalRawData) + { + Description = description; + ProvisioningState = provisioningState; + Version = version; + SchemaRegistryRef = schemaRegistryRef; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal InstanceProperties() + { + } + + /// Detailed description of the Instance. + public string Description { get; set; } + /// The status of the last operation. + public ProvisioningState? ProvisioningState { get; } + /// The Azure IoT Operations version. + public string Version { get; } + /// The reference to the Schema Registry for this AIO Instance. + internal SchemaRegistryRef SchemaRegistryRef { get; set; } + /// The resource ID of the Schema Registry. + public ResourceIdentifier SchemaRegistryRefResourceId + { + get => SchemaRegistryRef is null ? default : SchemaRegistryRef.ResourceId; + set => SchemaRegistryRef = new SchemaRegistryRef(value); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/InstanceResourceListResult.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/InstanceResourceListResult.Serialization.cs new file mode 100644 index 000000000000..7cdbaa81b2bc --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/InstanceResourceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + internal partial class InstanceResourceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(InstanceResourceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + InstanceResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InstanceResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInstanceResourceListResult(document.RootElement, options); + } + + internal static InstanceResourceListResult DeserializeInstanceResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InstanceResourceData.DeserializeInstanceResourceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InstanceResourceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(InstanceResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + InstanceResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeInstanceResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InstanceResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/InstanceResourceListResult.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/InstanceResourceListResult.cs new file mode 100644 index 000000000000..80ca98065f8d --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/InstanceResourceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// The response of a InstanceResource list operation. + internal partial class InstanceResourceListResult + { + /// + /// 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; + + /// Initializes a new instance of . + /// The InstanceResource items on this page. + /// is null. + internal InstanceResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The InstanceResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal InstanceResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal InstanceResourceListResult() + { + } + + /// The InstanceResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/InstanceResourcePatch.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/InstanceResourcePatch.Serialization.cs new file mode 100644 index 000000000000..d42f1462a337 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/InstanceResourcePatch.Serialization.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class InstanceResourcePatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(InstanceResourcePatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + InstanceResourcePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InstanceResourcePatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInstanceResourcePatch(document.RootElement, options); + } + + internal static InstanceResourcePatch DeserializeInstanceResourcePatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + ManagedServiceIdentity identity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"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()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InstanceResourcePatch(tags ?? new ChangeTrackingDictionary(), identity, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(InstanceResourcePatch)} does not support writing '{options.Format}' format."); + } + } + + InstanceResourcePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeInstanceResourcePatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InstanceResourcePatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/InstanceResourcePatch.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/InstanceResourcePatch.cs new file mode 100644 index 000000000000..ce3bcb938c2c --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/InstanceResourcePatch.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// The Instance update model. + public partial class InstanceResourcePatch + { + /// + /// 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; + + /// Initializes a new instance of . + public InstanceResourcePatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// The managed service identities assigned to this resource. + /// Keeps track of any properties unknown to the library. + internal InstanceResourcePatch(IDictionary tags, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) + { + Tags = tags; + Identity = identity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + /// The managed service identities assigned to this resource. + public ManagedServiceIdentity Identity { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/KafkaAuthMethod.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/KafkaAuthMethod.cs new file mode 100644 index 000000000000..ab77ab58e197 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/KafkaAuthMethod.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// DataflowEndpoint Kafka Authentication Method properties. + public readonly partial struct KafkaAuthMethod : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public KafkaAuthMethod(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SystemAssignedManagedIdentityValue = "SystemAssignedManagedIdentity"; + private const string UserAssignedManagedIdentityValue = "UserAssignedManagedIdentity"; + private const string SaslValue = "Sasl"; + private const string X509CertificateValue = "X509Certificate"; + private const string AnonymousValue = "Anonymous"; + + /// SystemAssignedManagedIdentity type. + public static KafkaAuthMethod SystemAssignedManagedIdentity { get; } = new KafkaAuthMethod(SystemAssignedManagedIdentityValue); + /// UserAssignedManagedIdentity type. + public static KafkaAuthMethod UserAssignedManagedIdentity { get; } = new KafkaAuthMethod(UserAssignedManagedIdentityValue); + /// Sasl Option. + public static KafkaAuthMethod Sasl { get; } = new KafkaAuthMethod(SaslValue); + /// x509Certificate Option. + public static KafkaAuthMethod X509Certificate { get; } = new KafkaAuthMethod(X509CertificateValue); + /// Anonymous Option. + public static KafkaAuthMethod Anonymous { get; } = new KafkaAuthMethod(AnonymousValue); + /// Determines if two values are the same. + public static bool operator ==(KafkaAuthMethod left, KafkaAuthMethod right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(KafkaAuthMethod left, KafkaAuthMethod right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator KafkaAuthMethod(string value) => new KafkaAuthMethod(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is KafkaAuthMethod other && Equals(other); + /// + public bool Equals(KafkaAuthMethod 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/KubernetesReference.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/KubernetesReference.Serialization.cs new file mode 100644 index 000000000000..80133bae2299 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/KubernetesReference.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class KubernetesReference : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(KubernetesReference)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ApiGroup)) + { + writer.WritePropertyName("apiGroup"u8); + writer.WriteStringValue(ApiGroup); + } + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Namespace)) + { + writer.WritePropertyName("namespace"u8); + writer.WriteStringValue(Namespace); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + KubernetesReference IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(KubernetesReference)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeKubernetesReference(document.RootElement, options); + } + + internal static KubernetesReference DeserializeKubernetesReference(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string apiGroup = default; + string kind = default; + string name = default; + string @namespace = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("apiGroup"u8)) + { + apiGroup = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("namespace"u8)) + { + @namespace = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new KubernetesReference(apiGroup, kind, name, @namespace, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(KubernetesReference)} does not support writing '{options.Format}' format."); + } + } + + KubernetesReference IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeKubernetesReference(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(KubernetesReference)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/KubernetesReference.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/KubernetesReference.cs new file mode 100644 index 000000000000..140fb09dc889 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/KubernetesReference.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Kubernetes reference. + public partial class KubernetesReference + { + /// + /// 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; + + /// Initializes a new instance of . + /// Kind is the type of resource being referenced. + /// Name is the name of resource being referenced. + /// or is null. + public KubernetesReference(string kind, string name) + { + Argument.AssertNotNull(kind, nameof(kind)); + Argument.AssertNotNull(name, nameof(name)); + + Kind = kind; + Name = name; + } + + /// Initializes a new instance of . + /// APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. + /// Kind is the type of resource being referenced. + /// Name is the name of resource being referenced. + /// Namespace is the namespace of the resource being referenced. This field is required when the resource has a namespace. + /// Keeps track of any properties unknown to the library. + internal KubernetesReference(string apiGroup, string kind, string name, string @namespace, IDictionary serializedAdditionalRawData) + { + ApiGroup = apiGroup; + Kind = kind; + Name = name; + Namespace = @namespace; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal KubernetesReference() + { + } + + /// APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. + public string ApiGroup { get; set; } + /// Kind is the type of resource being referenced. + public string Kind { get; set; } + /// Name is the name of resource being referenced. + public string Name { get; set; } + /// Namespace is the namespace of the resource being referenced. This field is required when the resource has a namespace. + public string Namespace { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ListenerPort.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ListenerPort.Serialization.cs new file mode 100644 index 000000000000..5289d976ca89 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ListenerPort.Serialization.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class ListenerPort : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ListenerPort)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AuthenticationRef)) + { + writer.WritePropertyName("authenticationRef"u8); + writer.WriteStringValue(AuthenticationRef); + } + if (Optional.IsDefined(AuthorizationRef)) + { + writer.WritePropertyName("authorizationRef"u8); + writer.WriteStringValue(AuthorizationRef); + } + if (Optional.IsDefined(NodePort)) + { + writer.WritePropertyName("nodePort"u8); + writer.WriteNumberValue(NodePort.Value); + } + writer.WritePropertyName("port"u8); + writer.WriteNumberValue(Port); + if (Optional.IsDefined(Protocol)) + { + writer.WritePropertyName("protocol"u8); + writer.WriteStringValue(Protocol.Value.ToString()); + } + if (Optional.IsDefined(Tls)) + { + writer.WritePropertyName("tls"u8); + writer.WriteObjectValue(Tls, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ListenerPort IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ListenerPort)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeListenerPort(document.RootElement, options); + } + + internal static ListenerPort DeserializeListenerPort(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string authenticationRef = default; + string authorizationRef = default; + int? nodePort = default; + int port = default; + BrokerProtocolType? protocol = default; + TlsCertMethod tls = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authenticationRef"u8)) + { + authenticationRef = property.Value.GetString(); + continue; + } + if (property.NameEquals("authorizationRef"u8)) + { + authorizationRef = property.Value.GetString(); + continue; + } + if (property.NameEquals("nodePort"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nodePort = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("port"u8)) + { + port = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("protocol"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + protocol = new BrokerProtocolType(property.Value.GetString()); + continue; + } + if (property.NameEquals("tls"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tls = TlsCertMethod.DeserializeTlsCertMethod(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ListenerPort( + authenticationRef, + authorizationRef, + nodePort, + port, + protocol, + tls, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ListenerPort)} does not support writing '{options.Format}' format."); + } + } + + ListenerPort IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeListenerPort(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ListenerPort)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ListenerPort.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ListenerPort.cs new file mode 100644 index 000000000000..b43259c8b99e --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ListenerPort.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Defines a TCP port on which a `BrokerListener` listens. + public partial class ListenerPort + { + /// + /// 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; + + /// Initializes a new instance of . + /// TCP port for accepting client connections. + public ListenerPort(int port) + { + Port = port; + } + + /// Initializes a new instance of . + /// Reference to client authentication settings. Omit to disable authentication. + /// Reference to client authorization settings. Omit to disable authorization. + /// Kubernetes node port. Only relevant when this port is associated with a `NodePort` listener. + /// TCP port for accepting client connections. + /// Protocol to use for client connections. + /// TLS server certificate settings for this port. Omit to disable TLS. + /// Keeps track of any properties unknown to the library. + internal ListenerPort(string authenticationRef, string authorizationRef, int? nodePort, int port, BrokerProtocolType? protocol, TlsCertMethod tls, IDictionary serializedAdditionalRawData) + { + AuthenticationRef = authenticationRef; + AuthorizationRef = authorizationRef; + NodePort = nodePort; + Port = port; + Protocol = protocol; + Tls = tls; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ListenerPort() + { + } + + /// Reference to client authentication settings. Omit to disable authentication. + public string AuthenticationRef { get; set; } + /// Reference to client authorization settings. Omit to disable authorization. + public string AuthorizationRef { get; set; } + /// Kubernetes node port. Only relevant when this port is associated with a `NodePort` listener. + public int? NodePort { get; set; } + /// TCP port for accepting client connections. + public int Port { get; set; } + /// Protocol to use for client connections. + public BrokerProtocolType? Protocol { get; set; } + /// TLS server certificate settings for this port. Omit to disable TLS. + public TlsCertMethod Tls { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/LocalKubernetesReference.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/LocalKubernetesReference.Serialization.cs new file mode 100644 index 000000000000..f64c87cbeffa --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/LocalKubernetesReference.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class LocalKubernetesReference : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(LocalKubernetesReference)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ApiGroup)) + { + writer.WritePropertyName("apiGroup"u8); + writer.WriteStringValue(ApiGroup); + } + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + LocalKubernetesReference IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LocalKubernetesReference)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLocalKubernetesReference(document.RootElement, options); + } + + internal static LocalKubernetesReference DeserializeLocalKubernetesReference(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string apiGroup = default; + string kind = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("apiGroup"u8)) + { + apiGroup = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LocalKubernetesReference(apiGroup, kind, name, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(LocalKubernetesReference)} does not support writing '{options.Format}' format."); + } + } + + LocalKubernetesReference IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeLocalKubernetesReference(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LocalKubernetesReference)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/LocalKubernetesReference.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/LocalKubernetesReference.cs new file mode 100644 index 000000000000..67e3e6a6b33a --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/LocalKubernetesReference.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Kubernetes reference. + public partial class LocalKubernetesReference + { + /// + /// 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; + + /// Initializes a new instance of . + /// Kind is the type of resource being referenced. + /// Name is the name of resource being referenced. + /// or is null. + public LocalKubernetesReference(string kind, string name) + { + Argument.AssertNotNull(kind, nameof(kind)); + Argument.AssertNotNull(name, nameof(name)); + + Kind = kind; + Name = name; + } + + /// Initializes a new instance of . + /// APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. + /// Kind is the type of resource being referenced. + /// Name is the name of resource being referenced. + /// Keeps track of any properties unknown to the library. + internal LocalKubernetesReference(string apiGroup, string kind, string name, IDictionary serializedAdditionalRawData) + { + ApiGroup = apiGroup; + Kind = kind; + Name = name; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal LocalKubernetesReference() + { + } + + /// APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. + public string ApiGroup { get; set; } + /// Kind is the type of resource being referenced. + public string Kind { get; set; } + /// Name is the name of resource being referenced. + public string Name { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Metrics.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Metrics.Serialization.cs new file mode 100644 index 000000000000..ab7f05d862e9 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Metrics.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + internal partial class Metrics : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(Metrics)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(PrometheusPort)) + { + writer.WritePropertyName("prometheusPort"u8); + writer.WriteNumberValue(PrometheusPort.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + Metrics IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Metrics)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMetrics(document.RootElement, options); + } + + internal static Metrics DeserializeMetrics(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? prometheusPort = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("prometheusPort"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + prometheusPort = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Metrics(prometheusPort, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(Metrics)} does not support writing '{options.Format}' format."); + } + } + + Metrics IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMetrics(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Metrics)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Metrics.cs similarity index 61% rename from sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.cs rename to sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Metrics.cs index 6aafb0c3d308..c6d664b41a92 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Metrics.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable @@ -5,10 +8,10 @@ using System; using System.Collections.Generic; -namespace Azure.AI.OpenAI +namespace Azure.ResourceManager.IoTOperations.Models { - /// A structured representation of an error an Azure OpenAI request. - internal partial class AzureOpenAIDalleErrorResponse + /// Diagnostic Metrics properties. + internal partial class Metrics { /// /// Keeps track of any properties unknown to the library. @@ -40,22 +43,23 @@ internal partial class AzureOpenAIDalleErrorResponse /// /// /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - internal AzureOpenAIDalleErrorResponse() + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public Metrics() { } - /// Initializes a new instance of . - /// + /// Initializes a new instance of . + /// The prometheus port to expose the metrics. /// Keeps track of any properties unknown to the library. - internal AzureOpenAIDalleErrorResponse(AzureOpenAIDalleError error, IDictionary serializedAdditionalRawData) + internal Metrics(int? prometheusPort, IDictionary serializedAdditionalRawData) { - Error = error; - SerializedAdditionalRawData = serializedAdditionalRawData; + PrometheusPort = prometheusPort; + _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets the error. - public AzureOpenAIDalleError Error { get; } + /// The prometheus port to expose the metrics. + public int? PrometheusPort { get; set; } } } diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/MqttAuthMethod.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/MqttAuthMethod.cs new file mode 100644 index 000000000000..51de4735b851 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/MqttAuthMethod.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// DataflowEndpoint Mqtt Authentication Method properties. + public readonly partial struct MqttAuthMethod : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MqttAuthMethod(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SystemAssignedManagedIdentityValue = "SystemAssignedManagedIdentity"; + private const string UserAssignedManagedIdentityValue = "UserAssignedManagedIdentity"; + private const string ServiceAccountTokenValue = "ServiceAccountToken"; + private const string X509CertificateValue = "X509Certificate"; + private const string AnonymousValue = "Anonymous"; + + /// SystemAssignedManagedIdentity type. + public static MqttAuthMethod SystemAssignedManagedIdentity { get; } = new MqttAuthMethod(SystemAssignedManagedIdentityValue); + /// UserAssignedManagedIdentity type. + public static MqttAuthMethod UserAssignedManagedIdentity { get; } = new MqttAuthMethod(UserAssignedManagedIdentityValue); + /// ServiceAccountToken Option. + public static MqttAuthMethod ServiceAccountToken { get; } = new MqttAuthMethod(ServiceAccountTokenValue); + /// x509Certificate Option. + public static MqttAuthMethod X509Certificate { get; } = new MqttAuthMethod(X509CertificateValue); + /// Anonymous Option. + public static MqttAuthMethod Anonymous { get; } = new MqttAuthMethod(AnonymousValue); + /// Determines if two values are the same. + public static bool operator ==(MqttAuthMethod left, MqttAuthMethod right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MqttAuthMethod left, MqttAuthMethod right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MqttAuthMethod(string value) => new MqttAuthMethod(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MqttAuthMethod other && Equals(other); + /// + public bool Equals(MqttAuthMethod 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/MqttRetainType.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/MqttRetainType.cs new file mode 100644 index 000000000000..2dbcf13e8244 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/MqttRetainType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Broker Retain types. + public readonly partial struct MqttRetainType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MqttRetainType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string KeepValue = "Keep"; + private const string NeverValue = "Never"; + + /// Retain the messages. + public static MqttRetainType Keep { get; } = new MqttRetainType(KeepValue); + /// Never retain messages. + public static MqttRetainType Never { get; } = new MqttRetainType(NeverValue); + /// Determines if two values are the same. + public static bool operator ==(MqttRetainType left, MqttRetainType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MqttRetainType left, MqttRetainType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MqttRetainType(string value) => new MqttRetainType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MqttRetainType other && Equals(other); + /// + public bool Equals(MqttRetainType 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/OperationType.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/OperationType.cs new file mode 100644 index 000000000000..c2bd3ae3d057 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/OperationType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Dataflow Operation Type properties. + public readonly partial struct OperationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OperationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SourceValue = "Source"; + private const string DestinationValue = "Destination"; + private const string BuiltInTransformationValue = "BuiltInTransformation"; + + /// Dataflow Source Operation. + public static OperationType Source { get; } = new OperationType(SourceValue); + /// Dataflow Destination Operation. + public static OperationType Destination { get; } = new OperationType(DestinationValue); + /// Dataflow BuiltIn Transformation Operation. + public static OperationType BuiltInTransformation { get; } = new OperationType(BuiltInTransformationValue); + /// Determines if two values are the same. + public static bool operator ==(OperationType left, OperationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OperationType left, OperationType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OperationType(string value) => new OperationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OperationType other && Equals(other); + /// + public bool Equals(OperationType 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/OperationalMode.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/OperationalMode.cs new file mode 100644 index 000000000000..f3c6686a2eec --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/OperationalMode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Mode properties. + public readonly partial struct OperationalMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OperationalMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// Enabled is equivalent to True. + public static OperationalMode Enabled { get; } = new OperationalMode(EnabledValue); + /// Disabled is equivalent to False. + public static OperationalMode Disabled { get; } = new OperationalMode(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(OperationalMode left, OperationalMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OperationalMode left, OperationalMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OperationalMode(string value) => new OperationalMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OperationalMode other && Equals(other); + /// + public bool Equals(OperationalMode 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/OperatorValue.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/OperatorValue.cs new file mode 100644 index 000000000000..c072dd0f6130 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/OperatorValue.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Valid operators are In, NotIn, Exists and DoesNotExist. + public readonly partial struct OperatorValue : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OperatorValue(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InValue = "In"; + private const string NotInValue = "NotIn"; + private const string ExistsValue = "Exists"; + private const string DoesNotExistValue = "DoesNotExist"; + + /// In operator. + public static OperatorValue In { get; } = new OperatorValue(InValue); + /// NotIn operator. + public static OperatorValue NotIn { get; } = new OperatorValue(NotInValue); + /// Exists operator. + public static OperatorValue Exists { get; } = new OperatorValue(ExistsValue); + /// DoesNotExist operator. + public static OperatorValue DoesNotExist { get; } = new OperatorValue(DoesNotExistValue); + /// Determines if two values are the same. + public static bool operator ==(OperatorValue left, OperatorValue right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OperatorValue left, OperatorValue right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OperatorValue(string value) => new OperatorValue(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OperatorValue other && Equals(other); + /// + public bool Equals(OperatorValue 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/PrincipalConfig.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/PrincipalConfig.Serialization.cs new file mode 100644 index 000000000000..913171d4dcdf --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/PrincipalConfig.Serialization.cs @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class PrincipalConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrincipalConfig)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Attributes)) + { + writer.WritePropertyName("attributes"u8); + writer.WriteStartArray(); + foreach (var item in Attributes) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStartObject(); + foreach (var item0 in item) + { + writer.WritePropertyName(item0.Key); + writer.WriteStringValue(item0.Value); + } + writer.WriteEndObject(); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ClientIds)) + { + writer.WritePropertyName("clientIds"u8); + writer.WriteStartArray(); + foreach (var item in ClientIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Usernames)) + { + writer.WritePropertyName("usernames"u8); + writer.WriteStartArray(); + foreach (var item in Usernames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PrincipalConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrincipalConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePrincipalConfig(document.RootElement, options); + } + + internal static PrincipalConfig DeserializePrincipalConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList> attributes = default; + IList clientIds = default; + IList usernames = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("attributes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List> array = new List>(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + Dictionary dictionary = new Dictionary(); + foreach (var property0 in item.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + array.Add(dictionary); + } + } + attributes = array; + continue; + } + if (property.NameEquals("clientIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + clientIds = array; + continue; + } + if (property.NameEquals("usernames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + usernames = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PrincipalConfig(attributes ?? new ChangeTrackingList>(), clientIds ?? new ChangeTrackingList(), usernames ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PrincipalConfig)} does not support writing '{options.Format}' format."); + } + } + + PrincipalConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePrincipalConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PrincipalConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/PrincipalConfig.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/PrincipalConfig.cs new file mode 100644 index 000000000000..dbb99932dd61 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/PrincipalConfig.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// PrincipalDefinition properties of Rule. + public partial class PrincipalConfig + { + /// + /// 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; + + /// Initializes a new instance of . + public PrincipalConfig() + { + Attributes = new ChangeTrackingList>(); + ClientIds = new ChangeTrackingList(); + Usernames = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// A list of key-value pairs that match the attributes of the clients. The attributes are case-sensitive and must match the attributes provided by the clients during authentication. + /// A list of client IDs that match the clients. The client IDs are case-sensitive and must match the client IDs provided by the clients during connection. + /// A list of usernames that match the clients. The usernames are case-sensitive and must match the usernames provided by the clients during authentication. + /// Keeps track of any properties unknown to the library. + internal PrincipalConfig(IList> attributes, IList clientIds, IList usernames, IDictionary serializedAdditionalRawData) + { + Attributes = attributes; + ClientIds = clientIds; + Usernames = usernames; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// A list of key-value pairs that match the attributes of the clients. The attributes are case-sensitive and must match the attributes provided by the clients during authentication. + public IList> Attributes { get; } + /// A list of client IDs that match the clients. The client IDs are case-sensitive and must match the client IDs provided by the clients during connection. + public IList ClientIds { get; } + /// A list of usernames that match the clients. The usernames are case-sensitive and must match the usernames provided by the clients during authentication. + public IList Usernames { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/PrivateKeyAlgorithm.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/PrivateKeyAlgorithm.cs new file mode 100644 index 000000000000..38992465ec66 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/PrivateKeyAlgorithm.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Private key algorithm types. + public readonly partial struct PrivateKeyAlgorithm : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PrivateKeyAlgorithm(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string Ec256Value = "Ec256"; + private const string Ec384Value = "Ec384"; + private const string Ec521Value = "Ec521"; + private const string Ed25519Value = "Ed25519"; + private const string Rsa2048Value = "Rsa2048"; + private const string Rsa4096Value = "Rsa4096"; + private const string Rsa8192Value = "Rsa8192"; + + /// Algorithm - ec256. + public static PrivateKeyAlgorithm Ec256 { get; } = new PrivateKeyAlgorithm(Ec256Value); + /// Algorithm - ec384. + public static PrivateKeyAlgorithm Ec384 { get; } = new PrivateKeyAlgorithm(Ec384Value); + /// Algorithm - ec521. + public static PrivateKeyAlgorithm Ec521 { get; } = new PrivateKeyAlgorithm(Ec521Value); + /// Algorithm - ed25519. + public static PrivateKeyAlgorithm Ed25519 { get; } = new PrivateKeyAlgorithm(Ed25519Value); + /// Algorithm - rsa2048. + public static PrivateKeyAlgorithm Rsa2048 { get; } = new PrivateKeyAlgorithm(Rsa2048Value); + /// Algorithm - rsa4096. + public static PrivateKeyAlgorithm Rsa4096 { get; } = new PrivateKeyAlgorithm(Rsa4096Value); + /// Algorithm - rsa8192. + public static PrivateKeyAlgorithm Rsa8192 { get; } = new PrivateKeyAlgorithm(Rsa8192Value); + /// Determines if two values are the same. + public static bool operator ==(PrivateKeyAlgorithm left, PrivateKeyAlgorithm right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PrivateKeyAlgorithm left, PrivateKeyAlgorithm right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PrivateKeyAlgorithm(string value) => new PrivateKeyAlgorithm(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PrivateKeyAlgorithm other && Equals(other); + /// + public bool Equals(PrivateKeyAlgorithm 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/PrivateKeyRotationPolicy.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/PrivateKeyRotationPolicy.cs new file mode 100644 index 000000000000..68f1284b1c62 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/PrivateKeyRotationPolicy.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Private key rotation policy. + public readonly partial struct PrivateKeyRotationPolicy : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PrivateKeyRotationPolicy(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AlwaysValue = "Always"; + private const string NeverValue = "Never"; + + /// Rotation Policy - Always. + public static PrivateKeyRotationPolicy Always { get; } = new PrivateKeyRotationPolicy(AlwaysValue); + /// Rotation Policy - Never. + public static PrivateKeyRotationPolicy Never { get; } = new PrivateKeyRotationPolicy(NeverValue); + /// Determines if two values are the same. + public static bool operator ==(PrivateKeyRotationPolicy left, PrivateKeyRotationPolicy right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PrivateKeyRotationPolicy left, PrivateKeyRotationPolicy right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PrivateKeyRotationPolicy(string value) => new PrivateKeyRotationPolicy(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PrivateKeyRotationPolicy other && Equals(other); + /// + public bool Equals(PrivateKeyRotationPolicy 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ProfileDiagnostics.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ProfileDiagnostics.Serialization.cs new file mode 100644 index 000000000000..85f2a1ff7f20 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ProfileDiagnostics.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class ProfileDiagnostics : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProfileDiagnostics)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Logs)) + { + writer.WritePropertyName("logs"u8); + writer.WriteObjectValue(Logs, options); + } + if (Optional.IsDefined(Metrics)) + { + writer.WritePropertyName("metrics"u8); + writer.WriteObjectValue(Metrics, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProfileDiagnostics IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProfileDiagnostics)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProfileDiagnostics(document.RootElement, options); + } + + internal static ProfileDiagnostics DeserializeProfileDiagnostics(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DiagnosticsLogs logs = default; + Metrics metrics = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("logs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + logs = DiagnosticsLogs.DeserializeDiagnosticsLogs(property.Value, options); + continue; + } + if (property.NameEquals("metrics"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + metrics = Metrics.DeserializeMetrics(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProfileDiagnostics(logs, metrics, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ProfileDiagnostics)} does not support writing '{options.Format}' format."); + } + } + + ProfileDiagnostics IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeProfileDiagnostics(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProfileDiagnostics)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ProfileDiagnostics.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ProfileDiagnostics.cs new file mode 100644 index 000000000000..2e29fc16cc95 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ProfileDiagnostics.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// DataflowProfile Diagnostics properties. + public partial class ProfileDiagnostics + { + /// + /// 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; + + /// Initializes a new instance of . + public ProfileDiagnostics() + { + } + + /// Initializes a new instance of . + /// Diagnostic log settings for the resource. + /// The metrics settings for the resource. + /// Keeps track of any properties unknown to the library. + internal ProfileDiagnostics(DiagnosticsLogs logs, Metrics metrics, IDictionary serializedAdditionalRawData) + { + Logs = logs; + Metrics = metrics; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Diagnostic log settings for the resource. + internal DiagnosticsLogs Logs { get; set; } + /// The log level. Examples - 'debug', 'info', 'warn', 'error', 'trace'. + public string LogsLevel + { + get => Logs is null ? default : Logs.Level; + set + { + if (Logs is null) + Logs = new DiagnosticsLogs(); + Logs.Level = value; + } + } + + /// The metrics settings for the resource. + internal Metrics Metrics { get; set; } + /// The prometheus port to expose the metrics. + public int? MetricsPrometheusPort + { + get => Metrics is null ? default : Metrics.PrometheusPort; + set + { + if (Metrics is null) + Metrics = new Metrics(); + Metrics.PrometheusPort = value; + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ProvisioningState.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ProvisioningState.cs new file mode 100644 index 000000000000..044791997bda --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ProvisioningState.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// The enum defining status of resource. + public readonly partial struct ProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string ProvisioningValue = "Provisioning"; + private const string UpdatingValue = "Updating"; + private const string DeletingValue = "Deleting"; + private const string AcceptedValue = "Accepted"; + + /// Resource has been created. + public static ProvisioningState Succeeded { get; } = new ProvisioningState(SucceededValue); + /// Resource creation failed. + public static ProvisioningState Failed { get; } = new ProvisioningState(FailedValue); + /// Resource creation was canceled. + public static ProvisioningState Canceled { get; } = new ProvisioningState(CanceledValue); + /// Resource is getting provisioned. + public static ProvisioningState Provisioning { get; } = new ProvisioningState(ProvisioningValue); + /// Resource is Updating. + public static ProvisioningState Updating { get; } = new ProvisioningState(UpdatingValue); + /// Resource is Deleting. + public static ProvisioningState Deleting { get; } = new ProvisioningState(DeletingValue); + /// Resource has been Accepted. + public static ProvisioningState Accepted { get; } = new ProvisioningState(AcceptedValue); + /// Determines if two values are the same. + public static bool operator ==(ProvisioningState left, ProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProvisioningState left, ProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ProvisioningState(string value) => new ProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProvisioningState other && Equals(other); + /// + public bool Equals(ProvisioningState 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SanForCert.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SanForCert.Serialization.cs new file mode 100644 index 000000000000..0369a42258b0 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SanForCert.Serialization.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class SanForCert : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(SanForCert)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("dns"u8); + writer.WriteStartArray(); + foreach (var item in Dns) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("ip"u8); + writer.WriteStartArray(); + foreach (var item in IP) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SanForCert IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SanForCert)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSanForCert(document.RootElement, options); + } + + internal static SanForCert DeserializeSanForCert(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList dns = default; + IList ip = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("dns"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + dns = array; + continue; + } + if (property.NameEquals("ip"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ip = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SanForCert(dns, ip, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SanForCert)} does not support writing '{options.Format}' format."); + } + } + + SanForCert IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSanForCert(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SanForCert)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SanForCert.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SanForCert.cs new file mode 100644 index 000000000000..750bd03821a1 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SanForCert.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Subject Alternative Names (SANs) for certificate. + public partial class SanForCert + { + /// + /// 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; + + /// Initializes a new instance of . + /// DNS SANs. + /// IP address SANs. + /// or is null. + public SanForCert(IEnumerable dns, IEnumerable ip) + { + Argument.AssertNotNull(dns, nameof(dns)); + Argument.AssertNotNull(ip, nameof(ip)); + + Dns = dns.ToList(); + IP = ip.ToList(); + } + + /// Initializes a new instance of . + /// DNS SANs. + /// IP address SANs. + /// Keeps track of any properties unknown to the library. + internal SanForCert(IList dns, IList ip, IDictionary serializedAdditionalRawData) + { + Dns = dns; + IP = ip; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SanForCert() + { + } + + /// DNS SANs. + public IList Dns { get; } + /// IP address SANs. + public IList IP { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SchemaRegistryRef.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SchemaRegistryRef.Serialization.cs new file mode 100644 index 000000000000..f77ca693f334 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SchemaRegistryRef.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class SchemaRegistryRef : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(SchemaRegistryRef)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("resourceId"u8); + writer.WriteStringValue(ResourceId); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SchemaRegistryRef IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SchemaRegistryRef)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSchemaRegistryRef(document.RootElement, options); + } + + internal static SchemaRegistryRef DeserializeSchemaRegistryRef(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier resourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceId"u8)) + { + resourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SchemaRegistryRef(resourceId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SchemaRegistryRef)} does not support writing '{options.Format}' format."); + } + } + + SchemaRegistryRef IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSchemaRegistryRef(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SchemaRegistryRef)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseResourceMoveDefinition.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SchemaRegistryRef.cs similarity index 67% rename from sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseResourceMoveDefinition.cs rename to sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SchemaRegistryRef.cs index eabf80e4af11..eba95c26b820 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseResourceMoveDefinition.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SchemaRegistryRef.cs @@ -9,10 +9,10 @@ using System.Collections.Generic; using Azure.Core; -namespace Azure.ResourceManager.Synapse.Models +namespace Azure.ResourceManager.IoTOperations.Models { - /// Contains the information necessary to perform a resource move (rename). - public partial class SynapseResourceMoveDefinition + /// The reference to the Schema Registry for this AIO Instance. + public partial class SchemaRegistryRef { /// /// Keeps track of any properties unknown to the library. @@ -46,31 +46,31 @@ public partial class SynapseResourceMoveDefinition /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The target ID for the resource. - /// is null. - public SynapseResourceMoveDefinition(ResourceIdentifier id) + /// Initializes a new instance of . + /// The resource ID of the Schema Registry. + /// is null. + public SchemaRegistryRef(ResourceIdentifier resourceId) { - Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(resourceId, nameof(resourceId)); - Id = id; + ResourceId = resourceId; } - /// Initializes a new instance of . - /// The target ID for the resource. + /// Initializes a new instance of . + /// The resource ID of the Schema Registry. /// Keeps track of any properties unknown to the library. - internal SynapseResourceMoveDefinition(ResourceIdentifier id, IDictionary serializedAdditionalRawData) + internal SchemaRegistryRef(ResourceIdentifier resourceId, IDictionary serializedAdditionalRawData) { - Id = id; + ResourceId = resourceId; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal SynapseResourceMoveDefinition() + /// Initializes a new instance of for deserialization. + internal SchemaRegistryRef() { } - /// The target ID for the resource. - public ResourceIdentifier Id { get; } + /// The resource ID of the Schema Registry. + public ResourceIdentifier ResourceId { get; set; } } } diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SelfCheck.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SelfCheck.Serialization.cs new file mode 100644 index 000000000000..353de084add0 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SelfCheck.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class SelfCheck : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(SelfCheck)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Mode)) + { + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.Value.ToString()); + } + if (Optional.IsDefined(IntervalSeconds)) + { + writer.WritePropertyName("intervalSeconds"u8); + writer.WriteNumberValue(IntervalSeconds.Value); + } + if (Optional.IsDefined(TimeoutSeconds)) + { + writer.WritePropertyName("timeoutSeconds"u8); + writer.WriteNumberValue(TimeoutSeconds.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SelfCheck IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SelfCheck)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSelfCheck(document.RootElement, options); + } + + internal static SelfCheck DeserializeSelfCheck(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OperationalMode? mode = default; + int? intervalSeconds = default; + int? timeoutSeconds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mode = new OperationalMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("intervalSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + intervalSeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("timeoutSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeoutSeconds = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SelfCheck(mode, intervalSeconds, timeoutSeconds, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SelfCheck)} does not support writing '{options.Format}' format."); + } + } + + SelfCheck IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSelfCheck(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SelfCheck)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SelfCheck.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SelfCheck.cs new file mode 100644 index 000000000000..6fa8789c8bbf --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SelfCheck.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Broker Diagnostic Self check properties. + public partial class SelfCheck + { + /// + /// 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; + + /// Initializes a new instance of . + public SelfCheck() + { + } + + /// Initializes a new instance of . + /// The toggle to enable/disable self check. + /// The self check interval. + /// The timeout for self check. + /// Keeps track of any properties unknown to the library. + internal SelfCheck(OperationalMode? mode, int? intervalSeconds, int? timeoutSeconds, IDictionary serializedAdditionalRawData) + { + Mode = mode; + IntervalSeconds = intervalSeconds; + TimeoutSeconds = timeoutSeconds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The toggle to enable/disable self check. + public OperationalMode? Mode { get; set; } + /// The self check interval. + public int? IntervalSeconds { get; set; } + /// The timeout for self check. + public int? TimeoutSeconds { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SelfTracing.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SelfTracing.Serialization.cs new file mode 100644 index 000000000000..db1d705bddad --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SelfTracing.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class SelfTracing : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(SelfTracing)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Mode)) + { + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.Value.ToString()); + } + if (Optional.IsDefined(IntervalSeconds)) + { + writer.WritePropertyName("intervalSeconds"u8); + writer.WriteNumberValue(IntervalSeconds.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SelfTracing IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SelfTracing)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSelfTracing(document.RootElement, options); + } + + internal static SelfTracing DeserializeSelfTracing(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OperationalMode? mode = default; + int? intervalSeconds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mode = new OperationalMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("intervalSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + intervalSeconds = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SelfTracing(mode, intervalSeconds, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SelfTracing)} does not support writing '{options.Format}' format."); + } + } + + SelfTracing IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSelfTracing(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SelfTracing)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SelfTracing.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SelfTracing.cs new file mode 100644 index 000000000000..9fe7f6412260 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SelfTracing.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Diagnostic Self tracing properties. + public partial class SelfTracing + { + /// + /// 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; + + /// Initializes a new instance of . + public SelfTracing() + { + } + + /// Initializes a new instance of . + /// The toggle to enable/disable self tracing. + /// The self tracing interval. + /// Keeps track of any properties unknown to the library. + internal SelfTracing(OperationalMode? mode, int? intervalSeconds, IDictionary serializedAdditionalRawData) + { + Mode = mode; + IntervalSeconds = intervalSeconds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The toggle to enable/disable self tracing. + public OperationalMode? Mode { get; set; } + /// The self tracing interval. + public int? IntervalSeconds { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ServiceType.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ServiceType.cs new file mode 100644 index 000000000000..34dec84c483d --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/ServiceType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Kubernetes Service Types supported by Listener. + public readonly partial struct ServiceType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ServiceType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ClusterIPValue = "ClusterIp"; + private const string LoadBalancerValue = "LoadBalancer"; + private const string NodePortValue = "NodePort"; + + /// Cluster IP Service. + public static ServiceType ClusterIP { get; } = new ServiceType(ClusterIPValue); + /// Load Balancer Service. + public static ServiceType LoadBalancer { get; } = new ServiceType(LoadBalancerValue); + /// Node Port Service. + public static ServiceType NodePort { get; } = new ServiceType(NodePortValue); + /// Determines if two values are the same. + public static bool operator ==(ServiceType left, ServiceType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ServiceType left, ServiceType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ServiceType(string value) => new ServiceType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ServiceType other && Equals(other); + /// + public bool Equals(ServiceType 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SourceSerializationFormat.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SourceSerializationFormat.cs new file mode 100644 index 000000000000..778296f426c1 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SourceSerializationFormat.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Serialization Format properties. + public readonly partial struct SourceSerializationFormat : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SourceSerializationFormat(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string JsonValue = "Json"; + + /// JSON Format. + public static SourceSerializationFormat Json { get; } = new SourceSerializationFormat(JsonValue); + /// Determines if two values are the same. + public static bool operator ==(SourceSerializationFormat left, SourceSerializationFormat right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SourceSerializationFormat left, SourceSerializationFormat right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SourceSerializationFormat(string value) => new SourceSerializationFormat(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SourceSerializationFormat other && Equals(other); + /// + public bool Equals(SourceSerializationFormat 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/StateStoreResourceDefinitionMethod.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/StateStoreResourceDefinitionMethod.cs new file mode 100644 index 000000000000..b53f1eff7445 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/StateStoreResourceDefinitionMethod.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// StateStoreResourceDefinitionMethods methods allowed. + public readonly partial struct StateStoreResourceDefinitionMethod : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public StateStoreResourceDefinitionMethod(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ReadValue = "Read"; + private const string WriteValue = "Write"; + private const string ReadWriteValue = "ReadWrite"; + + /// Get/KeyNotify from Store. + public static StateStoreResourceDefinitionMethod Read { get; } = new StateStoreResourceDefinitionMethod(ReadValue); + /// Set/Delete in Store. + public static StateStoreResourceDefinitionMethod Write { get; } = new StateStoreResourceDefinitionMethod(WriteValue); + /// Allowed all operations on Store - Get/KeyNotify/Set/Delete. + public static StateStoreResourceDefinitionMethod ReadWrite { get; } = new StateStoreResourceDefinitionMethod(ReadWriteValue); + /// Determines if two values are the same. + public static bool operator ==(StateStoreResourceDefinitionMethod left, StateStoreResourceDefinitionMethod right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(StateStoreResourceDefinitionMethod left, StateStoreResourceDefinitionMethod right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator StateStoreResourceDefinitionMethod(string value) => new StateStoreResourceDefinitionMethod(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is StateStoreResourceDefinitionMethod other && Equals(other); + /// + public bool Equals(StateStoreResourceDefinitionMethod 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/StateStoreResourceKeyType.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/StateStoreResourceKeyType.cs new file mode 100644 index 000000000000..cd212b6f043f --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/StateStoreResourceKeyType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// StateStoreResourceKeyTypes properties. + public readonly partial struct StateStoreResourceKeyType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public StateStoreResourceKeyType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PatternValue = "Pattern"; + private const string StringValue = "String"; + private const string BinaryValue = "Binary"; + + /// Key type - pattern. + public static StateStoreResourceKeyType Pattern { get; } = new StateStoreResourceKeyType(PatternValue); + /// Key type - string. + public static StateStoreResourceKeyType String { get; } = new StateStoreResourceKeyType(StringValue); + /// Key type - binary. + public static StateStoreResourceKeyType Binary { get; } = new StateStoreResourceKeyType(BinaryValue); + /// Determines if two values are the same. + public static bool operator ==(StateStoreResourceKeyType left, StateStoreResourceKeyType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(StateStoreResourceKeyType left, StateStoreResourceKeyType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator StateStoreResourceKeyType(string value) => new StateStoreResourceKeyType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is StateStoreResourceKeyType other && Equals(other); + /// + public bool Equals(StateStoreResourceKeyType 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/StateStoreResourceRule.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/StateStoreResourceRule.Serialization.cs new file mode 100644 index 000000000000..69941dd5a4a5 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/StateStoreResourceRule.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class StateStoreResourceRule : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(StateStoreResourceRule)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("keyType"u8); + writer.WriteStringValue(KeyType.ToString()); + writer.WritePropertyName("keys"u8); + writer.WriteStartArray(); + foreach (var item in Keys) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("method"u8); + writer.WriteStringValue(Method.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + StateStoreResourceRule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StateStoreResourceRule)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStateStoreResourceRule(document.RootElement, options); + } + + internal static StateStoreResourceRule DeserializeStateStoreResourceRule(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + StateStoreResourceKeyType keyType = default; + IList keys = default; + StateStoreResourceDefinitionMethod method = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keyType"u8)) + { + keyType = new StateStoreResourceKeyType(property.Value.GetString()); + continue; + } + if (property.NameEquals("keys"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + keys = array; + continue; + } + if (property.NameEquals("method"u8)) + { + method = new StateStoreResourceDefinitionMethod(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StateStoreResourceRule(keyType, keys, method, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(StateStoreResourceRule)} does not support writing '{options.Format}' format."); + } + } + + StateStoreResourceRule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeStateStoreResourceRule(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StateStoreResourceRule)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/StateStoreResourceRule.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/StateStoreResourceRule.cs new file mode 100644 index 000000000000..9087cc273357 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/StateStoreResourceRule.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// State Store Resource Rule properties. + public partial class StateStoreResourceRule + { + /// + /// 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; + + /// Initializes a new instance of . + /// Allowed keyTypes pattern, string, binary. The key type used for matching, for example pattern tries to match the key to a glob-style pattern and string checks key is equal to value provided in keys. + /// Give access to state store keys for the corresponding principals defined. When key type is pattern set glob-style pattern (e.g., '*', 'clients/*'). + /// Give access for `Read`, `Write` and `ReadWrite` access level. + /// is null. + public StateStoreResourceRule(StateStoreResourceKeyType keyType, IEnumerable keys, StateStoreResourceDefinitionMethod method) + { + Argument.AssertNotNull(keys, nameof(keys)); + + KeyType = keyType; + Keys = keys.ToList(); + Method = method; + } + + /// Initializes a new instance of . + /// Allowed keyTypes pattern, string, binary. The key type used for matching, for example pattern tries to match the key to a glob-style pattern and string checks key is equal to value provided in keys. + /// Give access to state store keys for the corresponding principals defined. When key type is pattern set glob-style pattern (e.g., '*', 'clients/*'). + /// Give access for `Read`, `Write` and `ReadWrite` access level. + /// Keeps track of any properties unknown to the library. + internal StateStoreResourceRule(StateStoreResourceKeyType keyType, IList keys, StateStoreResourceDefinitionMethod method, IDictionary serializedAdditionalRawData) + { + KeyType = keyType; + Keys = keys; + Method = method; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal StateStoreResourceRule() + { + } + + /// Allowed keyTypes pattern, string, binary. The key type used for matching, for example pattern tries to match the key to a glob-style pattern and string checks key is equal to value provided in keys. + public StateStoreResourceKeyType KeyType { get; set; } + /// Give access to state store keys for the corresponding principals defined. When key type is pattern set glob-style pattern (e.g., '*', 'clients/*'). + public IList Keys { get; } + /// Give access for `Read`, `Write` and `ReadWrite` access level. + public StateStoreResourceDefinitionMethod Method { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SubscriberMessageDropStrategy.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SubscriberMessageDropStrategy.cs new file mode 100644 index 000000000000..6d418d59d48e --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SubscriberMessageDropStrategy.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// The enum defining strategies for dropping messages from the subscriber queue. + public readonly partial struct SubscriberMessageDropStrategy : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SubscriberMessageDropStrategy(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string DropOldestValue = "DropOldest"; + + /// Messages are never dropped. + public static SubscriberMessageDropStrategy None { get; } = new SubscriberMessageDropStrategy(NoneValue); + /// The oldest message is dropped. + public static SubscriberMessageDropStrategy DropOldest { get; } = new SubscriberMessageDropStrategy(DropOldestValue); + /// Determines if two values are the same. + public static bool operator ==(SubscriberMessageDropStrategy left, SubscriberMessageDropStrategy right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SubscriberMessageDropStrategy left, SubscriberMessageDropStrategy right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SubscriberMessageDropStrategy(string value) => new SubscriberMessageDropStrategy(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SubscriberMessageDropStrategy other && Equals(other); + /// + public bool Equals(SubscriberMessageDropStrategy 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SubscriberQueueLimit.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SubscriberQueueLimit.Serialization.cs new file mode 100644 index 000000000000..956b422dd3f0 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SubscriberQueueLimit.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class SubscriberQueueLimit : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(SubscriberQueueLimit)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Length)) + { + writer.WritePropertyName("length"u8); + writer.WriteNumberValue(Length.Value); + } + if (Optional.IsDefined(Strategy)) + { + writer.WritePropertyName("strategy"u8); + writer.WriteStringValue(Strategy.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SubscriberQueueLimit IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SubscriberQueueLimit)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSubscriberQueueLimit(document.RootElement, options); + } + + internal static SubscriberQueueLimit DeserializeSubscriberQueueLimit(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long? length = default; + SubscriberMessageDropStrategy? strategy = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("length"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + length = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("strategy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + strategy = new SubscriberMessageDropStrategy(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SubscriberQueueLimit(length, strategy, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SubscriberQueueLimit)} does not support writing '{options.Format}' format."); + } + } + + SubscriberQueueLimit IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSubscriberQueueLimit(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SubscriberQueueLimit)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SubscriberQueueLimit.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SubscriberQueueLimit.cs new file mode 100644 index 000000000000..b397650aa427 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/SubscriberQueueLimit.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// The settings of Subscriber Queue Limit. + public partial class SubscriberQueueLimit + { + /// + /// 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; + + /// Initializes a new instance of . + public SubscriberQueueLimit() + { + } + + /// Initializes a new instance of . + /// The maximum length of the queue before messages start getting dropped. + /// The strategy to use for dropping messages from the queue. + /// Keeps track of any properties unknown to the library. + internal SubscriberQueueLimit(long? length, SubscriberMessageDropStrategy? strategy, IDictionary serializedAdditionalRawData) + { + Length = length; + Strategy = strategy; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The maximum length of the queue before messages start getting dropped. + public long? Length { get; set; } + /// The strategy to use for dropping messages from the queue. + public SubscriberMessageDropStrategy? Strategy { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/TlsCertMethod.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/TlsCertMethod.Serialization.cs new file mode 100644 index 000000000000..924fa582eea8 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/TlsCertMethod.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class TlsCertMethod : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(TlsCertMethod)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.ToString()); + if (Optional.IsDefined(CertManagerCertificateSpec)) + { + writer.WritePropertyName("certManagerCertificateSpec"u8); + writer.WriteObjectValue(CertManagerCertificateSpec, options); + } + if (Optional.IsDefined(Manual)) + { + writer.WritePropertyName("manual"u8); + writer.WriteObjectValue(Manual, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TlsCertMethod IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TlsCertMethod)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTlsCertMethod(document.RootElement, options); + } + + internal static TlsCertMethod DeserializeTlsCertMethod(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + TlsCertMethodMode mode = default; + CertManagerCertificateSpec certManagerCertificateSpec = default; + X509ManualCertificate manual = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mode"u8)) + { + mode = new TlsCertMethodMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("certManagerCertificateSpec"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + certManagerCertificateSpec = CertManagerCertificateSpec.DeserializeCertManagerCertificateSpec(property.Value, options); + continue; + } + if (property.NameEquals("manual"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + manual = X509ManualCertificate.DeserializeX509ManualCertificate(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TlsCertMethod(mode, certManagerCertificateSpec, manual, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TlsCertMethod)} does not support writing '{options.Format}' format."); + } + } + + TlsCertMethod IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTlsCertMethod(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TlsCertMethod)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/TlsCertMethod.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/TlsCertMethod.cs new file mode 100644 index 000000000000..2f0fc69c5814 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/TlsCertMethod.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Collection of different TLS types, NOTE- Enum at a time only one of them needs to be supported. + public partial class TlsCertMethod + { + /// + /// 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; + + /// Initializes a new instance of . + /// Mode of TLS server certificate management. + public TlsCertMethod(TlsCertMethodMode mode) + { + Mode = mode; + } + + /// Initializes a new instance of . + /// Mode of TLS server certificate management. + /// Option 1 - Automatic TLS server certificate management with cert-manager. + /// Option 2 - Manual TLS server certificate management through a defined secret. + /// Keeps track of any properties unknown to the library. + internal TlsCertMethod(TlsCertMethodMode mode, CertManagerCertificateSpec certManagerCertificateSpec, X509ManualCertificate manual, IDictionary serializedAdditionalRawData) + { + Mode = mode; + CertManagerCertificateSpec = certManagerCertificateSpec; + Manual = manual; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TlsCertMethod() + { + } + + /// Mode of TLS server certificate management. + public TlsCertMethodMode Mode { get; set; } + /// Option 1 - Automatic TLS server certificate management with cert-manager. + public CertManagerCertificateSpec CertManagerCertificateSpec { get; set; } + /// Option 2 - Manual TLS server certificate management through a defined secret. + internal X509ManualCertificate Manual { get; set; } + /// Kubernetes secret containing an X.509 client certificate. This is a reference to the secret through an identifying name, not the secret itself. + public string ManualSecretRef + { + get => Manual is null ? default : Manual.SecretRef; + set => Manual = new X509ManualCertificate(value); + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/TlsCertMethodMode.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/TlsCertMethodMode.cs new file mode 100644 index 000000000000..38707ea3991e --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/TlsCertMethodMode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Broker Authentication Mode. + public readonly partial struct TlsCertMethodMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TlsCertMethodMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AutomaticValue = "Automatic"; + private const string ManualValue = "Manual"; + + /// Automatic TLS server certificate configuration. + public static TlsCertMethodMode Automatic { get; } = new TlsCertMethodMode(AutomaticValue); + /// Manual TLS server certificate configuration. + public static TlsCertMethodMode Manual { get; } = new TlsCertMethodMode(ManualValue); + /// Determines if two values are the same. + public static bool operator ==(TlsCertMethodMode left, TlsCertMethodMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TlsCertMethodMode left, TlsCertMethodMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TlsCertMethodMode(string value) => new TlsCertMethodMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TlsCertMethodMode other && Equals(other); + /// + public bool Equals(TlsCertMethodMode 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/TlsProperties.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/TlsProperties.Serialization.cs new file mode 100644 index 000000000000..0fc092a47382 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/TlsProperties.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class TlsProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(TlsProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Mode)) + { + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.Value.ToString()); + } + if (Optional.IsDefined(TrustedCaCertificateConfigMapRef)) + { + writer.WritePropertyName("trustedCaCertificateConfigMapRef"u8); + writer.WriteStringValue(TrustedCaCertificateConfigMapRef); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TlsProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TlsProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTlsProperties(document.RootElement, options); + } + + internal static TlsProperties DeserializeTlsProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OperationalMode? mode = default; + string trustedCaCertificateConfigMapRef = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mode = new OperationalMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("trustedCaCertificateConfigMapRef"u8)) + { + trustedCaCertificateConfigMapRef = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TlsProperties(mode, trustedCaCertificateConfigMapRef, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TlsProperties)} does not support writing '{options.Format}' format."); + } + } + + TlsProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTlsProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TlsProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/TlsProperties.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/TlsProperties.cs new file mode 100644 index 000000000000..f0d2baf4ae46 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/TlsProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Tls properties. + public partial class TlsProperties + { + /// + /// 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; + + /// Initializes a new instance of . + public TlsProperties() + { + } + + /// Initializes a new instance of . + /// Mode for TLS. + /// Trusted CA certificate config map. + /// Keeps track of any properties unknown to the library. + internal TlsProperties(OperationalMode? mode, string trustedCaCertificateConfigMapRef, IDictionary serializedAdditionalRawData) + { + Mode = mode; + TrustedCaCertificateConfigMapRef = trustedCaCertificateConfigMapRef; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Mode for TLS. + public OperationalMode? Mode { get; set; } + /// Trusted CA certificate config map. + public string TrustedCaCertificateConfigMapRef { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Traces.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Traces.Serialization.cs new file mode 100644 index 000000000000..381cc0e27ee5 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Traces.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class Traces : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(Traces)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Mode)) + { + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.Value.ToString()); + } + if (Optional.IsDefined(CacheSizeMegabytes)) + { + writer.WritePropertyName("cacheSizeMegabytes"u8); + writer.WriteNumberValue(CacheSizeMegabytes.Value); + } + if (Optional.IsDefined(SelfTracing)) + { + writer.WritePropertyName("selfTracing"u8); + writer.WriteObjectValue(SelfTracing, options); + } + if (Optional.IsDefined(SpanChannelCapacity)) + { + writer.WritePropertyName("spanChannelCapacity"u8); + writer.WriteNumberValue(SpanChannelCapacity.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + Traces IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Traces)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTraces(document.RootElement, options); + } + + internal static Traces DeserializeTraces(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OperationalMode? mode = default; + int? cacheSizeMegabytes = default; + SelfTracing selfTracing = default; + int? spanChannelCapacity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mode = new OperationalMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("cacheSizeMegabytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cacheSizeMegabytes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("selfTracing"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + selfTracing = SelfTracing.DeserializeSelfTracing(property.Value, options); + continue; + } + if (property.NameEquals("spanChannelCapacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + spanChannelCapacity = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Traces(mode, cacheSizeMegabytes, selfTracing, spanChannelCapacity, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(Traces)} does not support writing '{options.Format}' format."); + } + } + + Traces IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTraces(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Traces)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Traces.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Traces.cs new file mode 100644 index 000000000000..388b68edfcef --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/Traces.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Broker Diagnostic Trace properties. + public partial class Traces + { + /// + /// 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; + + /// Initializes a new instance of . + public Traces() + { + } + + /// Initializes a new instance of . + /// The toggle to enable/disable traces. + /// The cache size in megabytes. + /// The self tracing properties. + /// The span channel capacity. + /// Keeps track of any properties unknown to the library. + internal Traces(OperationalMode? mode, int? cacheSizeMegabytes, SelfTracing selfTracing, int? spanChannelCapacity, IDictionary serializedAdditionalRawData) + { + Mode = mode; + CacheSizeMegabytes = cacheSizeMegabytes; + SelfTracing = selfTracing; + SpanChannelCapacity = spanChannelCapacity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The toggle to enable/disable traces. + public OperationalMode? Mode { get; set; } + /// The cache size in megabytes. + public int? CacheSizeMegabytes { get; set; } + /// The self tracing properties. + public SelfTracing SelfTracing { get; set; } + /// The span channel capacity. + public int? SpanChannelCapacity { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/TransformationSerializationFormat.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/TransformationSerializationFormat.cs new file mode 100644 index 000000000000..5448edc318bd --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/TransformationSerializationFormat.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// Transformation Format properties. + public readonly partial struct TransformationSerializationFormat : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TransformationSerializationFormat(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DeltaValue = "Delta"; + private const string JsonValue = "Json"; + private const string ParquetValue = "Parquet"; + + /// Delta Format. + public static TransformationSerializationFormat Delta { get; } = new TransformationSerializationFormat(DeltaValue); + /// JSON Format. + public static TransformationSerializationFormat Json { get; } = new TransformationSerializationFormat(JsonValue); + /// Parquet Format. + public static TransformationSerializationFormat Parquet { get; } = new TransformationSerializationFormat(ParquetValue); + /// Determines if two values are the same. + public static bool operator ==(TransformationSerializationFormat left, TransformationSerializationFormat right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TransformationSerializationFormat left, TransformationSerializationFormat right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TransformationSerializationFormat(string value) => new TransformationSerializationFormat(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TransformationSerializationFormat other && Equals(other); + /// + public bool Equals(TransformationSerializationFormat 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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimResourceRequirements.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimResourceRequirements.Serialization.cs new file mode 100644 index 000000000000..85facff585cf --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimResourceRequirements.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class VolumeClaimResourceRequirements : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(VolumeClaimResourceRequirements)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Limits)) + { + writer.WritePropertyName("limits"u8); + writer.WriteStartObject(); + foreach (var item in Limits) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsCollectionDefined(Requests)) + { + writer.WritePropertyName("requests"u8); + writer.WriteStartObject(); + foreach (var item in Requests) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VolumeClaimResourceRequirements IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VolumeClaimResourceRequirements)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVolumeClaimResourceRequirements(document.RootElement, options); + } + + internal static VolumeClaimResourceRequirements DeserializeVolumeClaimResourceRequirements(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary limits = default; + IDictionary requests = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("limits"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()); + } + limits = dictionary; + continue; + } + if (property.NameEquals("requests"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()); + } + requests = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VolumeClaimResourceRequirements(limits ?? new ChangeTrackingDictionary(), requests ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VolumeClaimResourceRequirements)} does not support writing '{options.Format}' format."); + } + } + + VolumeClaimResourceRequirements IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVolumeClaimResourceRequirements(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VolumeClaimResourceRequirements)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimResourceRequirements.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimResourceRequirements.cs new file mode 100644 index 000000000000..d681ac7b0a98 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimResourceRequirements.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// VolumeClaimResourceRequirements properties. + public partial class VolumeClaimResourceRequirements + { + /// + /// 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; + + /// Initializes a new instance of . + public VolumeClaimResourceRequirements() + { + Limits = new ChangeTrackingDictionary(); + Requests = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/. + /// Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/. + /// Keeps track of any properties unknown to the library. + internal VolumeClaimResourceRequirements(IDictionary limits, IDictionary requests, IDictionary serializedAdditionalRawData) + { + Limits = limits; + Requests = requests; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/. + public IDictionary Limits { get; } + /// Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/. + public IDictionary Requests { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimSpec.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimSpec.Serialization.cs new file mode 100644 index 000000000000..87367f0f7f94 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimSpec.Serialization.cs @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class VolumeClaimSpec : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(VolumeClaimSpec)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(VolumeName)) + { + writer.WritePropertyName("volumeName"u8); + writer.WriteStringValue(VolumeName); + } + if (Optional.IsDefined(VolumeMode)) + { + writer.WritePropertyName("volumeMode"u8); + writer.WriteStringValue(VolumeMode); + } + if (Optional.IsDefined(StorageClassName)) + { + writer.WritePropertyName("storageClassName"u8); + writer.WriteStringValue(StorageClassName); + } + if (Optional.IsCollectionDefined(AccessModes)) + { + writer.WritePropertyName("accessModes"u8); + writer.WriteStartArray(); + foreach (var item in AccessModes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DataSource)) + { + writer.WritePropertyName("dataSource"u8); + writer.WriteObjectValue(DataSource, options); + } + if (Optional.IsDefined(DataSourceRef)) + { + writer.WritePropertyName("dataSourceRef"u8); + writer.WriteObjectValue(DataSourceRef, options); + } + if (Optional.IsDefined(Resources)) + { + writer.WritePropertyName("resources"u8); + writer.WriteObjectValue(Resources, options); + } + if (Optional.IsDefined(Selector)) + { + writer.WritePropertyName("selector"u8); + writer.WriteObjectValue(Selector, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VolumeClaimSpec IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VolumeClaimSpec)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVolumeClaimSpec(document.RootElement, options); + } + + internal static VolumeClaimSpec DeserializeVolumeClaimSpec(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string volumeName = default; + string volumeMode = default; + string storageClassName = default; + IList accessModes = default; + LocalKubernetesReference dataSource = default; + KubernetesReference dataSourceRef = default; + VolumeClaimResourceRequirements resources = default; + VolumeClaimSpecSelector selector = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("volumeName"u8)) + { + volumeName = property.Value.GetString(); + continue; + } + if (property.NameEquals("volumeMode"u8)) + { + volumeMode = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageClassName"u8)) + { + storageClassName = property.Value.GetString(); + continue; + } + if (property.NameEquals("accessModes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + accessModes = array; + continue; + } + if (property.NameEquals("dataSource"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataSource = LocalKubernetesReference.DeserializeLocalKubernetesReference(property.Value, options); + continue; + } + if (property.NameEquals("dataSourceRef"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataSourceRef = KubernetesReference.DeserializeKubernetesReference(property.Value, options); + continue; + } + if (property.NameEquals("resources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resources = VolumeClaimResourceRequirements.DeserializeVolumeClaimResourceRequirements(property.Value, options); + continue; + } + if (property.NameEquals("selector"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + selector = VolumeClaimSpecSelector.DeserializeVolumeClaimSpecSelector(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VolumeClaimSpec( + volumeName, + volumeMode, + storageClassName, + accessModes ?? new ChangeTrackingList(), + dataSource, + dataSourceRef, + resources, + selector, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VolumeClaimSpec)} does not support writing '{options.Format}' format."); + } + } + + VolumeClaimSpec IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVolumeClaimSpec(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VolumeClaimSpec)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimSpec.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimSpec.cs new file mode 100644 index 000000000000..19e9bce5dd85 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimSpec.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// VolumeClaimSpec properties. + public partial class VolumeClaimSpec + { + /// + /// 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; + + /// Initializes a new instance of . + public VolumeClaimSpec() + { + AccessModes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// VolumeName is the binding reference to the PersistentVolume backing this claim. + /// volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec. This is a beta feature. + /// Name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1. + /// AccessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1. + /// This field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. If the AnyVolumeDataSource feature gate is enabled, this field will always have the same contents as the DataSourceRef field. + /// Specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any local object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the DataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, both fields (DataSource and DataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. There are two important differences between DataSource and DataSourceRef: * While DataSource only allows two specific types of objects, DataSourceRef allows any non-core object, as well as PersistentVolumeClaim objects. * While DataSource ignores disallowed values (dropping them), DataSourceRef preserves all values, and generates an error if a disallowed value is specified. (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. + /// Resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources. + /// A label query over volumes to consider for binding. + /// Keeps track of any properties unknown to the library. + internal VolumeClaimSpec(string volumeName, string volumeMode, string storageClassName, IList accessModes, LocalKubernetesReference dataSource, KubernetesReference dataSourceRef, VolumeClaimResourceRequirements resources, VolumeClaimSpecSelector selector, IDictionary serializedAdditionalRawData) + { + VolumeName = volumeName; + VolumeMode = volumeMode; + StorageClassName = storageClassName; + AccessModes = accessModes; + DataSource = dataSource; + DataSourceRef = dataSourceRef; + Resources = resources; + Selector = selector; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// VolumeName is the binding reference to the PersistentVolume backing this claim. + public string VolumeName { get; set; } + /// volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec. This is a beta feature. + public string VolumeMode { get; set; } + /// Name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1. + public string StorageClassName { get; set; } + /// AccessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1. + public IList AccessModes { get; } + /// This field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. If the AnyVolumeDataSource feature gate is enabled, this field will always have the same contents as the DataSourceRef field. + public LocalKubernetesReference DataSource { get; set; } + /// Specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any local object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the DataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, both fields (DataSource and DataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. There are two important differences between DataSource and DataSourceRef: * While DataSource only allows two specific types of objects, DataSourceRef allows any non-core object, as well as PersistentVolumeClaim objects. * While DataSource ignores disallowed values (dropping them), DataSourceRef preserves all values, and generates an error if a disallowed value is specified. (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. + public KubernetesReference DataSourceRef { get; set; } + /// Resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources. + public VolumeClaimResourceRequirements Resources { get; set; } + /// A label query over volumes to consider for binding. + public VolumeClaimSpecSelector Selector { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimSpecSelector.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimSpecSelector.Serialization.cs new file mode 100644 index 000000000000..e4af32745130 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimSpecSelector.Serialization.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class VolumeClaimSpecSelector : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(VolumeClaimSpecSelector)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(MatchExpressions)) + { + writer.WritePropertyName("matchExpressions"u8); + writer.WriteStartArray(); + foreach (var item in MatchExpressions) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(MatchLabels)) + { + writer.WritePropertyName("matchLabels"u8); + writer.WriteStartObject(); + foreach (var item in MatchLabels) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VolumeClaimSpecSelector IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VolumeClaimSpecSelector)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVolumeClaimSpecSelector(document.RootElement, options); + } + + internal static VolumeClaimSpecSelector DeserializeVolumeClaimSpecSelector(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList matchExpressions = default; + IDictionary matchLabels = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("matchExpressions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VolumeClaimSpecSelectorMatchExpressions.DeserializeVolumeClaimSpecSelectorMatchExpressions(item, options)); + } + matchExpressions = array; + continue; + } + if (property.NameEquals("matchLabels"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()); + } + matchLabels = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VolumeClaimSpecSelector(matchExpressions ?? new ChangeTrackingList(), matchLabels ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VolumeClaimSpecSelector)} does not support writing '{options.Format}' format."); + } + } + + VolumeClaimSpecSelector IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVolumeClaimSpecSelector(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VolumeClaimSpecSelector)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimSpecSelector.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimSpecSelector.cs new file mode 100644 index 000000000000..b795f5039667 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimSpecSelector.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// VolumeClaimSpecSelector properties. + public partial class VolumeClaimSpecSelector + { + /// + /// 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; + + /// Initializes a new instance of . + public VolumeClaimSpecSelector() + { + MatchExpressions = new ChangeTrackingList(); + MatchLabels = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// MatchExpressions is a list of label selector requirements. The requirements are ANDed. + /// MatchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + /// Keeps track of any properties unknown to the library. + internal VolumeClaimSpecSelector(IList matchExpressions, IDictionary matchLabels, IDictionary serializedAdditionalRawData) + { + MatchExpressions = matchExpressions; + MatchLabels = matchLabels; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// MatchExpressions is a list of label selector requirements. The requirements are ANDed. + public IList MatchExpressions { get; } + /// MatchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + public IDictionary MatchLabels { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimSpecSelectorMatchExpressions.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimSpecSelectorMatchExpressions.Serialization.cs new file mode 100644 index 000000000000..a6ac4eba0940 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimSpecSelectorMatchExpressions.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + public partial class VolumeClaimSpecSelectorMatchExpressions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(VolumeClaimSpecSelectorMatchExpressions)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + writer.WritePropertyName("operator"u8); + writer.WriteStringValue(Operator.ToString()); + if (Optional.IsCollectionDefined(Values)) + { + writer.WritePropertyName("values"u8); + writer.WriteStartArray(); + foreach (var item in Values) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VolumeClaimSpecSelectorMatchExpressions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VolumeClaimSpecSelectorMatchExpressions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVolumeClaimSpecSelectorMatchExpressions(document.RootElement, options); + } + + internal static VolumeClaimSpecSelectorMatchExpressions DeserializeVolumeClaimSpecSelectorMatchExpressions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string key = default; + OperatorValue @operator = default; + IList values = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("key"u8)) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("operator"u8)) + { + @operator = new OperatorValue(property.Value.GetString()); + continue; + } + if (property.NameEquals("values"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + values = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VolumeClaimSpecSelectorMatchExpressions(key, @operator, values ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VolumeClaimSpecSelectorMatchExpressions)} does not support writing '{options.Format}' format."); + } + } + + VolumeClaimSpecSelectorMatchExpressions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVolumeClaimSpecSelectorMatchExpressions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VolumeClaimSpecSelectorMatchExpressions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimSpecSelectorMatchExpressions.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimSpecSelectorMatchExpressions.cs new file mode 100644 index 000000000000..29a3c93a77c4 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/VolumeClaimSpecSelectorMatchExpressions.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// VolumeClaimSpecSelectorMatchExpressions properties. + public partial class VolumeClaimSpecSelectorMatchExpressions + { + /// + /// 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; + + /// Initializes a new instance of . + /// key is the label key that the selector applies to. + /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + /// is null. + public VolumeClaimSpecSelectorMatchExpressions(string key, OperatorValue @operator) + { + Argument.AssertNotNull(key, nameof(key)); + + Key = key; + Operator = @operator; + Values = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// key is the label key that the selector applies to. + /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + /// Keeps track of any properties unknown to the library. + internal VolumeClaimSpecSelectorMatchExpressions(string key, OperatorValue @operator, IList values, IDictionary serializedAdditionalRawData) + { + Key = key; + Operator = @operator; + Values = values; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal VolumeClaimSpecSelectorMatchExpressions() + { + } + + /// key is the label key that the selector applies to. + public string Key { get; set; } + /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + public OperatorValue Operator { get; set; } + /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + public IList Values { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/X509ManualCertificate.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/X509ManualCertificate.Serialization.cs new file mode 100644 index 000000000000..67e99ebed383 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/X509ManualCertificate.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + internal partial class X509ManualCertificate : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(X509ManualCertificate)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("secretRef"u8); + writer.WriteStringValue(SecretRef); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + X509ManualCertificate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(X509ManualCertificate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeX509ManualCertificate(document.RootElement, options); + } + + internal static X509ManualCertificate DeserializeX509ManualCertificate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string secretRef = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("secretRef"u8)) + { + secretRef = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new X509ManualCertificate(secretRef, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(X509ManualCertificate)} does not support writing '{options.Format}' format."); + } + } + + X509ManualCertificate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeX509ManualCertificate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(X509ManualCertificate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/X509ManualCertificate.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/X509ManualCertificate.cs new file mode 100644 index 000000000000..690b57bfbf1b --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/Models/X509ManualCertificate.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.IoTOperations.Models +{ + /// X509 Certificate Authentication properties. + internal partial class X509ManualCertificate + { + /// + /// 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; + + /// Initializes a new instance of . + /// Kubernetes secret containing an X.509 client certificate. This is a reference to the secret through an identifying name, not the secret itself. + /// is null. + public X509ManualCertificate(string secretRef) + { + Argument.AssertNotNull(secretRef, nameof(secretRef)); + + SecretRef = secretRef; + } + + /// Initializes a new instance of . + /// Kubernetes secret containing an X.509 client certificate. This is a reference to the secret through an identifying name, not the secret itself. + /// Keeps track of any properties unknown to the library. + internal X509ManualCertificate(string secretRef, IDictionary serializedAdditionalRawData) + { + SecretRef = secretRef; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal X509ManualCertificate() + { + } + + /// Kubernetes secret containing an X.509 client certificate. This is a reference to the secret through an identifying name, not the secret itself. + public string SecretRef { get; set; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/ProviderConstants.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..4b35d29c2858 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/ProviderConstants.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.IoTOperations +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RestOperations/AccessPolicyAssignmentRestOperations.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/BrokerAuthenticationRestOperations.cs similarity index 51% rename from sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RestOperations/AccessPolicyAssignmentRestOperations.cs rename to sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/BrokerAuthenticationRestOperations.cs index 4fb579f23e19..8d9f654a6ba8 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RestOperations/AccessPolicyAssignmentRestOperations.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/BrokerAuthenticationRestOperations.cs @@ -11,32 +11,32 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; -using Azure.ResourceManager.RedisEnterprise.Models; +using Azure.ResourceManager.IoTOperations.Models; -namespace Azure.ResourceManager.RedisEnterprise +namespace Azure.ResourceManager.IoTOperations { - internal partial class AccessPolicyAssignmentRestOperations + internal partial class BrokerAuthenticationRestOperations { private readonly TelemetryDetails _userAgent; private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of AccessPolicyAssignmentRestOperations. + /// Initializes a new instance of BrokerAuthenticationRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. - public AccessPolicyAssignmentRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + public BrokerAuthenticationRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string databaseName, string accessPolicyAssignmentName, AccessPolicyAssignmentData data) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -44,107 +44,111 @@ internal RequestUriBuilder CreateCreateUpdateRequestUri(string subscriptionId, s uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Cache/redisEnterprise/", false); - uri.AppendPath(clusterName, true); - uri.AppendPath("/databases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/accessPolicyAssignments/", false); - uri.AppendPath(accessPolicyAssignmentName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authentications/", false); + uri.AppendPath(authenticationName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateUpdateRequest(string subscriptionId, string resourceGroupName, string clusterName, string databaseName, string accessPolicyAssignmentName, AccessPolicyAssignmentData data) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Cache/redisEnterprise/", false); - uri.AppendPath(clusterName, true); - uri.AppendPath("/databases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/accessPolicyAssignments/", false); - uri.AppendPath(accessPolicyAssignmentName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authentications/", false); + uri.AppendPath(authenticationName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Creates/Updates a particular access policy assignment for a database. - /// The ID of the target subscription. + /// Get a BrokerAuthenticationResource. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. - /// The name of the Redis Enterprise database. - /// The name of the Redis Enterprise database access policy assignment. - /// Parameters supplied to the create access policy assignment for database. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker authentication resource. /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task CreateUpdateAsync(string subscriptionId, string resourceGroupName, string clusterName, string databaseName, string accessPolicyAssignmentName, AccessPolicyAssignmentData data, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(accessPolicyAssignmentName, nameof(accessPolicyAssignmentName)); - Argument.AssertNotNull(data, nameof(data)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName)); - using var message = CreateCreateUpdateRequest(subscriptionId, resourceGroupName, clusterName, databaseName, accessPolicyAssignmentName, data); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName, brokerName, authenticationName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + BrokerAuthenticationResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BrokerAuthenticationResourceData.DeserializeBrokerAuthenticationResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((BrokerAuthenticationResourceData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Creates/Updates a particular access policy assignment for a database. - /// The ID of the target subscription. + /// Get a BrokerAuthenticationResource. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. - /// The name of the Redis Enterprise database. - /// The name of the Redis Enterprise database access policy assignment. - /// Parameters supplied to the create access policy assignment for database. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker authentication resource. /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response CreateUpdate(string subscriptionId, string resourceGroupName, string clusterName, string databaseName, string accessPolicyAssignmentName, AccessPolicyAssignmentData data, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(accessPolicyAssignmentName, nameof(accessPolicyAssignmentName)); - Argument.AssertNotNull(data, nameof(data)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName)); - using var message = CreateCreateUpdateRequest(subscriptionId, resourceGroupName, clusterName, databaseName, accessPolicyAssignmentName, data); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName, brokerName, authenticationName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + BrokerAuthenticationResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BrokerAuthenticationResourceData.DeserializeBrokerAuthenticationResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((BrokerAuthenticationResourceData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string databaseName, string accessPolicyAssignmentName) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName, BrokerAuthenticationResourceData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -152,111 +156,107 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Cache/redisEnterprise/", false); - uri.AppendPath(clusterName, true); - uri.AppendPath("/databases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/accessPolicyAssignments/", false); - uri.AppendPath(accessPolicyAssignmentName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authentications/", false); + uri.AppendPath(authenticationName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string clusterName, string databaseName, string accessPolicyAssignmentName) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName, BrokerAuthenticationResourceData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Cache/redisEnterprise/", false); - uri.AppendPath(clusterName, true); - uri.AppendPath("/databases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/accessPolicyAssignments/", false); - uri.AppendPath(accessPolicyAssignmentName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authentications/", false); + uri.AppendPath(authenticationName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Gets information about access policy assignment for database. - /// The ID of the target subscription. + /// Create a BrokerAuthenticationResource. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. - /// The name of the Redis Enterprise database. - /// The name of the Redis Enterprise database access policy assignment. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker authentication resource. + /// Resource create parameters. /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string clusterName, string databaseName, string accessPolicyAssignmentName, CancellationToken cancellationToken = default) + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName, BrokerAuthenticationResourceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(accessPolicyAssignmentName, nameof(accessPolicyAssignmentName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, clusterName, databaseName, accessPolicyAssignmentName); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, brokerName, authenticationName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - AccessPolicyAssignmentData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AccessPolicyAssignmentData.DeserializeAccessPolicyAssignmentData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((AccessPolicyAssignmentData)null, message.Response); + case 201: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Gets information about access policy assignment for database. - /// The ID of the target subscription. + /// Create a BrokerAuthenticationResource. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. - /// The name of the Redis Enterprise database. - /// The name of the Redis Enterprise database access policy assignment. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker authentication resource. + /// Resource create parameters. /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string clusterName, string databaseName, string accessPolicyAssignmentName, CancellationToken cancellationToken = default) + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName, BrokerAuthenticationResourceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(accessPolicyAssignmentName, nameof(accessPolicyAssignmentName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, clusterName, databaseName, accessPolicyAssignmentName); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, brokerName, authenticationName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - AccessPolicyAssignmentData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AccessPolicyAssignmentData.DeserializeAccessPolicyAssignmentData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((AccessPolicyAssignmentData)null, message.Response); + case 201: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string databaseName, string accessPolicyAssignmentName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -264,17 +264,17 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Cache/redisEnterprise/", false); - uri.AppendPath(clusterName, true); - uri.AppendPath("/databases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/accessPolicyAssignments/", false); - uri.AppendPath(accessPolicyAssignmentName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authentications/", false); + uri.AppendPath(authenticationName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string clusterName, string databaseName, string accessPolicyAssignmentName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -285,12 +285,12 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Cache/redisEnterprise/", false); - uri.AppendPath(clusterName, true); - uri.AppendPath("/databases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/accessPolicyAssignments/", false); - uri.AppendPath(accessPolicyAssignmentName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authentications/", false); + uri.AppendPath(authenticationName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -298,24 +298,24 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG return message; } - /// Deletes a single access policy assignment. - /// The ID of the target subscription. + /// Delete a BrokerAuthenticationResource. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. - /// The name of the Redis Enterprise database. - /// The name of the Redis Enterprise database access policy assignment. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker authentication resource. /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string clusterName, string databaseName, string accessPolicyAssignmentName, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(accessPolicyAssignmentName, nameof(accessPolicyAssignmentName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, clusterName, databaseName, accessPolicyAssignmentName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName, brokerName, authenticationName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -327,24 +327,24 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } } - /// Deletes a single access policy assignment. - /// The ID of the target subscription. + /// Delete a BrokerAuthenticationResource. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. - /// The name of the Redis Enterprise database. - /// The name of the Redis Enterprise database access policy assignment. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker authentication resource. /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string clusterName, string databaseName, string accessPolicyAssignmentName, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(accessPolicyAssignmentName, nameof(accessPolicyAssignmentName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, clusterName, databaseName, accessPolicyAssignmentName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName, brokerName, authenticationName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -356,7 +356,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string c } } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string databaseName) + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -364,16 +364,16 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Cache/redisEnterprise/", false); - uri.AppendPath(clusterName, true); - uri.AppendPath("/databases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/accessPolicyAssignments", false); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authentications", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string clusterName, string databaseName) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -384,11 +384,11 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Cache/redisEnterprise/", false); - uri.AppendPath(clusterName, true); - uri.AppendPath("/databases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/accessPolicyAssignments", false); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authentications", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -396,30 +396,30 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro return message; } - /// Gets all access policy assignments.. - /// The ID of the target subscription. + /// List BrokerAuthenticationResource resources by BrokerResource. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. - /// The name of the Redis Enterprise database. + /// Name of instance. + /// Name of broker. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string clusterName, string databaseName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, clusterName, databaseName); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, instanceName, brokerName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - AccessPolicyAssignmentList value = default; + BrokerAuthenticationResourceListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AccessPolicyAssignmentList.DeserializeAccessPolicyAssignmentList(document.RootElement); + value = BrokerAuthenticationResourceListResult.DeserializeBrokerAuthenticationResourceListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -427,30 +427,30 @@ public async Task> ListAsync(string subscri } } - /// Gets all access policy assignments.. - /// The ID of the target subscription. + /// List BrokerAuthenticationResource resources by BrokerResource. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. - /// The name of the Redis Enterprise database. + /// Name of instance. + /// Name of broker. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string clusterName, string databaseName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, clusterName, databaseName); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, instanceName, brokerName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - AccessPolicyAssignmentList value = default; + BrokerAuthenticationResourceListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AccessPolicyAssignmentList.DeserializeAccessPolicyAssignmentList(document.RootElement); + value = BrokerAuthenticationResourceListResult.DeserializeBrokerAuthenticationResourceListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -458,7 +458,7 @@ public Response List(string subscriptionId, string r } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string clusterName, string databaseName) + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string brokerName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -466,7 +466,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string clusterName, string databaseName) + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string brokerName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -480,32 +480,32 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript return message; } - /// Gets all access policy assignments.. + /// List BrokerAuthenticationResource resources by BrokerResource. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. - /// The name of the Redis Enterprise database. + /// Name of instance. + /// Name of broker. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string clusterName, string databaseName, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, clusterName, databaseName); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, instanceName, brokerName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - AccessPolicyAssignmentList value = default; + BrokerAuthenticationResourceListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AccessPolicyAssignmentList.DeserializeAccessPolicyAssignmentList(document.RootElement); + value = BrokerAuthenticationResourceListResult.DeserializeBrokerAuthenticationResourceListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -513,32 +513,32 @@ public async Task> ListNextPageAsync(string } } - /// Gets all access policy assignments.. + /// List BrokerAuthenticationResource resources by BrokerResource. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. - /// The name of the Redis Enterprise database. + /// Name of instance. + /// Name of broker. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string clusterName, string databaseName, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, clusterName, databaseName); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, instanceName, brokerName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - AccessPolicyAssignmentList value = default; + BrokerAuthenticationResourceListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AccessPolicyAssignmentList.DeserializeAccessPolicyAssignmentList(document.RootElement); + value = BrokerAuthenticationResourceListResult.DeserializeBrokerAuthenticationResourceListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/BrokerAuthorizationRestOperations.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/BrokerAuthorizationRestOperations.cs new file mode 100644 index 000000000000..c514cab57cd0 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/BrokerAuthorizationRestOperations.cs @@ -0,0 +1,549 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.IoTOperations.Models; + +namespace Azure.ResourceManager.IoTOperations +{ + internal partial class BrokerAuthorizationRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of BrokerAuthorizationRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public BrokerAuthorizationRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authorizations/", false); + uri.AppendPath(authorizationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authorizations/", false); + uri.AppendPath(authorizationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a BrokerAuthorizationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker authorization resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName, brokerName, authorizationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BrokerAuthorizationResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BrokerAuthorizationResourceData.DeserializeBrokerAuthorizationResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((BrokerAuthorizationResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a BrokerAuthorizationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker authorization resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName, brokerName, authorizationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BrokerAuthorizationResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BrokerAuthorizationResourceData.DeserializeBrokerAuthorizationResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((BrokerAuthorizationResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName, BrokerAuthorizationResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authorizations/", false); + uri.AppendPath(authorizationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName, BrokerAuthorizationResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authorizations/", false); + uri.AppendPath(authorizationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a BrokerAuthorizationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker authorization resource. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName, BrokerAuthorizationResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, brokerName, authorizationName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a BrokerAuthorizationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker authorization resource. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName, BrokerAuthorizationResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, brokerName, authorizationName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authorizations/", false); + uri.AppendPath(authorizationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authorizations/", false); + uri.AppendPath(authorizationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a BrokerAuthorizationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker authorization resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName, brokerName, authorizationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a BrokerAuthorizationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker authorization resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName, brokerName, authorizationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authorizations", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/authorizations", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List BrokerAuthorizationResource resources by BrokerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, instanceName, brokerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BrokerAuthorizationResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BrokerAuthorizationResourceListResult.DeserializeBrokerAuthorizationResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List BrokerAuthorizationResource resources by BrokerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, instanceName, brokerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BrokerAuthorizationResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BrokerAuthorizationResourceListResult.DeserializeBrokerAuthorizationResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List BrokerAuthorizationResource resources by BrokerResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, instanceName, brokerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BrokerAuthorizationResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BrokerAuthorizationResourceListResult.DeserializeBrokerAuthorizationResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List BrokerAuthorizationResource resources by BrokerResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, instanceName, brokerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BrokerAuthorizationResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BrokerAuthorizationResourceListResult.DeserializeBrokerAuthorizationResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/BrokerListenerRestOperations.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/BrokerListenerRestOperations.cs new file mode 100644 index 000000000000..09b58ad43689 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/BrokerListenerRestOperations.cs @@ -0,0 +1,549 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.IoTOperations.Models; + +namespace Azure.ResourceManager.IoTOperations +{ + internal partial class BrokerListenerRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of BrokerListenerRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public BrokerListenerRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/listeners/", false); + uri.AppendPath(listenerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/listeners/", false); + uri.AppendPath(listenerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a BrokerListenerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker listener resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName, brokerName, listenerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BrokerListenerResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BrokerListenerResourceData.DeserializeBrokerListenerResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((BrokerListenerResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a BrokerListenerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker listener resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName, brokerName, listenerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BrokerListenerResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BrokerListenerResourceData.DeserializeBrokerListenerResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((BrokerListenerResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName, BrokerListenerResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/listeners/", false); + uri.AppendPath(listenerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName, BrokerListenerResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/listeners/", false); + uri.AppendPath(listenerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a BrokerListenerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker listener resource. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName, BrokerListenerResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, brokerName, listenerName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a BrokerListenerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker listener resource. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName, BrokerListenerResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, brokerName, listenerName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/listeners/", false); + uri.AppendPath(listenerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/listeners/", false); + uri.AppendPath(listenerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a BrokerListenerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker listener resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName, brokerName, listenerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a BrokerListenerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Name of Instance broker listener resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName, brokerName, listenerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/listeners", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendPath("/listeners", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List BrokerListenerResource resources by BrokerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, instanceName, brokerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BrokerListenerResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BrokerListenerResourceListResult.DeserializeBrokerListenerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List BrokerListenerResource resources by BrokerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, instanceName, brokerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BrokerListenerResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BrokerListenerResourceListResult.DeserializeBrokerListenerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List BrokerListenerResource resources by BrokerResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, instanceName, brokerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BrokerListenerResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BrokerListenerResourceListResult.DeserializeBrokerListenerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List BrokerListenerResource resources by BrokerResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, instanceName, brokerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BrokerListenerResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BrokerListenerResourceListResult.DeserializeBrokerListenerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/BrokerRestOperations.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/BrokerRestOperations.cs new file mode 100644 index 000000000000..e036c05ae979 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/BrokerRestOperations.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.IoTOperations.Models; + +namespace Azure.ResourceManager.IoTOperations +{ + internal partial class BrokerRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of BrokerRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public BrokerRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a BrokerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName, brokerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BrokerResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BrokerResourceData.DeserializeBrokerResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((BrokerResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a BrokerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName, brokerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BrokerResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BrokerResourceData.DeserializeBrokerResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((BrokerResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, BrokerResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, BrokerResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a BrokerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, BrokerResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, brokerName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a BrokerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, BrokerResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, brokerName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string instanceName, string brokerName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers/", false); + uri.AppendPath(brokerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a BrokerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName, brokerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a BrokerResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of broker. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName, brokerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, string instanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, string instanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/brokers", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List BrokerResource resources by InstanceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, instanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BrokerResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BrokerResourceListResult.DeserializeBrokerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List BrokerResource resources by InstanceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, instanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BrokerResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BrokerResourceListResult.DeserializeBrokerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string instanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string instanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List BrokerResource resources by InstanceResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, instanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BrokerResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BrokerResourceListResult.DeserializeBrokerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List BrokerResource resources by InstanceResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, instanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BrokerResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BrokerResourceListResult.DeserializeBrokerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/DataflowEndpointRestOperations.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/DataflowEndpointRestOperations.cs new file mode 100644 index 000000000000..3387cbdb08b1 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/DataflowEndpointRestOperations.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.IoTOperations.Models; + +namespace Azure.ResourceManager.IoTOperations +{ + internal partial class DataflowEndpointRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of DataflowEndpointRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public DataflowEndpointRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowEndpoints/", false); + uri.AppendPath(dataflowEndpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowEndpoints/", false); + uri.AppendPath(dataflowEndpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a DataflowEndpointResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowEndpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataflowEndpointResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DataflowEndpointResourceData.DeserializeDataflowEndpointResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataflowEndpointResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a DataflowEndpointResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowEndpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataflowEndpointResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DataflowEndpointResourceData.DeserializeDataflowEndpointResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataflowEndpointResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName, DataflowEndpointResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowEndpoints/", false); + uri.AppendPath(dataflowEndpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName, DataflowEndpointResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowEndpoints/", false); + uri.AppendPath(dataflowEndpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a DataflowEndpointResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowEndpoint resource. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName, DataflowEndpointResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a DataflowEndpointResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowEndpoint resource. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName, DataflowEndpointResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowEndpoints/", false); + uri.AppendPath(dataflowEndpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowEndpoints/", false); + uri.AppendPath(dataflowEndpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a DataflowEndpointResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowEndpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a DataflowEndpointResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowEndpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName, dataflowEndpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, string instanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowEndpoints", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, string instanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowEndpoints", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DataflowEndpointResource resources by InstanceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, instanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataflowEndpointResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DataflowEndpointResourceListResult.DeserializeDataflowEndpointResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DataflowEndpointResource resources by InstanceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, instanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataflowEndpointResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DataflowEndpointResourceListResult.DeserializeDataflowEndpointResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string instanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string instanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DataflowEndpointResource resources by InstanceResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, instanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataflowEndpointResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DataflowEndpointResourceListResult.DeserializeDataflowEndpointResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DataflowEndpointResource resources by InstanceResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, instanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataflowEndpointResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DataflowEndpointResourceListResult.DeserializeDataflowEndpointResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/DataflowProfileRestOperations.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/DataflowProfileRestOperations.cs new file mode 100644 index 000000000000..4c390f5687bc --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/DataflowProfileRestOperations.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.IoTOperations.Models; + +namespace Azure.ResourceManager.IoTOperations +{ + internal partial class DataflowProfileRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of DataflowProfileRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public DataflowProfileRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles/", false); + uri.AppendPath(dataflowProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles/", false); + uri.AppendPath(dataflowProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a DataflowProfileResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataflowProfileResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DataflowProfileResourceData.DeserializeDataflowProfileResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataflowProfileResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a DataflowProfileResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataflowProfileResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DataflowProfileResourceData.DeserializeDataflowProfileResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataflowProfileResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, DataflowProfileResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles/", false); + uri.AppendPath(dataflowProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, DataflowProfileResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles/", false); + uri.AppendPath(dataflowProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a DataflowProfileResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, DataflowProfileResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a DataflowProfileResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, DataflowProfileResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles/", false); + uri.AppendPath(dataflowProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles/", false); + uri.AppendPath(dataflowProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a DataflowProfileResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a DataflowProfileResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, string instanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, string instanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DataflowProfileResource resources by InstanceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, instanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataflowProfileResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DataflowProfileResourceListResult.DeserializeDataflowProfileResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DataflowProfileResource resources by InstanceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, instanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataflowProfileResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DataflowProfileResourceListResult.DeserializeDataflowProfileResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string instanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string instanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DataflowProfileResource resources by InstanceResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, instanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataflowProfileResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DataflowProfileResourceListResult.DeserializeDataflowProfileResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DataflowProfileResource resources by InstanceResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, instanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataflowProfileResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DataflowProfileResourceListResult.DeserializeDataflowProfileResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/DataflowRestOperations.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/DataflowRestOperations.cs new file mode 100644 index 000000000000..d5e5e743414b --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/DataflowRestOperations.cs @@ -0,0 +1,549 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.IoTOperations.Models; + +namespace Azure.ResourceManager.IoTOperations +{ + internal partial class DataflowRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of DataflowRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public DataflowRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, string dataflowName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles/", false); + uri.AppendPath(dataflowProfileName, true); + uri.AppendPath("/dataflows/", false); + uri.AppendPath(dataflowName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, string dataflowName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles/", false); + uri.AppendPath(dataflowProfileName, true); + uri.AppendPath("/dataflows/", false); + uri.AppendPath(dataflowName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a DataflowResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// Name of Instance dataflowProfile dataflow resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, string dataflowName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + Argument.AssertNotNullOrEmpty(dataflowName, nameof(dataflowName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, dataflowName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataflowResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DataflowResourceData.DeserializeDataflowResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataflowResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a DataflowResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// Name of Instance dataflowProfile dataflow resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, string dataflowName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + Argument.AssertNotNullOrEmpty(dataflowName, nameof(dataflowName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, dataflowName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataflowResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DataflowResourceData.DeserializeDataflowResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataflowResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, string dataflowName, DataflowResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles/", false); + uri.AppendPath(dataflowProfileName, true); + uri.AppendPath("/dataflows/", false); + uri.AppendPath(dataflowName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, string dataflowName, DataflowResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles/", false); + uri.AppendPath(dataflowProfileName, true); + uri.AppendPath("/dataflows/", false); + uri.AppendPath(dataflowName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a DataflowResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// Name of Instance dataflowProfile dataflow resource. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, string dataflowName, DataflowResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + Argument.AssertNotNullOrEmpty(dataflowName, nameof(dataflowName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, dataflowName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a DataflowResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// Name of Instance dataflowProfile dataflow resource. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, string dataflowName, DataflowResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + Argument.AssertNotNullOrEmpty(dataflowName, nameof(dataflowName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, dataflowName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, string dataflowName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles/", false); + uri.AppendPath(dataflowProfileName, true); + uri.AppendPath("/dataflows/", false); + uri.AppendPath(dataflowName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, string dataflowName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles/", false); + uri.AppendPath(dataflowProfileName, true); + uri.AppendPath("/dataflows/", false); + uri.AppendPath(dataflowName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a DataflowResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// Name of Instance dataflowProfile dataflow resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, string dataflowName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + Argument.AssertNotNullOrEmpty(dataflowName, nameof(dataflowName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, dataflowName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a DataflowResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// Name of Instance dataflowProfile dataflow resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, string dataflowName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + Argument.AssertNotNullOrEmpty(dataflowName, nameof(dataflowName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName, dataflowProfileName, dataflowName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles/", false); + uri.AppendPath(dataflowProfileName, true); + uri.AppendPath("/dataflows", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendPath("/dataflowProfiles/", false); + uri.AppendPath(dataflowProfileName, true); + uri.AppendPath("/dataflows", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DataflowResource resources by DataflowProfileResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataflowResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DataflowResourceListResult.DeserializeDataflowResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DataflowResource resources by DataflowProfileResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataflowResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DataflowResourceListResult.DeserializeDataflowResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DataflowResource resources by DataflowProfileResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataflowResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DataflowResourceListResult.DeserializeDataflowResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DataflowResource resources by DataflowProfileResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Name of Instance dataflowProfile resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, string instanceName, string dataflowProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNullOrEmpty(dataflowProfileName, nameof(dataflowProfileName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, instanceName, dataflowProfileName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataflowResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DataflowResourceListResult.DeserializeDataflowResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/InstanceRestOperations.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/InstanceRestOperations.cs new file mode 100644 index 000000000000..0a7f2fbce169 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/RestOperations/InstanceRestOperations.cs @@ -0,0 +1,731 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.IoTOperations.Models; + +namespace Azure.ResourceManager.IoTOperations +{ + internal partial class InstanceRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of InstanceRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public InstanceRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string instanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string instanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a InstanceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + InstanceResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = InstanceResourceData.DeserializeInstanceResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((InstanceResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a InstanceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, instanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + InstanceResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = InstanceResourceData.DeserializeInstanceResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((InstanceResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string instanceName, InstanceResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string instanceName, InstanceResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a InstanceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string instanceName, InstanceResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a InstanceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string instanceName, InstanceResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, instanceName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string instanceName, InstanceResourcePatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string instanceName, InstanceResourcePatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a InstanceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string instanceName, InstanceResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, instanceName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + InstanceResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = InstanceResourceData.DeserializeInstanceResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a InstanceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string instanceName, InstanceResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, instanceName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + InstanceResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = InstanceResourceData.DeserializeInstanceResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string instanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string instanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances/", false); + uri.AppendPath(instanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a InstanceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a InstanceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of instance. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string instanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(instanceName, nameof(instanceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, instanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List InstanceResource resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + InstanceResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = InstanceResourceListResult.DeserializeInstanceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List InstanceResource resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + InstanceResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = InstanceResourceListResult.DeserializeInstanceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.IoTOperations/instances", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List InstanceResource resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + InstanceResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = InstanceResourceListResult.DeserializeInstanceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List InstanceResource resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + InstanceResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = InstanceResourceListResult.DeserializeInstanceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List InstanceResource resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + InstanceResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = InstanceResourceListResult.DeserializeInstanceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List InstanceResource resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + InstanceResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = InstanceResourceListResult.DeserializeInstanceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List InstanceResource resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + InstanceResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = InstanceResourceListResult.DeserializeInstanceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List InstanceResource resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + InstanceResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = InstanceResourceListResult.DeserializeInstanceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Properties/AssemblyInfo.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..ca1fee074caa --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.ResourceManager.IoTOperations.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("IoTOperations")] diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/tests/Azure.ResourceManager.IoTOperations.Tests.csproj b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/tests/Azure.ResourceManager.IoTOperations.Tests.csproj new file mode 100644 index 000000000000..564ddba11549 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/tests/Azure.ResourceManager.IoTOperations.Tests.csproj @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/tests/IoTOperationsManagementTestBase.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/tests/IoTOperationsManagementTestBase.cs new file mode 100644 index 000000000000..a102001a4a06 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/tests/IoTOperationsManagementTestBase.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.TestFramework; +using NUnit.Framework; +using System.Threading.Tasks; + +namespace Azure.ResourceManager.IoTOperations.Tests +{ + public class IoTOperationsManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected IoTOperationsManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected IoTOperationsManagementTestBase(bool isAsync) + : base(isAsync) + { + } + + [SetUp] + public async Task CreateCommonClient() + { + Client = GetArmClient(); + DefaultSubscription = await Client.GetDefaultSubscriptionAsync().ConfigureAwait(false); + } + + protected async Task CreateResourceGroup(SubscriptionResource subscription, string rgNamePrefix, AzureLocation location) + { + string rgName = Recording.GenerateAssetName(rgNamePrefix); + ResourceGroupData input = new ResourceGroupData(location); + var lro = await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, input); + return lro.Value; + } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/tests/IoTOperationsManagementTestEnvironment.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/tests/IoTOperationsManagementTestEnvironment.cs new file mode 100644 index 000000000000..b14834e385a0 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/tests/IoTOperationsManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.IoTOperations.Tests +{ + public class IoTOperationsManagementTestEnvironment : TestEnvironment + { + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/tsp-location.yaml b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/tsp-location.yaml new file mode 100644 index 000000000000..29e4dd1d3fcf --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/iotoperations/IoTOperations.Management +commit: 7c52cf4d9a41dd06846b099946e8b85a9504cf1e +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/iotoperations/ci.mgmt.yml b/sdk/iotoperations/ci.mgmt.yml new file mode 100644 index 000000000000..251f5f1f0e6f --- /dev/null +++ b/sdk/iotoperations/ci.mgmt.yml @@ -0,0 +1,24 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: none +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iotoperations/ci.mgmt.yml + - sdk/iotoperations/Azure.ResourceManager.IoTOperations/ + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: iotoperations + ArtifactName: packages + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.IoTOperations + safeName: AzureResourceManagerIoTOperations diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/api/Azure.ResourceManager.KeyVault.net8.0.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/api/Azure.ResourceManager.KeyVault.net8.0.cs index a255dd231bcc..0d40fdc78e70 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/api/Azure.ResourceManager.KeyVault.net8.0.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/api/Azure.ResourceManager.KeyVault.net8.0.cs @@ -1444,6 +1444,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly int _dummyPrimitive; public ManagedHsmSkuFamily(string value) { throw null; } public static Azure.ResourceManager.KeyVault.Models.ManagedHsmSkuFamily B { get { throw null; } } + public static Azure.ResourceManager.KeyVault.Models.ManagedHsmSkuFamily C { get { throw null; } } public bool Equals(Azure.ResourceManager.KeyVault.Models.ManagedHsmSkuFamily other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } @@ -1459,6 +1460,8 @@ public enum ManagedHsmSkuName StandardB1 = 0, CustomB32 = 1, CustomB6 = 2, + CustomC42 = 3, + CustomC10 = 4, } public partial class ManagedHsmVirtualNetworkRule : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/api/Azure.ResourceManager.KeyVault.netstandard2.0.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/api/Azure.ResourceManager.KeyVault.netstandard2.0.cs index a255dd231bcc..0d40fdc78e70 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/api/Azure.ResourceManager.KeyVault.netstandard2.0.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/api/Azure.ResourceManager.KeyVault.netstandard2.0.cs @@ -1444,6 +1444,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly int _dummyPrimitive; public ManagedHsmSkuFamily(string value) { throw null; } public static Azure.ResourceManager.KeyVault.Models.ManagedHsmSkuFamily B { get { throw null; } } + public static Azure.ResourceManager.KeyVault.Models.ManagedHsmSkuFamily C { get { throw null; } } public bool Equals(Azure.ResourceManager.KeyVault.Models.ManagedHsmSkuFamily other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } @@ -1459,6 +1460,8 @@ public enum ManagedHsmSkuName StandardB1 = 0, CustomB32 = 1, CustomB6 = 2, + CustomC42 = 3, + CustomC10 = 4, } public partial class ManagedHsmVirtualNetworkRule : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_DeletedKeyVaultCollection.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_DeletedKeyVaultCollection.cs index a3466a5e1787..0f00cee5f9a2 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_DeletedKeyVaultCollection.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_DeletedKeyVaultCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_DeletedKeyVaultCollection [Ignore("Only validating compilation of examples")] public async Task Get_RetrieveADeletedVault() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getDeletedVault.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/getDeletedVault.json // this example is just showing the usage of "Vaults_GetDeleted" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_RetrieveADeletedVault() [Ignore("Only validating compilation of examples")] public async Task Exists_RetrieveADeletedVault() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getDeletedVault.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/getDeletedVault.json // this example is just showing the usage of "Vaults_GetDeleted" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Exists_RetrieveADeletedVault() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_RetrieveADeletedVault() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getDeletedVault.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/getDeletedVault.json // this example is just showing the usage of "Vaults_GetDeleted" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_DeletedKeyVaultResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_DeletedKeyVaultResource.cs index 300532af4ae6..c3a3592fe443 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_DeletedKeyVaultResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_DeletedKeyVaultResource.cs @@ -19,7 +19,7 @@ public partial class Sample_DeletedKeyVaultResource [Ignore("Only validating compilation of examples")] public async Task Get_RetrieveADeletedVault() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getDeletedVault.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/getDeletedVault.json // this example is just showing the usage of "Vaults_GetDeleted" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +49,7 @@ public async Task Get_RetrieveADeletedVault() [Ignore("Only validating compilation of examples")] public async Task PurgeDeleted_PurgeADeletedVault() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/purgeDeletedVault.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/purgeDeletedVault.json // this example is just showing the usage of "Vaults_PurgeDeleted" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_DeletedManagedHsmCollection.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_DeletedManagedHsmCollection.cs index c4a9999d0e60..4d2dda5caa6c 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_DeletedManagedHsmCollection.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_DeletedManagedHsmCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_DeletedManagedHsmCollection [Ignore("Only validating compilation of examples")] public async Task Get_RetrieveADeletedManagedHSM() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/DeletedManagedHsm_Get.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/DeletedManagedHsm_Get.json // this example is just showing the usage of "ManagedHsms_GetDeleted" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_RetrieveADeletedManagedHSM() [Ignore("Only validating compilation of examples")] public async Task Exists_RetrieveADeletedManagedHSM() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/DeletedManagedHsm_Get.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/DeletedManagedHsm_Get.json // this example is just showing the usage of "ManagedHsms_GetDeleted" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Exists_RetrieveADeletedManagedHSM() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_RetrieveADeletedManagedHSM() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/DeletedManagedHsm_Get.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/DeletedManagedHsm_Get.json // this example is just showing the usage of "ManagedHsms_GetDeleted" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_DeletedManagedHsmResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_DeletedManagedHsmResource.cs index 67733bccb457..57a471c50b7e 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_DeletedManagedHsmResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_DeletedManagedHsmResource.cs @@ -19,7 +19,7 @@ public partial class Sample_DeletedManagedHsmResource [Ignore("Only validating compilation of examples")] public async Task Get_RetrieveADeletedManagedHSM() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/DeletedManagedHsm_Get.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/DeletedManagedHsm_Get.json // this example is just showing the usage of "ManagedHsms_GetDeleted" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +49,7 @@ public async Task Get_RetrieveADeletedManagedHSM() [Ignore("Only validating compilation of examples")] public async Task PurgeDeleted_PurgeAManagedHSMPool() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/DeletedManagedHsm_Purge.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/DeletedManagedHsm_Purge.json // this example is just showing the usage of "ManagedHsms_PurgeDeleted" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_KeyVaultCollection.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_KeyVaultCollection.cs index 393176e26973..f5a883e82a47 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_KeyVaultCollection.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_KeyVaultCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_KeyVaultCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateANewVaultOrUpdateAnExistingVault() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/createVault.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/createVault.json // this example is just showing the usage of "Vaults_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -68,7 +68,7 @@ public async Task CreateOrUpdate_CreateANewVaultOrUpdateAnExistingVault() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateAVaultWithNetworkAcls() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/createVaultWithNetworkAcls.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/createVaultWithNetworkAcls.json // this example is just showing the usage of "Vaults_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -115,7 +115,7 @@ public async Task CreateOrUpdate_CreateOrUpdateAVaultWithNetworkAcls() [Ignore("Only validating compilation of examples")] public async Task Get_RetrieveAVault() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getVault.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/getVault.json // this example is just showing the usage of "Vaults_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -148,7 +148,7 @@ public async Task Get_RetrieveAVault() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListVaultsInTheSpecifiedResourceGroup() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listVaultByResourceGroup.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/listVaultByResourceGroup.json // this example is just showing the usage of "Vaults_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -184,7 +184,7 @@ public async Task GetAll_ListVaultsInTheSpecifiedResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_RetrieveAVault() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getVault.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/getVault.json // this example is just showing the usage of "Vaults_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -213,7 +213,7 @@ public async Task Exists_RetrieveAVault() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_RetrieveAVault() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getVault.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/getVault.json // this example is just showing the usage of "Vaults_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_KeyVaultPrivateEndpointConnectionCollection.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_KeyVaultPrivateEndpointConnectionCollection.cs index 3bb0cefc3c20..bc251a49b15e 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_KeyVaultPrivateEndpointConnectionCollection.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_KeyVaultPrivateEndpointConnectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_KeyVaultPrivateEndpointConnectionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_KeyVaultPutPrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/putPrivateEndpointConnection.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/putPrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_Put" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -64,7 +64,7 @@ public async Task CreateOrUpdate_KeyVaultPutPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Get_KeyVaultGetPrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getPrivateEndpointConnection.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/getPrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -98,7 +98,7 @@ public async Task Get_KeyVaultGetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetAll_KeyVaultListPrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listPrivateEndpointConnection.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/listPrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_ListByResource" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -134,7 +134,7 @@ public async Task GetAll_KeyVaultListPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Exists_KeyVaultGetPrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getPrivateEndpointConnection.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/getPrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -164,7 +164,7 @@ public async Task Exists_KeyVaultGetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_KeyVaultGetPrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getPrivateEndpointConnection.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/getPrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_KeyVaultPrivateEndpointConnectionResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_KeyVaultPrivateEndpointConnectionResource.cs index 9faf9c46f042..8f11c569a7c3 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_KeyVaultPrivateEndpointConnectionResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_KeyVaultPrivateEndpointConnectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_KeyVaultPrivateEndpointConnectionResource [Ignore("Only validating compilation of examples")] public async Task Get_KeyVaultGetPrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getPrivateEndpointConnection.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/getPrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_KeyVaultGetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Delete_KeyVaultDeletePrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/deletePrivateEndpointConnection.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/deletePrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -83,7 +83,7 @@ public async Task Delete_KeyVaultDeletePrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Update_KeyVaultPutPrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/putPrivateEndpointConnection.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/putPrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_Put" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_KeyVaultResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_KeyVaultResource.cs index 0e6d89c57a8c..e66aaee2593f 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_KeyVaultResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_KeyVaultResource.cs @@ -20,7 +20,7 @@ public partial class Sample_KeyVaultResource [Ignore("Only validating compilation of examples")] public async Task Get_RetrieveAVault() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getVault.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/getVault.json // this example is just showing the usage of "Vaults_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_RetrieveAVault() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteAVault() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/deleteVault.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/deleteVault.json // this example is just showing the usage of "Vaults_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,7 +76,7 @@ public async Task Delete_DeleteAVault() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateAnExistingVault() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/updateVault.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/updateVault.json // this example is just showing the usage of "Vaults_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -124,7 +124,7 @@ public async Task Update_UpdateAnExistingVault() [Ignore("Only validating compilation of examples")] public async Task UpdateAccessPolicy_AddAnAccessPolicyOrUpdateAnAccessPolicyWithNewPermissions() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/updateAccessPoliciesAdd.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/updateAccessPoliciesAdd.json // this example is just showing the usage of "Vaults_UpdateAccessPolicy" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -160,7 +160,7 @@ public async Task UpdateAccessPolicy_AddAnAccessPolicyOrUpdateAnAccessPolicyWith [Ignore("Only validating compilation of examples")] public async Task GetPrivateLinkResources_KeyVaultListPrivateLinkResources() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listPrivateLinkResources.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/listPrivateLinkResources.json // this example is just showing the usage of "PrivateLinkResources_ListByVault" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_KeyVaultSecretCollection.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_KeyVaultSecretCollection.cs index b910dd73da4e..415724e0fca9 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_KeyVaultSecretCollection.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_KeyVaultSecretCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_KeyVaultSecretCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateASecret() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/createSecret.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/createSecret.json // this example is just showing the usage of "Secrets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task CreateOrUpdate_CreateASecret() [Ignore("Only validating compilation of examples")] public async Task Get_GetASecret() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getSecret.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/getSecret.json // this example is just showing the usage of "Secrets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,7 +93,7 @@ public async Task Get_GetASecret() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListSecretsInTheVault() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listSecrets.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/listSecrets.json // this example is just showing the usage of "Secrets_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +129,7 @@ public async Task GetAll_ListSecretsInTheVault() [Ignore("Only validating compilation of examples")] public async Task Exists_GetASecret() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getSecret.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/getSecret.json // this example is just showing the usage of "Secrets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -159,7 +159,7 @@ public async Task Exists_GetASecret() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetASecret() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getSecret.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/getSecret.json // this example is just showing the usage of "Secrets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_KeyVaultSecretResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_KeyVaultSecretResource.cs index 0fd20ab6e030..0d7a238d112f 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_KeyVaultSecretResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_KeyVaultSecretResource.cs @@ -20,7 +20,7 @@ public partial class Sample_KeyVaultSecretResource [Ignore("Only validating compilation of examples")] public async Task Get_GetASecret() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getSecret.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/getSecret.json // this example is just showing the usage of "Secrets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_GetASecret() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateASecret() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/updateSecret.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/updateSecret.json // this example is just showing the usage of "Secrets_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_ManagedHsmCollection.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_ManagedHsmCollection.cs index 218ffec7291a..9413eac31976 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_ManagedHsmCollection.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_ManagedHsmCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_ManagedHsmCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateANewManagedHSMPoolOrUpdateAnExistingManagedHSMPool() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_CreateOrUpdate.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/ManagedHsm_CreateOrUpdate.json // this example is just showing the usage of "ManagedHsms_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -72,7 +72,7 @@ public async Task CreateOrUpdate_CreateANewManagedHSMPoolOrUpdateAnExistingManag [Ignore("Only validating compilation of examples")] public async Task Get_RetrieveAManagedHSMPool() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_Get.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/ManagedHsm_Get.json // this example is just showing the usage of "ManagedHsms_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -105,7 +105,7 @@ public async Task Get_RetrieveAManagedHSMPool() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListManagedHSMPoolsInAResourceGroup() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_ListByResourceGroup.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/ManagedHsm_ListByResourceGroup.json // this example is just showing the usage of "ManagedHsms_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -140,7 +140,7 @@ public async Task GetAll_ListManagedHSMPoolsInAResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_RetrieveAManagedHSMPool() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_Get.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/ManagedHsm_Get.json // this example is just showing the usage of "ManagedHsms_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -169,7 +169,7 @@ public async Task Exists_RetrieveAManagedHSMPool() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_RetrieveAManagedHSMPool() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_Get.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/ManagedHsm_Get.json // this example is just showing the usage of "ManagedHsms_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_ManagedHsmPrivateEndpointConnectionCollection.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_ManagedHsmPrivateEndpointConnectionCollection.cs index 32f5f25df814..26fa0950d8c2 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_ManagedHsmPrivateEndpointConnectionCollection.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_ManagedHsmPrivateEndpointConnectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ManagedHsmPrivateEndpointConnectionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_ManagedHsmPutPrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_putPrivateEndpointConnection.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/ManagedHsm_putPrivateEndpointConnection.json // this example is just showing the usage of "MHSMPrivateEndpointConnections_Put" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -63,7 +63,7 @@ public async Task CreateOrUpdate_ManagedHsmPutPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Get_ManagedHsmGetPrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_getPrivateEndpointConnection.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/ManagedHsm_getPrivateEndpointConnection.json // this example is just showing the usage of "MHSMPrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,7 +97,7 @@ public async Task Get_ManagedHsmGetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListManagedHSMPoolsInASubscription() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_ListPrivateEndpointConnectionsByResource.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/ManagedHsm_ListPrivateEndpointConnectionsByResource.json // this example is just showing the usage of "MHSMPrivateEndpointConnections_ListByResource" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -133,7 +133,7 @@ public async Task GetAll_ListManagedHSMPoolsInASubscription() [Ignore("Only validating compilation of examples")] public async Task Exists_ManagedHsmGetPrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_getPrivateEndpointConnection.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/ManagedHsm_getPrivateEndpointConnection.json // this example is just showing the usage of "MHSMPrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -163,7 +163,7 @@ public async Task Exists_ManagedHsmGetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_ManagedHsmGetPrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_getPrivateEndpointConnection.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/ManagedHsm_getPrivateEndpointConnection.json // this example is just showing the usage of "MHSMPrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_ManagedHsmPrivateEndpointConnectionResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_ManagedHsmPrivateEndpointConnectionResource.cs index 1ae478707452..e3c526a26959 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_ManagedHsmPrivateEndpointConnectionResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_ManagedHsmPrivateEndpointConnectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ManagedHsmPrivateEndpointConnectionResource [Ignore("Only validating compilation of examples")] public async Task Get_ManagedHsmGetPrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_getPrivateEndpointConnection.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/ManagedHsm_getPrivateEndpointConnection.json // this example is just showing the usage of "MHSMPrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_ManagedHsmGetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Delete_ManagedHsmDeletePrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_deletePrivateEndpointConnection.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/ManagedHsm_deletePrivateEndpointConnection.json // this example is just showing the usage of "MHSMPrivateEndpointConnections_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -83,7 +83,7 @@ public async Task Delete_ManagedHsmDeletePrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Update_ManagedHsmPutPrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_putPrivateEndpointConnection.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/ManagedHsm_putPrivateEndpointConnection.json // this example is just showing the usage of "MHSMPrivateEndpointConnections_Put" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_ManagedHsmResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_ManagedHsmResource.cs index 020d2c109160..769a7ca2f109 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_ManagedHsmResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_ManagedHsmResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ManagedHsmResource [Ignore("Only validating compilation of examples")] public async Task Get_RetrieveAManagedHSMPool() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_Get.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/ManagedHsm_Get.json // this example is just showing the usage of "ManagedHsms_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_RetrieveAManagedHSMPool() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteAManagedHSMPool() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_Delete.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/ManagedHsm_Delete.json // this example is just showing the usage of "ManagedHsms_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,7 +76,7 @@ public async Task Delete_DeleteAManagedHSMPool() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateAnExistingManagedHSMPool() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_Update.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/ManagedHsm_Update.json // this example is just showing the usage of "ManagedHsms_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -116,7 +116,7 @@ public async Task Update_UpdateAnExistingManagedHSMPool() [Ignore("Only validating compilation of examples")] public async Task GetMHSMPrivateLinkResourcesByManagedHsmResource_KeyVaultListPrivateLinkResources() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_listPrivateLinkResources.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/ManagedHsm_listPrivateLinkResources.json // this example is just showing the usage of "MHSMPrivateLinkResources_ListByManagedHsmResource" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -145,7 +145,7 @@ public async Task GetMHSMPrivateLinkResourcesByManagedHsmResource_KeyVaultListPr [Ignore("Only validating compilation of examples")] public async Task GetMHSMRegionsByResource_ListManagedHSMPoolsInASubscription() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_ListRegionsByResource.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/ManagedHsm_ListRegionsByResource.json // this example is just showing the usage of "MHSMRegions_ListByResource" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index c312e821476a..52920fa3120b 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -21,7 +21,7 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task GetKeyVaults_ListVaultsInTheSpecifiedSubscription() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listVaultBySubscription.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/listVaultBySubscription.json // this example is just showing the usage of "Vaults_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task GetKeyVaults_ListVaultsInTheSpecifiedSubscription() [Ignore("Only validating compilation of examples")] public async Task GetDeletedKeyVaults_ListDeletedVaultsInTheSpecifiedSubscription() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listDeletedVaults.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/listDeletedVaults.json // this example is just showing the usage of "Vaults_ListDeleted" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -84,7 +84,7 @@ public async Task GetDeletedKeyVaults_ListDeletedVaultsInTheSpecifiedSubscriptio [Ignore("Only validating compilation of examples")] public async Task CheckKeyVaultNameAvailability_ValidateAVaultName() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/checkVaultNameAvailability.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/checkVaultNameAvailability.json // this example is just showing the usage of "Vaults_CheckNameAvailability" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -109,7 +109,7 @@ public async Task CheckKeyVaultNameAvailability_ValidateAVaultName() [Ignore("Only validating compilation of examples")] public async Task GetManagedHsms_ListManagedHSMPoolsInASubscription() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_ListBySubscription.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/ManagedHsm_ListBySubscription.json // this example is just showing the usage of "ManagedHsms_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -140,7 +140,7 @@ public async Task GetManagedHsms_ListManagedHSMPoolsInASubscription() [Ignore("Only validating compilation of examples")] public async Task GetDeletedManagedHsms_ListDeletedManagedHSMsInTheSpecifiedSubscription() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/DeletedManagedHsm_List.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/DeletedManagedHsm_List.json // this example is just showing the usage of "ManagedHsms_ListDeleted" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -171,7 +171,7 @@ public async Task GetDeletedManagedHsms_ListDeletedManagedHSMsInTheSpecifiedSubs [Ignore("Only validating compilation of examples")] public async Task CheckManagedHsmNameAvailability_ValidateAManagedHsmName() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_checkMhsmNameAvailability.json + // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2024-11-01/examples/ManagedHsm_checkMhsmNameAvailability.json // this example is just showing the usage of "ManagedHsms_CheckManagedHsmNameAvailability" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedKeyVaultCollection.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedKeyVaultCollection.cs index 9fedaa2a1957..026eb02f5c16 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedKeyVaultCollection.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedKeyVaultCollection.cs @@ -62,7 +62,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -108,7 +108,7 @@ public virtual async Task> GetAsync(AzureLocat /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(AzureLocation location, str /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -198,7 +198,7 @@ public virtual async Task> ExistsAsync(AzureLocation location, st /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -242,7 +242,7 @@ public virtual Response Exists(AzureLocation location, string vaultName, C /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -288,7 +288,7 @@ public virtual async Task> GetIfExists /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedKeyVaultResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedKeyVaultResource.cs index 70a11589f76f..a6d054c9829c 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedKeyVaultResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedKeyVaultResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task PurgeDeletedAsync(WaitUntil waitUntil, C /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedManagedHsmCollection.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedManagedHsmCollection.cs index bc09ba33d5f5..928590822e89 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedManagedHsmCollection.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedManagedHsmCollection.cs @@ -62,7 +62,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -108,7 +108,7 @@ public virtual async Task> GetAsync(AzureLoc /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(AzureLocation location, s /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -198,7 +198,7 @@ public virtual async Task> ExistsAsync(AzureLocation location, st /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -242,7 +242,7 @@ public virtual Response Exists(AzureLocation location, string name, Cancel /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -288,7 +288,7 @@ public virtual async Task> GetIfExis /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedManagedHsmResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedManagedHsmResource.cs index 10fccc7a35ee..825b2747414d 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedManagedHsmResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedManagedHsmResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cancella /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(CancellationToken cancell /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task PurgeDeletedAsync(WaitUntil waitUntil, C /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/KeyVaultExtensions.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/KeyVaultExtensions.cs index 720334f5df2d..ad4c34ebc793 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/KeyVaultExtensions.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/KeyVaultExtensions.cs @@ -196,7 +196,7 @@ public static KeyVaultCollection GetKeyVaults(this ResourceGroupResource resourc /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -234,7 +234,7 @@ public static async Task> GetKeyVaultAsync(this Resou /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -289,7 +289,7 @@ public static ManagedHsmCollection GetManagedHsms(this ResourceGroupResource res /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -327,7 +327,7 @@ public static async Task> GetManagedHsmAsync(this R /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -382,7 +382,7 @@ public static DeletedKeyVaultCollection GetDeletedKeyVaults(this SubscriptionRes /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -421,7 +421,7 @@ public static async Task> GetDeletedKeyVaultAs /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -477,7 +477,7 @@ public static DeletedManagedHsmCollection GetDeletedManagedHsms(this Subscriptio /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -516,7 +516,7 @@ public static async Task> GetDeletedManagedH /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -555,7 +555,7 @@ public static Response GetDeletedManagedHsm(this Subs /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -592,7 +592,7 @@ public static AsyncPageable GetKeyVaultsAsync(this Subscriptio /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -629,7 +629,7 @@ public static Pageable GetKeyVaults(this SubscriptionResource /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// @@ -661,7 +661,7 @@ public static AsyncPageable GetDeletedKeyVaultsAsync(th /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// @@ -693,7 +693,7 @@ public static Pageable GetDeletedKeyVaults(this Subscri /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -729,7 +729,7 @@ public static async Task> CheckKeyVault /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -765,7 +765,7 @@ public static Response CheckKeyVaultNameAvailabi /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -802,7 +802,7 @@ public static AsyncPageable GetManagedHsmsAsync(this Subscri /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -839,7 +839,7 @@ public static Pageable GetManagedHsms(this SubscriptionResou /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// @@ -871,7 +871,7 @@ public static AsyncPageable GetDeletedManagedHsmsAsyn /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// @@ -903,7 +903,7 @@ public static Pageable GetDeletedManagedHsms(this Sub /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -939,7 +939,7 @@ public static async Task> CheckManage /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/MockableKeyVaultResourceGroupResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/MockableKeyVaultResourceGroupResource.cs index cddb41101444..883687417b15 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/MockableKeyVaultResourceGroupResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/MockableKeyVaultResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual KeyVaultCollection GetKeyVaults() /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetKeyVaultAsync(string va /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -122,7 +122,7 @@ public virtual ManagedHsmCollection GetManagedHsms() /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -153,7 +153,7 @@ public virtual async Task> GetManagedHsmAsync(strin /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/MockableKeyVaultSubscriptionResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/MockableKeyVaultSubscriptionResource.cs index 09d7573c8c38..ec217bd4a936 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/MockableKeyVaultSubscriptionResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/MockableKeyVaultSubscriptionResource.cs @@ -74,7 +74,7 @@ public virtual DeletedKeyVaultCollection GetDeletedKeyVaults() /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -106,7 +106,7 @@ public virtual async Task> GetDeletedKeyVaultA /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -145,7 +145,7 @@ public virtual DeletedManagedHsmCollection GetDeletedManagedHsms() /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -177,7 +177,7 @@ public virtual async Task> GetDeletedManaged /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -209,7 +209,7 @@ public virtual Response GetDeletedManagedHsm(AzureLoc /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -240,7 +240,7 @@ public virtual AsyncPageable GetKeyVaultsAsync(int? top = null /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -271,7 +271,7 @@ public virtual Pageable GetKeyVaults(int? top = null, Cancella /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// @@ -297,7 +297,7 @@ public virtual AsyncPageable GetDeletedKeyVaultsAsync(C /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// @@ -323,7 +323,7 @@ public virtual Pageable GetDeletedKeyVaults(Cancellatio /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -365,7 +365,7 @@ public virtual async Task> CheckKeyVaul /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -407,7 +407,7 @@ public virtual Response CheckKeyVaultNameAvailab /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -438,7 +438,7 @@ public virtual AsyncPageable GetManagedHsmsAsync(int? top = /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -469,7 +469,7 @@ public virtual Pageable GetManagedHsms(int? top = null, Canc /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// @@ -495,7 +495,7 @@ public virtual AsyncPageable GetDeletedManagedHsmsAsy /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// @@ -521,7 +521,7 @@ public virtual Pageable GetDeletedManagedHsms(Cancell /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -563,7 +563,7 @@ public virtual async Task> CheckManag /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultCollection.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultCollection.cs index efd240b0a565..ccaa4ab31b3b 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultCollection.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultCollection.cs @@ -66,7 +66,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task> CreateOrUpdateAsync(Wa /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -164,7 +164,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -209,7 +209,7 @@ public virtual async Task> GetAsync(string vaultName, /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -254,7 +254,7 @@ public virtual Response Get(string vaultName, CancellationToke /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable GetAllAsync(int? top = null, Canc /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable GetAll(int? top = null, CancellationTo /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string vaultName, Cancella /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string vaultName, CancellationToken cancell /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -447,7 +447,7 @@ public virtual async Task> GetIfExistsAsync(s /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultPrivateEndpointConnectionCollection.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultPrivateEndpointConnectionCollection.cs index cbab25128bd1..6ccaf51bf3aa 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultPrivateEndpointConnectionCollection.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultPrivateEndpointConnectionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOrU /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(string pr /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable GetAllAs /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable GetAll(Cancel /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -447,7 +447,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultPrivateEndpointConnectionResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultPrivateEndpointConnectionResource.cs index 03cf5de486c0..15f06cf4737a 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultPrivateEndpointConnectionResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultPrivateEndpointConnectionResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Cancellat /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(Wa /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultResource.cs index b4b49e0a267e..23bc19236232 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultResource.cs @@ -115,7 +115,7 @@ public virtual KeyVaultPrivateEndpointConnectionCollection GetKeyVaultPrivateEnd /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -146,7 +146,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual KeyVaultSecretCollection GetKeyVaultSecrets() /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -215,7 +215,7 @@ public virtual async Task> GetKeyVaultSecretAsy /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -246,7 +246,7 @@ public virtual Response GetKeyVaultSecret(string secretN /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -286,7 +286,7 @@ public virtual async Task> GetAsync(CancellationToken /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -326,7 +326,7 @@ public virtual Response Get(CancellationToken cancellationToke /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -370,7 +370,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -414,7 +414,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -456,7 +456,7 @@ public virtual async Task> UpdateAsync(KeyVaultPatch /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -498,7 +498,7 @@ public virtual Response Update(KeyVaultPatch patch, Cancellati /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// @@ -537,7 +537,7 @@ public virtual async Task> UpdateAccess /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// @@ -576,7 +576,7 @@ public virtual Response UpdateAccessPolicy(Acces /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// @@ -601,7 +601,7 @@ public virtual AsyncPageable GetPrivateLinkReso /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// @@ -626,7 +626,7 @@ public virtual Pageable GetPrivateLinkResources /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -688,7 +688,7 @@ public virtual async Task> AddTagAsync(string key, st /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -750,7 +750,7 @@ public virtual Response AddTag(string key, string value, Cance /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -807,7 +807,7 @@ public virtual async Task> SetTagsAsync(IDictionary /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -864,7 +864,7 @@ public virtual Response SetTags(IDictionary ta /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -924,7 +924,7 @@ public virtual async Task> RemoveTagAsync(string key, /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultSecretCollection.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultSecretCollection.cs index c70fc0fe0156..f415d81cd4f9 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultSecretCollection.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultSecretCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> CreateOrUpdateAs /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wai /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsync(string secr /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string secretName, Cancellat /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -288,7 +288,7 @@ public virtual AsyncPageable GetAllAsync(int? top = null /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -319,7 +319,7 @@ public virtual Pageable GetAll(int? top = null, Cancella /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -362,7 +362,7 @@ public virtual async Task> ExistsAsync(string secretName, Cancell /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -405,7 +405,7 @@ public virtual Response Exists(string secretName, CancellationToken cancel /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -450,7 +450,7 @@ public virtual async Task> GetIfExistsA /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultSecretResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultSecretResource.cs index f5f7f3916b4f..f6f3f68d4283 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultSecretResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultSecretResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Cancellatio /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken cancellati /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task> UpdateAsync(KeyVault /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmCollection.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmCollection.cs index 36eb798d4b1e..1a7668a7b9bc 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmCollection.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsync( /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUnt /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string name, Ca /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string name, CancellationToken c /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -284,7 +284,7 @@ public virtual AsyncPageable GetAllAsync(int? top = null, Ca /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual Pageable GetAll(int? top = null, Cancellation /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -358,7 +358,7 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -401,7 +401,7 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -446,7 +446,7 @@ public virtual async Task> GetIfExistsAsync /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmPrivateEndpointConnectionCollection.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmPrivateEndpointConnectionCollection.cs index 7b08672fe9a0..140470aae55e 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmPrivateEndpointConnectionCollection.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmPrivateEndpointConnectionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation CreateO /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(string /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable GetAll /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable GetAll(Canc /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -447,7 +447,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmPrivateEndpointConnectionResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmPrivateEndpointConnectionResource.cs index 33e51ea61b25..5a0270bdc430 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmPrivateEndpointConnectionResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmPrivateEndpointConnectionResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(Cancell /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete( /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -362,7 +362,7 @@ public virtual ArmOperation Update( /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -419,7 +419,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -476,7 +476,7 @@ public virtual Response AddTag(stri /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -532,7 +532,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -588,7 +588,7 @@ public virtual Response SetTags(IDi /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -643,7 +643,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmResource.cs index 861b15060667..890b7d1c689f 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmResource.cs @@ -119,7 +119,7 @@ public virtual ManagedHsmPrivateEndpointConnectionCollection GetManagedHsmPrivat /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -150,7 +150,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response GetManagedH /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -221,7 +221,7 @@ public virtual async Task> GetAsync(CancellationTok /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -261,7 +261,7 @@ public virtual Response Get(CancellationToken cancellationTo /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -303,7 +303,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -345,7 +345,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -391,7 +391,7 @@ public virtual async Task> UpdateAsync(WaitUnti /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -437,7 +437,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, Mana /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// @@ -462,7 +462,7 @@ public virtual AsyncPageable GetMHSMPrivateLi /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// @@ -487,7 +487,7 @@ public virtual Pageable GetMHSMPrivateLinkRes /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// @@ -513,7 +513,7 @@ public virtual AsyncPageable GetMHSMRegionsByReso /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// @@ -539,7 +539,7 @@ public virtual Pageable GetMHSMRegionsByResource( /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -601,7 +601,7 @@ public virtual async Task> AddTagAsync(string key, /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -663,7 +663,7 @@ public virtual Response AddTag(string key, string value, Can /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -720,7 +720,7 @@ public virtual async Task> SetTagsAsync(IDictionary /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -777,7 +777,7 @@ public virtual Response SetTags(IDictionary /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource @@ -837,7 +837,7 @@ public virtual async Task> RemoveTagAsync(string ke /// /// /// Default Api Version - /// 2023-07-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmSkuFamily.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmSkuFamily.cs index 530f412df78f..4c28399cb60c 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmSkuFamily.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmSkuFamily.cs @@ -23,9 +23,12 @@ public ManagedHsmSkuFamily(string value) } private const string BValue = "B"; + private const string CValue = "C"; /// B. public static ManagedHsmSkuFamily B { get; } = new ManagedHsmSkuFamily(BValue); + /// C. + public static ManagedHsmSkuFamily C { get; } = new ManagedHsmSkuFamily(CValue); /// Determines if two values are the same. public static bool operator ==(ManagedHsmSkuFamily left, ManagedHsmSkuFamily right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmSkuName.Serialization.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmSkuName.Serialization.cs index 606fd08c2771..634313f9f09c 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmSkuName.Serialization.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmSkuName.Serialization.cs @@ -16,6 +16,8 @@ internal static partial class ManagedHsmSkuNameExtensions ManagedHsmSkuName.StandardB1 => "Standard_B1", ManagedHsmSkuName.CustomB32 => "Custom_B32", ManagedHsmSkuName.CustomB6 => "Custom_B6", + ManagedHsmSkuName.CustomC42 => "Custom_C42", + ManagedHsmSkuName.CustomC10 => "Custom_C10", _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ManagedHsmSkuName value.") }; @@ -24,6 +26,8 @@ public static ManagedHsmSkuName ToManagedHsmSkuName(this string value) if (StringComparer.OrdinalIgnoreCase.Equals(value, "Standard_B1")) return ManagedHsmSkuName.StandardB1; if (StringComparer.OrdinalIgnoreCase.Equals(value, "Custom_B32")) return ManagedHsmSkuName.CustomB32; if (StringComparer.OrdinalIgnoreCase.Equals(value, "Custom_B6")) return ManagedHsmSkuName.CustomB6; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Custom_C42")) return ManagedHsmSkuName.CustomC42; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Custom_C10")) return ManagedHsmSkuName.CustomC10; throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ManagedHsmSkuName value."); } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmSkuName.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmSkuName.cs index 64e86544e7c3..01a23594aebf 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmSkuName.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmSkuName.cs @@ -15,6 +15,10 @@ public enum ManagedHsmSkuName /// Custom_B32. CustomB32, /// Custom_B6. - CustomB6 + CustomB6, + /// Custom_C42. + CustomC42, + /// Custom_C10. + CustomC10 } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/ManagedHsmsRestOperations.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/ManagedHsmsRestOperations.cs index bad956922d77..a863c288dea6 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/ManagedHsmsRestOperations.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/ManagedHsmsRestOperations.cs @@ -32,7 +32,7 @@ public ManagedHsmsRestOperations(HttpPipeline pipeline, string applicationId, Ur { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-07-01"; + _apiVersion = apiVersion ?? "2024-11-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/MhsmPrivateEndpointConnectionsRestOperations.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/MhsmPrivateEndpointConnectionsRestOperations.cs index 78789cdbe3e2..435f04f3049c 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/MhsmPrivateEndpointConnectionsRestOperations.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/MhsmPrivateEndpointConnectionsRestOperations.cs @@ -32,7 +32,7 @@ public MhsmPrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, strin { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-07-01"; + _apiVersion = apiVersion ?? "2024-11-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/MhsmPrivateLinkResourcesRestOperations.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/MhsmPrivateLinkResourcesRestOperations.cs index 0306c0e006d5..b6b074fd3cc0 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/MhsmPrivateLinkResourcesRestOperations.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/MhsmPrivateLinkResourcesRestOperations.cs @@ -32,7 +32,7 @@ public MhsmPrivateLinkResourcesRestOperations(HttpPipeline pipeline, string appl { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-07-01"; + _apiVersion = apiVersion ?? "2024-11-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/MhsmRegionsRestOperations.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/MhsmRegionsRestOperations.cs index 14882073b945..dd7378750bdc 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/MhsmRegionsRestOperations.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/MhsmRegionsRestOperations.cs @@ -32,7 +32,7 @@ public MhsmRegionsRestOperations(HttpPipeline pipeline, string applicationId, Ur { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-07-01"; + _apiVersion = apiVersion ?? "2024-11-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index f8d9c49e7584..74e527618873 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -32,7 +32,7 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-07-01"; + _apiVersion = apiVersion ?? "2024-11-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs index 6078116a5f5e..c779de8bfad0 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -32,7 +32,7 @@ public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-07-01"; + _apiVersion = apiVersion ?? "2024-11-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/SecretsRestOperations.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/SecretsRestOperations.cs index f1bb76b1259e..fb6151d8c9a0 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/SecretsRestOperations.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/SecretsRestOperations.cs @@ -32,7 +32,7 @@ public SecretsRestOperations(HttpPipeline pipeline, string applicationId, Uri en { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-07-01"; + _apiVersion = apiVersion ?? "2024-11-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/VaultsRestOperations.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/VaultsRestOperations.cs index a0a47004dcc5..7a18ebecd393 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/VaultsRestOperations.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/VaultsRestOperations.cs @@ -32,7 +32,7 @@ public VaultsRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-07-01"; + _apiVersion = apiVersion ?? "2024-11-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/autorest.md b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/autorest.md index d31ada843283..d5d65a80d5a4 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/autorest.md +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/autorest.md @@ -7,7 +7,7 @@ azure-arm: true csharp: true library-name: KeyVault namespace: Azure.ResourceManager.KeyVault -require: https://github.com/Azure/azure-rest-api-specs/blob/d1296700aa6cd650970e9891dd58eef5698327fd/specification/keyvault/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/keyvault/resource-manager/readme.md #tag: package-2023-07 output-folder: $(this-folder)/Generated clear-output-folder: true diff --git a/sdk/keyvault/ci.mgmt.yml b/sdk/keyvault/ci.mgmt.yml index b48c2f8d4ff4..52dc51bf885a 100644 --- a/sdk/keyvault/ci.mgmt.yml +++ b/sdk/keyvault/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/keyvault/ci.mgmt.yml - sdk/keyvault/Azure.ResourceManager.KeyVault/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/keyvault/ci.mgmt.yml + - sdk/keyvault/Azure.ResourceManager.KeyVault/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/keyvault/ci.mgmt.yml + - sdk/keyvault/Azure.ResourceManager.KeyVault/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/keyvault/ci.mgmt.yml + - sdk/keyvault/Azure.ResourceManager.KeyVault/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/keyvault/ci.mgmt.yml + - sdk/keyvault/Azure.ResourceManager.KeyVault/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/keyvault/ci.mgmt.yml + - sdk/keyvault/Azure.ResourceManager.KeyVault/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/keyvault/ci.mgmt.yml + - sdk/keyvault/Azure.ResourceManager.KeyVault/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/keyvault/ci.mgmt.yml + - sdk/keyvault/Azure.ResourceManager.KeyVault/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/keyvault/ci.mgmt.yml + - sdk/keyvault/Azure.ResourceManager.KeyVault/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/keyvault/ci.mgmt.yml + - sdk/keyvault/Azure.ResourceManager.KeyVault/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/kubernetesconfiguration/ci.mgmt.yml b/sdk/kubernetesconfiguration/ci.mgmt.yml index 4249ef57fa6e..8484399bcf31 100644 --- a/sdk/kubernetesconfiguration/ci.mgmt.yml +++ b/sdk/kubernetesconfiguration/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/kubernetesconfiguration/ci.mgmt.yml - sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/kubernetesconfiguration/ci.mgmt.yml + - sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/kubernetesconfiguration/ci.mgmt.yml + - sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/kubernetesconfiguration/ci.mgmt.yml + - sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/kubernetesconfiguration/ci.mgmt.yml + - sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/kubernetesconfiguration/ci.mgmt.yml + - sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/kubernetesconfiguration/ci.mgmt.yml + - sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/kubernetesconfiguration/ci.mgmt.yml + - sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/kubernetesconfiguration/ci.mgmt.yml + - sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/kubernetesconfiguration/ci.mgmt.yml + - sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/kusto/ci.mgmt.yml b/sdk/kusto/ci.mgmt.yml index 374cf1f0cb81..6b3c66d37612 100644 --- a/sdk/kusto/ci.mgmt.yml +++ b/sdk/kusto/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/kusto/ci.mgmt.yml - sdk/kusto/Azure.ResourceManager.Kusto/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/kusto/ci.mgmt.yml + - sdk/kusto/Azure.ResourceManager.Kusto/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/kusto/ci.mgmt.yml + - sdk/kusto/Azure.ResourceManager.Kusto/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/kusto/ci.mgmt.yml + - sdk/kusto/Azure.ResourceManager.Kusto/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/kusto/ci.mgmt.yml + - sdk/kusto/Azure.ResourceManager.Kusto/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/kusto/ci.mgmt.yml + - sdk/kusto/Azure.ResourceManager.Kusto/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/kusto/ci.mgmt.yml + - sdk/kusto/Azure.ResourceManager.Kusto/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/kusto/ci.mgmt.yml + - sdk/kusto/Azure.ResourceManager.Kusto/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/kusto/ci.mgmt.yml + - sdk/kusto/Azure.ResourceManager.Kusto/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/kusto/ci.mgmt.yml + - sdk/kusto/Azure.ResourceManager.Kusto/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/labservices/ci.mgmt.yml b/sdk/labservices/ci.mgmt.yml index 48f80379ab14..b5636a5ca5aa 100644 --- a/sdk/labservices/ci.mgmt.yml +++ b/sdk/labservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/labservices/ci.mgmt.yml - sdk/labservices/Azure.ResourceManager.LabServices/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/labservices/ci.mgmt.yml + - sdk/labservices/Azure.ResourceManager.LabServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/labservices/ci.mgmt.yml + - sdk/labservices/Azure.ResourceManager.LabServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/labservices/ci.mgmt.yml + - sdk/labservices/Azure.ResourceManager.LabServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/labservices/ci.mgmt.yml + - sdk/labservices/Azure.ResourceManager.LabServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/labservices/ci.mgmt.yml + - sdk/labservices/Azure.ResourceManager.LabServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/labservices/ci.mgmt.yml + - sdk/labservices/Azure.ResourceManager.LabServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/labservices/ci.mgmt.yml + - sdk/labservices/Azure.ResourceManager.LabServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/labservices/ci.mgmt.yml + - sdk/labservices/Azure.ResourceManager.LabServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/labservices/ci.mgmt.yml + - sdk/labservices/Azure.ResourceManager.LabServices/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/loadtestservice/ci.mgmt.yml b/sdk/loadtestservice/ci.mgmt.yml index 4e3d99d42979..fa74ded1d68c 100644 --- a/sdk/loadtestservice/ci.mgmt.yml +++ b/sdk/loadtestservice/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/loadtestservice/ci.mgmt.yml - sdk/loadtestservice/Azure.ResourceManager.LoadTesting/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/loadtestservice/ci.mgmt.yml + - sdk/loadtestservice/Azure.ResourceManager.LoadTesting/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/loadtestservice/ci.mgmt.yml + - sdk/loadtestservice/Azure.ResourceManager.LoadTesting/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/loadtestservice/ci.mgmt.yml + - sdk/loadtestservice/Azure.ResourceManager.LoadTesting/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/loadtestservice/ci.mgmt.yml + - sdk/loadtestservice/Azure.ResourceManager.LoadTesting/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/loadtestservice/ci.mgmt.yml + - sdk/loadtestservice/Azure.ResourceManager.LoadTesting/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/loadtestservice/ci.mgmt.yml + - sdk/loadtestservice/Azure.ResourceManager.LoadTesting/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/loadtestservice/ci.mgmt.yml + - sdk/loadtestservice/Azure.ResourceManager.LoadTesting/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/loadtestservice/ci.mgmt.yml + - sdk/loadtestservice/Azure.ResourceManager.LoadTesting/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/loadtestservice/ci.mgmt.yml + - sdk/loadtestservice/Azure.ResourceManager.LoadTesting/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/logic/ci.mgmt.yml b/sdk/logic/ci.mgmt.yml index b89b224082ee..f3c59cff4dbf 100644 --- a/sdk/logic/ci.mgmt.yml +++ b/sdk/logic/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/logic/ci.mgmt.yml - sdk/logic/Azure.ResourceManager.Logic/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/logic/ci.mgmt.yml + - sdk/logic/Azure.ResourceManager.Logic/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/logic/ci.mgmt.yml + - sdk/logic/Azure.ResourceManager.Logic/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/logic/ci.mgmt.yml + - sdk/logic/Azure.ResourceManager.Logic/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/logic/ci.mgmt.yml + - sdk/logic/Azure.ResourceManager.Logic/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/logic/ci.mgmt.yml + - sdk/logic/Azure.ResourceManager.Logic/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/logic/ci.mgmt.yml + - sdk/logic/Azure.ResourceManager.Logic/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/logic/ci.mgmt.yml + - sdk/logic/Azure.ResourceManager.Logic/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/logic/ci.mgmt.yml + - sdk/logic/Azure.ResourceManager.Logic/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/logic/ci.mgmt.yml + - sdk/logic/Azure.ResourceManager.Logic/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/machinelearningcompute/ci.mgmt.yml b/sdk/machinelearningcompute/ci.mgmt.yml index 9ea84fdf4d15..43deaee6d283 100644 --- a/sdk/machinelearningcompute/ci.mgmt.yml +++ b/sdk/machinelearningcompute/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/machinelearningcompute/ci.mgmt.yml - sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/machinelearningcompute/ci.mgmt.yml + - sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/machinelearningcompute/ci.mgmt.yml + - sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/machinelearningcompute/ci.mgmt.yml + - sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/machinelearningcompute/ci.mgmt.yml + - sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/machinelearningcompute/ci.mgmt.yml + - sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/machinelearningcompute/ci.mgmt.yml + - sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/machinelearningcompute/ci.mgmt.yml + - sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/machinelearningcompute/ci.mgmt.yml + - sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/machinelearningcompute/ci.mgmt.yml + - sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/machinelearningservices/ci.mgmt.yml b/sdk/machinelearningservices/ci.mgmt.yml index 457299ab20b9..e921a984b5f6 100644 --- a/sdk/machinelearningservices/ci.mgmt.yml +++ b/sdk/machinelearningservices/ci.mgmt.yml @@ -1,5 +1,6 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -12,6 +13,114 @@ pr: - sdk/machinelearningservices/ci.mgmt.yml - sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/machinelearningservices/ci.mgmt.yml + - sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/machinelearningservices/ci.mgmt.yml + - sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/machinelearningservices/ci.mgmt.yml + - sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/machinelearningservices/ci.mgmt.yml + - sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/machinelearningservices/ci.mgmt.yml + - sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/machinelearningservices/ci.mgmt.yml + - sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/machinelearningservices/ci.mgmt.yml + - sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/machinelearningservices/ci.mgmt.yml + - sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/machinelearningservices/ci.mgmt.yml + - sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/maintenance/ci.mgmt.yml b/sdk/maintenance/ci.mgmt.yml index c49cc1565d6d..3428cc8373c4 100644 --- a/sdk/maintenance/ci.mgmt.yml +++ b/sdk/maintenance/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/maintenance/ci.mgmt.yml - sdk/maintenance/Azure.ResourceManager.Maintenance/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/maintenance/ci.mgmt.yml + - sdk/maintenance/Azure.ResourceManager.Maintenance/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/maintenance/ci.mgmt.yml + - sdk/maintenance/Azure.ResourceManager.Maintenance/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/maintenance/ci.mgmt.yml + - sdk/maintenance/Azure.ResourceManager.Maintenance/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/maintenance/ci.mgmt.yml + - sdk/maintenance/Azure.ResourceManager.Maintenance/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/maintenance/ci.mgmt.yml + - sdk/maintenance/Azure.ResourceManager.Maintenance/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/maintenance/ci.mgmt.yml + - sdk/maintenance/Azure.ResourceManager.Maintenance/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/maintenance/ci.mgmt.yml + - sdk/maintenance/Azure.ResourceManager.Maintenance/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/maintenance/ci.mgmt.yml + - sdk/maintenance/Azure.ResourceManager.Maintenance/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/maintenance/ci.mgmt.yml + - sdk/maintenance/Azure.ResourceManager.Maintenance/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/managednetwork/ci.mgmt.yml b/sdk/managednetwork/ci.mgmt.yml index 431d66d1245b..c38fe554e3f4 100644 --- a/sdk/managednetwork/ci.mgmt.yml +++ b/sdk/managednetwork/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/managednetwork/ci.mgmt.yml - sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managednetwork/ci.mgmt.yml + - sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managednetwork/ci.mgmt.yml + - sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managednetwork/ci.mgmt.yml + - sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managednetwork/ci.mgmt.yml + - sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managednetwork/ci.mgmt.yml + - sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managednetwork/ci.mgmt.yml + - sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managednetwork/ci.mgmt.yml + - sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managednetwork/ci.mgmt.yml + - sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managednetwork/ci.mgmt.yml + - sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/managednetworkfabric/ci.mgmt.yml b/sdk/managednetworkfabric/ci.mgmt.yml index aa6b571b04e2..1307550a1953 100644 --- a/sdk/managednetworkfabric/ci.mgmt.yml +++ b/sdk/managednetworkfabric/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/managednetworkfabric/ci.mgmt.yml - sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managednetworkfabric/ci.mgmt.yml + - sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managednetworkfabric/ci.mgmt.yml + - sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managednetworkfabric/ci.mgmt.yml + - sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managednetworkfabric/ci.mgmt.yml + - sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managednetworkfabric/ci.mgmt.yml + - sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managednetworkfabric/ci.mgmt.yml + - sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managednetworkfabric/ci.mgmt.yml + - sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managednetworkfabric/ci.mgmt.yml + - sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managednetworkfabric/ci.mgmt.yml + - sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/managedserviceidentity/ci.mgmt.yml b/sdk/managedserviceidentity/ci.mgmt.yml index c8f3a187f918..14267fa9a1f5 100644 --- a/sdk/managedserviceidentity/ci.mgmt.yml +++ b/sdk/managedserviceidentity/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/managedserviceidentity/ci.mgmt.yml - sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managedserviceidentity/ci.mgmt.yml + - sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managedserviceidentity/ci.mgmt.yml + - sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managedserviceidentity/ci.mgmt.yml + - sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managedserviceidentity/ci.mgmt.yml + - sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managedserviceidentity/ci.mgmt.yml + - sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managedserviceidentity/ci.mgmt.yml + - sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managedserviceidentity/ci.mgmt.yml + - sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managedserviceidentity/ci.mgmt.yml + - sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managedserviceidentity/ci.mgmt.yml + - sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/ + extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/managedservices/ci.mgmt.yml b/sdk/managedservices/ci.mgmt.yml index d6c0ccd16eef..e2d0c40be4f2 100644 --- a/sdk/managedservices/ci.mgmt.yml +++ b/sdk/managedservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/managedservices/ci.mgmt.yml - sdk/managedservices/Azure.ResourceManager.ManagedServices/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managedservices/ci.mgmt.yml + - sdk/managedservices/Azure.ResourceManager.ManagedServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managedservices/ci.mgmt.yml + - sdk/managedservices/Azure.ResourceManager.ManagedServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managedservices/ci.mgmt.yml + - sdk/managedservices/Azure.ResourceManager.ManagedServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managedservices/ci.mgmt.yml + - sdk/managedservices/Azure.ResourceManager.ManagedServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managedservices/ci.mgmt.yml + - sdk/managedservices/Azure.ResourceManager.ManagedServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managedservices/ci.mgmt.yml + - sdk/managedservices/Azure.ResourceManager.ManagedServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managedservices/ci.mgmt.yml + - sdk/managedservices/Azure.ResourceManager.ManagedServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managedservices/ci.mgmt.yml + - sdk/managedservices/Azure.ResourceManager.ManagedServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managedservices/ci.mgmt.yml + - sdk/managedservices/Azure.ResourceManager.ManagedServices/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/managementpartner/ci.mgmt.yml b/sdk/managementpartner/ci.mgmt.yml index 52c8e762088e..ee029000f5a0 100644 --- a/sdk/managementpartner/ci.mgmt.yml +++ b/sdk/managementpartner/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/managementpartner/ci.mgmt.yml - sdk/managementpartner/Azure.ResourceManager.ManagementPartner/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managementpartner/ci.mgmt.yml + - sdk/managementpartner/Azure.ResourceManager.ManagementPartner/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managementpartner/ci.mgmt.yml + - sdk/managementpartner/Azure.ResourceManager.ManagementPartner/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managementpartner/ci.mgmt.yml + - sdk/managementpartner/Azure.ResourceManager.ManagementPartner/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managementpartner/ci.mgmt.yml + - sdk/managementpartner/Azure.ResourceManager.ManagementPartner/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managementpartner/ci.mgmt.yml + - sdk/managementpartner/Azure.ResourceManager.ManagementPartner/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managementpartner/ci.mgmt.yml + - sdk/managementpartner/Azure.ResourceManager.ManagementPartner/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managementpartner/ci.mgmt.yml + - sdk/managementpartner/Azure.ResourceManager.ManagementPartner/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managementpartner/ci.mgmt.yml + - sdk/managementpartner/Azure.ResourceManager.ManagementPartner/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managementpartner/ci.mgmt.yml + - sdk/managementpartner/Azure.ResourceManager.ManagementPartner/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/maps/ci.mgmt.yml b/sdk/maps/ci.mgmt.yml index 2f16079cab2e..323727d77a39 100644 --- a/sdk/maps/ci.mgmt.yml +++ b/sdk/maps/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/maps/ci.mgmt.yml - sdk/maps/Azure.ResourceManager.Maps/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/maps/ci.mgmt.yml + - sdk/maps/Azure.ResourceManager.Maps/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/maps/ci.mgmt.yml + - sdk/maps/Azure.ResourceManager.Maps/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/maps/ci.mgmt.yml + - sdk/maps/Azure.ResourceManager.Maps/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/maps/ci.mgmt.yml + - sdk/maps/Azure.ResourceManager.Maps/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/maps/ci.mgmt.yml + - sdk/maps/Azure.ResourceManager.Maps/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/maps/ci.mgmt.yml + - sdk/maps/Azure.ResourceManager.Maps/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/maps/ci.mgmt.yml + - sdk/maps/Azure.ResourceManager.Maps/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/maps/ci.mgmt.yml + - sdk/maps/Azure.ResourceManager.Maps/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/maps/ci.mgmt.yml + - sdk/maps/Azure.ResourceManager.Maps/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/marketplace/ci.mgmt.yml b/sdk/marketplace/ci.mgmt.yml index e6574bdb3039..cf0c1a65f609 100644 --- a/sdk/marketplace/ci.mgmt.yml +++ b/sdk/marketplace/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/marketplace/ci.mgmt.yml - sdk/marketplace/Azure.ResourceManager.Marketplace/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/marketplace/ci.mgmt.yml + - sdk/marketplace/Azure.ResourceManager.Marketplace/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/marketplace/ci.mgmt.yml + - sdk/marketplace/Azure.ResourceManager.Marketplace/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/marketplace/ci.mgmt.yml + - sdk/marketplace/Azure.ResourceManager.Marketplace/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/marketplace/ci.mgmt.yml + - sdk/marketplace/Azure.ResourceManager.Marketplace/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/marketplace/ci.mgmt.yml + - sdk/marketplace/Azure.ResourceManager.Marketplace/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/marketplace/ci.mgmt.yml + - sdk/marketplace/Azure.ResourceManager.Marketplace/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/marketplace/ci.mgmt.yml + - sdk/marketplace/Azure.ResourceManager.Marketplace/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/marketplace/ci.mgmt.yml + - sdk/marketplace/Azure.ResourceManager.Marketplace/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/marketplace/ci.mgmt.yml + - sdk/marketplace/Azure.ResourceManager.Marketplace/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/marketplaceordering/ci.mgmt.yml b/sdk/marketplaceordering/ci.mgmt.yml index 2b1f8721902e..7ff3bf8819d5 100644 --- a/sdk/marketplaceordering/ci.mgmt.yml +++ b/sdk/marketplaceordering/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/marketplaceordering/ci.mgmt.yml - sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/marketplaceordering/ci.mgmt.yml + - sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/marketplaceordering/ci.mgmt.yml + - sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/marketplaceordering/ci.mgmt.yml + - sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/marketplaceordering/ci.mgmt.yml + - sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/marketplaceordering/ci.mgmt.yml + - sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/marketplaceordering/ci.mgmt.yml + - sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/marketplaceordering/ci.mgmt.yml + - sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/marketplaceordering/ci.mgmt.yml + - sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/marketplaceordering/ci.mgmt.yml + - sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/mediaservices/ci.mgmt.yml b/sdk/mediaservices/ci.mgmt.yml index 55656f3ae48b..c70b4478ade1 100644 --- a/sdk/mediaservices/ci.mgmt.yml +++ b/sdk/mediaservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/mediaservices/ci.mgmt.yml - sdk/mediaservices/Azure.ResourceManager.Media/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mediaservices/ci.mgmt.yml + - sdk/mediaservices/Azure.ResourceManager.Media/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mediaservices/ci.mgmt.yml + - sdk/mediaservices/Azure.ResourceManager.Media/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mediaservices/ci.mgmt.yml + - sdk/mediaservices/Azure.ResourceManager.Media/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mediaservices/ci.mgmt.yml + - sdk/mediaservices/Azure.ResourceManager.Media/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mediaservices/ci.mgmt.yml + - sdk/mediaservices/Azure.ResourceManager.Media/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mediaservices/ci.mgmt.yml + - sdk/mediaservices/Azure.ResourceManager.Media/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mediaservices/ci.mgmt.yml + - sdk/mediaservices/Azure.ResourceManager.Media/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mediaservices/ci.mgmt.yml + - sdk/mediaservices/Azure.ResourceManager.Media/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mediaservices/ci.mgmt.yml + - sdk/mediaservices/Azure.ResourceManager.Media/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/migrationdiscoverysap/ci.mgmt.yml b/sdk/migrationdiscoverysap/ci.mgmt.yml index f5eb354d28e7..45005a946f6f 100644 --- a/sdk/migrationdiscoverysap/ci.mgmt.yml +++ b/sdk/migrationdiscoverysap/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/migrationdiscoverysap/ci.mgmt.yml - sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/migrationdiscoverysap/ci.mgmt.yml + - sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/migrationdiscoverysap/ci.mgmt.yml + - sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/migrationdiscoverysap/ci.mgmt.yml + - sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/migrationdiscoverysap/ci.mgmt.yml + - sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/migrationdiscoverysap/ci.mgmt.yml + - sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/migrationdiscoverysap/ci.mgmt.yml + - sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/migrationdiscoverysap/ci.mgmt.yml + - sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/migrationdiscoverysap/ci.mgmt.yml + - sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/migrationdiscoverysap/ci.mgmt.yml + - sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/mixedreality/ci.mgmt.yml b/sdk/mixedreality/ci.mgmt.yml index 81c0c2744232..828e10c4a9c6 100644 --- a/sdk/mixedreality/ci.mgmt.yml +++ b/sdk/mixedreality/ci.mgmt.yml @@ -1,5 +1,6 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -12,6 +13,114 @@ pr: - sdk/mixedreality/ci.mgmt.yml - sdk/mixedreality/Azure.ResourceManager.MixedReality/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mixedreality/ci.mgmt.yml + - sdk/mixedreality/Azure.ResourceManager.MixedReality/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mixedreality/ci.mgmt.yml + - sdk/mixedreality/Azure.ResourceManager.MixedReality/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mixedreality/ci.mgmt.yml + - sdk/mixedreality/Azure.ResourceManager.MixedReality/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mixedreality/ci.mgmt.yml + - sdk/mixedreality/Azure.ResourceManager.MixedReality/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mixedreality/ci.mgmt.yml + - sdk/mixedreality/Azure.ResourceManager.MixedReality/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mixedreality/ci.mgmt.yml + - sdk/mixedreality/Azure.ResourceManager.MixedReality/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mixedreality/ci.mgmt.yml + - sdk/mixedreality/Azure.ResourceManager.MixedReality/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mixedreality/ci.mgmt.yml + - sdk/mixedreality/Azure.ResourceManager.MixedReality/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mixedreality/ci.mgmt.yml + - sdk/mixedreality/Azure.ResourceManager.MixedReality/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/mobilenetwork/ci.mgmt.yml b/sdk/mobilenetwork/ci.mgmt.yml index 8a68e6749ba7..edcbb25b9da1 100644 --- a/sdk/mobilenetwork/ci.mgmt.yml +++ b/sdk/mobilenetwork/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/mobilenetwork/ci.mgmt.yml - sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mobilenetwork/ci.mgmt.yml + - sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mobilenetwork/ci.mgmt.yml + - sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mobilenetwork/ci.mgmt.yml + - sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mobilenetwork/ci.mgmt.yml + - sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mobilenetwork/ci.mgmt.yml + - sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mobilenetwork/ci.mgmt.yml + - sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mobilenetwork/ci.mgmt.yml + - sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mobilenetwork/ci.mgmt.yml + - sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mobilenetwork/ci.mgmt.yml + - sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/ + extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/mongocluster/ci.mgmt.yml b/sdk/mongocluster/ci.mgmt.yml index d2eafe7877dd..3c21305acc06 100644 --- a/sdk/mongocluster/ci.mgmt.yml +++ b/sdk/mongocluster/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/mongocluster/ci.mgmt.yml - sdk/mongocluster/Azure.ResourceManager.MongoCluster/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mongocluster/ci.mgmt.yml + - sdk/mongocluster/Azure.ResourceManager.MongoCluster/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mongocluster/ci.mgmt.yml + - sdk/mongocluster/Azure.ResourceManager.MongoCluster/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mongocluster/ci.mgmt.yml + - sdk/mongocluster/Azure.ResourceManager.MongoCluster/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mongocluster/ci.mgmt.yml + - sdk/mongocluster/Azure.ResourceManager.MongoCluster/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mongocluster/ci.mgmt.yml + - sdk/mongocluster/Azure.ResourceManager.MongoCluster/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mongocluster/ci.mgmt.yml + - sdk/mongocluster/Azure.ResourceManager.MongoCluster/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mongocluster/ci.mgmt.yml + - sdk/mongocluster/Azure.ResourceManager.MongoCluster/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mongocluster/ci.mgmt.yml + - sdk/mongocluster/Azure.ResourceManager.MongoCluster/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mongocluster/ci.mgmt.yml + - sdk/mongocluster/Azure.ResourceManager.MongoCluster/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/monitor/ci.mgmt.yml b/sdk/monitor/ci.mgmt.yml index 8beeded4e3b9..a6c6447f7420 100644 --- a/sdk/monitor/ci.mgmt.yml +++ b/sdk/monitor/ci.mgmt.yml @@ -2,6 +2,7 @@ # This file is generated automatically and any changes will be lost. trigger: none + pr: branches: include: @@ -14,6 +15,114 @@ pr: - sdk/monitor/ci.mgmt.yml - sdk/monitor/Azure.ResourceManager.Monitor/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/monitor/ci.mgmt.yml + - sdk/monitor/Azure.ResourceManager.Monitor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/monitor/ci.mgmt.yml + - sdk/monitor/Azure.ResourceManager.Monitor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/monitor/ci.mgmt.yml + - sdk/monitor/Azure.ResourceManager.Monitor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/monitor/ci.mgmt.yml + - sdk/monitor/Azure.ResourceManager.Monitor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/monitor/ci.mgmt.yml + - sdk/monitor/Azure.ResourceManager.Monitor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/monitor/ci.mgmt.yml + - sdk/monitor/Azure.ResourceManager.Monitor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/monitor/ci.mgmt.yml + - sdk/monitor/Azure.ResourceManager.Monitor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/monitor/ci.mgmt.yml + - sdk/monitor/Azure.ResourceManager.Monitor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/monitor/ci.mgmt.yml + - sdk/monitor/Azure.ResourceManager.Monitor/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/mysql/ci.mgmt.yml b/sdk/mysql/ci.mgmt.yml index e1521b4ed568..6e4185d5dad1 100644 --- a/sdk/mysql/ci.mgmt.yml +++ b/sdk/mysql/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/mysql/ci.mgmt.yml - sdk/mysql/Azure.ResourceManager.MySql/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mysql/ci.mgmt.yml + - sdk/mysql/Azure.ResourceManager.MySql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mysql/ci.mgmt.yml + - sdk/mysql/Azure.ResourceManager.MySql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mysql/ci.mgmt.yml + - sdk/mysql/Azure.ResourceManager.MySql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mysql/ci.mgmt.yml + - sdk/mysql/Azure.ResourceManager.MySql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mysql/ci.mgmt.yml + - sdk/mysql/Azure.ResourceManager.MySql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mysql/ci.mgmt.yml + - sdk/mysql/Azure.ResourceManager.MySql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mysql/ci.mgmt.yml + - sdk/mysql/Azure.ResourceManager.MySql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mysql/ci.mgmt.yml + - sdk/mysql/Azure.ResourceManager.MySql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mysql/ci.mgmt.yml + - sdk/mysql/Azure.ResourceManager.MySql/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/neonpostgres/ci.mgmt.yml b/sdk/neonpostgres/ci.mgmt.yml index 72d449fc7a16..9a31140db2f8 100644 --- a/sdk/neonpostgres/ci.mgmt.yml +++ b/sdk/neonpostgres/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/neonpostgres/ci.mgmt.yml - sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/neonpostgres/ci.mgmt.yml + - sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/neonpostgres/ci.mgmt.yml + - sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/neonpostgres/ci.mgmt.yml + - sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/neonpostgres/ci.mgmt.yml + - sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/neonpostgres/ci.mgmt.yml + - sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/neonpostgres/ci.mgmt.yml + - sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/neonpostgres/ci.mgmt.yml + - sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/neonpostgres/ci.mgmt.yml + - sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/neonpostgres/ci.mgmt.yml + - sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/netapp/ci.mgmt.yml b/sdk/netapp/ci.mgmt.yml index 05a683e910f5..42ebb84c775d 100644 --- a/sdk/netapp/ci.mgmt.yml +++ b/sdk/netapp/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/netapp/ci.mgmt.yml - sdk/netapp/Azure.ResourceManager.NetApp/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/netapp/ci.mgmt.yml + - sdk/netapp/Azure.ResourceManager.NetApp/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/netapp/ci.mgmt.yml + - sdk/netapp/Azure.ResourceManager.NetApp/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/netapp/ci.mgmt.yml + - sdk/netapp/Azure.ResourceManager.NetApp/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/netapp/ci.mgmt.yml + - sdk/netapp/Azure.ResourceManager.NetApp/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/netapp/ci.mgmt.yml + - sdk/netapp/Azure.ResourceManager.NetApp/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/netapp/ci.mgmt.yml + - sdk/netapp/Azure.ResourceManager.NetApp/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/netapp/ci.mgmt.yml + - sdk/netapp/Azure.ResourceManager.NetApp/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/netapp/ci.mgmt.yml + - sdk/netapp/Azure.ResourceManager.NetApp/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/netapp/ci.mgmt.yml + - sdk/netapp/Azure.ResourceManager.NetApp/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/network/ci.mgmt.yml b/sdk/network/ci.mgmt.yml index edf77de02a49..29ebc151abde 100644 --- a/sdk/network/ci.mgmt.yml +++ b/sdk/network/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/network/ci.mgmt.yml - sdk/network/Azure.ResourceManager.Network/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/network/ci.mgmt.yml + - sdk/network/Azure.ResourceManager.Network/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/network/ci.mgmt.yml + - sdk/network/Azure.ResourceManager.Network/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/network/ci.mgmt.yml + - sdk/network/Azure.ResourceManager.Network/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/network/ci.mgmt.yml + - sdk/network/Azure.ResourceManager.Network/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/network/ci.mgmt.yml + - sdk/network/Azure.ResourceManager.Network/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/network/ci.mgmt.yml + - sdk/network/Azure.ResourceManager.Network/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/network/ci.mgmt.yml + - sdk/network/Azure.ResourceManager.Network/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/network/ci.mgmt.yml + - sdk/network/Azure.ResourceManager.Network/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/network/ci.mgmt.yml + - sdk/network/Azure.ResourceManager.Network/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/networkanalytics/ci.mgmt.yml b/sdk/networkanalytics/ci.mgmt.yml index 9ece072ce867..2eed802c7043 100644 --- a/sdk/networkanalytics/ci.mgmt.yml +++ b/sdk/networkanalytics/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/networkanalytics/ci.mgmt.yml - sdk/networkanalytics/Azure.ResourceManager.NetworkAnalytics/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkanalytics/ci.mgmt.yml + - sdk/networkanalytics/Azure.ResourceManager.NetworkAnalytics/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkanalytics/ci.mgmt.yml + - sdk/networkanalytics/Azure.ResourceManager.NetworkAnalytics/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkanalytics/ci.mgmt.yml + - sdk/networkanalytics/Azure.ResourceManager.NetworkAnalytics/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkanalytics/ci.mgmt.yml + - sdk/networkanalytics/Azure.ResourceManager.NetworkAnalytics/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkanalytics/ci.mgmt.yml + - sdk/networkanalytics/Azure.ResourceManager.NetworkAnalytics/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkanalytics/ci.mgmt.yml + - sdk/networkanalytics/Azure.ResourceManager.NetworkAnalytics/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkanalytics/ci.mgmt.yml + - sdk/networkanalytics/Azure.ResourceManager.NetworkAnalytics/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkanalytics/ci.mgmt.yml + - sdk/networkanalytics/Azure.ResourceManager.NetworkAnalytics/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkanalytics/ci.mgmt.yml + - sdk/networkanalytics/Azure.ResourceManager.NetworkAnalytics/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/networkcloud/ci.mgmt.yml b/sdk/networkcloud/ci.mgmt.yml index f6c281af22a9..5ca51def4238 100644 --- a/sdk/networkcloud/ci.mgmt.yml +++ b/sdk/networkcloud/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/networkcloud/ci.mgmt.yml - sdk/networkcloud/Azure.ResourceManager.NetworkCloud/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkcloud/ci.mgmt.yml + - sdk/networkcloud/Azure.ResourceManager.NetworkCloud/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkcloud/ci.mgmt.yml + - sdk/networkcloud/Azure.ResourceManager.NetworkCloud/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkcloud/ci.mgmt.yml + - sdk/networkcloud/Azure.ResourceManager.NetworkCloud/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkcloud/ci.mgmt.yml + - sdk/networkcloud/Azure.ResourceManager.NetworkCloud/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkcloud/ci.mgmt.yml + - sdk/networkcloud/Azure.ResourceManager.NetworkCloud/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkcloud/ci.mgmt.yml + - sdk/networkcloud/Azure.ResourceManager.NetworkCloud/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkcloud/ci.mgmt.yml + - sdk/networkcloud/Azure.ResourceManager.NetworkCloud/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkcloud/ci.mgmt.yml + - sdk/networkcloud/Azure.ResourceManager.NetworkCloud/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkcloud/ci.mgmt.yml + - sdk/networkcloud/Azure.ResourceManager.NetworkCloud/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/networkfunction/ci.mgmt.yml b/sdk/networkfunction/ci.mgmt.yml index a3c743ef532a..bf09ef3ed50e 100644 --- a/sdk/networkfunction/ci.mgmt.yml +++ b/sdk/networkfunction/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/networkfunction/ci.mgmt.yml - sdk/networkfunction/Azure.ResourceManager.NetworkFunction/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkfunction/ci.mgmt.yml + - sdk/networkfunction/Azure.ResourceManager.NetworkFunction/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkfunction/ci.mgmt.yml + - sdk/networkfunction/Azure.ResourceManager.NetworkFunction/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkfunction/ci.mgmt.yml + - sdk/networkfunction/Azure.ResourceManager.NetworkFunction/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkfunction/ci.mgmt.yml + - sdk/networkfunction/Azure.ResourceManager.NetworkFunction/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkfunction/ci.mgmt.yml + - sdk/networkfunction/Azure.ResourceManager.NetworkFunction/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkfunction/ci.mgmt.yml + - sdk/networkfunction/Azure.ResourceManager.NetworkFunction/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkfunction/ci.mgmt.yml + - sdk/networkfunction/Azure.ResourceManager.NetworkFunction/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkfunction/ci.mgmt.yml + - sdk/networkfunction/Azure.ResourceManager.NetworkFunction/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkfunction/ci.mgmt.yml + - sdk/networkfunction/Azure.ResourceManager.NetworkFunction/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/newrelicobservability/ci.mgmt.yml b/sdk/newrelicobservability/ci.mgmt.yml index d01ef74cd749..7983d9893dad 100644 --- a/sdk/newrelicobservability/ci.mgmt.yml +++ b/sdk/newrelicobservability/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/newrelicobservability/ci.mgmt.yml - sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/newrelicobservability/ci.mgmt.yml + - sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/newrelicobservability/ci.mgmt.yml + - sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/newrelicobservability/ci.mgmt.yml + - sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/newrelicobservability/ci.mgmt.yml + - sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/newrelicobservability/ci.mgmt.yml + - sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/newrelicobservability/ci.mgmt.yml + - sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/newrelicobservability/ci.mgmt.yml + - sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/newrelicobservability/ci.mgmt.yml + - sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/newrelicobservability/ci.mgmt.yml + - sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/nginx/ci.mgmt.yml b/sdk/nginx/ci.mgmt.yml index f701b26a561a..eae53140c4fc 100644 --- a/sdk/nginx/ci.mgmt.yml +++ b/sdk/nginx/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/nginx/ci.mgmt.yml - sdk/nginx/Azure.ResourceManager.Nginx/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/nginx/ci.mgmt.yml + - sdk/nginx/Azure.ResourceManager.Nginx/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/nginx/ci.mgmt.yml + - sdk/nginx/Azure.ResourceManager.Nginx/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/nginx/ci.mgmt.yml + - sdk/nginx/Azure.ResourceManager.Nginx/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/nginx/ci.mgmt.yml + - sdk/nginx/Azure.ResourceManager.Nginx/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/nginx/ci.mgmt.yml + - sdk/nginx/Azure.ResourceManager.Nginx/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/nginx/ci.mgmt.yml + - sdk/nginx/Azure.ResourceManager.Nginx/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/nginx/ci.mgmt.yml + - sdk/nginx/Azure.ResourceManager.Nginx/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/nginx/ci.mgmt.yml + - sdk/nginx/Azure.ResourceManager.Nginx/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/nginx/ci.mgmt.yml + - sdk/nginx/Azure.ResourceManager.Nginx/ + extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/notificationhubs/ci.mgmt.yml b/sdk/notificationhubs/ci.mgmt.yml index ba5a26631dd4..43e9c7272e0f 100644 --- a/sdk/notificationhubs/ci.mgmt.yml +++ b/sdk/notificationhubs/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/notificationhubs/ci.mgmt.yml - sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/notificationhubs/ci.mgmt.yml + - sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/notificationhubs/ci.mgmt.yml + - sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/notificationhubs/ci.mgmt.yml + - sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/notificationhubs/ci.mgmt.yml + - sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/notificationhubs/ci.mgmt.yml + - sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/notificationhubs/ci.mgmt.yml + - sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/notificationhubs/ci.mgmt.yml + - sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/notificationhubs/ci.mgmt.yml + - sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/notificationhubs/ci.mgmt.yml + - sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AIOpenAIClientBuilderExtensions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AIOpenAIClientBuilderExtensions.cs new file mode 100644 index 000000000000..bc32a7f2b1a4 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AIOpenAIClientBuilderExtensions.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure; +using Azure.AI.OpenAI; +using Azure.Core.Extensions; + +namespace Microsoft.Extensions.Azure +{ + /// Extension methods to add to client builder. + public static partial class AIOpenAIClientBuilderExtensions + { + /// Registers a instance. + /// The builder to register with. + /// + /// Supported Cognitive Services endpoints (protocol and hostname, for example: + /// https://westus.api.cognitive.microsoft.com). + /// + /// A credential used to authenticate to an Azure Service. + public static IAzureClientBuilder AddOpenAIClient(this TBuilder builder, Uri endpoint, AzureKeyCredential credential) + where TBuilder : IAzureClientFactoryBuilder + { + return builder.RegisterClientFactory((options) => new OpenAIClient(endpoint, credential, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// + /// Supported Cognitive Services endpoints (protocol and hostname, for example: + /// https://westus.api.cognitive.microsoft.com). + /// + public static IAzureClientBuilder AddOpenAIClient(this TBuilder builder, Uri endpoint) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new OpenAIClient(endpoint, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddOpenAIClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AIOpenAIModelFactory.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AIOpenAIModelFactory.cs new file mode 100644 index 000000000000..1f6cdb179ec9 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AIOpenAIModelFactory.cs @@ -0,0 +1,1541 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; + +namespace Azure.AI.OpenAI +{ + /// Model factory for models. + public static partial class AIOpenAIModelFactory + { + /// Initializes a new instance of . + /// + /// The audio data to transcribe. This must be the binary content of a file in one of the supported media formats: + /// flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm. + /// + /// The optional filename or descriptive identifier to associate with with the audio data. + /// The requested format of the transcription response data, which will influence the content and detail of the result. + /// + /// The primary spoken language of the audio data to be transcribed, supplied as a two-letter ISO-639-1 language code + /// such as 'en' or 'fr'. + /// Providing this known input language is optional but may improve the accuracy and/or latency of transcription. + /// + /// + /// An optional hint to guide the model's style or continue from a prior audio segment. The written language of the + /// prompt should match the primary spoken language of the audio data. + /// + /// + /// The sampling temperature, between 0 and 1. + /// Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + /// If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit. + /// + /// + /// The timestamp granularities to populate for this transcription. + /// `response_format` must be set `verbose_json` to use timestamp granularities. + /// Either or both of these options are supported: `word`, or `segment`. + /// Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency. + /// + /// The model to use for this transcription request. + /// A new instance for mocking. + public static AudioTranscriptionOptions AudioTranscriptionOptions(Stream audioData = null, string filename = null, AudioTranscriptionFormat? responseFormat = null, string language = null, string prompt = null, float? temperature = null, IEnumerable timestampGranularities = null, string deploymentName = null) + { + timestampGranularities ??= new List(); + + return new AudioTranscriptionOptions( + audioData, + filename, + responseFormat, + language, + prompt, + temperature, + timestampGranularities?.ToList(), + deploymentName, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The 0-based index of this segment within a transcription. + /// The time at which this segment started relative to the beginning of the transcribed audio. + /// The time at which this segment ended relative to the beginning of the transcribed audio. + /// The transcribed text that was part of this audio segment. + /// The temperature score associated with this audio segment. + /// The average log probability associated with this audio segment. + /// The compression ratio of this audio segment. + /// The probability of no speech detection within this audio segment. + /// The token IDs matching the transcribed text in this audio segment. + /// + /// The seek position associated with the processing of this audio segment. + /// Seek positions are expressed as hundredths of seconds. + /// The model may process several segments from a single seek position, so while the seek position will never represent + /// a later time than the segment's start, the segment's start may represent a significantly later time than the + /// segment's associated seek position. + /// + /// A new instance for mocking. + public static AudioTranscriptionSegment AudioTranscriptionSegment(int id = default, TimeSpan start = default, TimeSpan end = default, string text = null, float temperature = default, float averageLogProbability = default, float compressionRatio = default, float noSpeechProbability = default, IEnumerable tokens = null, int seek = default) + { + tokens ??= new List(); + + return new AudioTranscriptionSegment( + id, + start, + end, + text, + temperature, + averageLogProbability, + compressionRatio, + noSpeechProbability, + tokens?.ToList(), + seek, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The textual content of the word. + /// The start time of the word relative to the beginning of the audio, expressed in seconds. + /// The end time of the word relative to the beginning of the audio, expressed in seconds. + /// A new instance for mocking. + public static AudioTranscriptionWord AudioTranscriptionWord(string word = null, TimeSpan start = default, TimeSpan end = default) + { + return new AudioTranscriptionWord(word, start, end, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// The audio data to translate. This must be the binary content of a file in one of the supported media formats: + /// flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm. + /// + /// The optional filename or descriptive identifier to associate with with the audio data. + /// The requested format of the translation response data, which will influence the content and detail of the result. + /// + /// An optional hint to guide the model's style or continue from a prior audio segment. The written language of the + /// prompt should match the primary spoken language of the audio data. + /// + /// + /// The sampling temperature, between 0 and 1. + /// Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + /// If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit. + /// + /// The model to use for this translation request. + /// A new instance for mocking. + public static AudioTranslationOptions AudioTranslationOptions(Stream audioData = null, string filename = null, AudioTranslationFormat? responseFormat = null, string prompt = null, float? temperature = null, string deploymentName = null) + { + return new AudioTranslationOptions( + audioData, + filename, + responseFormat, + prompt, + temperature, + deploymentName, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The 0-based index of this segment within a translation. + /// The time at which this segment started relative to the beginning of the translated audio. + /// The time at which this segment ended relative to the beginning of the translated audio. + /// The translated text that was part of this audio segment. + /// The temperature score associated with this audio segment. + /// The average log probability associated with this audio segment. + /// The compression ratio of this audio segment. + /// The probability of no speech detection within this audio segment. + /// The token IDs matching the translated text in this audio segment. + /// + /// The seek position associated with the processing of this audio segment. + /// Seek positions are expressed as hundredths of seconds. + /// The model may process several segments from a single seek position, so while the seek position will never represent + /// a later time than the segment's start, the segment's start may represent a significantly later time than the + /// segment's associated seek position. + /// + /// A new instance for mocking. + public static AudioTranslationSegment AudioTranslationSegment(int id = default, TimeSpan start = default, TimeSpan end = default, string text = null, float temperature = default, float averageLogProbability = default, float compressionRatio = default, float noSpeechProbability = default, IEnumerable tokens = null, int seek = default) + { + tokens ??= new List(); + + return new AudioTranslationSegment( + id, + start, + end, + text, + temperature, + averageLogProbability, + compressionRatio, + noSpeechProbability, + tokens?.ToList(), + seek, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// A unique identifier associated with this completions response. + /// + /// The first timestamp associated with generation activity for this completions response, + /// represented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970. + /// + /// + /// Content filtering results for zero or more prompts in the request. In a streaming request, + /// results for different prompts may arrive at different times or in different orders. + /// + /// + /// The collection of completions choices associated with this completions response. + /// Generally, `n` choices are generated per provided prompt with a default value of 1. + /// Token limits and other settings may limit the number of choices generated. + /// + /// Usage information for tokens processed and generated as part of this completions operation. + /// + /// This fingerprint represents the backend configuration that the model runs with. + /// + /// Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. + /// + /// A new instance for mocking. + public static Completions Completions(string id = null, DateTimeOffset created = default, IEnumerable promptFilterResults = null, IEnumerable choices = null, CompletionsUsage usage = null, string systemFingerprint = null) + { + promptFilterResults ??= new List(); + choices ??= new List(); + + return new Completions( + id, + created, + promptFilterResults?.ToList(), + choices?.ToList(), + usage, + systemFingerprint, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The index of this prompt in the set of prompt results. + /// Content filtering results for this prompt. + /// A new instance for mocking. + public static ContentFilterResultsForPrompt ContentFilterResultsForPrompt(int promptIndex = default, ContentFilterResultDetailsForPrompt contentFilterResults = null) + { + return new ContentFilterResultsForPrompt(promptIndex, contentFilterResults, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// Describes language related to anatomical organs and genitals, romantic relationships, + /// acts portrayed in erotic or affectionate terms, physical sexual acts, including + /// those portrayed as an assault or a forced sexual violent act against one’s will, + /// prostitution, pornography, and abuse. + /// + /// + /// Describes language related to physical actions intended to hurt, injure, damage, or + /// kill someone or something; describes weapons, etc. + /// + /// + /// Describes language attacks or uses that include pejorative or discriminatory language + /// with reference to a person or identity group on the basis of certain differentiating + /// attributes of these groups including but not limited to race, ethnicity, nationality, + /// gender identity and expression, sexual orientation, religion, immigration status, ability + /// status, personal appearance, and body size. + /// + /// + /// Describes language related to physical actions intended to purposely hurt, injure, + /// or damage one’s body, or kill oneself. + /// + /// Describes whether profanity was detected. + /// Describes detection results against configured custom blocklists. + /// + /// Describes an error returned if the content filtering system is + /// down or otherwise unable to complete the operation in time. + /// + /// Whether a jailbreak attempt was detected in the prompt. + /// Whether an indirect attack was detected in the prompt. + /// A new instance for mocking. + public static ContentFilterResultDetailsForPrompt ContentFilterResultDetailsForPrompt(ContentFilterResult sexual = null, ContentFilterResult violence = null, ContentFilterResult hate = null, ContentFilterResult selfHarm = null, ContentFilterDetectionResult profanity = null, ContentFilterDetailedResults customBlocklists = null, ResponseError error = null, ContentFilterDetectionResult jailbreak = null, ContentFilterDetectionResult indirectAttack = null) + { + return new ContentFilterResultDetailsForPrompt( + sexual, + violence, + hate, + selfHarm, + profanity, + customBlocklists, + error, + jailbreak, + indirectAttack, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// A value indicating whether or not the content has been filtered. + /// Ratings for the intensity and risk level of filtered content. + /// A new instance for mocking. + public static ContentFilterResult ContentFilterResult(bool filtered = default, ContentFilterSeverity severity = default) + { + return new ContentFilterResult(filtered, severity, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// A value indicating whether or not the content has been filtered. + /// A value indicating whether detection occurred, irrespective of severity or whether the content was filtered. + /// A new instance for mocking. + public static ContentFilterDetectionResult ContentFilterDetectionResult(bool filtered = default, bool detected = default) + { + return new ContentFilterDetectionResult(filtered, detected, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// A value indicating whether or not the content has been filtered. + /// The collection of detailed blocklist result information. + /// A new instance for mocking. + public static ContentFilterDetailedResults ContentFilterDetailedResults(bool filtered = default, IEnumerable details = null) + { + details ??= new List(); + + return new ContentFilterDetailedResults(filtered, details?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// A value indicating whether or not the content has been filtered. + /// The ID of the custom blocklist evaluated. + /// A new instance for mocking. + public static ContentFilterBlocklistIdResult ContentFilterBlocklistIdResult(bool filtered = default, string id = null) + { + return new ContentFilterBlocklistIdResult(filtered, id, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The generated text for a given completions prompt. + /// The ordered index associated with this completions choice. + /// + /// Information about the content filtering category (hate, sexual, violence, self_harm), if it + /// has been detected, as well as the severity level (very_low, low, medium, high-scale that + /// determines the intensity and risk level of harmful content) and if it has been filtered or not. + /// + /// The log probabilities model for tokens associated with this completions choice. + /// Reason for finishing. + /// A new instance for mocking. + public static Choice Choice(string text = null, int index = default, ContentFilterResultsForChoice contentFilterResults = null, CompletionsLogProbabilityModel logProbabilityModel = null, CompletionsFinishReason? finishReason = null) + { + return new Choice( + text, + index, + contentFilterResults, + logProbabilityModel, + finishReason, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// Describes language related to anatomical organs and genitals, romantic relationships, + /// acts portrayed in erotic or affectionate terms, physical sexual acts, including + /// those portrayed as an assault or a forced sexual violent act against one’s will, + /// prostitution, pornography, and abuse. + /// + /// + /// Describes language related to physical actions intended to hurt, injure, damage, or + /// kill someone or something; describes weapons, etc. + /// + /// + /// Describes language attacks or uses that include pejorative or discriminatory language + /// with reference to a person or identity group on the basis of certain differentiating + /// attributes of these groups including but not limited to race, ethnicity, nationality, + /// gender identity and expression, sexual orientation, religion, immigration status, ability + /// status, personal appearance, and body size. + /// + /// + /// Describes language related to physical actions intended to purposely hurt, injure, + /// or damage one’s body, or kill oneself. + /// + /// Describes whether profanity was detected. + /// Describes detection results against configured custom blocklists. + /// + /// Describes an error returned if the content filtering system is + /// down or otherwise unable to complete the operation in time. + /// + /// Information about detection of protected text material. + /// Information about detection of protected code material. + /// Information about detection of ungrounded material. + /// A new instance for mocking. + public static ContentFilterResultsForChoice ContentFilterResultsForChoice(ContentFilterResult sexual = null, ContentFilterResult violence = null, ContentFilterResult hate = null, ContentFilterResult selfHarm = null, ContentFilterDetectionResult profanity = null, ContentFilterDetailedResults customBlocklists = null, ResponseError error = null, ContentFilterDetectionResult protectedMaterialText = null, ContentFilterCitedDetectionResult protectedMaterialCode = null, ContentFilterCompletionTextSpanResult ungroundedMaterial = null) + { + return new ContentFilterResultsForChoice( + sexual, + violence, + hate, + selfHarm, + profanity, + customBlocklists, + error, + protectedMaterialText, + protectedMaterialCode, + ungroundedMaterial, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// A value indicating whether or not the content has been filtered. + /// A value indicating whether detection occurred, irrespective of severity or whether the content was filtered. + /// The internet location associated with the detection. + /// The license description associated with the detection. + /// A new instance for mocking. + public static ContentFilterCitedDetectionResult ContentFilterCitedDetectionResult(bool filtered = default, bool detected = default, Uri url = null, string license = null) + { + return new ContentFilterCitedDetectionResult(filtered, detected, url, license, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// A value indicating whether or not the content has been filtered. + /// A value indicating whether detection occurred, irrespective of severity or whether the content was filtered. + /// The collection of completion text spans. + /// A new instance for mocking. + public static ContentFilterCompletionTextSpanResult ContentFilterCompletionTextSpanResult(bool filtered = default, bool detected = default, IEnumerable details = null) + { + details ??= new List(); + + return new ContentFilterCompletionTextSpanResult(filtered, detected, details?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Offset of the UTF32 code point which begins the span. + /// + /// Offset of the first UTF32 code point which is excluded from the span. + /// This field is always equal to completion_start_offset for empty spans. + /// This field is always larger than completion_start_offset for non-empty spans. + /// + /// A new instance for mocking. + public static ContentFilterCompletionTextSpan ContentFilterCompletionTextSpan(int completionStartOffset = default, int completionEndOffset = default) + { + return new ContentFilterCompletionTextSpan(completionStartOffset, completionEndOffset, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The textual forms of tokens evaluated in this probability model. + /// A collection of log probability values for the tokens in this completions data. + /// A mapping of tokens to maximum log probability values in this completions data. + /// The text offsets associated with tokens in this completions data. + /// A new instance for mocking. + public static CompletionsLogProbabilityModel CompletionsLogProbabilityModel(IEnumerable tokens = null, IEnumerable tokenLogProbabilities = null, IEnumerable> topLogProbabilities = null, IEnumerable textOffsets = null) + { + tokens ??= new List(); + tokenLogProbabilities ??= new List(); + topLogProbabilities ??= new List>(); + textOffsets ??= new List(); + + return new CompletionsLogProbabilityModel(tokens?.ToList(), tokenLogProbabilities?.ToList(), topLogProbabilities?.ToList(), textOffsets?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The number of tokens generated across all completions emissions. + /// The number of tokens in the provided prompts for the completions request. + /// The total number of tokens processed for the completions request and response. + /// Details of the prompt tokens. + /// Breakdown of tokens used in a completion. + /// A new instance for mocking. + public static CompletionsUsage CompletionsUsage(int completionTokens = default, int promptTokens = default, int totalTokens = default, CompletionsUsagePromptTokensDetails promptTokensDetails = null, CompletionsUsageCompletionTokensDetails completionTokensDetails = null) + { + return new CompletionsUsage( + completionTokens, + promptTokens, + totalTokens, + promptTokensDetails, + completionTokensDetails, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The number of cached prompt tokens. + /// A new instance for mocking. + public static CompletionsUsagePromptTokensDetails CompletionsUsagePromptTokensDetails(int? cachedTokens = null) + { + return new CompletionsUsagePromptTokensDetails(cachedTokens, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Tokens generated by the model for reasoning. + /// A new instance for mocking. + public static CompletionsUsageCompletionTokensDetails CompletionsUsageCompletionTokensDetails(int? reasoningTokens = null) + { + return new CompletionsUsageCompletionTokensDetails(reasoningTokens, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The contents of the system message. + /// An optional name for the participant. + /// A new instance for mocking. + public static ChatRequestSystemMessage ChatRequestSystemMessage(BinaryData content = null, string name = null) + { + return new ChatRequestSystemMessage(ChatRole.System, serializedAdditionalRawData: null, content, name); + } + + /// Initializes a new instance of . + /// The content of the message. + /// A new instance for mocking. + public static ChatMessageTextContentItem ChatMessageTextContentItem(string text = null) + { + return new ChatMessageTextContentItem("text", serializedAdditionalRawData: null, text); + } + + /// Initializes a new instance of . + /// The refusal message. + /// A new instance for mocking. + public static ChatMessageRefusalContentItem ChatMessageRefusalContentItem(string refusal = null) + { + return new ChatMessageRefusalContentItem("refusal", serializedAdditionalRawData: null, refusal); + } + + /// Initializes a new instance of . + /// An internet location, which must be accessible to the model,from which the image may be retrieved. + /// A new instance for mocking. + public static ChatMessageImageContentItem ChatMessageImageContentItem(ChatMessageImageUrl imageUrl = null) + { + return new ChatMessageImageContentItem("image_url", serializedAdditionalRawData: null, imageUrl); + } + + /// Initializes a new instance of . + /// The URL of the image. + /// + /// The evaluation quality setting to use, which controls relative prioritization of speed, token consumption, and + /// accuracy. + /// + /// A new instance for mocking. + public static ChatMessageImageUrl ChatMessageImageUrl(Uri url = null, ChatMessageImageDetailLevel? detail = null) + { + return new ChatMessageImageUrl(url, detail, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The contents of the user message, with available input types varying by selected model. + /// An optional name for the participant. + /// A new instance for mocking. + public static ChatRequestUserMessage ChatRequestUserMessage(BinaryData content = null, string name = null) + { + return new ChatRequestUserMessage(ChatRole.User, serializedAdditionalRawData: null, content, name); + } + + /// Initializes a new instance of . + /// The content of the message. + /// An optional name for the participant. + /// + /// The tool calls that must be resolved and have their outputs appended to subsequent input messages for the chat + /// completions request to resolve as configured. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + /// + /// The function call that must be resolved and have its output appended to subsequent input messages for the chat + /// completions request to resolve as configured. + /// + /// The refusal message by the assistant. + /// A new instance for mocking. + public static ChatRequestAssistantMessage ChatRequestAssistantMessage(BinaryData content = null, string name = null, IEnumerable toolCalls = null, FunctionCall functionCall = null, string refusal = null) + { + toolCalls ??= new List(); + + return new ChatRequestAssistantMessage( + ChatRole.Assistant, + serializedAdditionalRawData: null, + content, + name, + toolCalls?.ToList(), + functionCall, + refusal); + } + + /// Initializes a new instance of . + /// The content of the message. + /// The ID of the tool call resolved by the provided content. + /// A new instance for mocking. + public static ChatRequestToolMessage ChatRequestToolMessage(BinaryData content = null, string toolCallId = null) + { + return new ChatRequestToolMessage(ChatRole.Tool, serializedAdditionalRawData: null, content, toolCallId); + } + + /// Initializes a new instance of . + /// The name of the function that was called to produce output. + /// The output of the function as requested by the function call. + /// A new instance for mocking. + public static ChatRequestFunctionMessage ChatRequestFunctionMessage(string name = null, string content = null) + { + return new ChatRequestFunctionMessage(ChatRole.Function, serializedAdditionalRawData: null, name, content); + } + + /// Initializes a new instance of . + /// The name of the function to be called. + /// + /// A description of what the function does. The model will use this description when selecting the function and + /// interpreting its parameters. + /// + /// The parameters the function accepts, described as a JSON Schema object. + /// A new instance for mocking. + public static FunctionDefinition FunctionDefinition(string name = null, string description = null, BinaryData parameters = null) + { + return new FunctionDefinition(name, description, parameters, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The parameters to use when configuring Azure Search. + /// A new instance for mocking. + public static AzureSearchChatExtensionConfiguration AzureSearchChatExtensionConfiguration(AzureSearchChatExtensionParameters parameters = null) + { + return new AzureSearchChatExtensionConfiguration(AzureChatExtensionType.AzureSearch, serializedAdditionalRawData: null, parameters); + } + + /// Initializes a new instance of . + /// The configured top number of documents to feature for the configured query. + /// Whether queries should be restricted to use of indexed data. + /// The configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but lower recall of the answer. + /// + /// The max number of rewritten queries should be send to search provider for one user message. If not specified, + /// the system will decide the number of queries to send. + /// + /// + /// If specified as true, the system will allow partial search results to be used and the request fails if all the queries fail. + /// If not specified, or specified as false, the request will fail if any search query fails. + /// + /// The included properties of the output context. If not specified, the default value is `citations` and `intent`. + /// + /// The authentication method to use when accessing the defined data source. + /// Each data source type supports a specific set of available authentication methods; please see the documentation of + /// the data source for supported mechanisms. + /// If not otherwise provided, On Your Data will attempt to use System Managed Identity (default credential) + /// authentication. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , and . + /// + /// The absolute endpoint path for the Azure Cognitive Search resource to use. + /// The name of the index to use as available in the referenced Azure Cognitive Search resource. + /// Customized field mapping behavior to use when interacting with the search index. + /// The query type to use with Azure Cognitive Search. + /// The additional semantic configuration for the query. + /// Search filter. + /// + /// The embedding dependency for vector search. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + /// A new instance for mocking. + public static AzureSearchChatExtensionParameters AzureSearchChatExtensionParameters(int? documentCount = null, bool? shouldRestrictResultScope = null, int? strictness = null, int? maxSearchQueries = null, bool? allowPartialResult = null, IEnumerable includeContexts = null, OnYourDataAuthenticationOptions authentication = null, Uri searchEndpoint = null, string indexName = null, AzureSearchIndexFieldMappingOptions fieldMappingOptions = null, AzureSearchQueryType? queryType = null, string semanticConfiguration = null, string filter = null, OnYourDataVectorizationSource embeddingDependency = null) + { + includeContexts ??= new List(); + + return new AzureSearchChatExtensionParameters( + documentCount, + shouldRestrictResultScope, + strictness, + maxSearchQueries, + allowPartialResult, + includeContexts?.ToList(), + authentication, + searchEndpoint, + indexName, + fieldMappingOptions, + queryType, + semanticConfiguration, + filter, + embeddingDependency, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The API key to use for authentication. + /// A new instance for mocking. + public static OnYourDataApiKeyAuthenticationOptions OnYourDataApiKeyAuthenticationOptions(string key = null) + { + return new OnYourDataApiKeyAuthenticationOptions(OnYourDataAuthenticationType.ApiKey, serializedAdditionalRawData: null, key); + } + + /// Initializes a new instance of . + /// The connection string to use for authentication. + /// A new instance for mocking. + public static OnYourDataConnectionStringAuthenticationOptions OnYourDataConnectionStringAuthenticationOptions(string connectionString = null) + { + return new OnYourDataConnectionStringAuthenticationOptions(OnYourDataAuthenticationType.ConnectionString, serializedAdditionalRawData: null, connectionString); + } + + /// Initializes a new instance of . + /// The key to use for authentication. + /// The key ID to use for authentication. + /// A new instance for mocking. + public static OnYourDataKeyAndKeyIdAuthenticationOptions OnYourDataKeyAndKeyIdAuthenticationOptions(string key = null, string keyId = null) + { + return new OnYourDataKeyAndKeyIdAuthenticationOptions(OnYourDataAuthenticationType.KeyAndKeyId, serializedAdditionalRawData: null, key, keyId); + } + + /// Initializes a new instance of . + /// The encoded API key to use for authentication. + /// A new instance for mocking. + public static OnYourDataEncodedApiKeyAuthenticationOptions OnYourDataEncodedApiKeyAuthenticationOptions(string encodedApiKey = null) + { + return new OnYourDataEncodedApiKeyAuthenticationOptions(OnYourDataAuthenticationType.EncodedApiKey, serializedAdditionalRawData: null, encodedApiKey); + } + + /// Initializes a new instance of . + /// The username. + /// The password. + /// A new instance for mocking. + public static OnYourDataUsernameAndPasswordAuthenticationOptions OnYourDataUsernameAndPasswordAuthenticationOptions(string username = null, string password = null) + { + return new OnYourDataUsernameAndPasswordAuthenticationOptions(OnYourDataAuthenticationType.UsernameAndPassword, serializedAdditionalRawData: null, username, password); + } + + /// Initializes a new instance of . + /// The access token to use for authentication. + /// A new instance for mocking. + public static OnYourDataAccessTokenAuthenticationOptions OnYourDataAccessTokenAuthenticationOptions(string accessToken = null) + { + return new OnYourDataAccessTokenAuthenticationOptions(OnYourDataAuthenticationType.AccessToken, serializedAdditionalRawData: null, accessToken); + } + + /// Initializes a new instance of . + /// The resource ID of the user-assigned managed identity to use for authentication. + /// A new instance for mocking. + public static OnYourDataUserAssignedManagedIdentityAuthenticationOptions OnYourDataUserAssignedManagedIdentityAuthenticationOptions(string managedIdentityResourceId = null) + { + return new OnYourDataUserAssignedManagedIdentityAuthenticationOptions(OnYourDataAuthenticationType.UserAssignedManagedIdentity, serializedAdditionalRawData: null, managedIdentityResourceId); + } + + /// Initializes a new instance of . + /// Specifies the resource endpoint URL from which embeddings should be retrieved. It should be in the format of https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/embeddings. The api-version query parameter is not allowed. + /// + /// Specifies the authentication options to use when retrieving embeddings from the specified endpoint. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// A new instance for mocking. + public static OnYourDataEndpointVectorizationSource OnYourDataEndpointVectorizationSource(Uri endpoint = null, OnYourDataVectorSearchAuthenticationOptions authentication = null) + { + return new OnYourDataEndpointVectorizationSource(OnYourDataVectorizationSourceType.Endpoint, serializedAdditionalRawData: null, endpoint, authentication); + } + + /// Initializes a new instance of . + /// The API key to use for authentication. + /// A new instance for mocking. + public static OnYourDataVectorSearchApiKeyAuthenticationOptions OnYourDataVectorSearchApiKeyAuthenticationOptions(string key = null) + { + return new OnYourDataVectorSearchApiKeyAuthenticationOptions(OnYourDataVectorSearchAuthenticationType.ApiKey, serializedAdditionalRawData: null, key); + } + + /// Initializes a new instance of . + /// The access token to use for authentication. + /// A new instance for mocking. + public static OnYourDataVectorSearchAccessTokenAuthenticationOptions OnYourDataVectorSearchAccessTokenAuthenticationOptions(string accessToken = null) + { + return new OnYourDataVectorSearchAccessTokenAuthenticationOptions(OnYourDataVectorSearchAuthenticationType.AccessToken, serializedAdditionalRawData: null, accessToken); + } + + /// Initializes a new instance of . + /// The embedding model deployment name within the same Azure OpenAI resource. This enables you to use vector search without Azure OpenAI api-key and without Azure OpenAI public network access. + /// The number of dimensions the embeddings should have. Only supported in `text-embedding-3` and later models. + /// A new instance for mocking. + public static OnYourDataDeploymentNameVectorizationSource OnYourDataDeploymentNameVectorizationSource(string deploymentName = null, int? dimensions = null) + { + return new OnYourDataDeploymentNameVectorizationSource(OnYourDataVectorizationSourceType.DeploymentName, serializedAdditionalRawData: null, deploymentName, dimensions); + } + + /// Initializes a new instance of . + /// The embedding model ID build inside the search service. Currently only supported by Elasticsearch®. + /// A new instance for mocking. + public static OnYourDataModelIdVectorizationSource OnYourDataModelIdVectorizationSource(string modelId = null) + { + return new OnYourDataModelIdVectorizationSource(OnYourDataVectorizationSourceType.ModelId, serializedAdditionalRawData: null, modelId); + } + + /// Initializes a new instance of . + /// The parameters to use when configuring Azure OpenAI CosmosDB chat extensions. + /// A new instance for mocking. + public static AzureCosmosDBChatExtensionConfiguration AzureCosmosDBChatExtensionConfiguration(AzureCosmosDBChatExtensionParameters parameters = null) + { + return new AzureCosmosDBChatExtensionConfiguration(AzureChatExtensionType.AzureCosmosDB, serializedAdditionalRawData: null, parameters); + } + + /// Initializes a new instance of . + /// The configured top number of documents to feature for the configured query. + /// Whether queries should be restricted to use of indexed data. + /// The configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but lower recall of the answer. + /// + /// The max number of rewritten queries should be send to search provider for one user message. If not specified, + /// the system will decide the number of queries to send. + /// + /// + /// If specified as true, the system will allow partial search results to be used and the request fails if all the queries fail. + /// If not specified, or specified as false, the request will fail if any search query fails. + /// + /// The included properties of the output context. If not specified, the default value is `citations` and `intent`. + /// + /// The authentication method to use when accessing the defined data source. + /// Each data source type supports a specific set of available authentication methods; please see the documentation of + /// the data source for supported mechanisms. + /// If not otherwise provided, On Your Data will attempt to use System Managed Identity (default credential) + /// authentication. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , and . + /// + /// The MongoDB vCore database name to use with Azure Cosmos DB. + /// The name of the Azure Cosmos DB resource container. + /// The MongoDB vCore index name to use with Azure Cosmos DB. + /// Customized field mapping behavior to use when interacting with the search index. + /// + /// The embedding dependency for vector search. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + /// A new instance for mocking. + public static AzureCosmosDBChatExtensionParameters AzureCosmosDBChatExtensionParameters(int? documentCount = null, bool? shouldRestrictResultScope = null, int? strictness = null, int? maxSearchQueries = null, bool? allowPartialResult = null, IEnumerable includeContexts = null, OnYourDataAuthenticationOptions authentication = null, string databaseName = null, string containerName = null, string indexName = null, AzureCosmosDBFieldMappingOptions fieldMappingOptions = null, OnYourDataVectorizationSource embeddingDependency = null) + { + includeContexts ??= new List(); + + return new AzureCosmosDBChatExtensionParameters( + documentCount, + shouldRestrictResultScope, + strictness, + maxSearchQueries, + allowPartialResult, + includeContexts?.ToList(), + authentication, + databaseName, + containerName, + indexName, + fieldMappingOptions, + embeddingDependency, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The parameters to use when configuring Elasticsearch®. + /// A new instance for mocking. + public static ElasticsearchChatExtensionConfiguration ElasticsearchChatExtensionConfiguration(ElasticsearchChatExtensionParameters parameters = null) + { + return new ElasticsearchChatExtensionConfiguration(AzureChatExtensionType.Elasticsearch, serializedAdditionalRawData: null, parameters); + } + + /// Initializes a new instance of . + /// The configured top number of documents to feature for the configured query. + /// Whether queries should be restricted to use of indexed data. + /// The configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but lower recall of the answer. + /// + /// The max number of rewritten queries should be send to search provider for one user message. If not specified, + /// the system will decide the number of queries to send. + /// + /// + /// If specified as true, the system will allow partial search results to be used and the request fails if all the queries fail. + /// If not specified, or specified as false, the request will fail if any search query fails. + /// + /// The included properties of the output context. If not specified, the default value is `citations` and `intent`. + /// + /// The authentication method to use when accessing the defined data source. + /// Each data source type supports a specific set of available authentication methods; please see the documentation of + /// the data source for supported mechanisms. + /// If not otherwise provided, On Your Data will attempt to use System Managed Identity (default credential) + /// authentication. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , and . + /// + /// The endpoint of Elasticsearch®. + /// The index name of Elasticsearch®. + /// The index field mapping options of Elasticsearch®. + /// The query type of Elasticsearch®. + /// + /// The embedding dependency for vector search. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + /// A new instance for mocking. + public static ElasticsearchChatExtensionParameters ElasticsearchChatExtensionParameters(int? documentCount = null, bool? shouldRestrictResultScope = null, int? strictness = null, int? maxSearchQueries = null, bool? allowPartialResult = null, IEnumerable includeContexts = null, OnYourDataAuthenticationOptions authentication = null, Uri endpoint = null, string indexName = null, ElasticsearchIndexFieldMappingOptions fieldMappingOptions = null, ElasticsearchQueryType? queryType = null, OnYourDataVectorizationSource embeddingDependency = null) + { + includeContexts ??= new List(); + + return new ElasticsearchChatExtensionParameters( + documentCount, + shouldRestrictResultScope, + strictness, + maxSearchQueries, + allowPartialResult, + includeContexts?.ToList(), + authentication, + endpoint, + indexName, + fieldMappingOptions, + queryType, + embeddingDependency, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The parameters for the MongoDB chat extension. + /// A new instance for mocking. + public static MongoDBChatExtensionConfiguration MongoDBChatExtensionConfiguration(MongoDBChatExtensionParameters parameters = null) + { + return new MongoDBChatExtensionConfiguration(AzureChatExtensionType.MongoDB, serializedAdditionalRawData: null, parameters); + } + + /// Initializes a new instance of . + /// The configured top number of documents to feature for the configured query. + /// Whether queries should be restricted to use of indexed data. + /// The configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but lower recall of the answer. + /// + /// The max number of rewritten queries should be send to search provider for one user message. If not specified, + /// the system will decide the number of queries to send. + /// + /// + /// If specified as true, the system will allow partial search results to be used and the request fails if all the queries fail. + /// If not specified, or specified as false, the request will fail if any search query fails. + /// + /// The included properties of the output context. If not specified, the default value is `citations` and `intent`. + /// + /// The authentication method to use when accessing the defined data source. + /// Each data source type supports a specific set of available authentication methods; please see the documentation of + /// the data source for supported mechanisms. + /// If not otherwise provided, On Your Data will attempt to use System Managed Identity (default credential) + /// authentication. + /// + /// The endpoint name for MongoDB. + /// The collection name for MongoDB. + /// The database name for MongoDB. + /// The app name for MongoDB. + /// The name of the MongoDB index. + /// + /// Field mappings to apply to data used by the MongoDB data source. + /// Note that content and vector field mappings are required for MongoDB. + /// + /// The vectorization source to use with the MongoDB chat extension. + /// A new instance for mocking. + public static MongoDBChatExtensionParameters MongoDBChatExtensionParameters(int? documentCount = null, bool? shouldRestrictResultScope = null, int? strictness = null, int? maxSearchQueries = null, bool? allowPartialResult = null, IEnumerable includeContexts = null, OnYourDataUsernameAndPasswordAuthenticationOptions authentication = null, string endpoint = null, string collectionName = null, string databaseName = null, string appName = null, string indexName = null, MongoDBChatExtensionParametersFieldsMapping fieldsMapping = null, BinaryData embeddingDependency = null) + { + includeContexts ??= new List(); + + return new MongoDBChatExtensionParameters( + documentCount, + shouldRestrictResultScope, + strictness, + maxSearchQueries, + allowPartialResult, + includeContexts?.ToList(), + authentication, + endpoint, + collectionName, + databaseName, + appName, + indexName, + fieldsMapping, + embeddingDependency, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The parameters to use when configuring Azure OpenAI chat extensions. + /// A new instance for mocking. + public static PineconeChatExtensionConfiguration PineconeChatExtensionConfiguration(PineconeChatExtensionParameters parameters = null) + { + return new PineconeChatExtensionConfiguration(AzureChatExtensionType.Pinecone, serializedAdditionalRawData: null, parameters); + } + + /// Initializes a new instance of . + /// The configured top number of documents to feature for the configured query. + /// Whether queries should be restricted to use of indexed data. + /// The configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but lower recall of the answer. + /// + /// The max number of rewritten queries should be send to search provider for one user message. If not specified, + /// the system will decide the number of queries to send. + /// + /// + /// If specified as true, the system will allow partial search results to be used and the request fails if all the queries fail. + /// If not specified, or specified as false, the request will fail if any search query fails. + /// + /// The included properties of the output context. If not specified, the default value is `citations` and `intent`. + /// + /// The authentication method to use when accessing the defined data source. + /// Each data source type supports a specific set of available authentication methods; please see the documentation of + /// the data source for supported mechanisms. + /// If not otherwise provided, On Your Data will attempt to use System Managed Identity (default credential) + /// authentication. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , and . + /// + /// The environment name of Pinecone. + /// The name of the Pinecone database index. + /// Customized field mapping behavior to use when interacting with the search index. + /// + /// The embedding dependency for vector search. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + /// A new instance for mocking. + public static PineconeChatExtensionParameters PineconeChatExtensionParameters(int? documentCount = null, bool? shouldRestrictResultScope = null, int? strictness = null, int? maxSearchQueries = null, bool? allowPartialResult = null, IEnumerable includeContexts = null, OnYourDataAuthenticationOptions authentication = null, string environmentName = null, string indexName = null, PineconeFieldMappingOptions fieldMappingOptions = null, OnYourDataVectorizationSource embeddingDependency = null) + { + includeContexts ??= new List(); + + return new PineconeChatExtensionParameters( + documentCount, + shouldRestrictResultScope, + strictness, + maxSearchQueries, + allowPartialResult, + includeContexts?.ToList(), + authentication, + environmentName, + indexName, + fieldMappingOptions, + embeddingDependency, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// A new instance for mocking. + public static ChatCompletionsJsonSchemaResponseFormat ChatCompletionsJsonSchemaResponseFormat(ChatCompletionsJsonSchemaResponseFormatJsonSchema jsonSchema = null) + { + return new ChatCompletionsJsonSchemaResponseFormat("json_schema", serializedAdditionalRawData: null, jsonSchema); + } + + /// Initializes a new instance of . + /// A description of what the response format is for, used by the model to determine how to respond in the format. + /// The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. + /// + /// Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is `true`. To learn more, read the [Structured Outputs guide](/docs/guides/structured-outputs). + /// A new instance for mocking. + public static ChatCompletionsJsonSchemaResponseFormatJsonSchema ChatCompletionsJsonSchemaResponseFormatJsonSchema(string description = null, string name = null, BinaryData schema = null, bool? strict = null) + { + return new ChatCompletionsJsonSchemaResponseFormatJsonSchema(description, name, schema, strict, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The function definition details for the function tool. + /// A new instance for mocking. + public static ChatCompletionsFunctionToolDefinition ChatCompletionsFunctionToolDefinition(ChatCompletionsFunctionToolDefinitionFunction function = null) + { + return new ChatCompletionsFunctionToolDefinition("function", serializedAdditionalRawData: null, function); + } + + /// Initializes a new instance of . + /// A description of what the function does, used by the model to choose when and how to call the function. + /// The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. + /// + /// Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](docs/guides/function-calling). + /// A new instance for mocking. + public static ChatCompletionsFunctionToolDefinitionFunction ChatCompletionsFunctionToolDefinitionFunction(string description = null, string name = null, BinaryData parameters = null, bool? strict = null) + { + return new ChatCompletionsFunctionToolDefinitionFunction(description, name, parameters, strict, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The function that should be called. + /// A new instance for mocking. + public static ChatCompletionsNamedFunctionToolSelection ChatCompletionsNamedFunctionToolSelection(ChatCompletionsFunctionToolSelection function = null) + { + return new ChatCompletionsNamedFunctionToolSelection("function", serializedAdditionalRawData: null, function); + } + + /// Initializes a new instance of . + /// A unique identifier associated with this chat completions response. + /// + /// The first timestamp associated with generation activity for this completions response, + /// represented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970. + /// + /// + /// The collection of completions choices associated with this completions response. + /// Generally, `n` choices are generated per provided prompt with a default value of 1. + /// Token limits and other settings may limit the number of choices generated. + /// + /// The model name used for this completions request. + /// + /// Content filtering results for zero or more prompts in the request. In a streaming request, + /// results for different prompts may arrive at different times or in different orders. + /// + /// + /// Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that + /// might impact determinism. + /// + /// Usage information for tokens processed and generated as part of this completions operation. + /// A new instance for mocking. + public static ChatCompletions ChatCompletions(string id = null, DateTimeOffset created = default, IEnumerable choices = null, string model = null, IEnumerable promptFilterResults = null, string systemFingerprint = null, CompletionsUsage usage = null) + { + choices ??= new List(); + promptFilterResults ??= new List(); + + return new ChatCompletions( + id, + created, + choices?.ToList(), + model, + promptFilterResults?.ToList(), + systemFingerprint, + usage, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The chat message for a given chat completions prompt. + /// The log probability information for this choice, as enabled via the 'logprobs' request option. + /// The ordered index associated with this chat completions choice. + /// The reason that this chat completions choice completed its generated. + /// The delta message content for a streaming response. + /// + /// Information about the content filtering category (hate, sexual, violence, self_harm), if it + /// has been detected, as well as the severity level (very_low, low, medium, high-scale that + /// determines the intensity and risk level of harmful content) and if it has been filtered or not. + /// + /// + /// Represents the output results of Azure OpenAI enhancements to chat completions, as configured via the matching input + /// provided in the request. This supplementary information is only available when using Azure OpenAI and only when the + /// request is configured to use enhancements. + /// + /// A new instance for mocking. + public static ChatChoice ChatChoice(ChatResponseMessage message = null, ChatChoiceLogProbabilityInfo logProbabilityInfo = null, int index = default, CompletionsFinishReason? finishReason = null, ChatResponseMessage internalStreamingDeltaMessage = null, ContentFilterResultsForChoice contentFilterResults = null, AzureChatEnhancements enhancements = null) + { + return new ChatChoice( + message, + logProbabilityInfo, + index, + finishReason, + internalStreamingDeltaMessage, + contentFilterResults, + enhancements, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The chat role associated with the message. + /// The refusal message generated by the model. + /// The content of the message. + /// + /// The tool calls that must be resolved and have their outputs appended to subsequent input messages for the chat + /// completions request to resolve as configured. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + /// + /// The function call that must be resolved and have its output appended to subsequent input messages for the chat + /// completions request to resolve as configured. + /// + /// + /// If Azure OpenAI chat extensions are configured, this array represents the incremental steps performed by those + /// extensions while processing the chat completions request. + /// + /// A new instance for mocking. + public static ChatResponseMessage ChatResponseMessage(ChatRole role = default, string refusal = null, string content = null, IEnumerable toolCalls = null, FunctionCall functionCall = null, AzureChatExtensionsMessageContext azureExtensionsContext = null) + { + toolCalls ??= new List(); + + return new ChatResponseMessage( + role, + refusal, + content, + toolCalls?.ToList(), + functionCall, + azureExtensionsContext, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// The contextual information associated with the Azure chat extensions used for a chat completions request. + /// These messages describe the data source retrievals, plugin invocations, and other intermediate steps taken in the + /// course of generating a chat completions response that was augmented by capabilities from Azure OpenAI chat + /// extensions. + /// + /// The detected intent from the chat history, used to pass to the next turn to carry over the context. + /// All the retrieved documents. + /// A new instance for mocking. + public static AzureChatExtensionsMessageContext AzureChatExtensionsMessageContext(IEnumerable citations = null, string intent = null, IEnumerable allRetrievedDocuments = null) + { + citations ??= new List(); + allRetrievedDocuments ??= new List(); + + return new AzureChatExtensionsMessageContext(citations?.ToList(), intent, allRetrievedDocuments?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The content of the citation. + /// The title of the citation. + /// The URL of the citation. + /// The file path of the citation. + /// The chunk ID of the citation. + /// The rerank score of the retrieved document. + /// A new instance for mocking. + public static AzureChatExtensionDataSourceResponseCitation AzureChatExtensionDataSourceResponseCitation(string content = null, string title = null, string url = null, string filepath = null, string chunkId = null, double? rerankScore = null) + { + return new AzureChatExtensionDataSourceResponseCitation( + content, + title, + url, + filepath, + chunkId, + rerankScore, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The content of the citation. + /// The title of the citation. + /// The URL of the citation. + /// The file path of the citation. + /// The chunk ID of the citation. + /// The rerank score of the retrieved document. + /// The search queries used to retrieve the document. + /// The index of the data source. + /// The original search score of the retrieved document. + /// + /// Represents the rationale for filtering the document. If the document does not undergo filtering, + /// this field will remain unset. + /// + /// A new instance for mocking. + public static AzureChatExtensionRetrievedDocument AzureChatExtensionRetrievedDocument(string content = null, string title = null, string url = null, string filepath = null, string chunkId = null, double? rerankScore = null, IEnumerable searchQueries = null, int dataSourceIndex = default, double? originalSearchScore = null, AzureChatExtensionRetrieveDocumentFilterReason? filterReason = null) + { + searchQueries ??= new List(); + + return new AzureChatExtensionRetrievedDocument( + content, + title, + url, + filepath, + chunkId, + rerankScore, + searchQueries?.ToList(), + dataSourceIndex, + originalSearchScore, + filterReason, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The list of log probability information entries for the choice's message content tokens, as requested via the 'logprobs' option. + /// The list of log probability information entries for the choice's message refusal message tokens, as requested via the 'logprobs' option. + /// A new instance for mocking. + public static ChatChoiceLogProbabilityInfo ChatChoiceLogProbabilityInfo(IEnumerable tokenLogProbabilityResults = null, IEnumerable refusal = null) + { + tokenLogProbabilityResults ??= new List(); + refusal ??= new List(); + + return new ChatChoiceLogProbabilityInfo(tokenLogProbabilityResults?.ToList(), refusal?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The message content token. + /// The log probability of the message content token. + /// A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be null if there is no bytes representation for the token. + /// The list of most likely tokens and their log probability information, as requested via 'top_logprobs'. + /// A new instance for mocking. + public static ChatTokenLogProbabilityResult ChatTokenLogProbabilityResult(string token = null, float logProbability = default, IEnumerable utf8ByteValues = null, IEnumerable topLogProbabilityEntries = null) + { + utf8ByteValues ??= new List(); + topLogProbabilityEntries ??= new List(); + + return new ChatTokenLogProbabilityResult(token, logProbability, utf8ByteValues?.ToList(), topLogProbabilityEntries?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The message content token. + /// The log probability of the message content token. + /// A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be null if there is no bytes representation for the token. + /// A new instance for mocking. + public static ChatTokenLogProbabilityInfo ChatTokenLogProbabilityInfo(string token = null, float logProbability = default, IEnumerable utf8ByteValues = null) + { + utf8ByteValues ??= new List(); + + return new ChatTokenLogProbabilityInfo(token, logProbability, utf8ByteValues?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The grounding enhancement that returns the bounding box of the objects detected in the image. + /// A new instance for mocking. + public static AzureChatEnhancements AzureChatEnhancements(AzureGroundingEnhancement grounding = null) + { + return new AzureChatEnhancements(grounding, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The lines of text detected by the grounding enhancement. + /// A new instance for mocking. + public static AzureGroundingEnhancement AzureGroundingEnhancement(IEnumerable lines = null) + { + lines ??= new List(); + + return new AzureGroundingEnhancement(lines?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The text within the line. + /// An array of spans that represent detected objects and its bounding box information. + /// A new instance for mocking. + public static AzureGroundingEnhancementLine AzureGroundingEnhancementLine(string text = null, IEnumerable spans = null) + { + spans ??= new List(); + + return new AzureGroundingEnhancementLine(text, spans?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The text content of the span that represents the detected object. + /// + /// The character offset within the text where the span begins. This offset is defined as the position of the first + /// character of the span, counting from the start of the text as Unicode codepoints. + /// + /// The length of the span in characters, measured in Unicode codepoints. + /// An array of objects representing points in the polygon that encloses the detected object. + /// A new instance for mocking. + public static AzureGroundingEnhancementLineSpan AzureGroundingEnhancementLineSpan(string text = null, int offset = default, int length = default, IEnumerable polygon = null) + { + polygon ??= new List(); + + return new AzureGroundingEnhancementLineSpan(text, offset, length, polygon?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The x-coordinate (horizontal axis) of the point. + /// The y-coordinate (vertical axis) of the point. + /// A new instance for mocking. + public static AzureGroundingEnhancementCoordinatePoint AzureGroundingEnhancementCoordinatePoint(float x = default, float y = default) + { + return new AzureGroundingEnhancementCoordinatePoint(x, y, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// A timestamp representing when this operation was started. + /// Expressed in seconds since the Unix epoch of 1970-01-01T00:00:00+0000. + /// + /// The images generated by the operation. + /// A new instance for mocking. + public static ImageGenerations ImageGenerations(DateTimeOffset created = default, IEnumerable data = null) + { + data ??= new List(); + + return new ImageGenerations(created, data?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The URL that provides temporary access to download the generated image. + /// The complete data for an image, represented as a base64-encoded string. + /// Information about the content filtering results. + /// + /// The final prompt used by the model to generate the image. + /// Only provided with dall-3-models and only when revisions were made to the prompt. + /// + /// + /// Information about the content filtering category (hate, sexual, violence, self_harm), if + /// it has been detected, as well as the severity level (very_low, low, medium, high-scale + /// that determines the intensity and risk level of harmful content) and if it has been + /// filtered or not. Information about jailbreak content and profanity, if it has been detected, + /// and if it has been filtered or not. And information about customer block list, if it has + /// been filtered and its id. + /// + /// A new instance for mocking. + public static ImageGenerationData ImageGenerationData(Uri url = null, string base64Data = null, ImageGenerationContentFilterResults contentFilterResults = null, string revisedPrompt = null, ImageGenerationPromptFilterResults promptFilterResults = null) + { + return new ImageGenerationData( + url, + base64Data, + contentFilterResults, + revisedPrompt, + promptFilterResults, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// Describes language related to anatomical organs and genitals, romantic relationships, + /// acts portrayed in erotic or affectionate terms, physical sexual acts, including + /// those portrayed as an assault or a forced sexual violent act against one’s will, + /// prostitution, pornography, and abuse. + /// + /// + /// Describes language related to physical actions intended to hurt, injure, damage, or + /// kill someone or something; describes weapons, etc. + /// + /// + /// Describes language attacks or uses that include pejorative or discriminatory language + /// with reference to a person or identity group on the basis of certain differentiating + /// attributes of these groups including but not limited to race, ethnicity, nationality, + /// gender identity and expression, sexual orientation, religion, immigration status, ability + /// status, personal appearance, and body size. + /// + /// + /// Describes language related to physical actions intended to purposely hurt, injure, + /// or damage one’s body, or kill oneself. + /// + /// A new instance for mocking. + public static ImageGenerationContentFilterResults ImageGenerationContentFilterResults(ContentFilterResult sexual = null, ContentFilterResult violence = null, ContentFilterResult hate = null, ContentFilterResult selfHarm = null) + { + return new ImageGenerationContentFilterResults(sexual, violence, hate, selfHarm, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// Describes language related to anatomical organs and genitals, romantic relationships, + /// acts portrayed in erotic or affectionate terms, physical sexual acts, including + /// those portrayed as an assault or a forced sexual violent act against one’s will, + /// prostitution, pornography, and abuse. + /// + /// + /// Describes language related to physical actions intended to hurt, injure, damage, or + /// kill someone or something; describes weapons, etc. + /// + /// + /// Describes language attacks or uses that include pejorative or discriminatory language + /// with reference to a person or identity group on the basis of certain differentiating + /// attributes of these groups including but not limited to race, ethnicity, nationality, + /// gender identity and expression, sexual orientation, religion, immigration status, ability + /// status, personal appearance, and body size. + /// + /// + /// Describes language related to physical actions intended to purposely hurt, injure, + /// or damage one’s body, or kill oneself. + /// + /// Describes whether profanity was detected. + /// Whether a jailbreak attempt was detected in the prompt. + /// Information about customer block lists and if something was detected the associated list ID. + /// A new instance for mocking. + public static ImageGenerationPromptFilterResults ImageGenerationPromptFilterResults(ContentFilterResult sexual = null, ContentFilterResult violence = null, ContentFilterResult hate = null, ContentFilterResult selfHarm = null, ContentFilterDetectionResult profanity = null, ContentFilterDetectionResult jailbreak = null, ContentFilterDetailedResults customBlocklists = null) + { + return new ImageGenerationPromptFilterResults( + sexual, + violence, + hate, + selfHarm, + profanity, + jailbreak, + customBlocklists, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The text to generate audio for. The maximum length is 4096 characters. + /// The voice to use for text-to-speech. + /// The audio output format for the spoken text. By default, the MP3 format will be used. + /// The speed of speech for generated audio. Values are valid in the range from 0.25 to 4.0, with 1.0 the default and higher values corresponding to faster speech. + /// The model to use for this text-to-speech request. + /// A new instance for mocking. + public static SpeechGenerationOptions SpeechGenerationOptions(string input = null, SpeechVoice voice = default, SpeechGenerationResponseFormat? responseFormat = null, float? speed = null, string deploymentName = null) + { + return new SpeechGenerationOptions( + input, + voice, + responseFormat, + speed, + deploymentName, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The object type, which is always 'list'. + /// The files returned for the request. + /// A new instance for mocking. + public static FileListResponse FileListResponse(FileListResponseObject @object = default, IEnumerable data = null) + { + data ??= new List(); + + return new FileListResponse(@object, data?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The object type, which is always 'file'. + /// The identifier, which can be referenced in API endpoints. + /// The size of the file, in bytes. + /// The name of the file. + /// The Unix timestamp, in seconds, representing when this object was created. + /// The intended purpose of a file. + /// The state of the file. This field is available in Azure OpenAI only. + /// The error message with details in case processing of this file failed. This field is available in Azure OpenAI only. + /// A new instance for mocking. + public static OpenAIFile OpenAIFile(OpenAIFileObject @object = default, string id = null, int bytes = default, string filename = null, DateTimeOffset createdAt = default, FilePurpose purpose = default, FileState? status = null, string statusDetails = null) + { + return new OpenAIFile( + @object, + id, + bytes, + filename, + createdAt, + purpose, + status, + statusDetails, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The ID of the resource specified for deletion. + /// A value indicating whether deletion was successful. + /// The object type, which is always 'file'. + /// A new instance for mocking. + public static FileDeletionStatus FileDeletionStatus(string id = null, bool deleted = default, FileDeletionStatusObject @object = default) + { + return new FileDeletionStatus(id, deleted, @object, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The object type, which is always list. + /// The requested list of items. + /// The first ID represented in this list. + /// The last ID represented in this list. + /// A value indicating whether there are additional values available not captured in this list. + /// A new instance for mocking. + public static OpenAIPageableListOfBatch OpenAIPageableListOfBatch(OpenAIPageableListOfBatchObject @object = default, IEnumerable data = null, string firstId = null, string lastId = null, bool? hasMore = null) + { + data ??= new List(); + + return new OpenAIPageableListOfBatch( + @object, + data?.ToList(), + firstId, + lastId, + hasMore, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The API endpoint used by the batch. + /// The ID of the input file for the batch. + /// The time frame within which the batch should be processed. + /// A set of key-value pairs that can be attached to the batch. This can be useful for storing additional information about the batch in a structured format. + /// A new instance for mocking. + public static BatchCreateRequest BatchCreateRequest(string endpoint = null, string inputFileId = null, string completionWindow = null, IDictionary metadata = null) + { + metadata ??= new Dictionary(); + + return new BatchCreateRequest(endpoint, inputFileId, completionWindow, metadata, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The Upload unique identifier, which can be referenced in API endpoints. + /// The Unix timestamp (in seconds) for when the Upload was created. + /// The name of the file to be uploaded. + /// The intended number of bytes to be uploaded. + /// The intended purpose of the file. + /// The status of the Upload. + /// The Unix timestamp (in seconds) for when the Upload was created. + /// The object type, which is always "upload". + /// The ready File object after the Upload is completed. + /// A new instance for mocking. + public static Upload Upload(string id = null, DateTimeOffset createdAt = default, string filename = null, long bytes = default, UploadPurpose purpose = default, UploadStatus status = default, DateTimeOffset expiresAt = default, UploadObject? @object = null, OpenAIFile file = null) + { + return new Upload( + id, + createdAt, + filename, + bytes, + purpose, + status, + expiresAt, + @object, + file, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The upload Part unique identifier, which can be referenced in API endpoints. + /// The Unix timestamp (in seconds) for when the Part was created. + /// The ID of the Upload object that this Part was added to. + /// The object type, which is always `upload.part`. + /// Azure only field. + /// A new instance for mocking. + public static UploadPart UploadPart(string id = null, DateTimeOffset createdAt = default, string uploadId = null, UploadPartObject @object = default, string azureBlockId = null) + { + return new UploadPart( + id, + createdAt, + uploadId, + @object, + azureBlockId, + serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AddUploadPartRequest.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AddUploadPartRequest.Serialization.cs new file mode 100644 index 000000000000..d89b6ce18330 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AddUploadPartRequest.Serialization.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class AddUploadPartRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AddUploadPartRequest)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("data"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(global::System.BinaryData.FromStream(Data)); +#else + using (JsonDocument document = JsonDocument.Parse(BinaryData.FromStream(Data))) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AddUploadPartRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AddUploadPartRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAddUploadPartRequest(document.RootElement, options); + } + + internal static AddUploadPartRequest DeserializeAddUploadPartRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Stream data = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("data"u8)) + { + data = BinaryData.FromString(property.Value.GetRawText()).ToStream(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AddUploadPartRequest(data, serializedAdditionalRawData); + } + + private BinaryData SerializeMultipart(ModelReaderWriterOptions options) + { + using MultipartFormDataRequestContent content = ToMultipartRequestContent(); + using MemoryStream stream = new MemoryStream(); + content.WriteTo(stream); + if (stream.Position > int.MaxValue) + { + return BinaryData.FromStream(stream); + } + else + { + return new BinaryData(stream.GetBuffer().AsMemory(0, (int)stream.Position)); + } + } + + internal virtual MultipartFormDataRequestContent ToMultipartRequestContent() + { + MultipartFormDataRequestContent content = new MultipartFormDataRequestContent(); + content.Add(Data, "data", "data", "application/octet-stream"); + return content; + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "MFD": + return SerializeMultipart(options); + default: + throw new FormatException($"The model {nameof(AddUploadPartRequest)} does not support writing '{options.Format}' format."); + } + } + + AddUploadPartRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAddUploadPartRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AddUploadPartRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "MFD"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AddUploadPartRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAddUploadPartRequest(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/openai/Azure.AI.OpenAI/src/Generated/AddUploadPartRequest.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AddUploadPartRequest.cs new file mode 100644 index 000000000000..9f8e672d50eb --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AddUploadPartRequest.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Azure.AI.OpenAI +{ + /// The multipart/form-data request body of a data part addition request for an upload. + public partial class AddUploadPartRequest + { + /// + /// 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; + + /// Initializes a new instance of . + /// The chunk of bytes for this Part. + /// is null. + public AddUploadPartRequest(Stream data) + { + Argument.AssertNotNull(data, nameof(data)); + + Data = data; + } + + /// Initializes a new instance of . + /// The chunk of bytes for this Part. + /// Keeps track of any properties unknown to the library. + internal AddUploadPartRequest(Stream data, IDictionary serializedAdditionalRawData) + { + Data = data; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AddUploadPartRequest() + { + } + + /// The chunk of bytes for this Part. + public Stream Data { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTaskLabel.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTaskLabel.cs new file mode 100644 index 000000000000..e4669cce267d --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTaskLabel.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// Defines the possible descriptors for available audio operation responses. + internal readonly partial struct AudioTaskLabel : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AudioTaskLabel(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string TranscribeValue = "transcribe"; + private const string TranslateValue = "translate"; + + /// Accompanying response data resulted from an audio transcription task. + public static AudioTaskLabel Transcribe { get; } = new AudioTaskLabel(TranscribeValue); + /// Accompanying response data resulted from an audio translation task. + public static AudioTaskLabel Translate { get; } = new AudioTaskLabel(TranslateValue); + /// Determines if two values are the same. + public static bool operator ==(AudioTaskLabel left, AudioTaskLabel right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AudioTaskLabel left, AudioTaskLabel right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AudioTaskLabel(string value) => new AudioTaskLabel(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AudioTaskLabel other && Equals(other); + /// + public bool Equals(AudioTaskLabel 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/openai/Azure.AI.OpenAI/src/Generated/AudioTranscription.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscription.Serialization.cs new file mode 100644 index 000000000000..d5d01c56896e --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscription.Serialization.cs @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class AudioTranscription : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AudioTranscription)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + if (Optional.IsDefined(InternalAudioTaskLabel)) + { + writer.WritePropertyName("task"u8); + writer.WriteStringValue(InternalAudioTaskLabel.Value.ToString()); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + if (Optional.IsDefined(Duration)) + { + writer.WritePropertyName("duration"u8); + writer.WriteNumberValue(Convert.ToDouble(Duration.Value.ToString("s\\.FFF"))); + } + if (Optional.IsCollectionDefined(Segments)) + { + writer.WritePropertyName("segments"u8); + writer.WriteStartArray(); + foreach (var item in Segments) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Words)) + { + writer.WritePropertyName("words"u8); + writer.WriteStartArray(); + foreach (var item in Words) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AudioTranscription IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AudioTranscription)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAudioTranscription(document.RootElement, options); + } + + internal static AudioTranscription DeserializeAudioTranscription(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string text = default; + AudioTaskLabel? task = default; + string language = default; + TimeSpan? duration = default; + IReadOnlyList segments = default; + IReadOnlyList words = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("task"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + task = new AudioTaskLabel(property.Value.GetString()); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("duration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + duration = TimeSpan.FromSeconds(property.Value.GetDouble()); + continue; + } + if (property.NameEquals("segments"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AudioTranscriptionSegment.DeserializeAudioTranscriptionSegment(item, options)); + } + segments = array; + continue; + } + if (property.NameEquals("words"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AudioTranscriptionWord.DeserializeAudioTranscriptionWord(item, options)); + } + words = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AudioTranscription( + text, + task, + language, + duration, + segments ?? new ChangeTrackingList(), + words ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AudioTranscription)} does not support writing '{options.Format}' format."); + } + } + + AudioTranscription IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAudioTranscription(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AudioTranscription)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AudioTranscription FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAudioTranscription(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/openai/Azure.AI.OpenAI/src/Generated/AudioTranscription.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscription.cs new file mode 100644 index 000000000000..af332f94ac50 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscription.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Result information for an operation that transcribed spoken audio into written text. + public partial class AudioTranscription + { + /// + /// 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; + + /// Initializes a new instance of . + /// The transcribed text for the provided audio data. + /// is null. + internal AudioTranscription(string text) + { + Argument.AssertNotNull(text, nameof(text)); + + Text = text; + Segments = new ChangeTrackingList(); + Words = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The transcribed text for the provided audio data. + /// The label that describes which operation type generated the accompanying response data. + /// + /// The spoken language that was detected in the transcribed audio data. + /// This is expressed as a two-letter ISO-639-1 language code like 'en' or 'fr'. + /// + /// The total duration of the audio processed to produce accompanying transcription information. + /// A collection of information about the timing, probabilities, and other detail of each processed audio segment. + /// A collection of information about the timing of each processed word. + /// Keeps track of any properties unknown to the library. + internal AudioTranscription(string text, AudioTaskLabel? internalAudioTaskLabel, string language, TimeSpan? duration, IReadOnlyList segments, IReadOnlyList words, IDictionary serializedAdditionalRawData) + { + Text = text; + InternalAudioTaskLabel = internalAudioTaskLabel; + Language = language; + Duration = duration; + Segments = segments; + Words = words; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AudioTranscription() + { + } + + /// The transcribed text for the provided audio data. + public string Text { get; } + /// The label that describes which operation type generated the accompanying response data. + public AudioTaskLabel? InternalAudioTaskLabel { get; } + /// + /// The spoken language that was detected in the transcribed audio data. + /// This is expressed as a two-letter ISO-639-1 language code like 'en' or 'fr'. + /// + public string Language { get; } + /// The total duration of the audio processed to produce accompanying transcription information. + public TimeSpan? Duration { get; } + /// A collection of information about the timing, probabilities, and other detail of each processed audio segment. + public IReadOnlyList Segments { get; } + /// A collection of information about the timing of each processed word. + public IReadOnlyList Words { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionFormat.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionFormat.cs new file mode 100644 index 000000000000..fc8228609c41 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionFormat.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// Defines available options for the underlying response format of output transcription information. + public readonly partial struct AudioTranscriptionFormat : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AudioTranscriptionFormat(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SimpleValue = "json"; + private const string VerboseValue = "verbose_json"; + private const string InternalPlainTextValue = "text"; + private const string SrtValue = "srt"; + private const string VttValue = "vtt"; + + /// Use a response body that is a JSON object containing a single 'text' field for the transcription. + public static AudioTranscriptionFormat Simple { get; } = new AudioTranscriptionFormat(SimpleValue); + /// + /// Use a response body that is a JSON object containing transcription text along with timing, segments, and other + /// metadata. + /// + public static AudioTranscriptionFormat Verbose { get; } = new AudioTranscriptionFormat(VerboseValue); + /// Use a response body that is plain text containing the raw, unannotated transcription. + public static AudioTranscriptionFormat InternalPlainText { get; } = new AudioTranscriptionFormat(InternalPlainTextValue); + /// Use a response body that is plain text in SubRip (SRT) format that also includes timing information. + public static AudioTranscriptionFormat Srt { get; } = new AudioTranscriptionFormat(SrtValue); + /// Use a response body that is plain text in Web Video Text Tracks (VTT) format that also includes timing information. + public static AudioTranscriptionFormat Vtt { get; } = new AudioTranscriptionFormat(VttValue); + /// Determines if two values are the same. + public static bool operator ==(AudioTranscriptionFormat left, AudioTranscriptionFormat right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AudioTranscriptionFormat left, AudioTranscriptionFormat right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AudioTranscriptionFormat(string value) => new AudioTranscriptionFormat(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AudioTranscriptionFormat other && Equals(other); + /// + public bool Equals(AudioTranscriptionFormat 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/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionOptions.Serialization.cs new file mode 100644 index 000000000000..35fde9f7347c --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionOptions.Serialization.cs @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class AudioTranscriptionOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AudioTranscriptionOptions)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("file"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(global::System.BinaryData.FromStream(AudioData)); +#else + using (JsonDocument document = JsonDocument.Parse(BinaryData.FromStream(AudioData))) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + if (Optional.IsDefined(Filename)) + { + writer.WritePropertyName("filename"u8); + writer.WriteStringValue(Filename); + } + if (Optional.IsDefined(ResponseFormat)) + { + writer.WritePropertyName("response_format"u8); + writer.WriteStringValue(ResponseFormat.Value.ToString()); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + if (Optional.IsDefined(Prompt)) + { + writer.WritePropertyName("prompt"u8); + writer.WriteStringValue(Prompt); + } + if (Optional.IsDefined(Temperature)) + { + writer.WritePropertyName("temperature"u8); + writer.WriteNumberValue(Temperature.Value); + } + if (Optional.IsCollectionDefined(TimestampGranularities)) + { + writer.WritePropertyName("timestamp_granularities"u8); + writer.WriteStartArray(); + foreach (var item in TimestampGranularities) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DeploymentName)) + { + writer.WritePropertyName("model"u8); + writer.WriteStringValue(DeploymentName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AudioTranscriptionOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AudioTranscriptionOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAudioTranscriptionOptions(document.RootElement, options); + } + + internal static AudioTranscriptionOptions DeserializeAudioTranscriptionOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Stream file = default; + string filename = default; + AudioTranscriptionFormat? responseFormat = default; + string language = default; + string prompt = default; + float? temperature = default; + IList timestampGranularities = default; + string model = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("file"u8)) + { + file = BinaryData.FromString(property.Value.GetRawText()).ToStream(); + continue; + } + if (property.NameEquals("filename"u8)) + { + filename = property.Value.GetString(); + continue; + } + if (property.NameEquals("response_format"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + responseFormat = new AudioTranscriptionFormat(property.Value.GetString()); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("prompt"u8)) + { + prompt = property.Value.GetString(); + continue; + } + if (property.NameEquals("temperature"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + temperature = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("timestamp_granularities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new AudioTranscriptionTimestampGranularity(item.GetString())); + } + timestampGranularities = array; + continue; + } + if (property.NameEquals("model"u8)) + { + model = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AudioTranscriptionOptions( + file, + filename, + responseFormat, + language, + prompt, + temperature, + timestampGranularities ?? new ChangeTrackingList(), + model, + serializedAdditionalRawData); + } + + private BinaryData SerializeMultipart(ModelReaderWriterOptions options) + { + using MultipartFormDataRequestContent content = ToMultipartRequestContent(); + using MemoryStream stream = new MemoryStream(); + content.WriteTo(stream); + if (stream.Position > int.MaxValue) + { + return BinaryData.FromStream(stream); + } + else + { + return new BinaryData(stream.GetBuffer().AsMemory(0, (int)stream.Position)); + } + } + + internal virtual MultipartFormDataRequestContent ToMultipartRequestContent() + { + MultipartFormDataRequestContent content = new MultipartFormDataRequestContent(); + content.Add(AudioData, "file", "file", "application/octet-stream"); + if (Optional.IsDefined(Filename)) + { + content.Add(Filename, "filename"); + } + if (Optional.IsDefined(ResponseFormat)) + { + content.Add(ResponseFormat.Value.ToString(), "response_format"); + } + if (Optional.IsDefined(Language)) + { + content.Add(Language, "language"); + } + if (Optional.IsDefined(Prompt)) + { + content.Add(Prompt, "prompt"); + } + if (Optional.IsDefined(Temperature)) + { + content.Add(Temperature.Value, "temperature"); + } + if (Optional.IsCollectionDefined(TimestampGranularities)) + { + foreach (AudioTranscriptionTimestampGranularity item in TimestampGranularities) + { + content.Add(item.ToString(), "timestamp_granularities"); + } + } + if (Optional.IsDefined(DeploymentName)) + { + content.Add(DeploymentName, "model"); + } + return content; + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "MFD": + return SerializeMultipart(options); + default: + throw new FormatException($"The model {nameof(AudioTranscriptionOptions)} does not support writing '{options.Format}' format."); + } + } + + AudioTranscriptionOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAudioTranscriptionOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AudioTranscriptionOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "MFD"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AudioTranscriptionOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAudioTranscriptionOptions(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/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionOptions.cs new file mode 100644 index 000000000000..e4c0a5294401 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionOptions.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Azure.AI.OpenAI +{ + /// The configuration information for an audio transcription request. + public partial class AudioTranscriptionOptions + { + /// + /// 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; + + /// Initializes a new instance of . + /// + /// The audio data to transcribe. This must be the binary content of a file in one of the supported media formats: + /// flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm. + /// + /// is null. + public AudioTranscriptionOptions(Stream audioData) + { + Argument.AssertNotNull(audioData, nameof(audioData)); + + AudioData = audioData; + TimestampGranularities = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// The audio data to transcribe. This must be the binary content of a file in one of the supported media formats: + /// flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm. + /// + /// The optional filename or descriptive identifier to associate with with the audio data. + /// The requested format of the transcription response data, which will influence the content and detail of the result. + /// + /// The primary spoken language of the audio data to be transcribed, supplied as a two-letter ISO-639-1 language code + /// such as 'en' or 'fr'. + /// Providing this known input language is optional but may improve the accuracy and/or latency of transcription. + /// + /// + /// An optional hint to guide the model's style or continue from a prior audio segment. The written language of the + /// prompt should match the primary spoken language of the audio data. + /// + /// + /// The sampling temperature, between 0 and 1. + /// Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + /// If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit. + /// + /// + /// The timestamp granularities to populate for this transcription. + /// `response_format` must be set `verbose_json` to use timestamp granularities. + /// Either or both of these options are supported: `word`, or `segment`. + /// Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency. + /// + /// The model to use for this transcription request. + /// Keeps track of any properties unknown to the library. + internal AudioTranscriptionOptions(Stream audioData, string filename, AudioTranscriptionFormat? responseFormat, string language, string prompt, float? temperature, IList timestampGranularities, string deploymentName, IDictionary serializedAdditionalRawData) + { + AudioData = audioData; + Filename = filename; + ResponseFormat = responseFormat; + Language = language; + Prompt = prompt; + Temperature = temperature; + TimestampGranularities = timestampGranularities; + DeploymentName = deploymentName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AudioTranscriptionOptions() + { + } + + /// + /// The audio data to transcribe. This must be the binary content of a file in one of the supported media formats: + /// flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm. + /// + public Stream AudioData { get; } + /// The optional filename or descriptive identifier to associate with with the audio data. + public string Filename { get; set; } + /// The requested format of the transcription response data, which will influence the content and detail of the result. + public AudioTranscriptionFormat? ResponseFormat { get; set; } + /// + /// The primary spoken language of the audio data to be transcribed, supplied as a two-letter ISO-639-1 language code + /// such as 'en' or 'fr'. + /// Providing this known input language is optional but may improve the accuracy and/or latency of transcription. + /// + public string Language { get; set; } + /// + /// An optional hint to guide the model's style or continue from a prior audio segment. The written language of the + /// prompt should match the primary spoken language of the audio data. + /// + public string Prompt { get; set; } + /// + /// The sampling temperature, between 0 and 1. + /// Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + /// If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit. + /// + public float? Temperature { get; set; } + /// + /// The timestamp granularities to populate for this transcription. + /// `response_format` must be set `verbose_json` to use timestamp granularities. + /// Either or both of these options are supported: `word`, or `segment`. + /// Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency. + /// + public IList TimestampGranularities { get; } + /// The model to use for this transcription request. + public string DeploymentName { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionSegment.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionSegment.Serialization.cs new file mode 100644 index 000000000000..85c7cea22662 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionSegment.Serialization.cs @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class AudioTranscriptionSegment : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AudioTranscriptionSegment)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("id"u8); + writer.WriteNumberValue(Id); + writer.WritePropertyName("start"u8); + writer.WriteNumberValue(Convert.ToDouble(Start.ToString("s\\.FFF"))); + writer.WritePropertyName("end"u8); + writer.WriteNumberValue(Convert.ToDouble(End.ToString("s\\.FFF"))); + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + writer.WritePropertyName("temperature"u8); + writer.WriteNumberValue(Temperature); + writer.WritePropertyName("avg_logprob"u8); + writer.WriteNumberValue(AverageLogProbability); + writer.WritePropertyName("compression_ratio"u8); + writer.WriteNumberValue(CompressionRatio); + writer.WritePropertyName("no_speech_prob"u8); + writer.WriteNumberValue(NoSpeechProbability); + writer.WritePropertyName("tokens"u8); + writer.WriteStartArray(); + foreach (var item in Tokens) + { + writer.WriteNumberValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("seek"u8); + writer.WriteNumberValue(Seek); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AudioTranscriptionSegment IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AudioTranscriptionSegment)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAudioTranscriptionSegment(document.RootElement, options); + } + + internal static AudioTranscriptionSegment DeserializeAudioTranscriptionSegment(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int id = default; + TimeSpan start = default; + TimeSpan end = default; + string text = default; + float temperature = default; + float avgLogprob = default; + float compressionRatio = default; + float noSpeechProb = default; + IReadOnlyList tokens = default; + int seek = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("start"u8)) + { + start = TimeSpan.FromSeconds(property.Value.GetDouble()); + continue; + } + if (property.NameEquals("end"u8)) + { + end = TimeSpan.FromSeconds(property.Value.GetDouble()); + continue; + } + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("temperature"u8)) + { + temperature = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("avg_logprob"u8)) + { + avgLogprob = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("compression_ratio"u8)) + { + compressionRatio = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("no_speech_prob"u8)) + { + noSpeechProb = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("tokens"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetInt32()); + } + tokens = array; + continue; + } + if (property.NameEquals("seek"u8)) + { + seek = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AudioTranscriptionSegment( + id, + start, + end, + text, + temperature, + avgLogprob, + compressionRatio, + noSpeechProb, + tokens, + seek, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AudioTranscriptionSegment)} does not support writing '{options.Format}' format."); + } + } + + AudioTranscriptionSegment IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAudioTranscriptionSegment(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AudioTranscriptionSegment)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AudioTranscriptionSegment FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAudioTranscriptionSegment(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/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionSegment.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionSegment.cs new file mode 100644 index 000000000000..e1dd9c8fad59 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionSegment.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.OpenAI +{ + /// + /// Extended information about a single segment of transcribed audio data. + /// Segments generally represent roughly 5-10 seconds of speech. Segment boundaries typically occur between words but not + /// necessarily sentences. + /// + public partial class AudioTranscriptionSegment + { + /// + /// 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; + + /// Initializes a new instance of . + /// The 0-based index of this segment within a transcription. + /// The time at which this segment started relative to the beginning of the transcribed audio. + /// The time at which this segment ended relative to the beginning of the transcribed audio. + /// The transcribed text that was part of this audio segment. + /// The temperature score associated with this audio segment. + /// The average log probability associated with this audio segment. + /// The compression ratio of this audio segment. + /// The probability of no speech detection within this audio segment. + /// The token IDs matching the transcribed text in this audio segment. + /// + /// The seek position associated with the processing of this audio segment. + /// Seek positions are expressed as hundredths of seconds. + /// The model may process several segments from a single seek position, so while the seek position will never represent + /// a later time than the segment's start, the segment's start may represent a significantly later time than the + /// segment's associated seek position. + /// + /// or is null. + internal AudioTranscriptionSegment(int id, TimeSpan start, TimeSpan end, string text, float temperature, float averageLogProbability, float compressionRatio, float noSpeechProbability, IEnumerable tokens, int seek) + { + Argument.AssertNotNull(text, nameof(text)); + Argument.AssertNotNull(tokens, nameof(tokens)); + + Id = id; + Start = start; + End = end; + Text = text; + Temperature = temperature; + AverageLogProbability = averageLogProbability; + CompressionRatio = compressionRatio; + NoSpeechProbability = noSpeechProbability; + Tokens = tokens.ToList(); + Seek = seek; + } + + /// Initializes a new instance of . + /// The 0-based index of this segment within a transcription. + /// The time at which this segment started relative to the beginning of the transcribed audio. + /// The time at which this segment ended relative to the beginning of the transcribed audio. + /// The transcribed text that was part of this audio segment. + /// The temperature score associated with this audio segment. + /// The average log probability associated with this audio segment. + /// The compression ratio of this audio segment. + /// The probability of no speech detection within this audio segment. + /// The token IDs matching the transcribed text in this audio segment. + /// + /// The seek position associated with the processing of this audio segment. + /// Seek positions are expressed as hundredths of seconds. + /// The model may process several segments from a single seek position, so while the seek position will never represent + /// a later time than the segment's start, the segment's start may represent a significantly later time than the + /// segment's associated seek position. + /// + /// Keeps track of any properties unknown to the library. + internal AudioTranscriptionSegment(int id, TimeSpan start, TimeSpan end, string text, float temperature, float averageLogProbability, float compressionRatio, float noSpeechProbability, IReadOnlyList tokens, int seek, IDictionary serializedAdditionalRawData) + { + Id = id; + Start = start; + End = end; + Text = text; + Temperature = temperature; + AverageLogProbability = averageLogProbability; + CompressionRatio = compressionRatio; + NoSpeechProbability = noSpeechProbability; + Tokens = tokens; + Seek = seek; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AudioTranscriptionSegment() + { + } + + /// The 0-based index of this segment within a transcription. + public int Id { get; } + /// The time at which this segment started relative to the beginning of the transcribed audio. + public TimeSpan Start { get; } + /// The time at which this segment ended relative to the beginning of the transcribed audio. + public TimeSpan End { get; } + /// The transcribed text that was part of this audio segment. + public string Text { get; } + /// The temperature score associated with this audio segment. + public float Temperature { get; } + /// The average log probability associated with this audio segment. + public float AverageLogProbability { get; } + /// The compression ratio of this audio segment. + public float CompressionRatio { get; } + /// The probability of no speech detection within this audio segment. + public float NoSpeechProbability { get; } + /// The token IDs matching the transcribed text in this audio segment. + public IReadOnlyList Tokens { get; } + /// + /// The seek position associated with the processing of this audio segment. + /// Seek positions are expressed as hundredths of seconds. + /// The model may process several segments from a single seek position, so while the seek position will never represent + /// a later time than the segment's start, the segment's start may represent a significantly later time than the + /// segment's associated seek position. + /// + public int Seek { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionTimestampGranularity.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionTimestampGranularity.cs new file mode 100644 index 000000000000..b0ae51145060 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionTimestampGranularity.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// Defines the timestamp granularities that can be requested on a verbose transcription response. + public readonly partial struct AudioTranscriptionTimestampGranularity : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AudioTranscriptionTimestampGranularity(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string WordValue = "word"; + private const string SegmentValue = "segment"; + + /// + /// Indicates that responses should include timing information about each transcribed word. Note that generating word + /// timestamp information will incur additional response latency. + /// + public static AudioTranscriptionTimestampGranularity Word { get; } = new AudioTranscriptionTimestampGranularity(WordValue); + /// + /// Indicates that responses should include timing and other information about each transcribed audio segment. Audio + /// segment timestamp information does not incur any additional latency. + /// + public static AudioTranscriptionTimestampGranularity Segment { get; } = new AudioTranscriptionTimestampGranularity(SegmentValue); + /// Determines if two values are the same. + public static bool operator ==(AudioTranscriptionTimestampGranularity left, AudioTranscriptionTimestampGranularity right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AudioTranscriptionTimestampGranularity left, AudioTranscriptionTimestampGranularity right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AudioTranscriptionTimestampGranularity(string value) => new AudioTranscriptionTimestampGranularity(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AudioTranscriptionTimestampGranularity other && Equals(other); + /// + public bool Equals(AudioTranscriptionTimestampGranularity 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/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionWord.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionWord.Serialization.cs new file mode 100644 index 000000000000..70ae89c891a4 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionWord.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class AudioTranscriptionWord : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AudioTranscriptionWord)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("word"u8); + writer.WriteStringValue(Word); + writer.WritePropertyName("start"u8); + writer.WriteNumberValue(Convert.ToDouble(Start.ToString("s\\.FFF"))); + writer.WritePropertyName("end"u8); + writer.WriteNumberValue(Convert.ToDouble(End.ToString("s\\.FFF"))); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AudioTranscriptionWord IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AudioTranscriptionWord)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAudioTranscriptionWord(document.RootElement, options); + } + + internal static AudioTranscriptionWord DeserializeAudioTranscriptionWord(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string word = default; + TimeSpan start = default; + TimeSpan end = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("word"u8)) + { + word = property.Value.GetString(); + continue; + } + if (property.NameEquals("start"u8)) + { + start = TimeSpan.FromSeconds(property.Value.GetDouble()); + continue; + } + if (property.NameEquals("end"u8)) + { + end = TimeSpan.FromSeconds(property.Value.GetDouble()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AudioTranscriptionWord(word, start, end, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AudioTranscriptionWord)} does not support writing '{options.Format}' format."); + } + } + + AudioTranscriptionWord IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAudioTranscriptionWord(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AudioTranscriptionWord)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AudioTranscriptionWord FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAudioTranscriptionWord(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/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionWord.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionWord.cs new file mode 100644 index 000000000000..9fa92dfadb66 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranscriptionWord.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Extended information about a single transcribed word, as provided on responses when the 'word' timestamp granularity is provided. + public partial class AudioTranscriptionWord + { + /// + /// 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; + + /// Initializes a new instance of . + /// The textual content of the word. + /// The start time of the word relative to the beginning of the audio, expressed in seconds. + /// The end time of the word relative to the beginning of the audio, expressed in seconds. + /// is null. + internal AudioTranscriptionWord(string word, TimeSpan start, TimeSpan end) + { + Argument.AssertNotNull(word, nameof(word)); + + Word = word; + Start = start; + End = end; + } + + /// Initializes a new instance of . + /// The textual content of the word. + /// The start time of the word relative to the beginning of the audio, expressed in seconds. + /// The end time of the word relative to the beginning of the audio, expressed in seconds. + /// Keeps track of any properties unknown to the library. + internal AudioTranscriptionWord(string word, TimeSpan start, TimeSpan end, IDictionary serializedAdditionalRawData) + { + Word = word; + Start = start; + End = end; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AudioTranscriptionWord() + { + } + + /// The textual content of the word. + public string Word { get; } + /// The start time of the word relative to the beginning of the audio, expressed in seconds. + public TimeSpan Start { get; } + /// The end time of the word relative to the beginning of the audio, expressed in seconds. + public TimeSpan End { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranslation.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranslation.Serialization.cs new file mode 100644 index 000000000000..73e54cec4bfe --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranslation.Serialization.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class AudioTranslation : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AudioTranslation)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + if (Optional.IsDefined(InternalAudioTaskLabel)) + { + writer.WritePropertyName("task"u8); + writer.WriteStringValue(InternalAudioTaskLabel.Value.ToString()); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + if (Optional.IsDefined(Duration)) + { + writer.WritePropertyName("duration"u8); + writer.WriteNumberValue(Convert.ToDouble(Duration.Value.ToString("s\\.FFF"))); + } + if (Optional.IsCollectionDefined(Segments)) + { + writer.WritePropertyName("segments"u8); + writer.WriteStartArray(); + foreach (var item in Segments) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AudioTranslation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AudioTranslation)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAudioTranslation(document.RootElement, options); + } + + internal static AudioTranslation DeserializeAudioTranslation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string text = default; + AudioTaskLabel? task = default; + string language = default; + TimeSpan? duration = default; + IReadOnlyList segments = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("task"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + task = new AudioTaskLabel(property.Value.GetString()); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("duration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + duration = TimeSpan.FromSeconds(property.Value.GetDouble()); + continue; + } + if (property.NameEquals("segments"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AudioTranslationSegment.DeserializeAudioTranslationSegment(item, options)); + } + segments = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AudioTranslation( + text, + task, + language, + duration, + segments ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AudioTranslation)} does not support writing '{options.Format}' format."); + } + } + + AudioTranslation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAudioTranslation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AudioTranslation)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AudioTranslation FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAudioTranslation(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/openai/Azure.AI.OpenAI/src/Generated/AudioTranslation.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranslation.cs new file mode 100644 index 000000000000..476c481e3824 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranslation.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Result information for an operation that translated spoken audio into written text. + public partial class AudioTranslation + { + /// + /// 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; + + /// Initializes a new instance of . + /// The translated text for the provided audio data. + /// is null. + internal AudioTranslation(string text) + { + Argument.AssertNotNull(text, nameof(text)); + + Text = text; + Segments = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The translated text for the provided audio data. + /// The label that describes which operation type generated the accompanying response data. + /// + /// The spoken language that was detected in the translated audio data. + /// This is expressed as a two-letter ISO-639-1 language code like 'en' or 'fr'. + /// + /// The total duration of the audio processed to produce accompanying translation information. + /// A collection of information about the timing, probabilities, and other detail of each processed audio segment. + /// Keeps track of any properties unknown to the library. + internal AudioTranslation(string text, AudioTaskLabel? internalAudioTaskLabel, string language, TimeSpan? duration, IReadOnlyList segments, IDictionary serializedAdditionalRawData) + { + Text = text; + InternalAudioTaskLabel = internalAudioTaskLabel; + Language = language; + Duration = duration; + Segments = segments; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AudioTranslation() + { + } + + /// The translated text for the provided audio data. + public string Text { get; } + /// The label that describes which operation type generated the accompanying response data. + public AudioTaskLabel? InternalAudioTaskLabel { get; } + /// + /// The spoken language that was detected in the translated audio data. + /// This is expressed as a two-letter ISO-639-1 language code like 'en' or 'fr'. + /// + public string Language { get; } + /// The total duration of the audio processed to produce accompanying translation information. + public TimeSpan? Duration { get; } + /// A collection of information about the timing, probabilities, and other detail of each processed audio segment. + public IReadOnlyList Segments { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranslationFormat.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranslationFormat.cs new file mode 100644 index 000000000000..0c8068cb6afe --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranslationFormat.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// Defines available options for the underlying response format of output translation information. + public readonly partial struct AudioTranslationFormat : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AudioTranslationFormat(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SimpleValue = "json"; + private const string VerboseValue = "verbose_json"; + private const string InternalPlainTextValue = "text"; + private const string SrtValue = "srt"; + private const string VttValue = "vtt"; + + /// Use a response body that is a JSON object containing a single 'text' field for the translation. + public static AudioTranslationFormat Simple { get; } = new AudioTranslationFormat(SimpleValue); + /// + /// Use a response body that is a JSON object containing translation text along with timing, segments, and other + /// metadata. + /// + public static AudioTranslationFormat Verbose { get; } = new AudioTranslationFormat(VerboseValue); + /// Use a response body that is plain text containing the raw, unannotated translation. + public static AudioTranslationFormat InternalPlainText { get; } = new AudioTranslationFormat(InternalPlainTextValue); + /// Use a response body that is plain text in SubRip (SRT) format that also includes timing information. + public static AudioTranslationFormat Srt { get; } = new AudioTranslationFormat(SrtValue); + /// Use a response body that is plain text in Web Video Text Tracks (VTT) format that also includes timing information. + public static AudioTranslationFormat Vtt { get; } = new AudioTranslationFormat(VttValue); + /// Determines if two values are the same. + public static bool operator ==(AudioTranslationFormat left, AudioTranslationFormat right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AudioTranslationFormat left, AudioTranslationFormat right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AudioTranslationFormat(string value) => new AudioTranslationFormat(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AudioTranslationFormat other && Equals(other); + /// + public bool Equals(AudioTranslationFormat 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/openai/Azure.AI.OpenAI/src/Generated/AudioTranslationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranslationOptions.Serialization.cs new file mode 100644 index 000000000000..458903e87688 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranslationOptions.Serialization.cs @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class AudioTranslationOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AudioTranslationOptions)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("file"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(global::System.BinaryData.FromStream(AudioData)); +#else + using (JsonDocument document = JsonDocument.Parse(BinaryData.FromStream(AudioData))) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + if (Optional.IsDefined(Filename)) + { + writer.WritePropertyName("filename"u8); + writer.WriteStringValue(Filename); + } + if (Optional.IsDefined(ResponseFormat)) + { + writer.WritePropertyName("response_format"u8); + writer.WriteStringValue(ResponseFormat.Value.ToString()); + } + if (Optional.IsDefined(Prompt)) + { + writer.WritePropertyName("prompt"u8); + writer.WriteStringValue(Prompt); + } + if (Optional.IsDefined(Temperature)) + { + writer.WritePropertyName("temperature"u8); + writer.WriteNumberValue(Temperature.Value); + } + if (Optional.IsDefined(DeploymentName)) + { + writer.WritePropertyName("model"u8); + writer.WriteStringValue(DeploymentName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AudioTranslationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AudioTranslationOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAudioTranslationOptions(document.RootElement, options); + } + + internal static AudioTranslationOptions DeserializeAudioTranslationOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Stream file = default; + string filename = default; + AudioTranslationFormat? responseFormat = default; + string prompt = default; + float? temperature = default; + string model = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("file"u8)) + { + file = BinaryData.FromString(property.Value.GetRawText()).ToStream(); + continue; + } + if (property.NameEquals("filename"u8)) + { + filename = property.Value.GetString(); + continue; + } + if (property.NameEquals("response_format"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + responseFormat = new AudioTranslationFormat(property.Value.GetString()); + continue; + } + if (property.NameEquals("prompt"u8)) + { + prompt = property.Value.GetString(); + continue; + } + if (property.NameEquals("temperature"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + temperature = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("model"u8)) + { + model = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AudioTranslationOptions( + file, + filename, + responseFormat, + prompt, + temperature, + model, + serializedAdditionalRawData); + } + + private BinaryData SerializeMultipart(ModelReaderWriterOptions options) + { + using MultipartFormDataRequestContent content = ToMultipartRequestContent(); + using MemoryStream stream = new MemoryStream(); + content.WriteTo(stream); + if (stream.Position > int.MaxValue) + { + return BinaryData.FromStream(stream); + } + else + { + return new BinaryData(stream.GetBuffer().AsMemory(0, (int)stream.Position)); + } + } + + internal virtual MultipartFormDataRequestContent ToMultipartRequestContent() + { + MultipartFormDataRequestContent content = new MultipartFormDataRequestContent(); + content.Add(AudioData, "file", "file", "application/octet-stream"); + if (Optional.IsDefined(Filename)) + { + content.Add(Filename, "filename"); + } + if (Optional.IsDefined(ResponseFormat)) + { + content.Add(ResponseFormat.Value.ToString(), "response_format"); + } + if (Optional.IsDefined(Prompt)) + { + content.Add(Prompt, "prompt"); + } + if (Optional.IsDefined(Temperature)) + { + content.Add(Temperature.Value, "temperature"); + } + if (Optional.IsDefined(DeploymentName)) + { + content.Add(DeploymentName, "model"); + } + return content; + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "MFD": + return SerializeMultipart(options); + default: + throw new FormatException($"The model {nameof(AudioTranslationOptions)} does not support writing '{options.Format}' format."); + } + } + + AudioTranslationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAudioTranslationOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AudioTranslationOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "MFD"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AudioTranslationOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAudioTranslationOptions(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/openai/Azure.AI.OpenAI/src/Generated/AudioTranslationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranslationOptions.cs new file mode 100644 index 000000000000..63936f35c61c --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranslationOptions.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Azure.AI.OpenAI +{ + /// The configuration information for an audio translation request. + public partial class AudioTranslationOptions + { + /// + /// 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; + + /// Initializes a new instance of . + /// + /// The audio data to translate. This must be the binary content of a file in one of the supported media formats: + /// flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm. + /// + /// is null. + public AudioTranslationOptions(Stream audioData) + { + Argument.AssertNotNull(audioData, nameof(audioData)); + + AudioData = audioData; + } + + /// Initializes a new instance of . + /// + /// The audio data to translate. This must be the binary content of a file in one of the supported media formats: + /// flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm. + /// + /// The optional filename or descriptive identifier to associate with with the audio data. + /// The requested format of the translation response data, which will influence the content and detail of the result. + /// + /// An optional hint to guide the model's style or continue from a prior audio segment. The written language of the + /// prompt should match the primary spoken language of the audio data. + /// + /// + /// The sampling temperature, between 0 and 1. + /// Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + /// If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit. + /// + /// The model to use for this translation request. + /// Keeps track of any properties unknown to the library. + internal AudioTranslationOptions(Stream audioData, string filename, AudioTranslationFormat? responseFormat, string prompt, float? temperature, string deploymentName, IDictionary serializedAdditionalRawData) + { + AudioData = audioData; + Filename = filename; + ResponseFormat = responseFormat; + Prompt = prompt; + Temperature = temperature; + DeploymentName = deploymentName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AudioTranslationOptions() + { + } + + /// + /// The audio data to translate. This must be the binary content of a file in one of the supported media formats: + /// flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm. + /// + public Stream AudioData { get; } + /// The optional filename or descriptive identifier to associate with with the audio data. + public string Filename { get; set; } + /// The requested format of the translation response data, which will influence the content and detail of the result. + public AudioTranslationFormat? ResponseFormat { get; set; } + /// + /// An optional hint to guide the model's style or continue from a prior audio segment. The written language of the + /// prompt should match the primary spoken language of the audio data. + /// + public string Prompt { get; set; } + /// + /// The sampling temperature, between 0 and 1. + /// Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + /// If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit. + /// + public float? Temperature { get; set; } + /// The model to use for this translation request. + public string DeploymentName { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranslationSegment.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranslationSegment.Serialization.cs new file mode 100644 index 000000000000..d97e2fd99122 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranslationSegment.Serialization.cs @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class AudioTranslationSegment : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AudioTranslationSegment)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("id"u8); + writer.WriteNumberValue(Id); + writer.WritePropertyName("start"u8); + writer.WriteNumberValue(Convert.ToDouble(Start.ToString("s\\.FFF"))); + writer.WritePropertyName("end"u8); + writer.WriteNumberValue(Convert.ToDouble(End.ToString("s\\.FFF"))); + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + writer.WritePropertyName("temperature"u8); + writer.WriteNumberValue(Temperature); + writer.WritePropertyName("avg_logprob"u8); + writer.WriteNumberValue(AverageLogProbability); + writer.WritePropertyName("compression_ratio"u8); + writer.WriteNumberValue(CompressionRatio); + writer.WritePropertyName("no_speech_prob"u8); + writer.WriteNumberValue(NoSpeechProbability); + writer.WritePropertyName("tokens"u8); + writer.WriteStartArray(); + foreach (var item in Tokens) + { + writer.WriteNumberValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("seek"u8); + writer.WriteNumberValue(Seek); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AudioTranslationSegment IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AudioTranslationSegment)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAudioTranslationSegment(document.RootElement, options); + } + + internal static AudioTranslationSegment DeserializeAudioTranslationSegment(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int id = default; + TimeSpan start = default; + TimeSpan end = default; + string text = default; + float temperature = default; + float avgLogprob = default; + float compressionRatio = default; + float noSpeechProb = default; + IReadOnlyList tokens = default; + int seek = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("start"u8)) + { + start = TimeSpan.FromSeconds(property.Value.GetDouble()); + continue; + } + if (property.NameEquals("end"u8)) + { + end = TimeSpan.FromSeconds(property.Value.GetDouble()); + continue; + } + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("temperature"u8)) + { + temperature = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("avg_logprob"u8)) + { + avgLogprob = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("compression_ratio"u8)) + { + compressionRatio = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("no_speech_prob"u8)) + { + noSpeechProb = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("tokens"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetInt32()); + } + tokens = array; + continue; + } + if (property.NameEquals("seek"u8)) + { + seek = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AudioTranslationSegment( + id, + start, + end, + text, + temperature, + avgLogprob, + compressionRatio, + noSpeechProb, + tokens, + seek, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AudioTranslationSegment)} does not support writing '{options.Format}' format."); + } + } + + AudioTranslationSegment IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAudioTranslationSegment(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AudioTranslationSegment)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AudioTranslationSegment FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAudioTranslationSegment(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/openai/Azure.AI.OpenAI/src/Generated/AudioTranslationSegment.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranslationSegment.cs new file mode 100644 index 000000000000..4eba8ec055ae --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AudioTranslationSegment.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.OpenAI +{ + /// + /// Extended information about a single segment of translated audio data. + /// Segments generally represent roughly 5-10 seconds of speech. Segment boundaries typically occur between words but not + /// necessarily sentences. + /// + public partial class AudioTranslationSegment + { + /// + /// 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; + + /// Initializes a new instance of . + /// The 0-based index of this segment within a translation. + /// The time at which this segment started relative to the beginning of the translated audio. + /// The time at which this segment ended relative to the beginning of the translated audio. + /// The translated text that was part of this audio segment. + /// The temperature score associated with this audio segment. + /// The average log probability associated with this audio segment. + /// The compression ratio of this audio segment. + /// The probability of no speech detection within this audio segment. + /// The token IDs matching the translated text in this audio segment. + /// + /// The seek position associated with the processing of this audio segment. + /// Seek positions are expressed as hundredths of seconds. + /// The model may process several segments from a single seek position, so while the seek position will never represent + /// a later time than the segment's start, the segment's start may represent a significantly later time than the + /// segment's associated seek position. + /// + /// or is null. + internal AudioTranslationSegment(int id, TimeSpan start, TimeSpan end, string text, float temperature, float averageLogProbability, float compressionRatio, float noSpeechProbability, IEnumerable tokens, int seek) + { + Argument.AssertNotNull(text, nameof(text)); + Argument.AssertNotNull(tokens, nameof(tokens)); + + Id = id; + Start = start; + End = end; + Text = text; + Temperature = temperature; + AverageLogProbability = averageLogProbability; + CompressionRatio = compressionRatio; + NoSpeechProbability = noSpeechProbability; + Tokens = tokens.ToList(); + Seek = seek; + } + + /// Initializes a new instance of . + /// The 0-based index of this segment within a translation. + /// The time at which this segment started relative to the beginning of the translated audio. + /// The time at which this segment ended relative to the beginning of the translated audio. + /// The translated text that was part of this audio segment. + /// The temperature score associated with this audio segment. + /// The average log probability associated with this audio segment. + /// The compression ratio of this audio segment. + /// The probability of no speech detection within this audio segment. + /// The token IDs matching the translated text in this audio segment. + /// + /// The seek position associated with the processing of this audio segment. + /// Seek positions are expressed as hundredths of seconds. + /// The model may process several segments from a single seek position, so while the seek position will never represent + /// a later time than the segment's start, the segment's start may represent a significantly later time than the + /// segment's associated seek position. + /// + /// Keeps track of any properties unknown to the library. + internal AudioTranslationSegment(int id, TimeSpan start, TimeSpan end, string text, float temperature, float averageLogProbability, float compressionRatio, float noSpeechProbability, IReadOnlyList tokens, int seek, IDictionary serializedAdditionalRawData) + { + Id = id; + Start = start; + End = end; + Text = text; + Temperature = temperature; + AverageLogProbability = averageLogProbability; + CompressionRatio = compressionRatio; + NoSpeechProbability = noSpeechProbability; + Tokens = tokens; + Seek = seek; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AudioTranslationSegment() + { + } + + /// The 0-based index of this segment within a translation. + public int Id { get; } + /// The time at which this segment started relative to the beginning of the translated audio. + public TimeSpan Start { get; } + /// The time at which this segment ended relative to the beginning of the translated audio. + public TimeSpan End { get; } + /// The translated text that was part of this audio segment. + public string Text { get; } + /// The temperature score associated with this audio segment. + public float Temperature { get; } + /// The average log probability associated with this audio segment. + public float AverageLogProbability { get; } + /// The compression ratio of this audio segment. + public float CompressionRatio { get; } + /// The probability of no speech detection within this audio segment. + public float NoSpeechProbability { get; } + /// The token IDs matching the translated text in this audio segment. + public IReadOnlyList Tokens { get; } + /// + /// The seek position associated with the processing of this audio segment. + /// Seek positions are expressed as hundredths of seconds. + /// The model may process several segments from a single seek position, so while the seek position will never represent + /// a later time than the segment's start, the segment's start may represent a significantly later time than the + /// segment's associated seek position. + /// + public int Seek { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatEnhancementConfiguration.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatEnhancementConfiguration.Serialization.cs new file mode 100644 index 000000000000..4a5790f6650d --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatEnhancementConfiguration.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class AzureChatEnhancementConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureChatEnhancementConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Grounding)) + { + writer.WritePropertyName("grounding"u8); + writer.WriteObjectValue(Grounding, options); + } + if (Optional.IsDefined(Ocr)) + { + writer.WritePropertyName("ocr"u8); + writer.WriteObjectValue(Ocr, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureChatEnhancementConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureChatEnhancementConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureChatEnhancementConfiguration(document.RootElement, options); + } + + internal static AzureChatEnhancementConfiguration DeserializeAzureChatEnhancementConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureChatGroundingEnhancementConfiguration grounding = default; + AzureChatOCREnhancementConfiguration ocr = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("grounding"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + grounding = AzureChatGroundingEnhancementConfiguration.DeserializeAzureChatGroundingEnhancementConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("ocr"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ocr = AzureChatOCREnhancementConfiguration.DeserializeAzureChatOCREnhancementConfiguration(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureChatEnhancementConfiguration(grounding, ocr, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureChatEnhancementConfiguration)} does not support writing '{options.Format}' format."); + } + } + + AzureChatEnhancementConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureChatEnhancementConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureChatEnhancementConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AzureChatEnhancementConfiguration FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAzureChatEnhancementConfiguration(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/openai/Azure.AI.OpenAI/src/Generated/AzureChatEnhancementConfiguration.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatEnhancementConfiguration.cs new file mode 100644 index 000000000000..9abaf36c33a7 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatEnhancementConfiguration.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// A representation of the available Azure OpenAI enhancement configurations. + public partial class AzureChatEnhancementConfiguration + { + /// + /// 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; + + /// Initializes a new instance of . + public AzureChatEnhancementConfiguration() + { + } + + /// Initializes a new instance of . + /// A representation of the available options for the Azure OpenAI grounding enhancement. + /// A representation of the available options for the Azure OpenAI optical character recognition (OCR) enhancement. + /// Keeps track of any properties unknown to the library. + internal AzureChatEnhancementConfiguration(AzureChatGroundingEnhancementConfiguration grounding, AzureChatOCREnhancementConfiguration ocr, IDictionary serializedAdditionalRawData) + { + Grounding = grounding; + Ocr = ocr; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// A representation of the available options for the Azure OpenAI grounding enhancement. + public AzureChatGroundingEnhancementConfiguration Grounding { get; set; } + /// A representation of the available options for the Azure OpenAI optical character recognition (OCR) enhancement. + public AzureChatOCREnhancementConfiguration Ocr { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatEnhancements.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatEnhancements.Serialization.cs new file mode 100644 index 000000000000..1705e3709324 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatEnhancements.Serialization.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class AzureChatEnhancements : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureChatEnhancements)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Grounding)) + { + writer.WritePropertyName("grounding"u8); + writer.WriteObjectValue(Grounding, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureChatEnhancements IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureChatEnhancements)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureChatEnhancements(document.RootElement, options); + } + + internal static AzureChatEnhancements DeserializeAzureChatEnhancements(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureGroundingEnhancement grounding = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("grounding"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + grounding = AzureGroundingEnhancement.DeserializeAzureGroundingEnhancement(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureChatEnhancements(grounding, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureChatEnhancements)} does not support writing '{options.Format}' format."); + } + } + + AzureChatEnhancements IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureChatEnhancements(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureChatEnhancements)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AzureChatEnhancements FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAzureChatEnhancements(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/openai/Azure.AI.OpenAI/src/Generated/AzureChatEnhancements.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatEnhancements.cs new file mode 100644 index 000000000000..113d9a88ea0a --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatEnhancements.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// + /// Represents the output results of Azure enhancements to chat completions, as configured via the matching input provided + /// in the request. + /// + public partial class AzureChatEnhancements + { + /// + /// 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; + + /// Initializes a new instance of . + internal AzureChatEnhancements() + { + } + + /// Initializes a new instance of . + /// The grounding enhancement that returns the bounding box of the objects detected in the image. + /// Keeps track of any properties unknown to the library. + internal AzureChatEnhancements(AzureGroundingEnhancement grounding, IDictionary serializedAdditionalRawData) + { + Grounding = grounding; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The grounding enhancement that returns the bounding box of the objects detected in the image. + public AzureGroundingEnhancement Grounding { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionConfiguration.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionConfiguration.Serialization.cs new file mode 100644 index 000000000000..87bf2c5ec9e1 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionConfiguration.Serialization.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + [PersistableModelProxy(typeof(UnknownAzureChatExtensionConfiguration))] + public partial class AzureChatExtensionConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureChatExtensionConfiguration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureChatExtensionConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureChatExtensionConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureChatExtensionConfiguration(document.RootElement, options); + } + + internal static AzureChatExtensionConfiguration DeserializeAzureChatExtensionConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "azure_cosmos_db": return AzureCosmosDBChatExtensionConfiguration.DeserializeAzureCosmosDBChatExtensionConfiguration(element, options); + case "azure_search": return AzureSearchChatExtensionConfiguration.DeserializeAzureSearchChatExtensionConfiguration(element, options); + case "elasticsearch": return ElasticsearchChatExtensionConfiguration.DeserializeElasticsearchChatExtensionConfiguration(element, options); + case "mongo_db": return MongoDBChatExtensionConfiguration.DeserializeMongoDBChatExtensionConfiguration(element, options); + case "pinecone": return PineconeChatExtensionConfiguration.DeserializePineconeChatExtensionConfiguration(element, options); + } + } + return UnknownAzureChatExtensionConfiguration.DeserializeUnknownAzureChatExtensionConfiguration(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureChatExtensionConfiguration)} does not support writing '{options.Format}' format."); + } + } + + AzureChatExtensionConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureChatExtensionConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureChatExtensionConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AzureChatExtensionConfiguration FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAzureChatExtensionConfiguration(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/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionConfiguration.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionConfiguration.cs new file mode 100644 index 000000000000..689f1809d2b8 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionConfiguration.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// + /// A representation of configuration data for a single Azure OpenAI chat extension. This will be used by a chat + /// completions request that should use Azure OpenAI chat extensions to augment the response behavior. + /// The use of this configuration is compatible only with Azure OpenAI. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + public abstract partial class AzureChatExtensionConfiguration + { + /// + /// 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; + + /// Initializes a new instance of . + protected AzureChatExtensionConfiguration() + { + } + + /// Initializes a new instance of . + /// + /// The label for the type of an Azure chat extension. This typically corresponds to a matching Azure resource. + /// Azure chat extensions are only compatible with Azure OpenAI. + /// + /// Keeps track of any properties unknown to the library. + internal AzureChatExtensionConfiguration(AzureChatExtensionType type, IDictionary serializedAdditionalRawData) + { + Type = type; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// The label for the type of an Azure chat extension. This typically corresponds to a matching Azure resource. + /// Azure chat extensions are only compatible with Azure OpenAI. + /// + internal AzureChatExtensionType Type { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCitation.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionDataSourceResponseCitation.Serialization.cs similarity index 56% rename from sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCitation.Serialization.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionDataSourceResponseCitation.Serialization.cs index ec636d318611..c08252a6e85c 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCitation.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionDataSourceResponseCitation.Serialization.cs @@ -1,64 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable using System; -using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.Core; -namespace Azure.AI.OpenAI.Chat +namespace Azure.AI.OpenAI { - public partial class ChatCitation : IJsonModel + public partial class AzureChatExtensionDataSourceResponseCitation : IUtf8JsonSerializable, IJsonModel { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ChatCitation)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(AzureChatExtensionDataSourceResponseCitation)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("content") != true) - { - writer.WritePropertyName("content"u8); - writer.WriteStringValue(Content); - } - if (SerializedAdditionalRawData?.ContainsKey("title") != true && Optional.IsDefined(Title)) + writer.WritePropertyName("content"u8); + writer.WriteStringValue(Content); + if (Optional.IsDefined(Title)) { writer.WritePropertyName("title"u8); writer.WriteStringValue(Title); } - if (SerializedAdditionalRawData?.ContainsKey("url") != true && Optional.IsDefined(Url)) + if (Optional.IsDefined(Url)) { writer.WritePropertyName("url"u8); writer.WriteStringValue(Url); } - if (SerializedAdditionalRawData?.ContainsKey("filepath") != true && Optional.IsDefined(FilePath)) + if (Optional.IsDefined(Filepath)) { writer.WritePropertyName("filepath"u8); - writer.WriteStringValue(FilePath); + writer.WriteStringValue(Filepath); } - if (SerializedAdditionalRawData?.ContainsKey("chunk_id") != true && Optional.IsDefined(ChunkId)) + if (Optional.IsDefined(ChunkId)) { writer.WritePropertyName("chunk_id"u8); writer.WriteStringValue(ChunkId); } - if (SerializedAdditionalRawData?.ContainsKey("rerank_score") != true && Optional.IsDefined(RerankScore)) + if (Optional.IsDefined(RerankScore)) { writer.WritePropertyName("rerank_score"u8); writer.WriteNumberValue(RerankScore.Value); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _serializedAdditionalRawData != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _serializedAdditionalRawData) { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -70,22 +76,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpti #endif } } - writer.WriteEndObject(); } - ChatCitation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AzureChatExtensionDataSourceResponseCitation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ChatCitation)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(AzureChatExtensionDataSourceResponseCitation)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeChatCitation(document.RootElement, options); + return DeserializeAzureChatExtensionDataSourceResponseCitation(document.RootElement, options); } - internal static ChatCitation DeserializeChatCitation(JsonElement element, ModelReaderWriterOptions options = null) + internal static AzureChatExtensionDataSourceResponseCitation DeserializeAzureChatExtensionDataSourceResponseCitation(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -139,12 +144,11 @@ internal static ChatCitation DeserializeChatCitation(JsonElement element, ModelR } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new ChatCitation( + return new AzureChatExtensionDataSourceResponseCitation( content, title, url, @@ -154,49 +158,51 @@ internal static ChatCitation DeserializeChatCitation(JsonElement element, ModelR serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ChatCitation)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(AzureChatExtensionDataSourceResponseCitation)} does not support writing '{options.Format}' format."); } } - ChatCitation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + AzureChatExtensionDataSourceResponseCitation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeChatCitation(document.RootElement, options); + return DeserializeAzureChatExtensionDataSourceResponseCitation(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ChatCitation)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(AzureChatExtensionDataSourceResponseCitation)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static ChatCitation FromResponse(PipelineResponse response) + /// The response to deserialize the model from. + internal static AzureChatExtensionDataSourceResponseCitation FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeChatCitation(document.RootElement); + return DeserializeAzureChatExtensionDataSourceResponseCitation(document.RootElement); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// Convert into a . + internal virtual RequestContent ToRequestContent() { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCitation.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionDataSourceResponseCitation.cs similarity index 53% rename from sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCitation.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionDataSourceResponseCitation.cs index 74cd970915ea..b07ff2f62a95 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCitation.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionDataSourceResponseCitation.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable @@ -5,10 +8,14 @@ using System; using System.Collections.Generic; -namespace Azure.AI.OpenAI.Chat +namespace Azure.AI.OpenAI { - /// The AzureChatMessageContextCitation. - public partial class ChatCitation + /// + /// A single instance of additional context information available when Azure OpenAI chat extensions are involved + /// in the generation of a corresponding chat completions response. This context information is only populated when + /// using an Azure OpenAI request configured to use a matching extension. + /// + public partial class AzureChatExtensionDataSourceResponseCitation { /// /// Keeps track of any properties unknown to the library. @@ -40,50 +47,53 @@ public partial class ChatCitation /// /// /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . /// The content of the citation. /// is null. - internal ChatCitation(string content) + internal AzureChatExtensionDataSourceResponseCitation(string content) { Argument.AssertNotNull(content, nameof(content)); Content = content; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The content of the citation. - /// The title for the citation. + /// The title of the citation. /// The URL of the citation. - /// The file path for the citation. - /// The chunk ID for the citation. - /// The rerank score for the retrieval. + /// The file path of the citation. + /// The chunk ID of the citation. + /// The rerank score of the retrieved document. /// Keeps track of any properties unknown to the library. - internal ChatCitation(string content, string title, string url, string filePath, string chunkId, double? rerankScore, IDictionary serializedAdditionalRawData) + internal AzureChatExtensionDataSourceResponseCitation(string content, string title, string url, string filepath, string chunkId, double? rerankScore, IDictionary serializedAdditionalRawData) { Content = content; Title = title; Url = url; - FilePath = filePath; + Filepath = filepath; ChunkId = chunkId; RerankScore = rerankScore; - SerializedAdditionalRawData = serializedAdditionalRawData; + _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ChatCitation() + /// Initializes a new instance of for deserialization. + internal AzureChatExtensionDataSourceResponseCitation() { } /// The content of the citation. public string Content { get; } - /// The title for the citation. + /// The title of the citation. public string Title { get; } /// The URL of the citation. public string Url { get; } - /// The chunk ID for the citation. + /// The file path of the citation. + public string Filepath { get; } + /// The chunk ID of the citation. public string ChunkId { get; } - /// The rerank score for the retrieval. + /// The rerank score of the retrieved document. public double? RerankScore { get; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionRetrieveDocumentFilterReason.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionRetrieveDocumentFilterReason.Serialization.cs new file mode 100644 index 000000000000..97679b72fb36 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionRetrieveDocumentFilterReason.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.AI.OpenAI +{ + internal static partial class AzureChatExtensionRetrieveDocumentFilterReasonExtensions + { + public static string ToSerialString(this AzureChatExtensionRetrieveDocumentFilterReason value) => value switch + { + AzureChatExtensionRetrieveDocumentFilterReason.Score => "score", + AzureChatExtensionRetrieveDocumentFilterReason.Rerank => "rerank", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AzureChatExtensionRetrieveDocumentFilterReason value.") + }; + + public static AzureChatExtensionRetrieveDocumentFilterReason ToAzureChatExtensionRetrieveDocumentFilterReason(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "score")) return AzureChatExtensionRetrieveDocumentFilterReason.Score; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "rerank")) return AzureChatExtensionRetrieveDocumentFilterReason.Rerank; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AzureChatExtensionRetrieveDocumentFilterReason value."); + } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionRetrieveDocumentFilterReason.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionRetrieveDocumentFilterReason.cs new file mode 100644 index 000000000000..a0ff002c2627 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionRetrieveDocumentFilterReason.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.AI.OpenAI +{ + /// The reason for filtering the retrieved document. + public enum AzureChatExtensionRetrieveDocumentFilterReason + { + /// The document is filtered by original search score threshold defined by `strictness` configure. + Score, + /// The document is not filtered by original search score threshold, but is filtered by rerank score and `top_n_documents` configure. + Rerank + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRetrievedDocument.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionRetrievedDocument.Serialization.cs similarity index 59% rename from sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRetrievedDocument.Serialization.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionRetrievedDocument.Serialization.cs index 5f62fdce58d6..7a63ceca87b7 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRetrievedDocument.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionRetrievedDocument.Serialization.cs @@ -1,89 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable using System; -using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.Core; -namespace Azure.AI.OpenAI.Chat +namespace Azure.AI.OpenAI { - public partial class ChatRetrievedDocument : IJsonModel + public partial class AzureChatExtensionRetrievedDocument : IUtf8JsonSerializable, IJsonModel { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; if (format != "J") { - throw new FormatException($"The model {nameof(ChatRetrievedDocument)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(AzureChatExtensionRetrievedDocument)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("content") != true) - { - writer.WritePropertyName("content"u8); - writer.WriteStringValue(Content); - } - if (SerializedAdditionalRawData?.ContainsKey("title") != true && Optional.IsDefined(Title)) + writer.WritePropertyName("content"u8); + writer.WriteStringValue(Content); + if (Optional.IsDefined(Title)) { writer.WritePropertyName("title"u8); writer.WriteStringValue(Title); } - if (SerializedAdditionalRawData?.ContainsKey("url") != true && Optional.IsDefined(Url)) + if (Optional.IsDefined(Url)) { writer.WritePropertyName("url"u8); writer.WriteStringValue(Url); } - if (SerializedAdditionalRawData?.ContainsKey("filepath") != true && Optional.IsDefined(FilePath)) + if (Optional.IsDefined(Filepath)) { writer.WritePropertyName("filepath"u8); - writer.WriteStringValue(FilePath); + writer.WriteStringValue(Filepath); } - if (SerializedAdditionalRawData?.ContainsKey("chunk_id") != true && Optional.IsDefined(ChunkId)) + if (Optional.IsDefined(ChunkId)) { writer.WritePropertyName("chunk_id"u8); writer.WriteStringValue(ChunkId); } - if (SerializedAdditionalRawData?.ContainsKey("rerank_score") != true && Optional.IsDefined(RerankScore)) + if (Optional.IsDefined(RerankScore)) { writer.WritePropertyName("rerank_score"u8); writer.WriteNumberValue(RerankScore.Value); } - if (SerializedAdditionalRawData?.ContainsKey("search_queries") != true) - { - writer.WritePropertyName("search_queries"u8); - writer.WriteStartArray(); - foreach (var item in SearchQueries) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (SerializedAdditionalRawData?.ContainsKey("data_source_index") != true) + writer.WritePropertyName("search_queries"u8); + writer.WriteStartArray(); + foreach (var item in SearchQueries) { - writer.WritePropertyName("data_source_index"u8); - writer.WriteNumberValue(DataSourceIndex); + writer.WriteStringValue(item); } - if (SerializedAdditionalRawData?.ContainsKey("original_search_score") != true && Optional.IsDefined(OriginalSearchScore)) + writer.WriteEndArray(); + writer.WritePropertyName("data_source_index"u8); + writer.WriteNumberValue(DataSourceIndex); + if (Optional.IsDefined(OriginalSearchScore)) { writer.WritePropertyName("original_search_score"u8); writer.WriteNumberValue(OriginalSearchScore.Value); } - if (SerializedAdditionalRawData?.ContainsKey("filter_reason") != true && Optional.IsDefined(FilterReason)) + if (Optional.IsDefined(FilterReason)) { writer.WritePropertyName("filter_reason"u8); - writer.WriteStringValue(FilterReason.Value.ToString()); + writer.WriteStringValue(FilterReason.Value.ToSerialString()); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _serializedAdditionalRawData != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _serializedAdditionalRawData) { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -95,22 +95,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW #endif } } - writer.WriteEndObject(); } - ChatRetrievedDocument IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AzureChatExtensionRetrievedDocument IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ChatRetrievedDocument)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(AzureChatExtensionRetrievedDocument)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeChatRetrievedDocument(document.RootElement, options); + return DeserializeAzureChatExtensionRetrievedDocument(document.RootElement, options); } - internal static ChatRetrievedDocument DeserializeChatRetrievedDocument(JsonElement element, ModelReaderWriterOptions options = null) + internal static AzureChatExtensionRetrievedDocument DeserializeAzureChatExtensionRetrievedDocument(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -127,7 +126,7 @@ internal static ChatRetrievedDocument DeserializeChatRetrievedDocument(JsonEleme IReadOnlyList searchQueries = default; int dataSourceIndex = default; double? originalSearchScore = default; - ChatDocumentFilterReason? filterReason = default; + AzureChatExtensionRetrieveDocumentFilterReason? filterReason = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -196,17 +195,16 @@ internal static ChatRetrievedDocument DeserializeChatRetrievedDocument(JsonEleme { continue; } - filterReason = new ChatDocumentFilterReason(property.Value.GetString()); + filterReason = property.Value.GetString().ToAzureChatExtensionRetrieveDocumentFilterReason(); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new ChatRetrievedDocument( + return new AzureChatExtensionRetrievedDocument( content, title, url, @@ -220,49 +218,51 @@ internal static ChatRetrievedDocument DeserializeChatRetrievedDocument(JsonEleme serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ChatRetrievedDocument)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(AzureChatExtensionRetrievedDocument)} does not support writing '{options.Format}' format."); } } - ChatRetrievedDocument IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + AzureChatExtensionRetrievedDocument IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeChatRetrievedDocument(document.RootElement, options); + return DeserializeAzureChatExtensionRetrievedDocument(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ChatRetrievedDocument)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(AzureChatExtensionRetrievedDocument)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static ChatRetrievedDocument FromResponse(PipelineResponse response) + /// The response to deserialize the model from. + internal static AzureChatExtensionRetrievedDocument FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeChatRetrievedDocument(document.RootElement); + return DeserializeAzureChatExtensionRetrievedDocument(document.RootElement); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// Convert into a . + internal virtual RequestContent ToRequestContent() { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRetrievedDocument.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionRetrievedDocument.cs similarity index 52% rename from sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRetrievedDocument.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionRetrievedDocument.cs index 145d0be9adf6..8ee20083b474 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRetrievedDocument.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionRetrievedDocument.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable @@ -6,10 +9,10 @@ using System.Collections.Generic; using System.Linq; -namespace Azure.AI.OpenAI.Chat +namespace Azure.AI.OpenAI { - /// The AzureChatMessageContextAllRetrievedDocuments. - public partial class ChatRetrievedDocument + /// The retrieved document. + public partial class AzureChatExtensionRetrievedDocument { /// /// Keeps track of any properties unknown to the library. @@ -41,13 +44,14 @@ public partial class ChatRetrievedDocument /// /// /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . /// The content of the citation. - /// The search queries executed to retrieve documents. - /// The index of the data source used for retrieval. + /// The search queries used to retrieve the document. + /// The index of the data source. /// or is null. - internal ChatRetrievedDocument(string content, IEnumerable searchQueries, int dataSourceIndex) + internal AzureChatExtensionRetrievedDocument(string content, IEnumerable searchQueries, int dataSourceIndex) { Argument.AssertNotNull(content, nameof(content)); Argument.AssertNotNull(searchQueries, nameof(searchQueries)); @@ -57,55 +61,63 @@ internal ChatRetrievedDocument(string content, IEnumerable searchQueries DataSourceIndex = dataSourceIndex; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The content of the citation. - /// The title for the citation. + /// The title of the citation. /// The URL of the citation. - /// The file path for the citation. - /// The chunk ID for the citation. - /// The rerank score for the retrieval. - /// The search queries executed to retrieve documents. - /// The index of the data source used for retrieval. - /// The original search score for the retrieval. - /// If applicable, an indication of why the document was filtered. + /// The file path of the citation. + /// The chunk ID of the citation. + /// The rerank score of the retrieved document. + /// The search queries used to retrieve the document. + /// The index of the data source. + /// The original search score of the retrieved document. + /// + /// Represents the rationale for filtering the document. If the document does not undergo filtering, + /// this field will remain unset. + /// /// Keeps track of any properties unknown to the library. - internal ChatRetrievedDocument(string content, string title, string url, string filePath, string chunkId, double? rerankScore, IReadOnlyList searchQueries, int dataSourceIndex, double? originalSearchScore, ChatDocumentFilterReason? filterReason, IDictionary serializedAdditionalRawData) + internal AzureChatExtensionRetrievedDocument(string content, string title, string url, string filepath, string chunkId, double? rerankScore, IReadOnlyList searchQueries, int dataSourceIndex, double? originalSearchScore, AzureChatExtensionRetrieveDocumentFilterReason? filterReason, IDictionary serializedAdditionalRawData) { Content = content; Title = title; Url = url; - FilePath = filePath; + Filepath = filepath; ChunkId = chunkId; RerankScore = rerankScore; SearchQueries = searchQueries; DataSourceIndex = dataSourceIndex; OriginalSearchScore = originalSearchScore; FilterReason = filterReason; - SerializedAdditionalRawData = serializedAdditionalRawData; + _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ChatRetrievedDocument() + /// Initializes a new instance of for deserialization. + internal AzureChatExtensionRetrievedDocument() { } /// The content of the citation. public string Content { get; } - /// The title for the citation. + /// The title of the citation. public string Title { get; } /// The URL of the citation. public string Url { get; } - /// The chunk ID for the citation. + /// The file path of the citation. + public string Filepath { get; } + /// The chunk ID of the citation. public string ChunkId { get; } - /// The rerank score for the retrieval. + /// The rerank score of the retrieved document. public double? RerankScore { get; } - /// The search queries executed to retrieve documents. + /// The search queries used to retrieve the document. public IReadOnlyList SearchQueries { get; } - /// The index of the data source used for retrieval. + /// The index of the data source. public int DataSourceIndex { get; } - /// The original search score for the retrieval. + /// The original search score of the retrieved document. public double? OriginalSearchScore { get; } - /// If applicable, an indication of why the document was filtered. - public ChatDocumentFilterReason? FilterReason { get; } + /// + /// Represents the rationale for filtering the document. If the document does not undergo filtering, + /// this field will remain unset. + /// + public AzureChatExtensionRetrieveDocumentFilterReason? FilterReason { get; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionType.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionType.cs new file mode 100644 index 000000000000..43ed79a551d4 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionType.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// + /// A representation of configuration data for a single Azure OpenAI chat extension. This will be used by a chat + /// completions request that should use Azure OpenAI chat extensions to augment the response behavior. + /// The use of this configuration is compatible only with Azure OpenAI. + /// + internal readonly partial struct AzureChatExtensionType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureChatExtensionType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AzureSearchValue = "azure_search"; + private const string AzureCosmosDBValue = "azure_cosmos_db"; + private const string ElasticsearchValue = "elasticsearch"; + private const string PineconeValue = "pinecone"; + private const string MongoDBValue = "mongo_db"; + + /// Represents the use of Azure AI Search as an Azure OpenAI chat extension. + public static AzureChatExtensionType AzureSearch { get; } = new AzureChatExtensionType(AzureSearchValue); + /// Represents the use of Azure Cosmos DB as an Azure OpenAI chat extension. + public static AzureChatExtensionType AzureCosmosDB { get; } = new AzureChatExtensionType(AzureCosmosDBValue); + /// Represents the use of Elasticsearch® index as an Azure OpenAI chat extension. + public static AzureChatExtensionType Elasticsearch { get; } = new AzureChatExtensionType(ElasticsearchValue); + /// Represents the use of Pinecone index as an Azure OpenAI chat extension. + public static AzureChatExtensionType Pinecone { get; } = new AzureChatExtensionType(PineconeValue); + /// Represents the use of a MongoDB chat extension. + public static AzureChatExtensionType MongoDB { get; } = new AzureChatExtensionType(MongoDBValue); + /// Determines if two values are the same. + public static bool operator ==(AzureChatExtensionType left, AzureChatExtensionType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureChatExtensionType left, AzureChatExtensionType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureChatExtensionType(string value) => new AzureChatExtensionType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureChatExtensionType other && Equals(other); + /// + public bool Equals(AzureChatExtensionType 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/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionsMessageContext.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionsMessageContext.Serialization.cs new file mode 100644 index 000000000000..dea845989cd7 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionsMessageContext.Serialization.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class AzureChatExtensionsMessageContext : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureChatExtensionsMessageContext)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Citations)) + { + writer.WritePropertyName("citations"u8); + writer.WriteStartArray(); + foreach (var item in Citations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Intent)) + { + writer.WritePropertyName("intent"u8); + writer.WriteStringValue(Intent); + } + if (Optional.IsCollectionDefined(AllRetrievedDocuments)) + { + writer.WritePropertyName("all_retrieved_documents"u8); + writer.WriteStartArray(); + foreach (var item in AllRetrievedDocuments) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureChatExtensionsMessageContext IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureChatExtensionsMessageContext)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureChatExtensionsMessageContext(document.RootElement, options); + } + + internal static AzureChatExtensionsMessageContext DeserializeAzureChatExtensionsMessageContext(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList citations = default; + string intent = default; + IReadOnlyList allRetrievedDocuments = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("citations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AzureChatExtensionDataSourceResponseCitation.DeserializeAzureChatExtensionDataSourceResponseCitation(item, options)); + } + citations = array; + continue; + } + if (property.NameEquals("intent"u8)) + { + intent = property.Value.GetString(); + continue; + } + if (property.NameEquals("all_retrieved_documents"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AzureChatExtensionRetrievedDocument.DeserializeAzureChatExtensionRetrievedDocument(item, options)); + } + allRetrievedDocuments = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureChatExtensionsMessageContext(citations ?? new ChangeTrackingList(), intent, allRetrievedDocuments ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureChatExtensionsMessageContext)} does not support writing '{options.Format}' format."); + } + } + + AzureChatExtensionsMessageContext IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureChatExtensionsMessageContext(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureChatExtensionsMessageContext)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AzureChatExtensionsMessageContext FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAzureChatExtensionsMessageContext(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/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionsMessageContext.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionsMessageContext.cs new file mode 100644 index 000000000000..0591400215bc --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatExtensionsMessageContext.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// + /// A representation of the additional context information available when Azure OpenAI chat extensions are involved + /// in the generation of a corresponding chat completions response. This context information is only populated when + /// using an Azure OpenAI request configured to use a matching extension. + /// + public partial class AzureChatExtensionsMessageContext + { + /// + /// 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; + + /// Initializes a new instance of . + internal AzureChatExtensionsMessageContext() + { + Citations = new ChangeTrackingList(); + AllRetrievedDocuments = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// The contextual information associated with the Azure chat extensions used for a chat completions request. + /// These messages describe the data source retrievals, plugin invocations, and other intermediate steps taken in the + /// course of generating a chat completions response that was augmented by capabilities from Azure OpenAI chat + /// extensions. + /// + /// The detected intent from the chat history, used to pass to the next turn to carry over the context. + /// All the retrieved documents. + /// Keeps track of any properties unknown to the library. + internal AzureChatExtensionsMessageContext(IReadOnlyList citations, string intent, IReadOnlyList allRetrievedDocuments, IDictionary serializedAdditionalRawData) + { + Citations = citations; + Intent = intent; + AllRetrievedDocuments = allRetrievedDocuments; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// The contextual information associated with the Azure chat extensions used for a chat completions request. + /// These messages describe the data source retrievals, plugin invocations, and other intermediate steps taken in the + /// course of generating a chat completions response that was augmented by capabilities from Azure OpenAI chat + /// extensions. + /// + public IReadOnlyList Citations { get; } + /// The detected intent from the chat history, used to pass to the next turn to carry over the context. + public string Intent { get; } + /// All the retrieved documents. + public IReadOnlyList AllRetrievedDocuments { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatGroundingEnhancementConfiguration.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatGroundingEnhancementConfiguration.Serialization.cs new file mode 100644 index 000000000000..2f001897e17a --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatGroundingEnhancementConfiguration.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class AzureChatGroundingEnhancementConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureChatGroundingEnhancementConfiguration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureChatGroundingEnhancementConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureChatGroundingEnhancementConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureChatGroundingEnhancementConfiguration(document.RootElement, options); + } + + internal static AzureChatGroundingEnhancementConfiguration DeserializeAzureChatGroundingEnhancementConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool enabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + enabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureChatGroundingEnhancementConfiguration(enabled, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureChatGroundingEnhancementConfiguration)} does not support writing '{options.Format}' format."); + } + } + + AzureChatGroundingEnhancementConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureChatGroundingEnhancementConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureChatGroundingEnhancementConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AzureChatGroundingEnhancementConfiguration FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAzureChatGroundingEnhancementConfiguration(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/openai/Azure.AI.OpenAI/src/Generated/AzureChatGroundingEnhancementConfiguration.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatGroundingEnhancementConfiguration.cs new file mode 100644 index 000000000000..8e14c4e438d2 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatGroundingEnhancementConfiguration.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// A representation of the available options for the Azure OpenAI grounding enhancement. + public partial class AzureChatGroundingEnhancementConfiguration + { + /// + /// 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; + + /// Initializes a new instance of . + /// Specifies whether the enhancement is enabled. + public AzureChatGroundingEnhancementConfiguration(bool enabled) + { + Enabled = enabled; + } + + /// Initializes a new instance of . + /// Specifies whether the enhancement is enabled. + /// Keeps track of any properties unknown to the library. + internal AzureChatGroundingEnhancementConfiguration(bool enabled, IDictionary serializedAdditionalRawData) + { + Enabled = enabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AzureChatGroundingEnhancementConfiguration() + { + } + + /// Specifies whether the enhancement is enabled. + public bool Enabled { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatOCREnhancementConfiguration.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatOCREnhancementConfiguration.Serialization.cs new file mode 100644 index 000000000000..6acd8e7bd961 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatOCREnhancementConfiguration.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class AzureChatOCREnhancementConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureChatOCREnhancementConfiguration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureChatOCREnhancementConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureChatOCREnhancementConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureChatOCREnhancementConfiguration(document.RootElement, options); + } + + internal static AzureChatOCREnhancementConfiguration DeserializeAzureChatOCREnhancementConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool enabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + enabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureChatOCREnhancementConfiguration(enabled, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureChatOCREnhancementConfiguration)} does not support writing '{options.Format}' format."); + } + } + + AzureChatOCREnhancementConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureChatOCREnhancementConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureChatOCREnhancementConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AzureChatOCREnhancementConfiguration FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAzureChatOCREnhancementConfiguration(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/openai/Azure.AI.OpenAI/src/Generated/AzureChatOCREnhancementConfiguration.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatOCREnhancementConfiguration.cs new file mode 100644 index 000000000000..6f3aee5baa5a --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatOCREnhancementConfiguration.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// A representation of the available options for the Azure OpenAI optical character recognition (OCR) enhancement. + public partial class AzureChatOCREnhancementConfiguration + { + /// + /// 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; + + /// Initializes a new instance of . + /// Specifies whether the enhancement is enabled. + public AzureChatOCREnhancementConfiguration(bool enabled) + { + Enabled = enabled; + } + + /// Initializes a new instance of . + /// Specifies whether the enhancement is enabled. + /// Keeps track of any properties unknown to the library. + internal AzureChatOCREnhancementConfiguration(bool enabled, IDictionary serializedAdditionalRawData) + { + Enabled = enabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AzureChatOCREnhancementConfiguration() + { + } + + /// Specifies whether the enhancement is enabled. + public bool Enabled { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatExtensionConfiguration.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatExtensionConfiguration.Serialization.cs new file mode 100644 index 000000000000..8d8f15ccb907 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatExtensionConfiguration.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class AzureCosmosDBChatExtensionConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureCosmosDBChatExtensionConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("parameters"u8); + writer.WriteObjectValue(Parameters, options); + } + + AzureCosmosDBChatExtensionConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureCosmosDBChatExtensionConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureCosmosDBChatExtensionConfiguration(document.RootElement, options); + } + + internal static AzureCosmosDBChatExtensionConfiguration DeserializeAzureCosmosDBChatExtensionConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureCosmosDBChatExtensionParameters parameters = default; + AzureChatExtensionType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("parameters"u8)) + { + parameters = AzureCosmosDBChatExtensionParameters.DeserializeAzureCosmosDBChatExtensionParameters(property.Value, options); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new AzureChatExtensionType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureCosmosDBChatExtensionConfiguration(type, serializedAdditionalRawData, parameters); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureCosmosDBChatExtensionConfiguration)} does not support writing '{options.Format}' format."); + } + } + + AzureCosmosDBChatExtensionConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureCosmosDBChatExtensionConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureCosmosDBChatExtensionConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new AzureCosmosDBChatExtensionConfiguration FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAzureCosmosDBChatExtensionConfiguration(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/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatExtensionConfiguration.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatExtensionConfiguration.cs new file mode 100644 index 000000000000..c3b36d9749ea --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatExtensionConfiguration.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// + /// A specific representation of configurable options for Azure Cosmos DB when using it as an Azure OpenAI chat + /// extension. + /// + public partial class AzureCosmosDBChatExtensionConfiguration : AzureChatExtensionConfiguration + { + /// Initializes a new instance of . + /// The parameters to use when configuring Azure OpenAI CosmosDB chat extensions. + /// is null. + public AzureCosmosDBChatExtensionConfiguration(AzureCosmosDBChatExtensionParameters parameters) + { + Argument.AssertNotNull(parameters, nameof(parameters)); + + Type = AzureChatExtensionType.AzureCosmosDB; + Parameters = parameters; + } + + /// Initializes a new instance of . + /// + /// The label for the type of an Azure chat extension. This typically corresponds to a matching Azure resource. + /// Azure chat extensions are only compatible with Azure OpenAI. + /// + /// Keeps track of any properties unknown to the library. + /// The parameters to use when configuring Azure OpenAI CosmosDB chat extensions. + internal AzureCosmosDBChatExtensionConfiguration(AzureChatExtensionType type, IDictionary serializedAdditionalRawData, AzureCosmosDBChatExtensionParameters parameters) : base(type, serializedAdditionalRawData) + { + Parameters = parameters; + } + + /// Initializes a new instance of for deserialization. + internal AzureCosmosDBChatExtensionConfiguration() + { + } + + /// The parameters to use when configuring Azure OpenAI CosmosDB chat extensions. + public AzureCosmosDBChatExtensionParameters Parameters { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatExtensionParameters.Serialization.cs similarity index 54% rename from sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.Serialization.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatExtensionParameters.Serialization.cs index 7f959c4214e5..ea2c6f253fd6 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatExtensionParameters.Serialization.cs @@ -1,99 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable using System; -using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.Core; -namespace Azure.AI.OpenAI.Chat +namespace Azure.AI.OpenAI { - internal partial class InternalAzureCosmosDBChatDataSourceParameters : IJsonModel + public partial class AzureCosmosDBChatExtensionParameters : IUtf8JsonSerializable, IJsonModel { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; if (format != "J") { - throw new FormatException($"The model {nameof(InternalAzureCosmosDBChatDataSourceParameters)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(AzureCosmosDBChatExtensionParameters)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("top_n_documents") != true && Optional.IsDefined(TopNDocuments)) + if (Optional.IsDefined(DocumentCount)) { writer.WritePropertyName("top_n_documents"u8); - writer.WriteNumberValue(TopNDocuments.Value); + writer.WriteNumberValue(DocumentCount.Value); } - if (SerializedAdditionalRawData?.ContainsKey("in_scope") != true && Optional.IsDefined(InScope)) + if (Optional.IsDefined(ShouldRestrictResultScope)) { writer.WritePropertyName("in_scope"u8); - writer.WriteBooleanValue(InScope.Value); + writer.WriteBooleanValue(ShouldRestrictResultScope.Value); } - if (SerializedAdditionalRawData?.ContainsKey("strictness") != true && Optional.IsDefined(Strictness)) + if (Optional.IsDefined(Strictness)) { writer.WritePropertyName("strictness"u8); writer.WriteNumberValue(Strictness.Value); } - if (SerializedAdditionalRawData?.ContainsKey("max_search_queries") != true && Optional.IsDefined(MaxSearchQueries)) + if (Optional.IsDefined(MaxSearchQueries)) { writer.WritePropertyName("max_search_queries"u8); writer.WriteNumberValue(MaxSearchQueries.Value); } - if (SerializedAdditionalRawData?.ContainsKey("allow_partial_result") != true && Optional.IsDefined(AllowPartialResult)) + if (Optional.IsDefined(AllowPartialResult)) { writer.WritePropertyName("allow_partial_result"u8); writer.WriteBooleanValue(AllowPartialResult.Value); } - if (SerializedAdditionalRawData?.ContainsKey("include_contexts") != true && Optional.IsCollectionDefined(_internalIncludeContexts)) + if (Optional.IsCollectionDefined(IncludeContexts)) { writer.WritePropertyName("include_contexts"u8); writer.WriteStartArray(); - foreach (var item in _internalIncludeContexts) + foreach (var item in IncludeContexts) { - writer.WriteStringValue(item); + writer.WriteStringValue(item.ToString()); } writer.WriteEndArray(); } - if (SerializedAdditionalRawData?.ContainsKey("container_name") != true) - { - writer.WritePropertyName("container_name"u8); - writer.WriteStringValue(ContainerName); - } - if (SerializedAdditionalRawData?.ContainsKey("database_name") != true) - { - writer.WritePropertyName("database_name"u8); - writer.WriteStringValue(DatabaseName); - } - if (SerializedAdditionalRawData?.ContainsKey("embedding_dependency") != true) - { - writer.WritePropertyName("embedding_dependency"u8); - writer.WriteObjectValue(VectorizationSource, options); - } - if (SerializedAdditionalRawData?.ContainsKey("index_name") != true) - { - writer.WritePropertyName("index_name"u8); - writer.WriteStringValue(IndexName); - } - if (SerializedAdditionalRawData?.ContainsKey("authentication") != true) + if (Optional.IsDefined(Authentication)) { writer.WritePropertyName("authentication"u8); - writer.WriteObjectValue(Authentication, options); + writer.WriteObjectValue(Authentication, options); } - if (SerializedAdditionalRawData?.ContainsKey("fields_mapping") != true) + writer.WritePropertyName("database_name"u8); + writer.WriteStringValue(DatabaseName); + writer.WritePropertyName("container_name"u8); + writer.WriteStringValue(ContainerName); + writer.WritePropertyName("index_name"u8); + writer.WriteStringValue(IndexName); + writer.WritePropertyName("fields_mapping"u8); + writer.WriteObjectValue(FieldMappingOptions, options); + writer.WritePropertyName("embedding_dependency"u8); + writer.WriteObjectValue(EmbeddingDependency, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) { - writer.WritePropertyName("fields_mapping"u8); - writer.WriteObjectValue(FieldMappings, options); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _serializedAdditionalRawData) { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -105,22 +99,21 @@ void IJsonModel.Write(Utf8JsonWri #endif } } - writer.WriteEndObject(); } - InternalAzureCosmosDBChatDataSourceParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AzureCosmosDBChatExtensionParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(InternalAzureCosmosDBChatDataSourceParameters)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(AzureCosmosDBChatExtensionParameters)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInternalAzureCosmosDBChatDataSourceParameters(document.RootElement, options); + return DeserializeAzureCosmosDBChatExtensionParameters(document.RootElement, options); } - internal static InternalAzureCosmosDBChatDataSourceParameters DeserializeInternalAzureCosmosDBChatDataSourceParameters(JsonElement element, ModelReaderWriterOptions options = null) + internal static AzureCosmosDBChatExtensionParameters DeserializeAzureCosmosDBChatExtensionParameters(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -133,13 +126,13 @@ internal static InternalAzureCosmosDBChatDataSourceParameters DeserializeInterna int? strictness = default; int? maxSearchQueries = default; bool? allowPartialResult = default; - IList includeContexts = default; - string containerName = default; + IList includeContexts = default; + OnYourDataAuthenticationOptions authentication = default; string databaseName = default; - DataSourceVectorizer embeddingDependency = default; + string containerName = default; string indexName = default; - DataSourceAuthentication authentication = default; - DataSourceFieldMappings fieldsMapping = default; + AzureCosmosDBFieldMappingOptions fieldsMapping = default; + OnYourDataVectorizationSource embeddingDependency = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -195,17 +188,21 @@ internal static InternalAzureCosmosDBChatDataSourceParameters DeserializeInterna { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(item.GetString()); + array.Add(new OnYourDataContextProperty(item.GetString())); } includeContexts = array; continue; } - if (property.NameEquals("container_name"u8)) + if (property.NameEquals("authentication"u8)) { - containerName = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authentication = OnYourDataAuthenticationOptions.DeserializeOnYourDataAuthenticationOptions(property.Value, options); continue; } if (property.NameEquals("database_name"u8)) @@ -213,9 +210,9 @@ internal static InternalAzureCosmosDBChatDataSourceParameters DeserializeInterna databaseName = property.Value.GetString(); continue; } - if (property.NameEquals("embedding_dependency"u8)) + if (property.NameEquals("container_name"u8)) { - embeddingDependency = DataSourceVectorizer.DeserializeDataSourceVectorizer(property.Value, options); + containerName = property.Value.GetString(); continue; } if (property.NameEquals("index_name"u8)) @@ -223,82 +220,83 @@ internal static InternalAzureCosmosDBChatDataSourceParameters DeserializeInterna indexName = property.Value.GetString(); continue; } - if (property.NameEquals("authentication"u8)) + if (property.NameEquals("fields_mapping"u8)) { - authentication = DataSourceAuthentication.DeserializeDataSourceAuthentication(property.Value, options); + fieldsMapping = AzureCosmosDBFieldMappingOptions.DeserializeAzureCosmosDBFieldMappingOptions(property.Value, options); continue; } - if (property.NameEquals("fields_mapping"u8)) + if (property.NameEquals("embedding_dependency"u8)) { - fieldsMapping = DataSourceFieldMappings.DeserializeDataSourceFieldMappings(property.Value, options); + embeddingDependency = OnYourDataVectorizationSource.DeserializeOnYourDataVectorizationSource(property.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureCosmosDBChatDataSourceParameters( + return new AzureCosmosDBChatExtensionParameters( topNDocuments, inScope, strictness, maxSearchQueries, allowPartialResult, - includeContexts ?? new ChangeTrackingList(), - containerName, + includeContexts ?? new ChangeTrackingList(), + authentication, databaseName, - embeddingDependency, + containerName, indexName, - authentication, fieldsMapping, + embeddingDependency, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(InternalAzureCosmosDBChatDataSourceParameters)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(AzureCosmosDBChatExtensionParameters)} does not support writing '{options.Format}' format."); } } - InternalAzureCosmosDBChatDataSourceParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + AzureCosmosDBChatExtensionParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInternalAzureCosmosDBChatDataSourceParameters(document.RootElement, options); + return DeserializeAzureCosmosDBChatExtensionParameters(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(InternalAzureCosmosDBChatDataSourceParameters)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(AzureCosmosDBChatExtensionParameters)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static InternalAzureCosmosDBChatDataSourceParameters FromResponse(PipelineResponse response) + /// The response to deserialize the model from. + internal static AzureCosmosDBChatExtensionParameters FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureCosmosDBChatDataSourceParameters(document.RootElement); + return DeserializeAzureCosmosDBChatExtensionParameters(document.RootElement); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// Convert into a . + internal virtual RequestContent ToRequestContent() { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatExtensionParameters.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatExtensionParameters.cs new file mode 100644 index 000000000000..af4079791b60 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatExtensionParameters.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// + /// Parameters to use when configuring Azure OpenAI On Your Data chat extensions when using Azure Cosmos DB for + /// MongoDB vCore. The supported authentication type is ConnectionString. + /// + public partial class AzureCosmosDBChatExtensionParameters + { + /// + /// 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; + + /// Initializes a new instance of . + /// The MongoDB vCore database name to use with Azure Cosmos DB. + /// The name of the Azure Cosmos DB resource container. + /// The MongoDB vCore index name to use with Azure Cosmos DB. + /// Customized field mapping behavior to use when interacting with the search index. + /// + /// The embedding dependency for vector search. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + /// , , , or is null. + public AzureCosmosDBChatExtensionParameters(string databaseName, string containerName, string indexName, AzureCosmosDBFieldMappingOptions fieldMappingOptions, OnYourDataVectorizationSource embeddingDependency) + { + Argument.AssertNotNull(databaseName, nameof(databaseName)); + Argument.AssertNotNull(containerName, nameof(containerName)); + Argument.AssertNotNull(indexName, nameof(indexName)); + Argument.AssertNotNull(fieldMappingOptions, nameof(fieldMappingOptions)); + Argument.AssertNotNull(embeddingDependency, nameof(embeddingDependency)); + + IncludeContexts = new ChangeTrackingList(); + DatabaseName = databaseName; + ContainerName = containerName; + IndexName = indexName; + FieldMappingOptions = fieldMappingOptions; + EmbeddingDependency = embeddingDependency; + } + + /// Initializes a new instance of . + /// The configured top number of documents to feature for the configured query. + /// Whether queries should be restricted to use of indexed data. + /// The configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but lower recall of the answer. + /// + /// The max number of rewritten queries should be send to search provider for one user message. If not specified, + /// the system will decide the number of queries to send. + /// + /// + /// If specified as true, the system will allow partial search results to be used and the request fails if all the queries fail. + /// If not specified, or specified as false, the request will fail if any search query fails. + /// + /// The included properties of the output context. If not specified, the default value is `citations` and `intent`. + /// + /// The authentication method to use when accessing the defined data source. + /// Each data source type supports a specific set of available authentication methods; please see the documentation of + /// the data source for supported mechanisms. + /// If not otherwise provided, On Your Data will attempt to use System Managed Identity (default credential) + /// authentication. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , and . + /// + /// The MongoDB vCore database name to use with Azure Cosmos DB. + /// The name of the Azure Cosmos DB resource container. + /// The MongoDB vCore index name to use with Azure Cosmos DB. + /// Customized field mapping behavior to use when interacting with the search index. + /// + /// The embedding dependency for vector search. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + /// Keeps track of any properties unknown to the library. + internal AzureCosmosDBChatExtensionParameters(int? documentCount, bool? shouldRestrictResultScope, int? strictness, int? maxSearchQueries, bool? allowPartialResult, IList includeContexts, OnYourDataAuthenticationOptions authentication, string databaseName, string containerName, string indexName, AzureCosmosDBFieldMappingOptions fieldMappingOptions, OnYourDataVectorizationSource embeddingDependency, IDictionary serializedAdditionalRawData) + { + DocumentCount = documentCount; + ShouldRestrictResultScope = shouldRestrictResultScope; + Strictness = strictness; + MaxSearchQueries = maxSearchQueries; + AllowPartialResult = allowPartialResult; + IncludeContexts = includeContexts; + Authentication = authentication; + DatabaseName = databaseName; + ContainerName = containerName; + IndexName = indexName; + FieldMappingOptions = fieldMappingOptions; + EmbeddingDependency = embeddingDependency; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AzureCosmosDBChatExtensionParameters() + { + } + + /// The configured top number of documents to feature for the configured query. + public int? DocumentCount { get; set; } + /// Whether queries should be restricted to use of indexed data. + public bool? ShouldRestrictResultScope { get; set; } + /// The configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but lower recall of the answer. + public int? Strictness { get; set; } + /// + /// The max number of rewritten queries should be send to search provider for one user message. If not specified, + /// the system will decide the number of queries to send. + /// + public int? MaxSearchQueries { get; set; } + /// + /// If specified as true, the system will allow partial search results to be used and the request fails if all the queries fail. + /// If not specified, or specified as false, the request will fail if any search query fails. + /// + public bool? AllowPartialResult { get; set; } + /// The included properties of the output context. If not specified, the default value is `citations` and `intent`. + public IList IncludeContexts { get; } + /// + /// The authentication method to use when accessing the defined data source. + /// Each data source type supports a specific set of available authentication methods; please see the documentation of + /// the data source for supported mechanisms. + /// If not otherwise provided, On Your Data will attempt to use System Managed Identity (default credential) + /// authentication. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , and . + /// + public OnYourDataAuthenticationOptions Authentication { get; set; } + /// The MongoDB vCore database name to use with Azure Cosmos DB. + public string DatabaseName { get; } + /// The name of the Azure Cosmos DB resource container. + public string ContainerName { get; } + /// The MongoDB vCore index name to use with Azure Cosmos DB. + public string IndexName { get; } + /// Customized field mapping behavior to use when interacting with the search index. + public AzureCosmosDBFieldMappingOptions FieldMappingOptions { get; } + /// + /// The embedding dependency for vector search. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + public OnYourDataVectorizationSource EmbeddingDependency { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBFieldMappingOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBFieldMappingOptions.Serialization.cs new file mode 100644 index 000000000000..0f6c8ec8dd0e --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBFieldMappingOptions.Serialization.cs @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class AzureCosmosDBFieldMappingOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureCosmosDBFieldMappingOptions)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(TitleFieldName)) + { + writer.WritePropertyName("title_field"u8); + writer.WriteStringValue(TitleFieldName); + } + if (Optional.IsDefined(UrlFieldName)) + { + writer.WritePropertyName("url_field"u8); + writer.WriteStringValue(UrlFieldName); + } + if (Optional.IsDefined(FilepathFieldName)) + { + writer.WritePropertyName("filepath_field"u8); + writer.WriteStringValue(FilepathFieldName); + } + writer.WritePropertyName("content_fields"u8); + writer.WriteStartArray(); + foreach (var item in ContentFieldNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(ContentFieldSeparator)) + { + writer.WritePropertyName("content_fields_separator"u8); + writer.WriteStringValue(ContentFieldSeparator); + } + writer.WritePropertyName("vector_fields"u8); + writer.WriteStartArray(); + foreach (var item in VectorFieldNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureCosmosDBFieldMappingOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureCosmosDBFieldMappingOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureCosmosDBFieldMappingOptions(document.RootElement, options); + } + + internal static AzureCosmosDBFieldMappingOptions DeserializeAzureCosmosDBFieldMappingOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string titleField = default; + string urlField = default; + string filepathField = default; + IList contentFields = default; + string contentFieldsSeparator = default; + IList vectorFields = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("title_field"u8)) + { + titleField = property.Value.GetString(); + continue; + } + if (property.NameEquals("url_field"u8)) + { + urlField = property.Value.GetString(); + continue; + } + if (property.NameEquals("filepath_field"u8)) + { + filepathField = property.Value.GetString(); + continue; + } + if (property.NameEquals("content_fields"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + contentFields = array; + continue; + } + if (property.NameEquals("content_fields_separator"u8)) + { + contentFieldsSeparator = property.Value.GetString(); + continue; + } + if (property.NameEquals("vector_fields"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + vectorFields = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureCosmosDBFieldMappingOptions( + titleField, + urlField, + filepathField, + contentFields, + contentFieldsSeparator, + vectorFields, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureCosmosDBFieldMappingOptions)} does not support writing '{options.Format}' format."); + } + } + + AzureCosmosDBFieldMappingOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureCosmosDBFieldMappingOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureCosmosDBFieldMappingOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AzureCosmosDBFieldMappingOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAzureCosmosDBFieldMappingOptions(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/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBFieldMappingOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBFieldMappingOptions.cs new file mode 100644 index 000000000000..aff56c9de289 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBFieldMappingOptions.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.OpenAI +{ + /// Optional settings to control how fields are processed when using a configured Azure Cosmos DB resource. + public partial class AzureCosmosDBFieldMappingOptions + { + /// + /// 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; + + /// Initializes a new instance of . + /// The names of index fields that should be treated as content. + /// The names of fields that represent vector data. + /// or is null. + public AzureCosmosDBFieldMappingOptions(IEnumerable contentFieldNames, IEnumerable vectorFieldNames) + { + Argument.AssertNotNull(contentFieldNames, nameof(contentFieldNames)); + Argument.AssertNotNull(vectorFieldNames, nameof(vectorFieldNames)); + + ContentFieldNames = contentFieldNames.ToList(); + VectorFieldNames = vectorFieldNames.ToList(); + } + + /// Initializes a new instance of . + /// The name of the index field to use as a title. + /// The name of the index field to use as a URL. + /// The name of the index field to use as a filepath. + /// The names of index fields that should be treated as content. + /// The separator pattern that content fields should use. + /// The names of fields that represent vector data. + /// Keeps track of any properties unknown to the library. + internal AzureCosmosDBFieldMappingOptions(string titleFieldName, string urlFieldName, string filepathFieldName, IList contentFieldNames, string contentFieldSeparator, IList vectorFieldNames, IDictionary serializedAdditionalRawData) + { + TitleFieldName = titleFieldName; + UrlFieldName = urlFieldName; + FilepathFieldName = filepathFieldName; + ContentFieldNames = contentFieldNames; + ContentFieldSeparator = contentFieldSeparator; + VectorFieldNames = vectorFieldNames; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AzureCosmosDBFieldMappingOptions() + { + } + + /// The name of the index field to use as a title. + public string TitleFieldName { get; set; } + /// The name of the index field to use as a URL. + public string UrlFieldName { get; set; } + /// The name of the index field to use as a filepath. + public string FilepathFieldName { get; set; } + /// The names of index fields that should be treated as content. + public IList ContentFieldNames { get; } + /// The separator pattern that content fields should use. + public string ContentFieldSeparator { get; set; } + /// The names of fields that represent vector data. + public IList VectorFieldNames { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCanceledEventData.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancement.Serialization.cs similarity index 52% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCanceledEventData.Serialization.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancement.Serialization.cs index 1a4b66647616..7a624075fdef 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCanceledEventData.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancement.Serialization.cs @@ -11,13 +11,13 @@ using System.Text.Json; using Azure.Core; -namespace Azure.Messaging.EventGrid.SystemEvents +namespace Azure.AI.OpenAI { - public partial class MediaJobCanceledEventData : IUtf8JsonSerializable, IJsonModel + public partial class AzureGroundingEnhancement : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -26,37 +26,51 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobCanceledEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(AzureGroundingEnhancement)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("outputs"u8); + writer.WritePropertyName("lines"u8); writer.WriteStartArray(); - foreach (var item in Outputs) + foreach (var item in Lines) { writer.WriteObjectValue(item, options); } writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } - MediaJobCanceledEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AzureGroundingEnhancement IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobCanceledEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(AzureGroundingEnhancement)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaJobCanceledEventData(document.RootElement, options); + return DeserializeAzureGroundingEnhancement(document.RootElement, options); } - internal static MediaJobCanceledEventData DeserializeMediaJobCanceledEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static AzureGroundingEnhancement DeserializeAzureGroundingEnhancement(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -64,42 +78,19 @@ internal static MediaJobCanceledEventData DeserializeMediaJobCanceledEventData(J { return null; } - IReadOnlyList outputs = default; - MediaJobState previousState = default; - MediaJobState state = default; - IReadOnlyDictionary correlationData = default; + IReadOnlyList lines = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("outputs"u8)) + if (property.NameEquals("lines"u8)) { - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(MediaJobOutput.DeserializeMediaJobOutput(item, options)); - } - outputs = array; - continue; - } - if (property.NameEquals("previousState"u8)) - { - previousState = new MediaJobState(property.Value.GetString()); - continue; - } - if (property.NameEquals("state"u8)) - { - state = new MediaJobState(property.Value.GetString()); - continue; - } - if (property.NameEquals("correlationData"u8)) - { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); + array.Add(AzureGroundingEnhancementLine.DeserializeAzureGroundingEnhancementLine(item, options)); } - correlationData = dictionary; + lines = array; continue; } if (options.Format != "W") @@ -108,50 +99,50 @@ internal static MediaJobCanceledEventData DeserializeMediaJobCanceledEventData(J } } serializedAdditionalRawData = rawDataDictionary; - return new MediaJobCanceledEventData(previousState, state, correlationData, serializedAdditionalRawData, outputs); + return new AzureGroundingEnhancement(lines, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MediaJobCanceledEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(AzureGroundingEnhancement)} does not support writing '{options.Format}' format."); } } - MediaJobCanceledEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + AzureGroundingEnhancement IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaJobCanceledEventData(document.RootElement, options); + return DeserializeAzureGroundingEnhancement(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MediaJobCanceledEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(AzureGroundingEnhancement)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new MediaJobCanceledEventData FromResponse(Response response) + internal static AzureGroundingEnhancement FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaJobCanceledEventData(document.RootElement); + return DeserializeAzureGroundingEnhancement(document.RootElement); } /// Convert into a . - internal override RequestContent ToRequestContent() + internal virtual RequestContent ToRequestContent() { var content = new Utf8JsonRequestContent(); content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancement.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancement.cs new file mode 100644 index 000000000000..c0194b3dfa44 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancement.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.OpenAI +{ + /// The grounding enhancement that returns the bounding box of the objects detected in the image. + public partial class AzureGroundingEnhancement + { + /// + /// 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; + + /// Initializes a new instance of . + /// The lines of text detected by the grounding enhancement. + /// is null. + internal AzureGroundingEnhancement(IEnumerable lines) + { + Argument.AssertNotNull(lines, nameof(lines)); + + Lines = lines.ToList(); + } + + /// Initializes a new instance of . + /// The lines of text detected by the grounding enhancement. + /// Keeps track of any properties unknown to the library. + internal AzureGroundingEnhancement(IReadOnlyList lines, IDictionary serializedAdditionalRawData) + { + Lines = lines; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AzureGroundingEnhancement() + { + } + + /// The lines of text detected by the grounding enhancement. + public IReadOnlyList Lines { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancementCoordinatePoint.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancementCoordinatePoint.Serialization.cs new file mode 100644 index 000000000000..f95f2d7ed313 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancementCoordinatePoint.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class AzureGroundingEnhancementCoordinatePoint : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureGroundingEnhancementCoordinatePoint)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("x"u8); + writer.WriteNumberValue(X); + writer.WritePropertyName("y"u8); + writer.WriteNumberValue(Y); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureGroundingEnhancementCoordinatePoint IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureGroundingEnhancementCoordinatePoint)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureGroundingEnhancementCoordinatePoint(document.RootElement, options); + } + + internal static AzureGroundingEnhancementCoordinatePoint DeserializeAzureGroundingEnhancementCoordinatePoint(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + float x = default; + float y = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("x"u8)) + { + x = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("y"u8)) + { + y = property.Value.GetSingle(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureGroundingEnhancementCoordinatePoint(x, y, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureGroundingEnhancementCoordinatePoint)} does not support writing '{options.Format}' format."); + } + } + + AzureGroundingEnhancementCoordinatePoint IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureGroundingEnhancementCoordinatePoint(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureGroundingEnhancementCoordinatePoint)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AzureGroundingEnhancementCoordinatePoint FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAzureGroundingEnhancementCoordinatePoint(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/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancementCoordinatePoint.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancementCoordinatePoint.cs new file mode 100644 index 000000000000..44b5c9dcbd18 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancementCoordinatePoint.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// A representation of a single polygon point as used by the Azure grounding enhancement. + public partial class AzureGroundingEnhancementCoordinatePoint + { + /// + /// 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; + + /// Initializes a new instance of . + /// The x-coordinate (horizontal axis) of the point. + /// The y-coordinate (vertical axis) of the point. + internal AzureGroundingEnhancementCoordinatePoint(float x, float y) + { + X = x; + Y = y; + } + + /// Initializes a new instance of . + /// The x-coordinate (horizontal axis) of the point. + /// The y-coordinate (vertical axis) of the point. + /// Keeps track of any properties unknown to the library. + internal AzureGroundingEnhancementCoordinatePoint(float x, float y, IDictionary serializedAdditionalRawData) + { + X = x; + Y = y; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AzureGroundingEnhancementCoordinatePoint() + { + } + + /// The x-coordinate (horizontal axis) of the point. + public float X { get; } + /// The y-coordinate (vertical axis) of the point. + public float Y { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancementLine.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancementLine.Serialization.cs new file mode 100644 index 000000000000..a1608ae113f6 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancementLine.Serialization.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class AzureGroundingEnhancementLine : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureGroundingEnhancementLine)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + writer.WritePropertyName("spans"u8); + writer.WriteStartArray(); + foreach (var item in Spans) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureGroundingEnhancementLine IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureGroundingEnhancementLine)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureGroundingEnhancementLine(document.RootElement, options); + } + + internal static AzureGroundingEnhancementLine DeserializeAzureGroundingEnhancementLine(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string text = default; + IReadOnlyList spans = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("spans"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AzureGroundingEnhancementLineSpan.DeserializeAzureGroundingEnhancementLineSpan(item, options)); + } + spans = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureGroundingEnhancementLine(text, spans, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureGroundingEnhancementLine)} does not support writing '{options.Format}' format."); + } + } + + AzureGroundingEnhancementLine IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureGroundingEnhancementLine(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureGroundingEnhancementLine)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AzureGroundingEnhancementLine FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAzureGroundingEnhancementLine(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/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancementLine.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancementLine.cs new file mode 100644 index 000000000000..5ce268709106 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancementLine.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.OpenAI +{ + /// A content line object consisting of an adjacent sequence of content elements, such as words and selection marks. + public partial class AzureGroundingEnhancementLine + { + /// + /// 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; + + /// Initializes a new instance of . + /// The text within the line. + /// An array of spans that represent detected objects and its bounding box information. + /// or is null. + internal AzureGroundingEnhancementLine(string text, IEnumerable spans) + { + Argument.AssertNotNull(text, nameof(text)); + Argument.AssertNotNull(spans, nameof(spans)); + + Text = text; + Spans = spans.ToList(); + } + + /// Initializes a new instance of . + /// The text within the line. + /// An array of spans that represent detected objects and its bounding box information. + /// Keeps track of any properties unknown to the library. + internal AzureGroundingEnhancementLine(string text, IReadOnlyList spans, IDictionary serializedAdditionalRawData) + { + Text = text; + Spans = spans; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AzureGroundingEnhancementLine() + { + } + + /// The text within the line. + public string Text { get; } + /// An array of spans that represent detected objects and its bounding box information. + public IReadOnlyList Spans { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancementLineSpan.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancementLineSpan.Serialization.cs new file mode 100644 index 000000000000..e0f4131f9a8d --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancementLineSpan.Serialization.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class AzureGroundingEnhancementLineSpan : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureGroundingEnhancementLineSpan)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + writer.WritePropertyName("offset"u8); + writer.WriteNumberValue(Offset); + writer.WritePropertyName("length"u8); + writer.WriteNumberValue(Length); + writer.WritePropertyName("polygon"u8); + writer.WriteStartArray(); + foreach (var item in Polygon) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureGroundingEnhancementLineSpan IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureGroundingEnhancementLineSpan)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureGroundingEnhancementLineSpan(document.RootElement, options); + } + + internal static AzureGroundingEnhancementLineSpan DeserializeAzureGroundingEnhancementLineSpan(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string text = default; + int offset = default; + int length = default; + IReadOnlyList polygon = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("offset"u8)) + { + offset = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("length"u8)) + { + length = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("polygon"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AzureGroundingEnhancementCoordinatePoint.DeserializeAzureGroundingEnhancementCoordinatePoint(item, options)); + } + polygon = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureGroundingEnhancementLineSpan(text, offset, length, polygon, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureGroundingEnhancementLineSpan)} does not support writing '{options.Format}' format."); + } + } + + AzureGroundingEnhancementLineSpan IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureGroundingEnhancementLineSpan(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureGroundingEnhancementLineSpan)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AzureGroundingEnhancementLineSpan FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAzureGroundingEnhancementLineSpan(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/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancementLineSpan.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancementLineSpan.cs new file mode 100644 index 000000000000..0c370dd4d762 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureGroundingEnhancementLineSpan.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.OpenAI +{ + /// A span object that represents a detected object and its bounding box information. + public partial class AzureGroundingEnhancementLineSpan + { + /// + /// 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; + + /// Initializes a new instance of . + /// The text content of the span that represents the detected object. + /// + /// The character offset within the text where the span begins. This offset is defined as the position of the first + /// character of the span, counting from the start of the text as Unicode codepoints. + /// + /// The length of the span in characters, measured in Unicode codepoints. + /// An array of objects representing points in the polygon that encloses the detected object. + /// or is null. + internal AzureGroundingEnhancementLineSpan(string text, int offset, int length, IEnumerable polygon) + { + Argument.AssertNotNull(text, nameof(text)); + Argument.AssertNotNull(polygon, nameof(polygon)); + + Text = text; + Offset = offset; + Length = length; + Polygon = polygon.ToList(); + } + + /// Initializes a new instance of . + /// The text content of the span that represents the detected object. + /// + /// The character offset within the text where the span begins. This offset is defined as the position of the first + /// character of the span, counting from the start of the text as Unicode codepoints. + /// + /// The length of the span in characters, measured in Unicode codepoints. + /// An array of objects representing points in the polygon that encloses the detected object. + /// Keeps track of any properties unknown to the library. + internal AzureGroundingEnhancementLineSpan(string text, int offset, int length, IReadOnlyList polygon, IDictionary serializedAdditionalRawData) + { + Text = text; + Offset = offset; + Length = length; + Polygon = polygon; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AzureGroundingEnhancementLineSpan() + { + } + + /// The text content of the span that represents the detected object. + public string Text { get; } + /// + /// The character offset within the text where the span begins. This offset is defined as the position of the first + /// character of the span, counting from the start of the text as Unicode codepoints. + /// + public int Offset { get; } + /// The length of the span in characters, measured in Unicode codepoints. + public int Length { get; } + /// An array of objects representing points in the polygon that encloses the detected object. + public IReadOnlyList Polygon { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.Serialization.cs deleted file mode 100644 index d4bda9baa41c..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.Serialization.cs +++ /dev/null @@ -1,190 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI -{ - internal partial class AzureOpenAIChatError : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AzureOpenAIChatError)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("code") != true && Optional.IsDefined(Code)) - { - writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code); - } - if (SerializedAdditionalRawData?.ContainsKey("message") != true && Optional.IsDefined(Message)) - { - writer.WritePropertyName("message"u8); - writer.WriteStringValue(Message); - } - if (SerializedAdditionalRawData?.ContainsKey("param") != true && Optional.IsDefined(Param)) - { - writer.WritePropertyName("param"u8); - writer.WriteStringValue(Param); - } - if (SerializedAdditionalRawData?.ContainsKey("type") != true && Optional.IsDefined(Type)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - } - if (SerializedAdditionalRawData?.ContainsKey("inner_error") != true && Optional.IsDefined(InnerError)) - { - writer.WritePropertyName("inner_error"u8); - writer.WriteObjectValue(InnerError, options); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - AzureOpenAIChatError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AzureOpenAIChatError)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAzureOpenAIChatError(document.RootElement, options); - } - - internal static AzureOpenAIChatError DeserializeAzureOpenAIChatError(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string code = default; - string message = default; - string param = default; - string type = default; - InternalAzureOpenAIChatErrorInnerError innerError = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code"u8)) - { - code = property.Value.GetString(); - continue; - } - if (property.NameEquals("message"u8)) - { - message = property.Value.GetString(); - continue; - } - if (property.NameEquals("param"u8)) - { - param = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("inner_error"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - innerError = InternalAzureOpenAIChatErrorInnerError.DeserializeInternalAzureOpenAIChatErrorInnerError(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new AzureOpenAIChatError( - code, - message, - param, - type, - innerError, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(AzureOpenAIChatError)} does not support writing '{options.Format}' format."); - } - } - - AzureOpenAIChatError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAzureOpenAIChatError(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AzureOpenAIChatError)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static AzureOpenAIChatError FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeAzureOpenAIChatError(document.RootElement); - } - - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.cs deleted file mode 100644 index b379c88ac0a8..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.cs +++ /dev/null @@ -1,77 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI -{ - /// The structured representation of an error from an Azure OpenAI chat completion request. - internal partial class AzureOpenAIChatError - { - /// - /// 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" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - internal AzureOpenAIChatError() - { - } - - /// Initializes a new instance of . - /// The distinct, machine-generated identifier for the error. - /// A human-readable message associated with the error. - /// If applicable, the request input parameter associated with the error. - /// If applicable, the input line number associated with the error. - /// If applicable, an upstream error that originated this error. - /// Keeps track of any properties unknown to the library. - internal AzureOpenAIChatError(string code, string message, string param, string type, InternalAzureOpenAIChatErrorInnerError innerError, IDictionary serializedAdditionalRawData) - { - Code = code; - Message = message; - Param = param; - Type = type; - InnerError = innerError; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The distinct, machine-generated identifier for the error. - public string Code { get; } - /// A human-readable message associated with the error. - public string Message { get; } - /// If applicable, the request input parameter associated with the error. - public string Param { get; } - /// If applicable, the input line number associated with the error. - public string Type { get; } - /// If applicable, an upstream error that originated this error. - public InternalAzureOpenAIChatErrorInnerError InnerError { get; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.Serialization.cs deleted file mode 100644 index a85c386fd313..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.Serialization.cs +++ /dev/null @@ -1,140 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI -{ - internal partial class AzureOpenAIChatErrorResponse : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AzureOpenAIChatErrorResponse)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("error") != true && Optional.IsDefined(Error)) - { - writer.WritePropertyName("error"u8); - writer.WriteObjectValue(Error, options); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - AzureOpenAIChatErrorResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AzureOpenAIChatErrorResponse)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAzureOpenAIChatErrorResponse(document.RootElement, options); - } - - internal static AzureOpenAIChatErrorResponse DeserializeAzureOpenAIChatErrorResponse(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - AzureOpenAIChatError error = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("error"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - error = AzureOpenAIChatError.DeserializeAzureOpenAIChatError(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new AzureOpenAIChatErrorResponse(error, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(AzureOpenAIChatErrorResponse)} does not support writing '{options.Format}' format."); - } - } - - AzureOpenAIChatErrorResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAzureOpenAIChatErrorResponse(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AzureOpenAIChatErrorResponse)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static AzureOpenAIChatErrorResponse FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeAzureOpenAIChatErrorResponse(document.RootElement); - } - - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.cs deleted file mode 100644 index 767fce2b029e..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.cs +++ /dev/null @@ -1,61 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI -{ - /// A structured representation of an error an Azure OpenAI request. - internal partial class AzureOpenAIChatErrorResponse - { - /// - /// 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" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - internal AzureOpenAIChatErrorResponse() - { - } - - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - internal AzureOpenAIChatErrorResponse(AzureOpenAIChatError error, IDictionary serializedAdditionalRawData) - { - Error = error; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Gets the error. - public AzureOpenAIChatError Error { get; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.Serialization.cs deleted file mode 100644 index 2498a9dac44b..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.Serialization.cs +++ /dev/null @@ -1,190 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI -{ - internal partial class AzureOpenAIDalleError : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AzureOpenAIDalleError)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("code") != true && Optional.IsDefined(Code)) - { - writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code); - } - if (SerializedAdditionalRawData?.ContainsKey("message") != true && Optional.IsDefined(Message)) - { - writer.WritePropertyName("message"u8); - writer.WriteStringValue(Message); - } - if (SerializedAdditionalRawData?.ContainsKey("param") != true && Optional.IsDefined(Param)) - { - writer.WritePropertyName("param"u8); - writer.WriteStringValue(Param); - } - if (SerializedAdditionalRawData?.ContainsKey("type") != true && Optional.IsDefined(Type)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - } - if (SerializedAdditionalRawData?.ContainsKey("inner_error") != true && Optional.IsDefined(InnerError)) - { - writer.WritePropertyName("inner_error"u8); - writer.WriteObjectValue(InnerError, options); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - AzureOpenAIDalleError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AzureOpenAIDalleError)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAzureOpenAIDalleError(document.RootElement, options); - } - - internal static AzureOpenAIDalleError DeserializeAzureOpenAIDalleError(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string code = default; - string message = default; - string param = default; - string type = default; - InternalAzureOpenAIDalleErrorInnerError innerError = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code"u8)) - { - code = property.Value.GetString(); - continue; - } - if (property.NameEquals("message"u8)) - { - message = property.Value.GetString(); - continue; - } - if (property.NameEquals("param"u8)) - { - param = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("inner_error"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - innerError = InternalAzureOpenAIDalleErrorInnerError.DeserializeInternalAzureOpenAIDalleErrorInnerError(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new AzureOpenAIDalleError( - code, - message, - param, - type, - innerError, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(AzureOpenAIDalleError)} does not support writing '{options.Format}' format."); - } - } - - AzureOpenAIDalleError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAzureOpenAIDalleError(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AzureOpenAIDalleError)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static AzureOpenAIDalleError FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeAzureOpenAIDalleError(document.RootElement); - } - - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.cs deleted file mode 100644 index 7dfb2de16f66..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.cs +++ /dev/null @@ -1,77 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI -{ - /// The structured representation of an error from an Azure OpenAI image generation request. - internal partial class AzureOpenAIDalleError - { - /// - /// 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" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - internal AzureOpenAIDalleError() - { - } - - /// Initializes a new instance of . - /// The distinct, machine-generated identifier for the error. - /// A human-readable message associated with the error. - /// If applicable, the request input parameter associated with the error. - /// If applicable, the input line number associated with the error. - /// If applicable, an upstream error that originated this error. - /// Keeps track of any properties unknown to the library. - internal AzureOpenAIDalleError(string code, string message, string param, string type, InternalAzureOpenAIDalleErrorInnerError innerError, IDictionary serializedAdditionalRawData) - { - Code = code; - Message = message; - Param = param; - Type = type; - InnerError = innerError; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The distinct, machine-generated identifier for the error. - public string Code { get; } - /// A human-readable message associated with the error. - public string Message { get; } - /// If applicable, the request input parameter associated with the error. - public string Param { get; } - /// If applicable, the input line number associated with the error. - public string Type { get; } - /// If applicable, an upstream error that originated this error. - public InternalAzureOpenAIDalleErrorInnerError InnerError { get; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.Serialization.cs deleted file mode 100644 index cdcc8bc203a6..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.Serialization.cs +++ /dev/null @@ -1,140 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI -{ - internal partial class AzureOpenAIDalleErrorResponse : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AzureOpenAIDalleErrorResponse)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("error") != true && Optional.IsDefined(Error)) - { - writer.WritePropertyName("error"u8); - writer.WriteObjectValue(Error, options); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - AzureOpenAIDalleErrorResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AzureOpenAIDalleErrorResponse)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAzureOpenAIDalleErrorResponse(document.RootElement, options); - } - - internal static AzureOpenAIDalleErrorResponse DeserializeAzureOpenAIDalleErrorResponse(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - AzureOpenAIDalleError error = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("error"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - error = AzureOpenAIDalleError.DeserializeAzureOpenAIDalleError(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new AzureOpenAIDalleErrorResponse(error, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(AzureOpenAIDalleErrorResponse)} does not support writing '{options.Format}' format."); - } - } - - AzureOpenAIDalleErrorResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAzureOpenAIDalleErrorResponse(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AzureOpenAIDalleErrorResponse)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static AzureOpenAIDalleErrorResponse FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeAzureOpenAIDalleErrorResponse(document.RootElement); - } - - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.Serialization.cs deleted file mode 100644 index a9deddec3d6a..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI.Chat -{ - public partial class AzureSearchChatDataSource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AzureSearchChatDataSource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("parameters") != true) - { - writer.WritePropertyName("parameters"u8); - writer.WriteObjectValue(InternalParameters, options); - } - if (SerializedAdditionalRawData?.ContainsKey("type") != true) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - AzureSearchChatDataSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AzureSearchChatDataSource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAzureSearchChatDataSource(document.RootElement, options); - } - - internal static AzureSearchChatDataSource DeserializeAzureSearchChatDataSource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - InternalAzureSearchChatDataSourceParameters parameters = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("parameters"u8)) - { - parameters = InternalAzureSearchChatDataSourceParameters.DeserializeInternalAzureSearchChatDataSourceParameters(property.Value, options); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new AzureSearchChatDataSource(type, serializedAdditionalRawData, parameters); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(AzureSearchChatDataSource)} does not support writing '{options.Format}' format."); - } - } - - AzureSearchChatDataSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAzureSearchChatDataSource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AzureSearchChatDataSource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new AzureSearchChatDataSource FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeAzureSearchChatDataSource(document.RootElement); - } - - /// Convert into a . - internal override BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.cs deleted file mode 100644 index 417a6abd7220..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.cs +++ /dev/null @@ -1,14 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI.Chat -{ - /// Represents a data source configuration that will use an Azure Search resource. - public partial class AzureSearchChatDataSource : ChatDataSource - { - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatExtensionConfiguration.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatExtensionConfiguration.Serialization.cs new file mode 100644 index 000000000000..f900ef90bb03 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatExtensionConfiguration.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class AzureSearchChatExtensionConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureSearchChatExtensionConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("parameters"u8); + writer.WriteObjectValue(Parameters, options); + } + + AzureSearchChatExtensionConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureSearchChatExtensionConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureSearchChatExtensionConfiguration(document.RootElement, options); + } + + internal static AzureSearchChatExtensionConfiguration DeserializeAzureSearchChatExtensionConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureSearchChatExtensionParameters parameters = default; + AzureChatExtensionType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("parameters"u8)) + { + parameters = AzureSearchChatExtensionParameters.DeserializeAzureSearchChatExtensionParameters(property.Value, options); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new AzureChatExtensionType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureSearchChatExtensionConfiguration(type, serializedAdditionalRawData, parameters); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureSearchChatExtensionConfiguration)} does not support writing '{options.Format}' format."); + } + } + + AzureSearchChatExtensionConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureSearchChatExtensionConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureSearchChatExtensionConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new AzureSearchChatExtensionConfiguration FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAzureSearchChatExtensionConfiguration(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/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatExtensionConfiguration.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatExtensionConfiguration.cs new file mode 100644 index 000000000000..5123cfe7c574 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatExtensionConfiguration.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// + /// A specific representation of configurable options for Azure Search when using it as an Azure OpenAI chat + /// extension. + /// + public partial class AzureSearchChatExtensionConfiguration : AzureChatExtensionConfiguration + { + /// Initializes a new instance of . + /// The parameters to use when configuring Azure Search. + /// is null. + public AzureSearchChatExtensionConfiguration(AzureSearchChatExtensionParameters parameters) + { + Argument.AssertNotNull(parameters, nameof(parameters)); + + Type = AzureChatExtensionType.AzureSearch; + Parameters = parameters; + } + + /// Initializes a new instance of . + /// + /// The label for the type of an Azure chat extension. This typically corresponds to a matching Azure resource. + /// Azure chat extensions are only compatible with Azure OpenAI. + /// + /// Keeps track of any properties unknown to the library. + /// The parameters to use when configuring Azure Search. + internal AzureSearchChatExtensionConfiguration(AzureChatExtensionType type, IDictionary serializedAdditionalRawData, AzureSearchChatExtensionParameters parameters) : base(type, serializedAdditionalRawData) + { + Parameters = parameters; + } + + /// Initializes a new instance of for deserialization. + internal AzureSearchChatExtensionConfiguration() + { + } + + /// The parameters to use when configuring Azure Search. + public AzureSearchChatExtensionParameters Parameters { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatExtensionParameters.Serialization.cs similarity index 58% rename from sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.Serialization.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatExtensionParameters.Serialization.cs index 88577c1676c5..1070c2f15152 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatExtensionParameters.Serialization.cs @@ -1,109 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable using System; -using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.Core; -namespace Azure.AI.OpenAI.Chat +namespace Azure.AI.OpenAI { - internal partial class InternalAzureSearchChatDataSourceParameters : IJsonModel + public partial class AzureSearchChatExtensionParameters : IUtf8JsonSerializable, IJsonModel { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(InternalAzureSearchChatDataSourceParameters)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(AzureSearchChatExtensionParameters)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("top_n_documents") != true && Optional.IsDefined(TopNDocuments)) + if (Optional.IsDefined(DocumentCount)) { writer.WritePropertyName("top_n_documents"u8); - writer.WriteNumberValue(TopNDocuments.Value); + writer.WriteNumberValue(DocumentCount.Value); } - if (SerializedAdditionalRawData?.ContainsKey("in_scope") != true && Optional.IsDefined(InScope)) + if (Optional.IsDefined(ShouldRestrictResultScope)) { writer.WritePropertyName("in_scope"u8); - writer.WriteBooleanValue(InScope.Value); + writer.WriteBooleanValue(ShouldRestrictResultScope.Value); } - if (SerializedAdditionalRawData?.ContainsKey("strictness") != true && Optional.IsDefined(Strictness)) + if (Optional.IsDefined(Strictness)) { writer.WritePropertyName("strictness"u8); writer.WriteNumberValue(Strictness.Value); } - if (SerializedAdditionalRawData?.ContainsKey("max_search_queries") != true && Optional.IsDefined(MaxSearchQueries)) + if (Optional.IsDefined(MaxSearchQueries)) { writer.WritePropertyName("max_search_queries"u8); writer.WriteNumberValue(MaxSearchQueries.Value); } - if (SerializedAdditionalRawData?.ContainsKey("allow_partial_result") != true && Optional.IsDefined(AllowPartialResult)) + if (Optional.IsDefined(AllowPartialResult)) { writer.WritePropertyName("allow_partial_result"u8); writer.WriteBooleanValue(AllowPartialResult.Value); } - if (SerializedAdditionalRawData?.ContainsKey("include_contexts") != true && Optional.IsCollectionDefined(_internalIncludeContexts)) + if (Optional.IsCollectionDefined(IncludeContexts)) { writer.WritePropertyName("include_contexts"u8); writer.WriteStartArray(); - foreach (var item in _internalIncludeContexts) + foreach (var item in IncludeContexts) { - writer.WriteStringValue(item); + writer.WriteStringValue(item.ToString()); } writer.WriteEndArray(); } - if (SerializedAdditionalRawData?.ContainsKey("endpoint") != true) - { - writer.WritePropertyName("endpoint"u8); - writer.WriteStringValue(Endpoint.AbsoluteUri); - } - if (SerializedAdditionalRawData?.ContainsKey("index_name") != true) - { - writer.WritePropertyName("index_name"u8); - writer.WriteStringValue(IndexName); - } - if (SerializedAdditionalRawData?.ContainsKey("authentication") != true) + if (Optional.IsDefined(Authentication)) { writer.WritePropertyName("authentication"u8); - writer.WriteObjectValue(Authentication, options); + writer.WriteObjectValue(Authentication, options); } - if (SerializedAdditionalRawData?.ContainsKey("fields_mapping") != true && Optional.IsDefined(FieldMappings)) + writer.WritePropertyName("endpoint"u8); + writer.WriteStringValue(SearchEndpoint.AbsoluteUri); + writer.WritePropertyName("index_name"u8); + writer.WriteStringValue(IndexName); + if (Optional.IsDefined(FieldMappingOptions)) { writer.WritePropertyName("fields_mapping"u8); - writer.WriteObjectValue(FieldMappings, options); + writer.WriteObjectValue(FieldMappingOptions, options); } - if (SerializedAdditionalRawData?.ContainsKey("query_type") != true && Optional.IsDefined(QueryType)) + if (Optional.IsDefined(QueryType)) { writer.WritePropertyName("query_type"u8); writer.WriteStringValue(QueryType.Value.ToString()); } - if (SerializedAdditionalRawData?.ContainsKey("semantic_configuration") != true && Optional.IsDefined(SemanticConfiguration)) + if (Optional.IsDefined(SemanticConfiguration)) { writer.WritePropertyName("semantic_configuration"u8); writer.WriteStringValue(SemanticConfiguration); } - if (SerializedAdditionalRawData?.ContainsKey("filter") != true && Optional.IsDefined(Filter)) + if (Optional.IsDefined(Filter)) { writer.WritePropertyName("filter"u8); writer.WriteStringValue(Filter); } - if (SerializedAdditionalRawData?.ContainsKey("embedding_dependency") != true && Optional.IsDefined(VectorizationSource)) + if (Optional.IsDefined(EmbeddingDependency)) { writer.WritePropertyName("embedding_dependency"u8); - writer.WriteObjectValue(VectorizationSource, options); + writer.WriteObjectValue(EmbeddingDependency, options); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _serializedAdditionalRawData != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _serializedAdditionalRawData) { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -115,22 +118,21 @@ void IJsonModel.Write(Utf8JsonWrite #endif } } - writer.WriteEndObject(); } - InternalAzureSearchChatDataSourceParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AzureSearchChatExtensionParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(InternalAzureSearchChatDataSourceParameters)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(AzureSearchChatExtensionParameters)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInternalAzureSearchChatDataSourceParameters(document.RootElement, options); + return DeserializeAzureSearchChatExtensionParameters(document.RootElement, options); } - internal static InternalAzureSearchChatDataSourceParameters DeserializeInternalAzureSearchChatDataSourceParameters(JsonElement element, ModelReaderWriterOptions options = null) + internal static AzureSearchChatExtensionParameters DeserializeAzureSearchChatExtensionParameters(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -143,15 +145,15 @@ internal static InternalAzureSearchChatDataSourceParameters DeserializeInternalA int? strictness = default; int? maxSearchQueries = default; bool? allowPartialResult = default; - IList includeContexts = default; + IList includeContexts = default; + OnYourDataAuthenticationOptions authentication = default; Uri endpoint = default; string indexName = default; - DataSourceAuthentication authentication = default; - DataSourceFieldMappings fieldsMapping = default; - DataSourceQueryType? queryType = default; + AzureSearchIndexFieldMappingOptions fieldsMapping = default; + AzureSearchQueryType? queryType = default; string semanticConfiguration = default; string filter = default; - DataSourceVectorizer embeddingDependency = default; + OnYourDataVectorizationSource embeddingDependency = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -207,14 +209,23 @@ internal static InternalAzureSearchChatDataSourceParameters DeserializeInternalA { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(item.GetString()); + array.Add(new OnYourDataContextProperty(item.GetString())); } includeContexts = array; continue; } + if (property.NameEquals("authentication"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authentication = OnYourDataAuthenticationOptions.DeserializeOnYourDataAuthenticationOptions(property.Value, options); + continue; + } if (property.NameEquals("endpoint"u8)) { endpoint = new Uri(property.Value.GetString()); @@ -225,18 +236,13 @@ internal static InternalAzureSearchChatDataSourceParameters DeserializeInternalA indexName = property.Value.GetString(); continue; } - if (property.NameEquals("authentication"u8)) - { - authentication = DataSourceAuthentication.DeserializeDataSourceAuthentication(property.Value, options); - continue; - } if (property.NameEquals("fields_mapping"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - fieldsMapping = DataSourceFieldMappings.DeserializeDataSourceFieldMappings(property.Value, options); + fieldsMapping = AzureSearchIndexFieldMappingOptions.DeserializeAzureSearchIndexFieldMappingOptions(property.Value, options); continue; } if (property.NameEquals("query_type"u8)) @@ -245,7 +251,7 @@ internal static InternalAzureSearchChatDataSourceParameters DeserializeInternalA { continue; } - queryType = new DataSourceQueryType(property.Value.GetString()); + queryType = new AzureSearchQueryType(property.Value.GetString()); continue; } if (property.NameEquals("semantic_configuration"u8)) @@ -264,26 +270,25 @@ internal static InternalAzureSearchChatDataSourceParameters DeserializeInternalA { continue; } - embeddingDependency = DataSourceVectorizer.DeserializeDataSourceVectorizer(property.Value, options); + embeddingDependency = OnYourDataVectorizationSource.DeserializeOnYourDataVectorizationSource(property.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureSearchChatDataSourceParameters( + return new AzureSearchChatExtensionParameters( topNDocuments, inScope, strictness, maxSearchQueries, allowPartialResult, - includeContexts ?? new ChangeTrackingList(), + includeContexts ?? new ChangeTrackingList(), + authentication, endpoint, indexName, - authentication, fieldsMapping, queryType, semanticConfiguration, @@ -292,49 +297,51 @@ internal static InternalAzureSearchChatDataSourceParameters DeserializeInternalA serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(InternalAzureSearchChatDataSourceParameters)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(AzureSearchChatExtensionParameters)} does not support writing '{options.Format}' format."); } } - InternalAzureSearchChatDataSourceParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + AzureSearchChatExtensionParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInternalAzureSearchChatDataSourceParameters(document.RootElement, options); + return DeserializeAzureSearchChatExtensionParameters(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(InternalAzureSearchChatDataSourceParameters)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(AzureSearchChatExtensionParameters)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static InternalAzureSearchChatDataSourceParameters FromResponse(PipelineResponse response) + /// The response to deserialize the model from. + internal static AzureSearchChatExtensionParameters FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureSearchChatDataSourceParameters(document.RootElement); + return DeserializeAzureSearchChatExtensionParameters(document.RootElement); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// Convert into a . + internal virtual RequestContent ToRequestContent() { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatExtensionParameters.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatExtensionParameters.cs new file mode 100644 index 000000000000..ad1430d18c2f --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatExtensionParameters.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Parameters for Azure Cognitive Search when used as an Azure OpenAI chat extension. The supported authentication types are APIKey, SystemAssignedManagedIdentity and UserAssignedManagedIdentity. + public partial class AzureSearchChatExtensionParameters + { + /// + /// 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; + + /// Initializes a new instance of . + /// The absolute endpoint path for the Azure Cognitive Search resource to use. + /// The name of the index to use as available in the referenced Azure Cognitive Search resource. + /// or is null. + public AzureSearchChatExtensionParameters(Uri searchEndpoint, string indexName) + { + Argument.AssertNotNull(searchEndpoint, nameof(searchEndpoint)); + Argument.AssertNotNull(indexName, nameof(indexName)); + + IncludeContexts = new ChangeTrackingList(); + SearchEndpoint = searchEndpoint; + IndexName = indexName; + } + + /// Initializes a new instance of . + /// The configured top number of documents to feature for the configured query. + /// Whether queries should be restricted to use of indexed data. + /// The configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but lower recall of the answer. + /// + /// The max number of rewritten queries should be send to search provider for one user message. If not specified, + /// the system will decide the number of queries to send. + /// + /// + /// If specified as true, the system will allow partial search results to be used and the request fails if all the queries fail. + /// If not specified, or specified as false, the request will fail if any search query fails. + /// + /// The included properties of the output context. If not specified, the default value is `citations` and `intent`. + /// + /// The authentication method to use when accessing the defined data source. + /// Each data source type supports a specific set of available authentication methods; please see the documentation of + /// the data source for supported mechanisms. + /// If not otherwise provided, On Your Data will attempt to use System Managed Identity (default credential) + /// authentication. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , and . + /// + /// The absolute endpoint path for the Azure Cognitive Search resource to use. + /// The name of the index to use as available in the referenced Azure Cognitive Search resource. + /// Customized field mapping behavior to use when interacting with the search index. + /// The query type to use with Azure Cognitive Search. + /// The additional semantic configuration for the query. + /// Search filter. + /// + /// The embedding dependency for vector search. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + /// Keeps track of any properties unknown to the library. + internal AzureSearchChatExtensionParameters(int? documentCount, bool? shouldRestrictResultScope, int? strictness, int? maxSearchQueries, bool? allowPartialResult, IList includeContexts, OnYourDataAuthenticationOptions authentication, Uri searchEndpoint, string indexName, AzureSearchIndexFieldMappingOptions fieldMappingOptions, AzureSearchQueryType? queryType, string semanticConfiguration, string filter, OnYourDataVectorizationSource embeddingDependency, IDictionary serializedAdditionalRawData) + { + DocumentCount = documentCount; + ShouldRestrictResultScope = shouldRestrictResultScope; + Strictness = strictness; + MaxSearchQueries = maxSearchQueries; + AllowPartialResult = allowPartialResult; + IncludeContexts = includeContexts; + Authentication = authentication; + SearchEndpoint = searchEndpoint; + IndexName = indexName; + FieldMappingOptions = fieldMappingOptions; + QueryType = queryType; + SemanticConfiguration = semanticConfiguration; + Filter = filter; + EmbeddingDependency = embeddingDependency; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AzureSearchChatExtensionParameters() + { + } + + /// The configured top number of documents to feature for the configured query. + public int? DocumentCount { get; set; } + /// Whether queries should be restricted to use of indexed data. + public bool? ShouldRestrictResultScope { get; set; } + /// The configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but lower recall of the answer. + public int? Strictness { get; set; } + /// + /// The max number of rewritten queries should be send to search provider for one user message. If not specified, + /// the system will decide the number of queries to send. + /// + public int? MaxSearchQueries { get; set; } + /// + /// If specified as true, the system will allow partial search results to be used and the request fails if all the queries fail. + /// If not specified, or specified as false, the request will fail if any search query fails. + /// + public bool? AllowPartialResult { get; set; } + /// The included properties of the output context. If not specified, the default value is `citations` and `intent`. + public IList IncludeContexts { get; } + /// + /// The authentication method to use when accessing the defined data source. + /// Each data source type supports a specific set of available authentication methods; please see the documentation of + /// the data source for supported mechanisms. + /// If not otherwise provided, On Your Data will attempt to use System Managed Identity (default credential) + /// authentication. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , and . + /// + public OnYourDataAuthenticationOptions Authentication { get; set; } + /// The absolute endpoint path for the Azure Cognitive Search resource to use. + public Uri SearchEndpoint { get; } + /// The name of the index to use as available in the referenced Azure Cognitive Search resource. + public string IndexName { get; } + /// Customized field mapping behavior to use when interacting with the search index. + public AzureSearchIndexFieldMappingOptions FieldMappingOptions { get; set; } + /// The query type to use with Azure Cognitive Search. + public AzureSearchQueryType? QueryType { get; set; } + /// The additional semantic configuration for the query. + public string SemanticConfiguration { get; set; } + /// Search filter. + public string Filter { get; set; } + /// + /// The embedding dependency for vector search. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + public OnYourDataVectorizationSource EmbeddingDependency { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchIndexFieldMappingOptions.Serialization.cs similarity index 65% rename from sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.Serialization.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchIndexFieldMappingOptions.Serialization.cs index 9daa6c711873..06f1fb8b2722 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchIndexFieldMappingOptions.Serialization.cs @@ -1,42 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable using System; -using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.Core; -namespace Azure.AI.OpenAI.Chat +namespace Azure.AI.OpenAI { - public partial class DataSourceFieldMappings : IJsonModel + public partial class AzureSearchIndexFieldMappingOptions : IUtf8JsonSerializable, IJsonModel { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DataSourceFieldMappings)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(AzureSearchIndexFieldMappingOptions)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("title_field") != true && Optional.IsDefined(TitleFieldName)) + if (Optional.IsDefined(TitleFieldName)) { writer.WritePropertyName("title_field"u8); writer.WriteStringValue(TitleFieldName); } - if (SerializedAdditionalRawData?.ContainsKey("url_field") != true && Optional.IsDefined(UrlFieldName)) + if (Optional.IsDefined(UrlFieldName)) { writer.WritePropertyName("url_field"u8); writer.WriteStringValue(UrlFieldName); } - if (SerializedAdditionalRawData?.ContainsKey("filepath_field") != true && Optional.IsDefined(FilePathFieldName)) + if (Optional.IsDefined(FilepathFieldName)) { writer.WritePropertyName("filepath_field"u8); - writer.WriteStringValue(FilePathFieldName); + writer.WriteStringValue(FilepathFieldName); } - if (SerializedAdditionalRawData?.ContainsKey("content_fields") != true && Optional.IsCollectionDefined(ContentFieldNames)) + if (Optional.IsCollectionDefined(ContentFieldNames)) { writer.WritePropertyName("content_fields"u8); writer.WriteStartArray(); @@ -46,12 +59,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade } writer.WriteEndArray(); } - if (SerializedAdditionalRawData?.ContainsKey("content_fields_separator") != true && Optional.IsDefined(ContentFieldSeparator)) + if (Optional.IsDefined(ContentFieldSeparator)) { writer.WritePropertyName("content_fields_separator"u8); writer.WriteStringValue(ContentFieldSeparator); } - if (SerializedAdditionalRawData?.ContainsKey("vector_fields") != true && Optional.IsCollectionDefined(VectorFieldNames)) + if (Optional.IsCollectionDefined(VectorFieldNames)) { writer.WritePropertyName("vector_fields"u8); writer.WriteStartArray(); @@ -61,7 +74,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade } writer.WriteEndArray(); } - if (SerializedAdditionalRawData?.ContainsKey("image_vector_fields") != true && Optional.IsCollectionDefined(ImageVectorFieldNames)) + if (Optional.IsCollectionDefined(ImageVectorFieldNames)) { writer.WritePropertyName("image_vector_fields"u8); writer.WriteStartArray(); @@ -71,14 +84,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade } writer.WriteEndArray(); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _serializedAdditionalRawData != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _serializedAdditionalRawData) { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -90,22 +99,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif } } - writer.WriteEndObject(); } - DataSourceFieldMappings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AzureSearchIndexFieldMappingOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DataSourceFieldMappings)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(AzureSearchIndexFieldMappingOptions)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataSourceFieldMappings(document.RootElement, options); + return DeserializeAzureSearchIndexFieldMappingOptions(document.RootElement, options); } - internal static DataSourceFieldMappings DeserializeDataSourceFieldMappings(JsonElement element, ModelReaderWriterOptions options = null) + internal static AzureSearchIndexFieldMappingOptions DeserializeAzureSearchIndexFieldMappingOptions(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -188,12 +196,11 @@ internal static DataSourceFieldMappings DeserializeDataSourceFieldMappings(JsonE } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new DataSourceFieldMappings( + return new AzureSearchIndexFieldMappingOptions( titleField, urlField, filepathField, @@ -204,49 +211,51 @@ internal static DataSourceFieldMappings DeserializeDataSourceFieldMappings(JsonE serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(DataSourceFieldMappings)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(AzureSearchIndexFieldMappingOptions)} does not support writing '{options.Format}' format."); } } - DataSourceFieldMappings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + AzureSearchIndexFieldMappingOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDataSourceFieldMappings(document.RootElement, options); + return DeserializeAzureSearchIndexFieldMappingOptions(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DataSourceFieldMappings)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(AzureSearchIndexFieldMappingOptions)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static DataSourceFieldMappings FromResponse(PipelineResponse response) + /// The response to deserialize the model from. + internal static AzureSearchIndexFieldMappingOptions FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeDataSourceFieldMappings(document.RootElement); + return DeserializeAzureSearchIndexFieldMappingOptions(document.RootElement); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// Convert into a . + internal virtual RequestContent ToRequestContent() { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchIndexFieldMappingOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchIndexFieldMappingOptions.cs new file mode 100644 index 000000000000..cd659dda5d7f --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchIndexFieldMappingOptions.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Optional settings to control how fields are processed when using a configured Azure Search resource. + public partial class AzureSearchIndexFieldMappingOptions + { + /// + /// 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; + + /// Initializes a new instance of . + public AzureSearchIndexFieldMappingOptions() + { + ContentFieldNames = new ChangeTrackingList(); + VectorFieldNames = new ChangeTrackingList(); + ImageVectorFieldNames = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The name of the index field to use as a title. + /// The name of the index field to use as a URL. + /// The name of the index field to use as a filepath. + /// The names of index fields that should be treated as content. + /// The separator pattern that content fields should use. + /// The names of fields that represent vector data. + /// The names of fields that represent image vector data. + /// Keeps track of any properties unknown to the library. + internal AzureSearchIndexFieldMappingOptions(string titleFieldName, string urlFieldName, string filepathFieldName, IList contentFieldNames, string contentFieldSeparator, IList vectorFieldNames, IList imageVectorFieldNames, IDictionary serializedAdditionalRawData) + { + TitleFieldName = titleFieldName; + UrlFieldName = urlFieldName; + FilepathFieldName = filepathFieldName; + ContentFieldNames = contentFieldNames; + ContentFieldSeparator = contentFieldSeparator; + VectorFieldNames = vectorFieldNames; + ImageVectorFieldNames = imageVectorFieldNames; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name of the index field to use as a title. + public string TitleFieldName { get; set; } + /// The name of the index field to use as a URL. + public string UrlFieldName { get; set; } + /// The name of the index field to use as a filepath. + public string FilepathFieldName { get; set; } + /// The names of index fields that should be treated as content. + public IList ContentFieldNames { get; } + /// The separator pattern that content fields should use. + public string ContentFieldSeparator { get; set; } + /// The names of fields that represent vector data. + public IList VectorFieldNames { get; } + /// The names of fields that represent image vector data. + public IList ImageVectorFieldNames { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchQueryType.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchQueryType.cs new file mode 100644 index 000000000000..98b220dec5f2 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchQueryType.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// The type of Azure Search retrieval query that should be executed when using it as an Azure OpenAI chat extension. + public readonly partial struct AzureSearchQueryType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureSearchQueryType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SimpleValue = "simple"; + private const string SemanticValue = "semantic"; + private const string VectorValue = "vector"; + private const string VectorSimpleHybridValue = "vector_simple_hybrid"; + private const string VectorSemanticHybridValue = "vector_semantic_hybrid"; + + /// Represents the default, simple query parser. + public static AzureSearchQueryType Simple { get; } = new AzureSearchQueryType(SimpleValue); + /// Represents the semantic query parser for advanced semantic modeling. + public static AzureSearchQueryType Semantic { get; } = new AzureSearchQueryType(SemanticValue); + /// Represents vector search over computed data. + public static AzureSearchQueryType Vector { get; } = new AzureSearchQueryType(VectorValue); + /// Represents a combination of the simple query strategy with vector data. + public static AzureSearchQueryType VectorSimpleHybrid { get; } = new AzureSearchQueryType(VectorSimpleHybridValue); + /// Represents a combination of semantic search and vector data querying. + public static AzureSearchQueryType VectorSemanticHybrid { get; } = new AzureSearchQueryType(VectorSemanticHybridValue); + /// Determines if two values are the same. + public static bool operator ==(AzureSearchQueryType left, AzureSearchQueryType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureSearchQueryType left, AzureSearchQueryType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureSearchQueryType(string value) => new AzureSearchQueryType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureSearchQueryType other && Equals(other); + /// + public bool Equals(AzureSearchQueryType 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/openai/Azure.AI.OpenAI/src/Generated/Batch.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Batch.Serialization.cs new file mode 100644 index 000000000000..b15e071e4de1 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/Batch.Serialization.cs @@ -0,0 +1,429 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + internal partial class Batch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenAI.Batch)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("object"u8); + writer.WriteStringValue(Object.ToString()); + if (Optional.IsDefined(Endpoint)) + { + writer.WritePropertyName("endpoint"u8); + writer.WriteStringValue(Endpoint); + } + if (Optional.IsDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteObjectValue(Errors, options); + } + writer.WritePropertyName("input_file_id"u8); + writer.WriteStringValue(InputFileId); + if (Optional.IsDefined(CompletionWindow)) + { + writer.WritePropertyName("completion_window"u8); + writer.WriteStringValue(CompletionWindow); + } + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(OutputFileId)) + { + writer.WritePropertyName("output_file_id"u8); + writer.WriteStringValue(OutputFileId); + } + if (Optional.IsDefined(ErrorFileId)) + { + writer.WritePropertyName("error_file_id"u8); + writer.WriteStringValue(ErrorFileId); + } + if (Optional.IsDefined(CreatedAt)) + { + writer.WritePropertyName("created_at"u8); + writer.WriteNumberValue(CreatedAt.Value, "U"); + } + if (Optional.IsDefined(InProgressAt)) + { + writer.WritePropertyName("in_progress_at"u8); + writer.WriteNumberValue(InProgressAt.Value, "U"); + } + if (Optional.IsDefined(ExpiresAt)) + { + writer.WritePropertyName("expires_at"u8); + writer.WriteNumberValue(ExpiresAt.Value, "U"); + } + if (Optional.IsDefined(FinalizingAt)) + { + writer.WritePropertyName("finalizing_at"u8); + writer.WriteNumberValue(FinalizingAt.Value, "U"); + } + if (Optional.IsDefined(CompletedAt)) + { + writer.WritePropertyName("completed_at"u8); + writer.WriteNumberValue(CompletedAt.Value, "U"); + } + if (Optional.IsDefined(FailedAt)) + { + writer.WritePropertyName("failed_at"u8); + writer.WriteNumberValue(FailedAt.Value, "U"); + } + if (Optional.IsDefined(ExpiredAt)) + { + writer.WritePropertyName("expired_at"u8); + writer.WriteNumberValue(ExpiredAt.Value, "U"); + } + if (Optional.IsDefined(CancellingAt)) + { + writer.WritePropertyName("cancelling_at"u8); + writer.WriteNumberValue(CancellingAt.Value, "U"); + } + if (Optional.IsDefined(CancelledAt)) + { + writer.WritePropertyName("cancelled_at"u8); + writer.WriteNumberValue(CancelledAt.Value, "U"); + } + if (Optional.IsDefined(RequestCounts)) + { + writer.WritePropertyName("request_counts"u8); + writer.WriteObjectValue(RequestCounts, options); + } + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartObject(); + foreach (var item in Metadata) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OpenAI.Batch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenAI.Batch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return OpenAI.Batch.DeserializeBatch(document.RootElement, options); + } + + internal static OpenAI.Batch DeserializeBatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + BatchObject @object = default; + string endpoint = default; + BatchErrorList errors = default; + string inputFileId = default; + string completionWindow = default; + BatchStatus? status = default; + string outputFileId = default; + string errorFileId = default; + DateTimeOffset? createdAt = default; + DateTimeOffset? inProgressAt = default; + DateTimeOffset? expiresAt = default; + DateTimeOffset? finalizingAt = default; + DateTimeOffset? completedAt = default; + DateTimeOffset? failedAt = default; + DateTimeOffset? expiredAt = default; + DateTimeOffset? cancellingAt = default; + DateTimeOffset? cancelledAt = default; + BatchRequestCounts requestCounts = default; + IReadOnlyDictionary metadata = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("object"u8)) + { + @object = new BatchObject(property.Value.GetString()); + continue; + } + if (property.NameEquals("endpoint"u8)) + { + endpoint = property.Value.GetString(); + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + errors = BatchErrorList.DeserializeBatchErrorList(property.Value, options); + continue; + } + if (property.NameEquals("input_file_id"u8)) + { + inputFileId = property.Value.GetString(); + continue; + } + if (property.NameEquals("completion_window"u8)) + { + completionWindow = property.Value.GetString(); + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new BatchStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("output_file_id"u8)) + { + outputFileId = property.Value.GetString(); + continue; + } + if (property.NameEquals("error_file_id"u8)) + { + errorFileId = property.Value.GetString(); + continue; + } + if (property.NameEquals("created_at"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdAt = DateTimeOffset.FromUnixTimeSeconds(property.Value.GetInt64()); + continue; + } + if (property.NameEquals("in_progress_at"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + inProgressAt = DateTimeOffset.FromUnixTimeSeconds(property.Value.GetInt64()); + continue; + } + if (property.NameEquals("expires_at"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expiresAt = DateTimeOffset.FromUnixTimeSeconds(property.Value.GetInt64()); + continue; + } + if (property.NameEquals("finalizing_at"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + finalizingAt = DateTimeOffset.FromUnixTimeSeconds(property.Value.GetInt64()); + continue; + } + if (property.NameEquals("completed_at"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + completedAt = DateTimeOffset.FromUnixTimeSeconds(property.Value.GetInt64()); + continue; + } + if (property.NameEquals("failed_at"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + failedAt = DateTimeOffset.FromUnixTimeSeconds(property.Value.GetInt64()); + continue; + } + if (property.NameEquals("expired_at"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expiredAt = DateTimeOffset.FromUnixTimeSeconds(property.Value.GetInt64()); + continue; + } + if (property.NameEquals("cancelling_at"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cancellingAt = DateTimeOffset.FromUnixTimeSeconds(property.Value.GetInt64()); + continue; + } + if (property.NameEquals("cancelled_at"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cancelledAt = DateTimeOffset.FromUnixTimeSeconds(property.Value.GetInt64()); + continue; + } + if (property.NameEquals("request_counts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + requestCounts = BatchRequestCounts.DeserializeBatchRequestCounts(property.Value, options); + continue; + } + if (property.NameEquals("metadata"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; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OpenAI.Batch( + id, + @object, + endpoint, + errors, + inputFileId, + completionWindow, + status, + outputFileId, + errorFileId, + createdAt, + inProgressAt, + expiresAt, + finalizingAt, + completedAt, + failedAt, + expiredAt, + cancellingAt, + cancelledAt, + requestCounts, + metadata ?? new ChangeTrackingDictionary(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OpenAI.Batch)} does not support writing '{options.Format}' format."); + } + } + + OpenAI.Batch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return OpenAI.Batch.DeserializeBatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OpenAI.Batch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static OpenAI.Batch FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return OpenAI.Batch.DeserializeBatch(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/openai/Azure.AI.OpenAI/src/Generated/Batch.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Batch.cs new file mode 100644 index 000000000000..6bed6d1a92f9 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/Batch.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// The Batch object. + internal partial class Batch + { + /// + /// 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; + + /// Initializes a new instance of . + /// The id assigned to the Batch. + /// The ID of the input file for the batch. + /// or is null. + internal Batch(string id, string inputFileId) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(inputFileId, nameof(inputFileId)); + + Id = id; + InputFileId = inputFileId; + Metadata = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The id assigned to the Batch. + /// The object type, which is always `batch`. + /// The OpenAI API endpoint used by the batch. + /// The list of Batch errors. + /// The ID of the input file for the batch. + /// The time frame within which the batch should be processed. + /// The current status of the batch. + /// The ID of the file containing the outputs of successfully executed requests. + /// The ID of the file containing the outputs of requests with errors. + /// The Unix timestamp (in seconds) for when the batch was created. + /// The Unix timestamp (in seconds) for when the batch started processing. + /// The Unix timestamp (in seconds) for when the batch will expire. + /// The Unix timestamp (in seconds) for when the batch started finalizing. + /// The Unix timestamp (in seconds) for when the batch was completed. + /// The Unix timestamp (in seconds) for when the batch failed. + /// The Unix timestamp (in seconds) for when the batch expired. + /// The Unix timestamp (in seconds) for when the batch started cancelling. + /// The Unix timestamp (in seconds) for when the batch was cancelled. + /// The request counts for different statuses within the batch. + /// A set of key-value pairs that can be attached to the batch. This can be useful for storing additional information about the batch in a structured format. + /// Keeps track of any properties unknown to the library. + internal Batch(string id, BatchObject @object, string endpoint, BatchErrorList errors, string inputFileId, string completionWindow, BatchStatus? status, string outputFileId, string errorFileId, DateTimeOffset? createdAt, DateTimeOffset? inProgressAt, DateTimeOffset? expiresAt, DateTimeOffset? finalizingAt, DateTimeOffset? completedAt, DateTimeOffset? failedAt, DateTimeOffset? expiredAt, DateTimeOffset? cancellingAt, DateTimeOffset? cancelledAt, BatchRequestCounts requestCounts, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) + { + Id = id; + Object = @object; + Endpoint = endpoint; + Errors = errors; + InputFileId = inputFileId; + CompletionWindow = completionWindow; + Status = status; + OutputFileId = outputFileId; + ErrorFileId = errorFileId; + CreatedAt = createdAt; + InProgressAt = inProgressAt; + ExpiresAt = expiresAt; + FinalizingAt = finalizingAt; + CompletedAt = completedAt; + FailedAt = failedAt; + ExpiredAt = expiredAt; + CancellingAt = cancellingAt; + CancelledAt = cancelledAt; + RequestCounts = requestCounts; + Metadata = metadata; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal Batch() + { + } + + /// The id assigned to the Batch. + public string Id { get; } + /// The object type, which is always `batch`. + public BatchObject Object { get; } = BatchObject.Batch; + + /// The OpenAI API endpoint used by the batch. + public string Endpoint { get; } + /// The list of Batch errors. + public BatchErrorList Errors { get; } + /// The ID of the input file for the batch. + public string InputFileId { get; } + /// The time frame within which the batch should be processed. + public string CompletionWindow { get; } + /// The current status of the batch. + public BatchStatus? Status { get; } + /// The ID of the file containing the outputs of successfully executed requests. + public string OutputFileId { get; } + /// The ID of the file containing the outputs of requests with errors. + public string ErrorFileId { get; } + /// The Unix timestamp (in seconds) for when the batch was created. + public DateTimeOffset? CreatedAt { get; } + /// The Unix timestamp (in seconds) for when the batch started processing. + public DateTimeOffset? InProgressAt { get; } + /// The Unix timestamp (in seconds) for when the batch will expire. + public DateTimeOffset? ExpiresAt { get; } + /// The Unix timestamp (in seconds) for when the batch started finalizing. + public DateTimeOffset? FinalizingAt { get; } + /// The Unix timestamp (in seconds) for when the batch was completed. + public DateTimeOffset? CompletedAt { get; } + /// The Unix timestamp (in seconds) for when the batch failed. + public DateTimeOffset? FailedAt { get; } + /// The Unix timestamp (in seconds) for when the batch expired. + public DateTimeOffset? ExpiredAt { get; } + /// The Unix timestamp (in seconds) for when the batch started cancelling. + public DateTimeOffset? CancellingAt { get; } + /// The Unix timestamp (in seconds) for when the batch was cancelled. + public DateTimeOffset? CancelledAt { get; } + /// The request counts for different statuses within the batch. + public BatchRequestCounts RequestCounts { get; } + /// A set of key-value pairs that can be attached to the batch. This can be useful for storing additional information about the batch in a structured format. + public IReadOnlyDictionary Metadata { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProgressEventData.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchCreateRequest.Serialization.cs similarity index 54% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProgressEventData.Serialization.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/BatchCreateRequest.Serialization.cs index dce247a47310..203e9e670fad 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProgressEventData.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchCreateRequest.Serialization.cs @@ -11,13 +11,13 @@ using System.Text.Json; using Azure.Core; -namespace Azure.Messaging.EventGrid.SystemEvents +namespace Azure.AI.OpenAI { - public partial class MediaJobOutputProgressEventData : IUtf8JsonSerializable, IJsonModel + public partial class BatchCreateRequest : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,30 +28,29 @@ 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobOutputProgressEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(BatchCreateRequest)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Label)) + writer.WritePropertyName("endpoint"u8); + writer.WriteStringValue(Endpoint); + writer.WritePropertyName("input_file_id"u8); + writer.WriteStringValue(InputFileId); + writer.WritePropertyName("completion_window"u8); + writer.WriteStringValue(CompletionWindow); + if (Optional.IsCollectionDefined(Metadata)) { - writer.WritePropertyName("label"u8); - writer.WriteStringValue(Label); - } - if (Optional.IsDefined(Progress)) - { - writer.WritePropertyName("progress"u8); - writer.WriteNumberValue(Progress.Value); - } - writer.WritePropertyName("jobCorrelationData"u8); - writer.WriteStartObject(); - foreach (var item in JobCorrelationData) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); + writer.WritePropertyName("metadata"u8); + writer.WriteStartObject(); + foreach (var item in Metadata) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); } - writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -69,19 +68,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - MediaJobOutputProgressEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + BatchCreateRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobOutputProgressEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(BatchCreateRequest)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaJobOutputProgressEventData(document.RootElement, options); + return DeserializeBatchCreateRequest(document.RootElement, options); } - internal static MediaJobOutputProgressEventData DeserializeMediaJobOutputProgressEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static BatchCreateRequest DeserializeBatchCreateRequest(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -89,35 +88,41 @@ internal static MediaJobOutputProgressEventData DeserializeMediaJobOutputProgres { return null; } - string label = default; - long? progress = default; - IReadOnlyDictionary jobCorrelationData = default; + string endpoint = default; + string inputFileId = default; + string completionWindow = default; + IDictionary metadata = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("label"u8)) + if (property.NameEquals("endpoint"u8)) { - label = property.Value.GetString(); + endpoint = property.Value.GetString(); continue; } - if (property.NameEquals("progress"u8)) + if (property.NameEquals("input_file_id"u8)) + { + inputFileId = property.Value.GetString(); + continue; + } + if (property.NameEquals("completion_window"u8)) + { + completionWindow = property.Value.GetString(); + continue; + } + if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - progress = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("jobCorrelationData"u8)) - { Dictionary dictionary = new Dictionary(); foreach (var property0 in property.Value.EnumerateObject()) { dictionary.Add(property0.Name, property0.Value.GetString()); } - jobCorrelationData = dictionary; + metadata = dictionary; continue; } if (options.Format != "W") @@ -126,46 +131,46 @@ internal static MediaJobOutputProgressEventData DeserializeMediaJobOutputProgres } } serializedAdditionalRawData = rawDataDictionary; - return new MediaJobOutputProgressEventData(label, progress, jobCorrelationData, serializedAdditionalRawData); + return new BatchCreateRequest(endpoint, inputFileId, completionWindow, metadata ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MediaJobOutputProgressEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(BatchCreateRequest)} does not support writing '{options.Format}' format."); } } - MediaJobOutputProgressEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + BatchCreateRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaJobOutputProgressEventData(document.RootElement, options); + return DeserializeBatchCreateRequest(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MediaJobOutputProgressEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(BatchCreateRequest)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static MediaJobOutputProgressEventData FromResponse(Response response) + internal static BatchCreateRequest FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaJobOutputProgressEventData(document.RootElement); + return DeserializeBatchCreateRequest(document.RootElement); } /// Convert into a . diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchCreateRequest.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchCreateRequest.cs new file mode 100644 index 000000000000..b041ee731672 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchCreateRequest.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Defines the request to create a batch. + public partial class BatchCreateRequest + { + /// + /// 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; + + /// Initializes a new instance of . + /// The API endpoint used by the batch. + /// The ID of the input file for the batch. + /// The time frame within which the batch should be processed. + /// , or is null. + public BatchCreateRequest(string endpoint, string inputFileId, string completionWindow) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(inputFileId, nameof(inputFileId)); + Argument.AssertNotNull(completionWindow, nameof(completionWindow)); + + Endpoint = endpoint; + InputFileId = inputFileId; + CompletionWindow = completionWindow; + Metadata = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The API endpoint used by the batch. + /// The ID of the input file for the batch. + /// The time frame within which the batch should be processed. + /// A set of key-value pairs that can be attached to the batch. This can be useful for storing additional information about the batch in a structured format. + /// Keeps track of any properties unknown to the library. + internal BatchCreateRequest(string endpoint, string inputFileId, string completionWindow, IDictionary metadata, IDictionary serializedAdditionalRawData) + { + Endpoint = endpoint; + InputFileId = inputFileId; + CompletionWindow = completionWindow; + Metadata = metadata; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BatchCreateRequest() + { + } + + /// The API endpoint used by the batch. + public string Endpoint { get; } + /// The ID of the input file for the batch. + public string InputFileId { get; } + /// The time frame within which the batch should be processed. + public string CompletionWindow { get; } + /// A set of key-value pairs that can be attached to the batch. This can be useful for storing additional information about the batch in a structured format. + public IDictionary Metadata { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchErrorDatum.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchErrorDatum.Serialization.cs new file mode 100644 index 000000000000..2d334e532bde --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchErrorDatum.Serialization.cs @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + internal partial class BatchErrorDatum : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(BatchErrorDatum)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (Optional.IsDefined(Param)) + { + writer.WritePropertyName("param"u8); + writer.WriteStringValue(Param); + } + if (Optional.IsDefined(Line)) + { + writer.WritePropertyName("line"u8); + writer.WriteNumberValue(Line.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BatchErrorDatum IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BatchErrorDatum)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBatchErrorDatum(document.RootElement, options); + } + + internal static BatchErrorDatum DeserializeBatchErrorDatum(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string code = default; + string message = default; + string param = default; + int? line = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("param"u8)) + { + param = property.Value.GetString(); + continue; + } + if (property.NameEquals("line"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + line = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BatchErrorDatum(code, message, param, line, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BatchErrorDatum)} does not support writing '{options.Format}' format."); + } + } + + BatchErrorDatum IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBatchErrorDatum(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BatchErrorDatum)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static BatchErrorDatum FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeBatchErrorDatum(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/openai/Azure.AI.OpenAI/src/Generated/BatchErrorDatum.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchErrorDatum.cs new file mode 100644 index 000000000000..456d267b86e9 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchErrorDatum.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// A Datum containing information about a Batch Error. + internal partial class BatchErrorDatum + { + /// + /// 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; + + /// Initializes a new instance of . + internal BatchErrorDatum() + { + } + + /// Initializes a new instance of . + /// An error code identifying the error type. + /// A human-readable message providing more details about the error. + /// The name of the parameter that caused the error, if applicable. + /// The line number of the input file where the error occurred, if applicable. + /// Keeps track of any properties unknown to the library. + internal BatchErrorDatum(string code, string message, string param, int? line, IDictionary serializedAdditionalRawData) + { + Code = code; + Message = message; + Param = param; + Line = line; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// An error code identifying the error type. + public string Code { get; } + /// A human-readable message providing more details about the error. + public string Message { get; } + /// The name of the parameter that caused the error, if applicable. + public string Param { get; } + /// The line number of the input file where the error occurred, if applicable. + public int? Line { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventChannelArchiveHeartbeatEventData.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchErrorList.Serialization.cs similarity index 55% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventChannelArchiveHeartbeatEventData.Serialization.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/BatchErrorList.Serialization.cs index 8e6b9507b93a..c3b342ce5256 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventChannelArchiveHeartbeatEventData.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchErrorList.Serialization.cs @@ -11,13 +11,13 @@ using System.Text.Json; using Azure.Core; -namespace Azure.Messaging.EventGrid.SystemEvents +namespace Azure.AI.OpenAI { - public partial class MediaLiveEventChannelArchiveHeartbeatEventData : IUtf8JsonSerializable, IJsonModel + internal partial class BatchErrorList : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,16 +28,24 @@ void IJsonModel.Write(Utf8JsonWr /// 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaLiveEventChannelArchiveHeartbeatEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(BatchErrorList)} does not support writing '{format}' format."); } - writer.WritePropertyName("channelLatencyMs"u8); - writer.WriteStringValue(ChannelLatencyMs); - writer.WritePropertyName("latencyResultCode"u8); - writer.WriteStringValue(LatencyResultCode); + writer.WritePropertyName("object"u8); + writer.WriteStringValue(Object.ToString()); + if (Optional.IsCollectionDefined(Data)) + { + writer.WritePropertyName("data"u8); + writer.WriteStartArray(); + foreach (var item in Data) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -55,19 +63,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - MediaLiveEventChannelArchiveHeartbeatEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + BatchErrorList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaLiveEventChannelArchiveHeartbeatEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(BatchErrorList)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaLiveEventChannelArchiveHeartbeatEventData(document.RootElement, options); + return DeserializeBatchErrorList(document.RootElement, options); } - internal static MediaLiveEventChannelArchiveHeartbeatEventData DeserializeMediaLiveEventChannelArchiveHeartbeatEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static BatchErrorList DeserializeBatchErrorList(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -75,20 +83,29 @@ internal static MediaLiveEventChannelArchiveHeartbeatEventData DeserializeMediaL { return null; } - string channelLatencyMs = default; - string latencyResultCode = default; + BatchErrorListObject @object = default; + IReadOnlyList data = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("channelLatencyMs"u8)) + if (property.NameEquals("object"u8)) { - channelLatencyMs = property.Value.GetString(); + @object = new BatchErrorListObject(property.Value.GetString()); continue; } - if (property.NameEquals("latencyResultCode"u8)) + if (property.NameEquals("data"u8)) { - latencyResultCode = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(BatchErrorDatum.DeserializeBatchErrorDatum(item, options)); + } + data = array; continue; } if (options.Format != "W") @@ -97,46 +114,46 @@ internal static MediaLiveEventChannelArchiveHeartbeatEventData DeserializeMediaL } } serializedAdditionalRawData = rawDataDictionary; - return new MediaLiveEventChannelArchiveHeartbeatEventData(channelLatencyMs, latencyResultCode, serializedAdditionalRawData); + return new BatchErrorList(@object, data ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MediaLiveEventChannelArchiveHeartbeatEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(BatchErrorList)} does not support writing '{options.Format}' format."); } } - MediaLiveEventChannelArchiveHeartbeatEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + BatchErrorList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaLiveEventChannelArchiveHeartbeatEventData(document.RootElement, options); + return DeserializeBatchErrorList(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MediaLiveEventChannelArchiveHeartbeatEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(BatchErrorList)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static MediaLiveEventChannelArchiveHeartbeatEventData FromResponse(Response response) + internal static BatchErrorList FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaLiveEventChannelArchiveHeartbeatEventData(document.RootElement); + return DeserializeBatchErrorList(document.RootElement); } /// Convert into a . diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchErrorList.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchErrorList.cs new file mode 100644 index 000000000000..29f92fdc83cf --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchErrorList.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// A list of Batch errors. + internal partial class BatchErrorList + { + /// + /// 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; + + /// Initializes a new instance of . + internal BatchErrorList() + { + Data = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The object type, which is always `list`. + /// The list of Batch error data. + /// Keeps track of any properties unknown to the library. + internal BatchErrorList(BatchErrorListObject @object, IReadOnlyList data, IDictionary serializedAdditionalRawData) + { + Object = @object; + Data = data; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The object type, which is always `list`. + public BatchErrorListObject Object { get; } = BatchErrorListObject.List; + + /// The list of Batch error data. + public IReadOnlyList Data { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchErrorListObject.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchErrorListObject.cs new file mode 100644 index 000000000000..55ccfecd62da --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchErrorListObject.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// The BatchErrorList_object. + internal readonly partial struct BatchErrorListObject : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BatchErrorListObject(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ListValue = "list"; + + /// list. + public static BatchErrorListObject List { get; } = new BatchErrorListObject(ListValue); + /// Determines if two values are the same. + public static bool operator ==(BatchErrorListObject left, BatchErrorListObject right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BatchErrorListObject left, BatchErrorListObject right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BatchErrorListObject(string value) => new BatchErrorListObject(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BatchErrorListObject other && Equals(other); + /// + public bool Equals(BatchErrorListObject 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/openai/Azure.AI.OpenAI/src/Generated/BatchObject.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchObject.cs new file mode 100644 index 000000000000..7d9b06bdf500 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchObject.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// The Batch_object. + internal readonly partial struct BatchObject : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BatchObject(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string BatchValue = "batch"; + + /// batch. + public static BatchObject Batch { get; } = new BatchObject(BatchValue); + /// Determines if two values are the same. + public static bool operator ==(BatchObject left, BatchObject right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BatchObject left, BatchObject right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BatchObject(string value) => new BatchObject(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BatchObject other && Equals(other); + /// + public bool Equals(BatchObject 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/openai/Azure.AI.OpenAI/src/Generated/BatchRequestCounts.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchRequestCounts.Serialization.cs new file mode 100644 index 000000000000..54b946273a85 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchRequestCounts.Serialization.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + internal partial class BatchRequestCounts : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(BatchRequestCounts)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Total)) + { + writer.WritePropertyName("total"u8); + writer.WriteNumberValue(Total.Value); + } + if (Optional.IsDefined(Completed)) + { + writer.WritePropertyName("completed"u8); + writer.WriteNumberValue(Completed.Value); + } + if (Optional.IsDefined(Failed)) + { + writer.WritePropertyName("failed"u8); + writer.WriteNumberValue(Failed.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BatchRequestCounts IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BatchRequestCounts)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBatchRequestCounts(document.RootElement, options); + } + + internal static BatchRequestCounts DeserializeBatchRequestCounts(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? total = default; + int? completed = default; + int? failed = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("total"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + total = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("completed"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + completed = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("failed"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + failed = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BatchRequestCounts(total, completed, failed, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BatchRequestCounts)} does not support writing '{options.Format}' format."); + } + } + + BatchRequestCounts IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBatchRequestCounts(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BatchRequestCounts)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static BatchRequestCounts FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeBatchRequestCounts(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/openai/Azure.AI.OpenAI/src/Generated/BatchRequestCounts.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchRequestCounts.cs new file mode 100644 index 000000000000..014a428c108f --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchRequestCounts.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// The BatchRequestCounts. + internal partial class BatchRequestCounts + { + /// + /// 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; + + /// Initializes a new instance of . + internal BatchRequestCounts() + { + } + + /// Initializes a new instance of . + /// Total number of requests in the batch. + /// Number of requests that have been completed successfully. + /// Number of requests that have failed. + /// Keeps track of any properties unknown to the library. + internal BatchRequestCounts(int? total, int? completed, int? failed, IDictionary serializedAdditionalRawData) + { + Total = total; + Completed = completed; + Failed = failed; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Total number of requests in the batch. + public int? Total { get; } + /// Number of requests that have been completed successfully. + public int? Completed { get; } + /// Number of requests that have failed. + public int? Failed { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchStatus.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchStatus.cs new file mode 100644 index 000000000000..421a0f16f186 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchStatus.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// The status of a batch. + internal readonly partial struct BatchStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BatchStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ValidatingValue = "validating"; + private const string FailedValue = "failed"; + private const string InProgressValue = "in_progress"; + private const string FinalizingValue = "finalizing"; + private const string CompletedValue = "completed"; + private const string ExpiredValue = "expired"; + private const string CancellingValue = "cancelling"; + private const string CancelledValue = "cancelled"; + + /// The input file is being validated before the batch can begin. + public static BatchStatus Validating { get; } = new BatchStatus(ValidatingValue); + /// The input file has failed the validation process. + public static BatchStatus Failed { get; } = new BatchStatus(FailedValue); + /// The input file was successfully validated and the batch is currently being executed. + public static BatchStatus InProgress { get; } = new BatchStatus(InProgressValue); + /// The batch has completed and the results are being prepared. + public static BatchStatus Finalizing { get; } = new BatchStatus(FinalizingValue); + /// The batch has been completed and the results are ready. + public static BatchStatus Completed { get; } = new BatchStatus(CompletedValue); + /// The batch was not able to complete within the 24-hour time window. + public static BatchStatus Expired { get; } = new BatchStatus(ExpiredValue); + /// Cancellation of the batch has been initiated. + public static BatchStatus Cancelling { get; } = new BatchStatus(CancellingValue); + /// The batch was cancelled. + public static BatchStatus Cancelled { get; } = new BatchStatus(CancelledValue); + /// Determines if two values are the same. + public static bool operator ==(BatchStatus left, BatchStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BatchStatus left, BatchStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BatchStatus(string value) => new BatchStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BatchStatus other && Equals(other); + /// + public bool Equals(BatchStatus 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/openai/Azure.AI.OpenAI/src/Generated/ChatChoice.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatChoice.Serialization.cs new file mode 100644 index 000000000000..958892a9dd6f --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatChoice.Serialization.cs @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ChatChoice : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatChoice)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteObjectValue(Message, options); + } + if (LogProbabilityInfo != null) + { + writer.WritePropertyName("logprobs"u8); + writer.WriteObjectValue(LogProbabilityInfo, options); + } + else + { + writer.WriteNull("logprobs"); + } + writer.WritePropertyName("index"u8); + writer.WriteNumberValue(Index); + if (FinishReason != null) + { + writer.WritePropertyName("finish_reason"u8); + writer.WriteStringValue(FinishReason.Value.ToString()); + } + else + { + writer.WriteNull("finish_reason"); + } + if (Optional.IsDefined(InternalStreamingDeltaMessage)) + { + writer.WritePropertyName("delta"u8); + writer.WriteObjectValue(InternalStreamingDeltaMessage, options); + } + if (Optional.IsDefined(ContentFilterResults)) + { + writer.WritePropertyName("content_filter_results"u8); + writer.WriteObjectValue(ContentFilterResults, options); + } + if (Optional.IsDefined(Enhancements)) + { + writer.WritePropertyName("enhancements"u8); + writer.WriteObjectValue(Enhancements, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ChatChoice IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatChoice)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatChoice(document.RootElement, options); + } + + internal static ChatChoice DeserializeChatChoice(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ChatResponseMessage message = default; + ChatChoiceLogProbabilityInfo logprobs = default; + int index = default; + CompletionsFinishReason? finishReason = default; + ChatResponseMessage delta = default; + ContentFilterResultsForChoice contentFilterResults = default; + AzureChatEnhancements enhancements = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("message"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + message = ChatResponseMessage.DeserializeChatResponseMessage(property.Value, options); + continue; + } + if (property.NameEquals("logprobs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + logprobs = null; + continue; + } + logprobs = ChatChoiceLogProbabilityInfo.DeserializeChatChoiceLogProbabilityInfo(property.Value, options); + continue; + } + if (property.NameEquals("index"u8)) + { + index = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("finish_reason"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + finishReason = null; + continue; + } + finishReason = new CompletionsFinishReason(property.Value.GetString()); + continue; + } + if (property.NameEquals("delta"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + delta = ChatResponseMessage.DeserializeChatResponseMessage(property.Value, options); + continue; + } + if (property.NameEquals("content_filter_results"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + contentFilterResults = ContentFilterResultsForChoice.DeserializeContentFilterResultsForChoice(property.Value, options); + continue; + } + if (property.NameEquals("enhancements"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enhancements = AzureChatEnhancements.DeserializeAzureChatEnhancements(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ChatChoice( + message, + logprobs, + index, + finishReason, + delta, + contentFilterResults, + enhancements, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatChoice)} does not support writing '{options.Format}' format."); + } + } + + ChatChoice IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatChoice(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatChoice)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ChatChoice FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatChoice(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/openai/Azure.AI.OpenAI/src/Generated/ChatChoice.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatChoice.cs new file mode 100644 index 000000000000..4e85fb934a30 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatChoice.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// + /// The representation of a single prompt completion as part of an overall chat completions request. + /// Generally, `n` choices are generated per provided prompt with a default value of 1. + /// Token limits and other settings may limit the number of choices generated. + /// + public partial class ChatChoice + { + /// + /// 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; + + /// Initializes a new instance of . + /// The log probability information for this choice, as enabled via the 'logprobs' request option. + /// The ordered index associated with this chat completions choice. + /// The reason that this chat completions choice completed its generated. + internal ChatChoice(ChatChoiceLogProbabilityInfo logProbabilityInfo, int index, CompletionsFinishReason? finishReason) + { + LogProbabilityInfo = logProbabilityInfo; + Index = index; + FinishReason = finishReason; + } + + /// Initializes a new instance of . + /// The chat message for a given chat completions prompt. + /// The log probability information for this choice, as enabled via the 'logprobs' request option. + /// The ordered index associated with this chat completions choice. + /// The reason that this chat completions choice completed its generated. + /// The delta message content for a streaming response. + /// + /// Information about the content filtering category (hate, sexual, violence, self_harm), if it + /// has been detected, as well as the severity level (very_low, low, medium, high-scale that + /// determines the intensity and risk level of harmful content) and if it has been filtered or not. + /// + /// + /// Represents the output results of Azure OpenAI enhancements to chat completions, as configured via the matching input + /// provided in the request. This supplementary information is only available when using Azure OpenAI and only when the + /// request is configured to use enhancements. + /// + /// Keeps track of any properties unknown to the library. + internal ChatChoice(ChatResponseMessage message, ChatChoiceLogProbabilityInfo logProbabilityInfo, int index, CompletionsFinishReason? finishReason, ChatResponseMessage internalStreamingDeltaMessage, ContentFilterResultsForChoice contentFilterResults, AzureChatEnhancements enhancements, IDictionary serializedAdditionalRawData) + { + Message = message; + LogProbabilityInfo = logProbabilityInfo; + Index = index; + FinishReason = finishReason; + InternalStreamingDeltaMessage = internalStreamingDeltaMessage; + ContentFilterResults = contentFilterResults; + Enhancements = enhancements; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ChatChoice() + { + } + + /// The chat message for a given chat completions prompt. + public ChatResponseMessage Message { get; } + /// The log probability information for this choice, as enabled via the 'logprobs' request option. + public ChatChoiceLogProbabilityInfo LogProbabilityInfo { get; } + /// The ordered index associated with this chat completions choice. + public int Index { get; } + /// The reason that this chat completions choice completed its generated. + public CompletionsFinishReason? FinishReason { get; } + /// The delta message content for a streaming response. + public ChatResponseMessage InternalStreamingDeltaMessage { get; } + /// + /// Information about the content filtering category (hate, sexual, violence, self_harm), if it + /// has been detected, as well as the severity level (very_low, low, medium, high-scale that + /// determines the intensity and risk level of harmful content) and if it has been filtered or not. + /// + public ContentFilterResultsForChoice ContentFilterResults { get; } + /// + /// Represents the output results of Azure OpenAI enhancements to chat completions, as configured via the matching input + /// provided in the request. This supplementary information is only available when using Azure OpenAI and only when the + /// request is configured to use enhancements. + /// + public AzureChatEnhancements Enhancements { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatChoiceLogProbabilityInfo.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatChoiceLogProbabilityInfo.Serialization.cs new file mode 100644 index 000000000000..992c2670e6c6 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatChoiceLogProbabilityInfo.Serialization.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ChatChoiceLogProbabilityInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatChoiceLogProbabilityInfo)} does not support writing '{format}' format."); + } + + if (TokenLogProbabilityResults != null && Optional.IsCollectionDefined(TokenLogProbabilityResults)) + { + writer.WritePropertyName("content"u8); + writer.WriteStartArray(); + foreach (var item in TokenLogProbabilityResults) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("content"); + } + if (Refusal != null && Optional.IsCollectionDefined(Refusal)) + { + writer.WritePropertyName("refusal"u8); + writer.WriteStartArray(); + foreach (var item in Refusal) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("refusal"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ChatChoiceLogProbabilityInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatChoiceLogProbabilityInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatChoiceLogProbabilityInfo(document.RootElement, options); + } + + internal static ChatChoiceLogProbabilityInfo DeserializeChatChoiceLogProbabilityInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList content = default; + IReadOnlyList refusal = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("content"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + content = new ChangeTrackingList(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ChatTokenLogProbabilityResult.DeserializeChatTokenLogProbabilityResult(item, options)); + } + content = array; + continue; + } + if (property.NameEquals("refusal"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + refusal = new ChangeTrackingList(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ChatTokenLogProbabilityResult.DeserializeChatTokenLogProbabilityResult(item, options)); + } + refusal = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ChatChoiceLogProbabilityInfo(content, refusal, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatChoiceLogProbabilityInfo)} does not support writing '{options.Format}' format."); + } + } + + ChatChoiceLogProbabilityInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatChoiceLogProbabilityInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatChoiceLogProbabilityInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ChatChoiceLogProbabilityInfo FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatChoiceLogProbabilityInfo(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/openai/Azure.AI.OpenAI/src/Generated/ChatChoiceLogProbabilityInfo.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatChoiceLogProbabilityInfo.cs new file mode 100644 index 000000000000..f2343104bd0a --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatChoiceLogProbabilityInfo.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.OpenAI +{ + /// Log probability information for a choice, as requested via 'logprobs' and 'top_logprobs'. + public partial class ChatChoiceLogProbabilityInfo + { + /// + /// 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; + + /// Initializes a new instance of . + /// The list of log probability information entries for the choice's message content tokens, as requested via the 'logprobs' option. + /// The list of log probability information entries for the choice's message refusal message tokens, as requested via the 'logprobs' option. + internal ChatChoiceLogProbabilityInfo(IEnumerable tokenLogProbabilityResults, IEnumerable refusal) + { + TokenLogProbabilityResults = tokenLogProbabilityResults?.ToList(); + Refusal = refusal?.ToList(); + } + + /// Initializes a new instance of . + /// The list of log probability information entries for the choice's message content tokens, as requested via the 'logprobs' option. + /// The list of log probability information entries for the choice's message refusal message tokens, as requested via the 'logprobs' option. + /// Keeps track of any properties unknown to the library. + internal ChatChoiceLogProbabilityInfo(IReadOnlyList tokenLogProbabilityResults, IReadOnlyList refusal, IDictionary serializedAdditionalRawData) + { + TokenLogProbabilityResults = tokenLogProbabilityResults; + Refusal = refusal; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ChatChoiceLogProbabilityInfo() + { + } + + /// The list of log probability information entries for the choice's message content tokens, as requested via the 'logprobs' option. + public IReadOnlyList TokenLogProbabilityResults { get; } + /// The list of log probability information entries for the choice's message refusal message tokens, as requested via the 'logprobs' option. + public IReadOnlyList Refusal { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionStreamOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionStreamOptions.Serialization.cs new file mode 100644 index 000000000000..d2791deafba2 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionStreamOptions.Serialization.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ChatCompletionStreamOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionStreamOptions)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(IncludeUsage)) + { + writer.WritePropertyName("include_usage"u8); + writer.WriteBooleanValue(IncludeUsage.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ChatCompletionStreamOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionStreamOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatCompletionStreamOptions(document.RootElement, options); + } + + internal static ChatCompletionStreamOptions DeserializeChatCompletionStreamOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? includeUsage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("include_usage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + includeUsage = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ChatCompletionStreamOptions(includeUsage, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatCompletionStreamOptions)} does not support writing '{options.Format}' format."); + } + } + + ChatCompletionStreamOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatCompletionStreamOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatCompletionStreamOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ChatCompletionStreamOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatCompletionStreamOptions(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/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionStreamOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionStreamOptions.cs new file mode 100644 index 000000000000..2dba2eb70309 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionStreamOptions.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Options for streaming response. Only set this when you set `stream: true`. + public partial class ChatCompletionStreamOptions + { + /// + /// 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; + + /// Initializes a new instance of . + public ChatCompletionStreamOptions() + { + } + + /// Initializes a new instance of . + /// If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value. + /// Keeps track of any properties unknown to the library. + internal ChatCompletionStreamOptions(bool? includeUsage, IDictionary serializedAdditionalRawData) + { + IncludeUsage = includeUsage; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value. + public bool? IncludeUsage { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletions.Serialization.cs new file mode 100644 index 000000000000..1c0989fb734f --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletions.Serialization.cs @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ChatCompletions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletions)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("created"u8); + writer.WriteNumberValue(Created, "U"); + writer.WritePropertyName("choices"u8); + writer.WriteStartArray(); + foreach (var item in Choices) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(Model)) + { + writer.WritePropertyName("model"u8); + writer.WriteStringValue(Model); + } + if (Optional.IsCollectionDefined(PromptFilterResults)) + { + writer.WritePropertyName("prompt_filter_results"u8); + writer.WriteStartArray(); + foreach (var item in PromptFilterResults) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(SystemFingerprint)) + { + writer.WritePropertyName("system_fingerprint"u8); + writer.WriteStringValue(SystemFingerprint); + } + writer.WritePropertyName("usage"u8); + writer.WriteObjectValue(Usage, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ChatCompletions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatCompletions(document.RootElement, options); + } + + internal static ChatCompletions DeserializeChatCompletions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + DateTimeOffset created = default; + IReadOnlyList choices = default; + string model = default; + IReadOnlyList promptFilterResults = default; + string systemFingerprint = default; + CompletionsUsage usage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("created"u8)) + { + created = DateTimeOffset.FromUnixTimeSeconds(property.Value.GetInt64()); + continue; + } + if (property.NameEquals("choices"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ChatChoice.DeserializeChatChoice(item, options)); + } + choices = array; + continue; + } + if (property.NameEquals("model"u8)) + { + model = property.Value.GetString(); + continue; + } + if (property.NameEquals("prompt_filter_results"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContentFilterResultsForPrompt.DeserializeContentFilterResultsForPrompt(item, options)); + } + promptFilterResults = array; + continue; + } + if (property.NameEquals("system_fingerprint"u8)) + { + systemFingerprint = property.Value.GetString(); + continue; + } + if (property.NameEquals("usage"u8)) + { + usage = CompletionsUsage.DeserializeCompletionsUsage(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ChatCompletions( + id, + created, + choices, + model, + promptFilterResults ?? new ChangeTrackingList(), + systemFingerprint, + usage, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatCompletions)} does not support writing '{options.Format}' format."); + } + } + + ChatCompletions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatCompletions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatCompletions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ChatCompletions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatCompletions(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/openai/Azure.AI.OpenAI/src/Generated/ChatCompletions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletions.cs new file mode 100644 index 000000000000..e50eb5c47d75 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletions.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.OpenAI +{ + /// + /// Representation of the response data from a chat completions request. + /// Completions support a wide variety of tasks and generate text that continues from or "completes" + /// provided prompt data. + /// + public partial class ChatCompletions + { + /// + /// 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; + + /// Initializes a new instance of . + /// A unique identifier associated with this chat completions response. + /// + /// The first timestamp associated with generation activity for this completions response, + /// represented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970. + /// + /// + /// The collection of completions choices associated with this completions response. + /// Generally, `n` choices are generated per provided prompt with a default value of 1. + /// Token limits and other settings may limit the number of choices generated. + /// + /// Usage information for tokens processed and generated as part of this completions operation. + /// , or is null. + internal ChatCompletions(string id, DateTimeOffset created, IEnumerable choices, CompletionsUsage usage) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(choices, nameof(choices)); + Argument.AssertNotNull(usage, nameof(usage)); + + Id = id; + Created = created; + Choices = choices.ToList(); + PromptFilterResults = new ChangeTrackingList(); + Usage = usage; + } + + /// Initializes a new instance of . + /// A unique identifier associated with this chat completions response. + /// + /// The first timestamp associated with generation activity for this completions response, + /// represented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970. + /// + /// + /// The collection of completions choices associated with this completions response. + /// Generally, `n` choices are generated per provided prompt with a default value of 1. + /// Token limits and other settings may limit the number of choices generated. + /// + /// The model name used for this completions request. + /// + /// Content filtering results for zero or more prompts in the request. In a streaming request, + /// results for different prompts may arrive at different times or in different orders. + /// + /// + /// Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that + /// might impact determinism. + /// + /// Usage information for tokens processed and generated as part of this completions operation. + /// Keeps track of any properties unknown to the library. + internal ChatCompletions(string id, DateTimeOffset created, IReadOnlyList choices, string model, IReadOnlyList promptFilterResults, string systemFingerprint, CompletionsUsage usage, IDictionary serializedAdditionalRawData) + { + Id = id; + Created = created; + Choices = choices; + Model = model; + PromptFilterResults = promptFilterResults; + SystemFingerprint = systemFingerprint; + Usage = usage; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ChatCompletions() + { + } + + /// A unique identifier associated with this chat completions response. + public string Id { get; } + /// + /// The first timestamp associated with generation activity for this completions response, + /// represented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970. + /// + public DateTimeOffset Created { get; } + /// + /// The collection of completions choices associated with this completions response. + /// Generally, `n` choices are generated per provided prompt with a default value of 1. + /// Token limits and other settings may limit the number of choices generated. + /// + public IReadOnlyList Choices { get; } + /// The model name used for this completions request. + public string Model { get; } + /// + /// Content filtering results for zero or more prompts in the request. In a streaming request, + /// results for different prompts may arrive at different times or in different orders. + /// + public IReadOnlyList PromptFilterResults { get; } + /// + /// Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that + /// might impact determinism. + /// + public string SystemFingerprint { get; } + /// Usage information for tokens processed and generated as part of this completions operation. + public CompletionsUsage Usage { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCanceledEventData.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolCall.Serialization.cs similarity index 58% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCanceledEventData.Serialization.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolCall.Serialization.cs index 0ac5b829f1dc..0c10e70de9c6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCanceledEventData.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolCall.Serialization.cs @@ -11,13 +11,13 @@ using System.Text.Json; using Azure.Core; -namespace Azure.Messaging.EventGrid.SystemEvents +namespace Azure.AI.OpenAI { - public partial class MediaJobOutputCanceledEventData : IUtf8JsonSerializable, IJsonModel + public partial class ChatCompletionsFunctionToolCall : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,28 +28,30 @@ 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobOutputCanceledEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ChatCompletionsFunctionToolCall)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("function"u8); + writer.WriteObjectValue(Function, options); } - MediaJobOutputCanceledEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ChatCompletionsFunctionToolCall IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobOutputCanceledEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ChatCompletionsFunctionToolCall)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaJobOutputCanceledEventData(document.RootElement, options); + return DeserializeChatCompletionsFunctionToolCall(document.RootElement, options); } - internal static MediaJobOutputCanceledEventData DeserializeMediaJobOutputCanceledEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static ChatCompletionsFunctionToolCall DeserializeChatCompletionsFunctionToolCall(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -57,31 +59,26 @@ internal static MediaJobOutputCanceledEventData DeserializeMediaJobOutputCancele { return null; } - MediaJobState previousState = default; - MediaJobOutput output = default; - IReadOnlyDictionary jobCorrelationData = default; + FunctionCall function = default; + string type = default; + string id = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("previousState"u8)) + if (property.NameEquals("function"u8)) { - previousState = new MediaJobState(property.Value.GetString()); + function = FunctionCall.DeserializeFunctionCall(property.Value, options); continue; } - if (property.NameEquals("output"u8)) + if (property.NameEquals("type"u8)) { - output = MediaJobOutput.DeserializeMediaJobOutput(property.Value, options); + type = property.Value.GetString(); continue; } - if (property.NameEquals("jobCorrelationData"u8)) + if (property.NameEquals("id"u8)) { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - jobCorrelationData = dictionary; + id = property.Value.GetString(); continue; } if (options.Format != "W") @@ -90,46 +87,46 @@ internal static MediaJobOutputCanceledEventData DeserializeMediaJobOutputCancele } } serializedAdditionalRawData = rawDataDictionary; - return new MediaJobOutputCanceledEventData(previousState, output, jobCorrelationData, serializedAdditionalRawData); + return new ChatCompletionsFunctionToolCall(type, id, serializedAdditionalRawData, function); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MediaJobOutputCanceledEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ChatCompletionsFunctionToolCall)} does not support writing '{options.Format}' format."); } } - MediaJobOutputCanceledEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ChatCompletionsFunctionToolCall IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaJobOutputCanceledEventData(document.RootElement, options); + return DeserializeChatCompletionsFunctionToolCall(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MediaJobOutputCanceledEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ChatCompletionsFunctionToolCall)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new MediaJobOutputCanceledEventData FromResponse(Response response) + internal static new ChatCompletionsFunctionToolCall FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaJobOutputCanceledEventData(document.RootElement); + return DeserializeChatCompletionsFunctionToolCall(document.RootElement); } /// Convert into a . diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolCall.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolCall.cs new file mode 100644 index 000000000000..97a6d2211fd9 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolCall.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// + /// A tool call to a function tool, issued by the model in evaluation of a configured function tool, that represents + /// a function invocation needed for a subsequent chat completions request to resolve. + /// + public partial class ChatCompletionsFunctionToolCall : ChatCompletionsToolCall + { + /// Initializes a new instance of . + /// The ID of the tool call. + /// The details of the function invocation requested by the tool call. + /// or is null. + public ChatCompletionsFunctionToolCall(string id, FunctionCall function) : base(id) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(function, nameof(function)); + + Type = "function"; + Function = function; + } + + /// Initializes a new instance of . + /// The object type. + /// The ID of the tool call. + /// Keeps track of any properties unknown to the library. + /// The details of the function invocation requested by the tool call. + internal ChatCompletionsFunctionToolCall(string type, string id, IDictionary serializedAdditionalRawData, FunctionCall function) : base(type, id, serializedAdditionalRawData) + { + Function = function; + } + + /// Initializes a new instance of for deserialization. + internal ChatCompletionsFunctionToolCall() + { + } + + /// The details of the function invocation requested by the tool call. + public FunctionCall Function { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolDefinition.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolDefinition.Serialization.cs new file mode 100644 index 000000000000..97c6f3f5e37a --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolDefinition.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ChatCompletionsFunctionToolDefinition : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsFunctionToolDefinition)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("function"u8); + writer.WriteObjectValue(Function, options); + } + + ChatCompletionsFunctionToolDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsFunctionToolDefinition)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatCompletionsFunctionToolDefinition(document.RootElement, options); + } + + internal static ChatCompletionsFunctionToolDefinition DeserializeChatCompletionsFunctionToolDefinition(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ChatCompletionsFunctionToolDefinitionFunction function = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("function"u8)) + { + function = ChatCompletionsFunctionToolDefinitionFunction.DeserializeChatCompletionsFunctionToolDefinitionFunction(property.Value, options); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ChatCompletionsFunctionToolDefinition(type, serializedAdditionalRawData, function); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatCompletionsFunctionToolDefinition)} does not support writing '{options.Format}' format."); + } + } + + ChatCompletionsFunctionToolDefinition IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatCompletionsFunctionToolDefinition(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatCompletionsFunctionToolDefinition)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ChatCompletionsFunctionToolDefinition FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatCompletionsFunctionToolDefinition(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/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolDefinition.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolDefinition.cs new file mode 100644 index 000000000000..7b1881366a9b --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolDefinition.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// The definition information for a chat completions function tool that can call a function in response to a tool call. + public partial class ChatCompletionsFunctionToolDefinition : ChatCompletionsToolDefinition + { + /// Initializes a new instance of . + /// The function definition details for the function tool. + /// is null. + public ChatCompletionsFunctionToolDefinition(ChatCompletionsFunctionToolDefinitionFunction function) + { + Argument.AssertNotNull(function, nameof(function)); + + Type = "function"; + Function = function; + } + + /// Initializes a new instance of . + /// The object type. + /// Keeps track of any properties unknown to the library. + /// The function definition details for the function tool. + internal ChatCompletionsFunctionToolDefinition(string type, IDictionary serializedAdditionalRawData, ChatCompletionsFunctionToolDefinitionFunction function) : base(type, serializedAdditionalRawData) + { + Function = function; + } + + /// Initializes a new instance of for deserialization. + internal ChatCompletionsFunctionToolDefinition() + { + } + + /// The function definition details for the function tool. + public ChatCompletionsFunctionToolDefinitionFunction Function { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolDefinitionFunction.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolDefinitionFunction.Serialization.cs new file mode 100644 index 000000000000..3534495e5d46 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolDefinitionFunction.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ChatCompletionsFunctionToolDefinitionFunction : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsFunctionToolDefinitionFunction)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Parameters)) + { + writer.WritePropertyName("parameters"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Parameters); +#else + using (JsonDocument document = JsonDocument.Parse(Parameters)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + if (Optional.IsDefined(Strict)) + { + if (Strict != null) + { + writer.WritePropertyName("strict"u8); + writer.WriteBooleanValue(Strict.Value); + } + else + { + writer.WriteNull("strict"); + } + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ChatCompletionsFunctionToolDefinitionFunction IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsFunctionToolDefinitionFunction)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatCompletionsFunctionToolDefinitionFunction(document.RootElement, options); + } + + internal static ChatCompletionsFunctionToolDefinitionFunction DeserializeChatCompletionsFunctionToolDefinitionFunction(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string description = default; + string name = default; + BinaryData parameters = default; + bool? strict = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("parameters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + parameters = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("strict"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + strict = null; + continue; + } + strict = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ChatCompletionsFunctionToolDefinitionFunction(description, name, parameters, strict, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatCompletionsFunctionToolDefinitionFunction)} does not support writing '{options.Format}' format."); + } + } + + ChatCompletionsFunctionToolDefinitionFunction IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatCompletionsFunctionToolDefinitionFunction(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatCompletionsFunctionToolDefinitionFunction)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ChatCompletionsFunctionToolDefinitionFunction FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatCompletionsFunctionToolDefinitionFunction(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/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolDefinitionFunction.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolDefinitionFunction.cs new file mode 100644 index 000000000000..03c565925bbd --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolDefinitionFunction.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// The ChatCompletionsFunctionToolDefinitionFunction. + public partial class ChatCompletionsFunctionToolDefinitionFunction + { + /// + /// 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; + + /// Initializes a new instance of . + /// The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. + /// is null. + public ChatCompletionsFunctionToolDefinitionFunction(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of . + /// A description of what the function does, used by the model to choose when and how to call the function. + /// The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. + /// + /// Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](docs/guides/function-calling). + /// Keeps track of any properties unknown to the library. + internal ChatCompletionsFunctionToolDefinitionFunction(string description, string name, BinaryData parameters, bool? strict, IDictionary serializedAdditionalRawData) + { + Description = description; + Name = name; + Parameters = parameters; + Strict = strict; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ChatCompletionsFunctionToolDefinitionFunction() + { + } + + /// A description of what the function does, used by the model to choose when and how to call the function. + public string Description { get; set; } + /// The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. + public string Name { get; } + /// + /// Gets or sets the parameters + /// + /// To assign an object to 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" }. + /// + /// + /// + /// + public BinaryData Parameters { get; set; } + /// Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](docs/guides/function-calling). + public bool? Strict { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolSelection.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolSelection.Serialization.cs new file mode 100644 index 000000000000..38d823332e17 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolSelection.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ChatCompletionsFunctionToolSelection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsFunctionToolSelection)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ChatCompletionsFunctionToolSelection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsFunctionToolSelection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatCompletionsFunctionToolSelection(document.RootElement, options); + } + + internal static ChatCompletionsFunctionToolSelection DeserializeChatCompletionsFunctionToolSelection(JsonElement element, ModelReaderWriterOptions options = null) + { + 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()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ChatCompletionsFunctionToolSelection(name, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatCompletionsFunctionToolSelection)} does not support writing '{options.Format}' format."); + } + } + + ChatCompletionsFunctionToolSelection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatCompletionsFunctionToolSelection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatCompletionsFunctionToolSelection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ChatCompletionsFunctionToolSelection FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatCompletionsFunctionToolSelection(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/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolSelection.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolSelection.cs new file mode 100644 index 000000000000..419c61a67c34 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsFunctionToolSelection.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// A tool selection of a specific, named function tool that will limit chat completions to using the named function. + public partial class ChatCompletionsFunctionToolSelection + { + /// + /// 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; + + /// Initializes a new instance of . + /// The name of the function that should be called. + /// is null. + public ChatCompletionsFunctionToolSelection(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of . + /// The name of the function that should be called. + /// Keeps track of any properties unknown to the library. + internal ChatCompletionsFunctionToolSelection(string name, IDictionary serializedAdditionalRawData) + { + Name = name; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ChatCompletionsFunctionToolSelection() + { + } + + /// The name of the function that should be called. + public string Name { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsJsonResponseFormat.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsJsonResponseFormat.Serialization.cs new file mode 100644 index 000000000000..27bd5644ae9a --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsJsonResponseFormat.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ChatCompletionsJsonResponseFormat : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsJsonResponseFormat)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ChatCompletionsJsonResponseFormat IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsJsonResponseFormat)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatCompletionsJsonResponseFormat(document.RootElement, options); + } + + internal static ChatCompletionsJsonResponseFormat DeserializeChatCompletionsJsonResponseFormat(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ChatCompletionsJsonResponseFormat(type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatCompletionsJsonResponseFormat)} does not support writing '{options.Format}' format."); + } + } + + ChatCompletionsJsonResponseFormat IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatCompletionsJsonResponseFormat(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatCompletionsJsonResponseFormat)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ChatCompletionsJsonResponseFormat FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatCompletionsJsonResponseFormat(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/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsJsonResponseFormat.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsJsonResponseFormat.cs new file mode 100644 index 000000000000..f38d98e6fbd6 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsJsonResponseFormat.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// A response format for Chat Completions that restricts responses to emitting valid JSON objects. + public partial class ChatCompletionsJsonResponseFormat : ChatCompletionsResponseFormat + { + /// Initializes a new instance of . + public ChatCompletionsJsonResponseFormat() + { + Type = "json_object"; + } + + /// Initializes a new instance of . + /// The discriminated type for the response format. + /// Keeps track of any properties unknown to the library. + internal ChatCompletionsJsonResponseFormat(string type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) + { + } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsJsonSchemaResponseFormat.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsJsonSchemaResponseFormat.Serialization.cs new file mode 100644 index 000000000000..87e214b021b2 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsJsonSchemaResponseFormat.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ChatCompletionsJsonSchemaResponseFormat : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsJsonSchemaResponseFormat)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("json_schema"u8); + writer.WriteObjectValue(JsonSchema, options); + } + + ChatCompletionsJsonSchemaResponseFormat IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsJsonSchemaResponseFormat)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatCompletionsJsonSchemaResponseFormat(document.RootElement, options); + } + + internal static ChatCompletionsJsonSchemaResponseFormat DeserializeChatCompletionsJsonSchemaResponseFormat(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ChatCompletionsJsonSchemaResponseFormatJsonSchema jsonSchema = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("json_schema"u8)) + { + jsonSchema = ChatCompletionsJsonSchemaResponseFormatJsonSchema.DeserializeChatCompletionsJsonSchemaResponseFormatJsonSchema(property.Value, options); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ChatCompletionsJsonSchemaResponseFormat(type, serializedAdditionalRawData, jsonSchema); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatCompletionsJsonSchemaResponseFormat)} does not support writing '{options.Format}' format."); + } + } + + ChatCompletionsJsonSchemaResponseFormat IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatCompletionsJsonSchemaResponseFormat(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatCompletionsJsonSchemaResponseFormat)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ChatCompletionsJsonSchemaResponseFormat FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatCompletionsJsonSchemaResponseFormat(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/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsJsonSchemaResponseFormat.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsJsonSchemaResponseFormat.cs new file mode 100644 index 000000000000..9892e885aba7 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsJsonSchemaResponseFormat.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// + /// A response format for Chat Completions that restricts responses to emitting JSON that conforms to a provided JSON + /// Schema for Structured Outputs. + /// + public partial class ChatCompletionsJsonSchemaResponseFormat : ChatCompletionsResponseFormat + { + /// Initializes a new instance of . + /// + /// is null. + public ChatCompletionsJsonSchemaResponseFormat(ChatCompletionsJsonSchemaResponseFormatJsonSchema jsonSchema) + { + Argument.AssertNotNull(jsonSchema, nameof(jsonSchema)); + + Type = "json_schema"; + JsonSchema = jsonSchema; + } + + /// Initializes a new instance of . + /// The discriminated type for the response format. + /// Keeps track of any properties unknown to the library. + /// + internal ChatCompletionsJsonSchemaResponseFormat(string type, IDictionary serializedAdditionalRawData, ChatCompletionsJsonSchemaResponseFormatJsonSchema jsonSchema) : base(type, serializedAdditionalRawData) + { + JsonSchema = jsonSchema; + } + + /// Initializes a new instance of for deserialization. + internal ChatCompletionsJsonSchemaResponseFormat() + { + } + + /// Gets the json schema. + public ChatCompletionsJsonSchemaResponseFormatJsonSchema JsonSchema { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsJsonSchemaResponseFormatJsonSchema.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsJsonSchemaResponseFormatJsonSchema.Serialization.cs new file mode 100644 index 000000000000..b56a30e896a3 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsJsonSchemaResponseFormatJsonSchema.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ChatCompletionsJsonSchemaResponseFormatJsonSchema : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsJsonSchemaResponseFormatJsonSchema)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Schema)) + { + writer.WritePropertyName("schema"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Schema); +#else + using (JsonDocument document = JsonDocument.Parse(Schema)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + if (Optional.IsDefined(Strict)) + { + if (Strict != null) + { + writer.WritePropertyName("strict"u8); + writer.WriteBooleanValue(Strict.Value); + } + else + { + writer.WriteNull("strict"); + } + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ChatCompletionsJsonSchemaResponseFormatJsonSchema IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsJsonSchemaResponseFormatJsonSchema)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatCompletionsJsonSchemaResponseFormatJsonSchema(document.RootElement, options); + } + + internal static ChatCompletionsJsonSchemaResponseFormatJsonSchema DeserializeChatCompletionsJsonSchemaResponseFormatJsonSchema(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string description = default; + string name = default; + BinaryData schema = default; + bool? strict = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("schema"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + schema = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("strict"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + strict = null; + continue; + } + strict = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ChatCompletionsJsonSchemaResponseFormatJsonSchema(description, name, schema, strict, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatCompletionsJsonSchemaResponseFormatJsonSchema)} does not support writing '{options.Format}' format."); + } + } + + ChatCompletionsJsonSchemaResponseFormatJsonSchema IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatCompletionsJsonSchemaResponseFormatJsonSchema(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatCompletionsJsonSchemaResponseFormatJsonSchema)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ChatCompletionsJsonSchemaResponseFormatJsonSchema FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatCompletionsJsonSchemaResponseFormatJsonSchema(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/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsJsonSchemaResponseFormatJsonSchema.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsJsonSchemaResponseFormatJsonSchema.cs new file mode 100644 index 000000000000..344920808c8c --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsJsonSchemaResponseFormatJsonSchema.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// The ChatCompletionsJsonSchemaResponseFormatJsonSchema. + public partial class ChatCompletionsJsonSchemaResponseFormatJsonSchema + { + /// + /// 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; + + /// Initializes a new instance of . + /// The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. + /// is null. + public ChatCompletionsJsonSchemaResponseFormatJsonSchema(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of . + /// A description of what the response format is for, used by the model to determine how to respond in the format. + /// The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. + /// + /// Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is `true`. To learn more, read the [Structured Outputs guide](/docs/guides/structured-outputs). + /// Keeps track of any properties unknown to the library. + internal ChatCompletionsJsonSchemaResponseFormatJsonSchema(string description, string name, BinaryData schema, bool? strict, IDictionary serializedAdditionalRawData) + { + Description = description; + Name = name; + Schema = schema; + Strict = strict; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ChatCompletionsJsonSchemaResponseFormatJsonSchema() + { + } + + /// A description of what the response format is for, used by the model to determine how to respond in the format. + public string Description { get; set; } + /// The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. + public string Name { get; } + /// + /// Gets or sets the schema + /// + /// To assign an object to 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" }. + /// + /// + /// + /// + public BinaryData Schema { get; set; } + /// Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is `true`. To learn more, read the [Structured Outputs guide](/docs/guides/structured-outputs). + public bool? Strict { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsNamedFunctionToolSelection.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsNamedFunctionToolSelection.Serialization.cs new file mode 100644 index 000000000000..21ce9f38c3d7 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsNamedFunctionToolSelection.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ChatCompletionsNamedFunctionToolSelection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsNamedFunctionToolSelection)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("function"u8); + writer.WriteObjectValue(Function, options); + } + + ChatCompletionsNamedFunctionToolSelection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsNamedFunctionToolSelection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatCompletionsNamedFunctionToolSelection(document.RootElement, options); + } + + internal static ChatCompletionsNamedFunctionToolSelection DeserializeChatCompletionsNamedFunctionToolSelection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ChatCompletionsFunctionToolSelection function = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("function"u8)) + { + function = ChatCompletionsFunctionToolSelection.DeserializeChatCompletionsFunctionToolSelection(property.Value, options); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ChatCompletionsNamedFunctionToolSelection(type, serializedAdditionalRawData, function); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatCompletionsNamedFunctionToolSelection)} does not support writing '{options.Format}' format."); + } + } + + ChatCompletionsNamedFunctionToolSelection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatCompletionsNamedFunctionToolSelection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatCompletionsNamedFunctionToolSelection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ChatCompletionsNamedFunctionToolSelection FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatCompletionsNamedFunctionToolSelection(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/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsNamedFunctionToolSelection.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsNamedFunctionToolSelection.cs new file mode 100644 index 000000000000..2645a6e5ad04 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsNamedFunctionToolSelection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// A tool selection of a specific, named function tool that will limit chat completions to using the named function. + public partial class ChatCompletionsNamedFunctionToolSelection : ChatCompletionsNamedToolSelection + { + /// Initializes a new instance of . + /// The function that should be called. + /// is null. + public ChatCompletionsNamedFunctionToolSelection(ChatCompletionsFunctionToolSelection function) + { + Argument.AssertNotNull(function, nameof(function)); + + Type = "function"; + Function = function; + } + + /// Initializes a new instance of . + /// The object type. + /// Keeps track of any properties unknown to the library. + /// The function that should be called. + internal ChatCompletionsNamedFunctionToolSelection(string type, IDictionary serializedAdditionalRawData, ChatCompletionsFunctionToolSelection function) : base(type, serializedAdditionalRawData) + { + Function = function; + } + + /// Initializes a new instance of for deserialization. + internal ChatCompletionsNamedFunctionToolSelection() + { + } + + /// The function that should be called. + public ChatCompletionsFunctionToolSelection Function { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsNamedToolSelection.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsNamedToolSelection.Serialization.cs new file mode 100644 index 000000000000..db69f1961944 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsNamedToolSelection.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + [PersistableModelProxy(typeof(UnknownChatCompletionsNamedToolSelection))] + public partial class ChatCompletionsNamedToolSelection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsNamedToolSelection)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ChatCompletionsNamedToolSelection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsNamedToolSelection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatCompletionsNamedToolSelection(document.RootElement, options); + } + + internal static ChatCompletionsNamedToolSelection DeserializeChatCompletionsNamedToolSelection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "function": return ChatCompletionsNamedFunctionToolSelection.DeserializeChatCompletionsNamedFunctionToolSelection(element, options); + } + } + return UnknownChatCompletionsNamedToolSelection.DeserializeUnknownChatCompletionsNamedToolSelection(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatCompletionsNamedToolSelection)} does not support writing '{options.Format}' format."); + } + } + + ChatCompletionsNamedToolSelection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatCompletionsNamedToolSelection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatCompletionsNamedToolSelection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ChatCompletionsNamedToolSelection FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatCompletionsNamedToolSelection(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/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsNamedToolSelection.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsNamedToolSelection.cs new file mode 100644 index 000000000000..b25ed8fab461 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsNamedToolSelection.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// + /// An abstract representation of an explicit, named tool selection to use for a chat completions request. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + public abstract partial class ChatCompletionsNamedToolSelection + { + /// + /// 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; + + /// Initializes a new instance of . + protected ChatCompletionsNamedToolSelection() + { + } + + /// Initializes a new instance of . + /// The object type. + /// Keeps track of any properties unknown to the library. + internal ChatCompletionsNamedToolSelection(string type, IDictionary serializedAdditionalRawData) + { + Type = type; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The object type. + internal string Type { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsOptions.Serialization.cs new file mode 100644 index 000000000000..c143035980f0 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsOptions.Serialization.cs @@ -0,0 +1,619 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ChatCompletionsOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsOptions)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("messages"u8); + writer.WriteStartArray(); + foreach (var item in Messages) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsCollectionDefined(Functions)) + { + writer.WritePropertyName("functions"u8); + writer.WriteStartArray(); + foreach (var item in Functions) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(FunctionCall)) + { + writer.WritePropertyName("function_call"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(FunctionCall); +#else + using (JsonDocument document = JsonDocument.Parse(FunctionCall)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + if (Optional.IsDefined(MaxTokens)) + { + writer.WritePropertyName("max_tokens"u8); + writer.WriteNumberValue(MaxTokens.Value); + } + if (Optional.IsDefined(MaxCompletionTokens)) + { + writer.WritePropertyName("max_completion_tokens"u8); + writer.WriteNumberValue(MaxCompletionTokens.Value); + } + if (Optional.IsDefined(Temperature)) + { + writer.WritePropertyName("temperature"u8); + writer.WriteNumberValue(Temperature.Value); + } + if (Optional.IsDefined(NucleusSamplingFactor)) + { + writer.WritePropertyName("top_p"u8); + writer.WriteNumberValue(NucleusSamplingFactor.Value); + } + if (Optional.IsCollectionDefined(TokenSelectionBiases)) + { + writer.WritePropertyName("logit_bias"u8); + writer.WriteStartObject(); + foreach (var item in TokenSelectionBiases) + { + writer.WritePropertyName(item.Key); + writer.WriteNumberValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(User)) + { + writer.WritePropertyName("user"u8); + writer.WriteStringValue(User); + } + if (Optional.IsDefined(ChoiceCount)) + { + writer.WritePropertyName("n"u8); + writer.WriteNumberValue(ChoiceCount.Value); + } + if (Optional.IsCollectionDefined(StopSequences)) + { + writer.WritePropertyName("stop"u8); + writer.WriteStartArray(); + foreach (var item in StopSequences) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(PresencePenalty)) + { + writer.WritePropertyName("presence_penalty"u8); + writer.WriteNumberValue(PresencePenalty.Value); + } + if (Optional.IsDefined(FrequencyPenalty)) + { + writer.WritePropertyName("frequency_penalty"u8); + writer.WriteNumberValue(FrequencyPenalty.Value); + } + if (Optional.IsDefined(InternalShouldStreamResponse)) + { + writer.WritePropertyName("stream"u8); + writer.WriteBooleanValue(InternalShouldStreamResponse.Value); + } + if (Optional.IsDefined(StreamOptions)) + { + if (StreamOptions != null) + { + writer.WritePropertyName("stream_options"u8); + writer.WriteObjectValue(StreamOptions, options); + } + else + { + writer.WriteNull("stream_options"); + } + } + if (Optional.IsDefined(DeploymentName)) + { + writer.WritePropertyName("model"u8); + writer.WriteStringValue(DeploymentName); + } + if (Optional.IsCollectionDefined(InternalAzureExtensionsDataSources)) + { + writer.WritePropertyName("data_sources"u8); + writer.WriteStartArray(); + foreach (var item in InternalAzureExtensionsDataSources) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Enhancements)) + { + writer.WritePropertyName("enhancements"u8); + writer.WriteObjectValue(Enhancements, options); + } + if (Optional.IsDefined(Seed)) + { + writer.WritePropertyName("seed"u8); + writer.WriteNumberValue(Seed.Value); + } + if (Optional.IsDefined(EnableLogProbabilities)) + { + if (EnableLogProbabilities != null) + { + writer.WritePropertyName("logprobs"u8); + writer.WriteBooleanValue(EnableLogProbabilities.Value); + } + else + { + writer.WriteNull("logprobs"); + } + } + if (Optional.IsDefined(LogProbabilitiesPerToken)) + { + if (LogProbabilitiesPerToken != null) + { + writer.WritePropertyName("top_logprobs"u8); + writer.WriteNumberValue(LogProbabilitiesPerToken.Value); + } + else + { + writer.WriteNull("top_logprobs"); + } + } + if (Optional.IsDefined(ResponseFormat)) + { + writer.WritePropertyName("response_format"u8); + writer.WriteObjectValue(ResponseFormat, options); + } + if (Optional.IsCollectionDefined(Tools)) + { + writer.WritePropertyName("tools"u8); + writer.WriteStartArray(); + foreach (var item in Tools) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ToolChoice)) + { + writer.WritePropertyName("tool_choice"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(ToolChoice); +#else + using (JsonDocument document = JsonDocument.Parse(ToolChoice)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + if (Optional.IsDefined(ParallelToolCalls)) + { + writer.WritePropertyName("parallel_tool_calls"u8); + writer.WriteBooleanValue(ParallelToolCalls.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ChatCompletionsOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatCompletionsOptions(document.RootElement, options); + } + + internal static ChatCompletionsOptions DeserializeChatCompletionsOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList messages = default; + IList functions = default; + BinaryData functionCall = default; + int? maxTokens = default; + int? maxCompletionTokens = default; + float? temperature = default; + float? topP = default; + IDictionary logitBias = default; + string user = default; + int? n = default; + IList stop = default; + float? presencePenalty = default; + float? frequencyPenalty = default; + bool? stream = default; + ChatCompletionStreamOptions streamOptions = default; + string model = default; + IList dataSources = default; + AzureChatEnhancementConfiguration enhancements = default; + long? seed = default; + bool? logprobs = default; + int? topLogprobs = default; + ChatCompletionsResponseFormat responseFormat = default; + IList tools = default; + BinaryData toolChoice = default; + bool? parallelToolCalls = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("messages"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ChatRequestMessage.DeserializeChatRequestMessage(item, options)); + } + messages = array; + continue; + } + if (property.NameEquals("functions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FunctionDefinition.DeserializeFunctionDefinition(item, options)); + } + functions = array; + continue; + } + if (property.NameEquals("function_call"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + functionCall = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("max_tokens"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxTokens = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("max_completion_tokens"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxCompletionTokens = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("temperature"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + temperature = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("top_p"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + topP = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("logit_bias"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.GetInt32()); + } + logitBias = dictionary; + continue; + } + if (property.NameEquals("user"u8)) + { + user = property.Value.GetString(); + continue; + } + if (property.NameEquals("n"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + n = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("stop"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + stop = array; + continue; + } + if (property.NameEquals("presence_penalty"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + presencePenalty = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("frequency_penalty"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + frequencyPenalty = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("stream"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stream = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("stream_options"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + streamOptions = null; + continue; + } + streamOptions = ChatCompletionStreamOptions.DeserializeChatCompletionStreamOptions(property.Value, options); + continue; + } + if (property.NameEquals("model"u8)) + { + model = property.Value.GetString(); + continue; + } + if (property.NameEquals("data_sources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AzureChatExtensionConfiguration.DeserializeAzureChatExtensionConfiguration(item, options)); + } + dataSources = array; + continue; + } + if (property.NameEquals("enhancements"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enhancements = AzureChatEnhancementConfiguration.DeserializeAzureChatEnhancementConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("seed"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + seed = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("logprobs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + logprobs = null; + continue; + } + logprobs = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("top_logprobs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + topLogprobs = null; + continue; + } + topLogprobs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("response_format"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + responseFormat = ChatCompletionsResponseFormat.DeserializeChatCompletionsResponseFormat(property.Value, options); + continue; + } + if (property.NameEquals("tools"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ChatCompletionsToolDefinition.DeserializeChatCompletionsToolDefinition(item, options)); + } + tools = array; + continue; + } + if (property.NameEquals("tool_choice"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + toolChoice = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("parallel_tool_calls"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + parallelToolCalls = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ChatCompletionsOptions( + messages, + functions ?? new ChangeTrackingList(), + functionCall, + maxTokens, + maxCompletionTokens, + temperature, + topP, + logitBias ?? new ChangeTrackingDictionary(), + user, + n, + stop ?? new ChangeTrackingList(), + presencePenalty, + frequencyPenalty, + stream, + streamOptions, + model, + dataSources ?? new ChangeTrackingList(), + enhancements, + seed, + logprobs, + topLogprobs, + responseFormat, + tools ?? new ChangeTrackingList(), + toolChoice, + parallelToolCalls, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatCompletionsOptions)} does not support writing '{options.Format}' format."); + } + } + + ChatCompletionsOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatCompletionsOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatCompletionsOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ChatCompletionsOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatCompletionsOptions(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/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsOptions.cs new file mode 100644 index 000000000000..3d1ebd1135d1 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsOptions.cs @@ -0,0 +1,414 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.OpenAI +{ + /// + /// The configuration information for a chat completions request. + /// Completions support a wide variety of tasks and generate text that continues from or "completes" + /// provided prompt data. + /// + public partial class ChatCompletionsOptions + { + /// + /// 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; + + /// Initializes a new instance of . + /// + /// The collection of context messages associated with this chat completions request. + /// Typical usage begins with a chat message for the System role that provides instructions for + /// the behavior of the assistant, followed by alternating messages between the User and + /// Assistant roles. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// is null. + public ChatCompletionsOptions(IEnumerable messages) + { + Argument.AssertNotNull(messages, nameof(messages)); + + Messages = messages.ToList(); + Functions = new ChangeTrackingList(); + TokenSelectionBiases = new ChangeTrackingDictionary(); + StopSequences = new ChangeTrackingList(); + InternalAzureExtensionsDataSources = new ChangeTrackingList(); + Tools = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// The collection of context messages associated with this chat completions request. + /// Typical usage begins with a chat message for the System role that provides instructions for + /// the behavior of the assistant, followed by alternating messages between the User and + /// Assistant roles. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// A list of functions the model may generate JSON inputs for. + /// + /// Controls how the model responds to function calls. "none" means the model does not call a function, + /// and responds to the end-user. "auto" means the model can pick between an end-user or calling a function. + /// Specifying a particular function via `{"name": "my_function"}` forces the model to call that function. + /// "none" is the default when no functions are present. "auto" is the default if functions are present. + /// + /// + /// The maximum number of tokens allowed for the generated answer. By default, the number of tokens the model can return will be (4096 - prompt tokens). + /// + /// This value is now deprecated in favor of `max_completion_tokens`, and is not compatible with o1 series models. + /// + /// An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. + /// + /// The sampling temperature to use that controls the apparent creativity of generated completions. + /// Higher values will make output more random while lower values will make results more focused + /// and deterministic. + /// It is not recommended to modify temperature and top_p for the same completions request as the + /// interaction of these two settings is difficult to predict. + /// + /// + /// An alternative to sampling with temperature called nucleus sampling. This value causes the + /// model to consider the results of tokens with the provided probability mass. As an example, a + /// value of 0.15 will cause only the tokens comprising the top 15% of probability mass to be + /// considered. + /// It is not recommended to modify temperature and top_p for the same completions request as the + /// interaction of these two settings is difficult to predict. + /// + /// + /// A map between GPT token IDs and bias scores that influences the probability of specific tokens + /// appearing in a completions response. Token IDs are computed via external tokenizer tools, while + /// bias scores reside in the range of -100 to 100 with minimum and maximum values corresponding to + /// a full ban or exclusive selection of a token, respectively. The exact behavior of a given bias + /// score varies by model. + /// + /// + /// An identifier for the caller or end user of the operation. This may be used for tracking + /// or rate-limiting purposes. + /// + /// + /// The number of chat completions choices that should be generated for a chat completions + /// response. + /// Because this setting can generate many completions, it may quickly consume your token quota. + /// Use carefully and ensure reasonable settings for max_tokens and stop. + /// + /// A collection of textual sequences that will end completions generation. + /// + /// A value that influences the probability of generated tokens appearing based on their existing + /// presence in generated text. + /// Positive values will make tokens less likely to appear when they already exist and increase the + /// model's likelihood to output new topics. + /// + /// + /// A value that influences the probability of generated tokens appearing based on their cumulative + /// frequency in generated text. + /// Positive values will make tokens less likely to appear as their frequency increases and + /// decrease the likelihood of the model repeating the same statements verbatim. + /// + /// A value indicating whether chat completions should be streamed for this request. + /// Options for streaming response. Only set this when you set `stream: true`. + /// + /// The model name to provide as part of this completions request. + /// Not applicable to Azure OpenAI, where deployment information should be included in the Azure + /// resource URI that's connected to. + /// + /// + /// The configuration entries for Azure OpenAI chat extensions that use them. + /// This additional specification is only compatible with Azure OpenAI. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// If provided, the configuration options for available Azure OpenAI chat enhancements. + /// + /// If specified, the system will make a best effort to sample deterministically such that repeated requests with the + /// same seed and parameters should return the same result. Determinism is not guaranteed, and you should refer to the + /// system_fingerprint response parameter to monitor changes in the backend." + /// + /// Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the `content` of `message`. This option is currently not available on the `gpt-4-vision-preview` model. + /// An integer between 0 and 5 specifying the number of most likely tokens to return at each token position, each with an associated log probability. `logprobs` must be set to `true` if this parameter is used. + /// + /// An object specifying the format that the model must output. Used to enable JSON mode. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// + /// The available tool definitions that the chat completions request can use, including caller-defined functions. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + /// If specified, the model will configure which of the provided tools it can use for the chat completions response. + /// Whether to enable parallel function calling during tool use. + /// Keeps track of any properties unknown to the library. + internal ChatCompletionsOptions(IList messages, IList functions, BinaryData functionCall, int? maxTokens, int? maxCompletionTokens, float? temperature, float? nucleusSamplingFactor, IDictionary tokenSelectionBiases, string user, int? choiceCount, IList stopSequences, float? presencePenalty, float? frequencyPenalty, bool? internalShouldStreamResponse, ChatCompletionStreamOptions streamOptions, string deploymentName, IList internalAzureExtensionsDataSources, AzureChatEnhancementConfiguration enhancements, long? seed, bool? enableLogProbabilities, int? logProbabilitiesPerToken, ChatCompletionsResponseFormat responseFormat, IList tools, BinaryData toolChoice, bool? parallelToolCalls, IDictionary serializedAdditionalRawData) + { + Messages = messages; + Functions = functions; + FunctionCall = functionCall; + MaxTokens = maxTokens; + MaxCompletionTokens = maxCompletionTokens; + Temperature = temperature; + NucleusSamplingFactor = nucleusSamplingFactor; + TokenSelectionBiases = tokenSelectionBiases; + User = user; + ChoiceCount = choiceCount; + StopSequences = stopSequences; + PresencePenalty = presencePenalty; + FrequencyPenalty = frequencyPenalty; + InternalShouldStreamResponse = internalShouldStreamResponse; + StreamOptions = streamOptions; + DeploymentName = deploymentName; + InternalAzureExtensionsDataSources = internalAzureExtensionsDataSources; + Enhancements = enhancements; + Seed = seed; + EnableLogProbabilities = enableLogProbabilities; + LogProbabilitiesPerToken = logProbabilitiesPerToken; + ResponseFormat = responseFormat; + Tools = tools; + ToolChoice = toolChoice; + ParallelToolCalls = parallelToolCalls; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ChatCompletionsOptions() + { + } + + /// + /// The collection of context messages associated with this chat completions request. + /// Typical usage begins with a chat message for the System role that provides instructions for + /// the behavior of the assistant, followed by alternating messages between the User and + /// Assistant roles. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + public IList Messages { get; } + /// A list of functions the model may generate JSON inputs for. + public IList Functions { get; } + /// + /// Controls how the model responds to function calls. "none" means the model does not call a function, + /// and responds to the end-user. "auto" means the model can pick between an end-user or calling a function. + /// Specifying a particular function via `{"name": "my_function"}` forces the model to call that function. + /// "none" is the default when no functions are present. "auto" is the default if functions are present. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// + /// Supported types: + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// 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" }. + /// + /// + /// + /// + public BinaryData FunctionCall { get; set; } + /// + /// The maximum number of tokens allowed for the generated answer. By default, the number of tokens the model can return will be (4096 - prompt tokens). + /// + /// This value is now deprecated in favor of `max_completion_tokens`, and is not compatible with o1 series models. + /// + public int? MaxTokens { get; set; } + /// An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. + public int? MaxCompletionTokens { get; set; } + /// + /// The sampling temperature to use that controls the apparent creativity of generated completions. + /// Higher values will make output more random while lower values will make results more focused + /// and deterministic. + /// It is not recommended to modify temperature and top_p for the same completions request as the + /// interaction of these two settings is difficult to predict. + /// + public float? Temperature { get; set; } + /// + /// An alternative to sampling with temperature called nucleus sampling. This value causes the + /// model to consider the results of tokens with the provided probability mass. As an example, a + /// value of 0.15 will cause only the tokens comprising the top 15% of probability mass to be + /// considered. + /// It is not recommended to modify temperature and top_p for the same completions request as the + /// interaction of these two settings is difficult to predict. + /// + public float? NucleusSamplingFactor { get; set; } + /// + /// A map between GPT token IDs and bias scores that influences the probability of specific tokens + /// appearing in a completions response. Token IDs are computed via external tokenizer tools, while + /// bias scores reside in the range of -100 to 100 with minimum and maximum values corresponding to + /// a full ban or exclusive selection of a token, respectively. The exact behavior of a given bias + /// score varies by model. + /// + public IDictionary TokenSelectionBiases { get; } + /// + /// An identifier for the caller or end user of the operation. This may be used for tracking + /// or rate-limiting purposes. + /// + public string User { get; set; } + /// + /// The number of chat completions choices that should be generated for a chat completions + /// response. + /// Because this setting can generate many completions, it may quickly consume your token quota. + /// Use carefully and ensure reasonable settings for max_tokens and stop. + /// + public int? ChoiceCount { get; set; } + /// A collection of textual sequences that will end completions generation. + public IList StopSequences { get; } + /// + /// A value that influences the probability of generated tokens appearing based on their existing + /// presence in generated text. + /// Positive values will make tokens less likely to appear when they already exist and increase the + /// model's likelihood to output new topics. + /// + public float? PresencePenalty { get; set; } + /// + /// A value that influences the probability of generated tokens appearing based on their cumulative + /// frequency in generated text. + /// Positive values will make tokens less likely to appear as their frequency increases and + /// decrease the likelihood of the model repeating the same statements verbatim. + /// + public float? FrequencyPenalty { get; set; } + /// A value indicating whether chat completions should be streamed for this request. + public bool? InternalShouldStreamResponse { get; set; } + /// Options for streaming response. Only set this when you set `stream: true`. + public ChatCompletionStreamOptions StreamOptions { get; set; } + /// + /// The model name to provide as part of this completions request. + /// Not applicable to Azure OpenAI, where deployment information should be included in the Azure + /// resource URI that's connected to. + /// + public string DeploymentName { get; set; } + /// + /// The configuration entries for Azure OpenAI chat extensions that use them. + /// This additional specification is only compatible with Azure OpenAI. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + public IList InternalAzureExtensionsDataSources { get; } + /// If provided, the configuration options for available Azure OpenAI chat enhancements. + public AzureChatEnhancementConfiguration Enhancements { get; set; } + /// + /// If specified, the system will make a best effort to sample deterministically such that repeated requests with the + /// same seed and parameters should return the same result. Determinism is not guaranteed, and you should refer to the + /// system_fingerprint response parameter to monitor changes in the backend." + /// + public long? Seed { get; set; } + /// Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the `content` of `message`. This option is currently not available on the `gpt-4-vision-preview` model. + public bool? EnableLogProbabilities { get; set; } + /// An integer between 0 and 5 specifying the number of most likely tokens to return at each token position, each with an associated log probability. `logprobs` must be set to `true` if this parameter is used. + public int? LogProbabilitiesPerToken { get; set; } + /// + /// An object specifying the format that the model must output. Used to enable JSON mode. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + public ChatCompletionsResponseFormat ResponseFormat { get; set; } + /// + /// The available tool definitions that the chat completions request can use, including caller-defined functions. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + public IList Tools { get; } + /// + /// If specified, the model will configure which of the provided tools it can use for the chat completions response. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// + /// Supported types: + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// 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" }. + /// + /// + /// + /// + public BinaryData ToolChoice { get; set; } + /// Whether to enable parallel function calling during tool use. + public bool? ParallelToolCalls { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsResponseFormat.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsResponseFormat.Serialization.cs new file mode 100644 index 000000000000..eed480521baf --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsResponseFormat.Serialization.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + [PersistableModelProxy(typeof(UnknownChatCompletionsResponseFormat))] + public partial class ChatCompletionsResponseFormat : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsResponseFormat)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ChatCompletionsResponseFormat IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsResponseFormat)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatCompletionsResponseFormat(document.RootElement, options); + } + + internal static ChatCompletionsResponseFormat DeserializeChatCompletionsResponseFormat(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "json_object": return ChatCompletionsJsonResponseFormat.DeserializeChatCompletionsJsonResponseFormat(element, options); + case "json_schema": return ChatCompletionsJsonSchemaResponseFormat.DeserializeChatCompletionsJsonSchemaResponseFormat(element, options); + case "text": return ChatCompletionsTextResponseFormat.DeserializeChatCompletionsTextResponseFormat(element, options); + } + } + return UnknownChatCompletionsResponseFormat.DeserializeUnknownChatCompletionsResponseFormat(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatCompletionsResponseFormat)} does not support writing '{options.Format}' format."); + } + } + + ChatCompletionsResponseFormat IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatCompletionsResponseFormat(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatCompletionsResponseFormat)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ChatCompletionsResponseFormat FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatCompletionsResponseFormat(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/openai/Azure.AI.OpenAI/src/Generated/ChatDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsResponseFormat.cs similarity index 55% rename from sdk/openai/Azure.AI.OpenAI/src/Generated/ChatDataSource.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsResponseFormat.cs index 35988a26e719..43211d2ed3cb 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatDataSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsResponseFormat.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable @@ -5,17 +8,15 @@ using System; using System.Collections.Generic; -namespace Azure.AI.OpenAI.Chat +namespace Azure.AI.OpenAI { /// - /// A representation of configuration data for a single Azure OpenAI chat data source. - /// This will be used by a chat completions request that should use Azure OpenAI chat extensions to augment the - /// response behavior. - /// The use of this configuration is compatible only with Azure OpenAI. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . + /// An abstract representation of a response format configuration usable by Chat Completions. Can be used to enable JSON + /// mode. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . /// - public abstract partial class ChatDataSource + public abstract partial class ChatCompletionsResponseFormat { /// /// Keeps track of any properties unknown to the library. @@ -47,22 +48,23 @@ public abstract partial class ChatDataSource /// /// /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - protected ChatDataSource() + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected ChatCompletionsResponseFormat() { } - /// Initializes a new instance of . - /// The differentiating type identifier for the data source. + /// Initializes a new instance of . + /// The discriminated type for the response format. /// Keeps track of any properties unknown to the library. - internal ChatDataSource(string type, IDictionary serializedAdditionalRawData) + internal ChatCompletionsResponseFormat(string type, IDictionary serializedAdditionalRawData) { Type = type; - SerializedAdditionalRawData = serializedAdditionalRawData; + _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The differentiating type identifier for the data source. + /// The discriminated type for the response format. internal string Type { get; set; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsTextResponseFormat.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsTextResponseFormat.Serialization.cs new file mode 100644 index 000000000000..ea55aba364ba --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsTextResponseFormat.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ChatCompletionsTextResponseFormat : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsTextResponseFormat)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ChatCompletionsTextResponseFormat IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsTextResponseFormat)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatCompletionsTextResponseFormat(document.RootElement, options); + } + + internal static ChatCompletionsTextResponseFormat DeserializeChatCompletionsTextResponseFormat(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ChatCompletionsTextResponseFormat(type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatCompletionsTextResponseFormat)} does not support writing '{options.Format}' format."); + } + } + + ChatCompletionsTextResponseFormat IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatCompletionsTextResponseFormat(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatCompletionsTextResponseFormat)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ChatCompletionsTextResponseFormat FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatCompletionsTextResponseFormat(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/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsTextResponseFormat.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsTextResponseFormat.cs new file mode 100644 index 000000000000..d1bf93c195ba --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsTextResponseFormat.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// + /// The standard Chat Completions response format that can freely generate text and is not guaranteed to produce response + /// content that adheres to a specific schema. + /// + public partial class ChatCompletionsTextResponseFormat : ChatCompletionsResponseFormat + { + /// Initializes a new instance of . + public ChatCompletionsTextResponseFormat() + { + Type = "text"; + } + + /// Initializes a new instance of . + /// The discriminated type for the response format. + /// Keeps track of any properties unknown to the library. + internal ChatCompletionsTextResponseFormat(string type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) + { + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutput.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsToolCall.Serialization.cs similarity index 53% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutput.Serialization.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsToolCall.Serialization.cs index 0e23a14437ba..c73eff304adc 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutput.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsToolCall.Serialization.cs @@ -10,14 +10,14 @@ using System.Text.Json; using Azure.Core; -namespace Azure.Messaging.EventGrid.SystemEvents +namespace Azure.AI.OpenAI { - [PersistableModelProxy(typeof(UnknownMediaJobOutput))] - public partial class MediaJobOutput : IUtf8JsonSerializable, IJsonModel + [PersistableModelProxy(typeof(UnknownChatCompletionsToolCall))] + public partial class ChatCompletionsToolCall : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,25 +28,16 @@ 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobOutput)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ChatCompletionsToolCall)} does not support writing '{format}' format."); } - writer.WritePropertyName("@odata.type"u8); - writer.WriteStringValue(OdataType); - writer.WritePropertyName("error"u8); - writer.WriteObjectValue(Error, options); - if (Optional.IsDefined(Label)) - { - writer.WritePropertyName("label"u8); - writer.WriteStringValue(Label); - } - writer.WritePropertyName("progress"u8); - writer.WriteNumberValue(Progress); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToString()); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -64,19 +55,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - MediaJobOutput IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ChatCompletionsToolCall IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobOutput)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ChatCompletionsToolCall)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaJobOutput(document.RootElement, options); + return DeserializeChatCompletionsToolCall(document.RootElement, options); } - internal static MediaJobOutput DeserializeMediaJobOutput(JsonElement element, ModelReaderWriterOptions options = null) + internal static ChatCompletionsToolCall DeserializeChatCompletionsToolCall(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -84,53 +75,53 @@ internal static MediaJobOutput DeserializeMediaJobOutput(JsonElement element, Mo { return null; } - if (element.TryGetProperty("@odata.type", out JsonElement discriminator)) + if (element.TryGetProperty("type", out JsonElement discriminator)) { switch (discriminator.GetString()) { - case "#Microsoft.Media.JobOutputAsset": return MediaJobOutputAsset.DeserializeMediaJobOutputAsset(element, options); + case "function": return ChatCompletionsFunctionToolCall.DeserializeChatCompletionsFunctionToolCall(element, options); } } - return UnknownMediaJobOutput.DeserializeUnknownMediaJobOutput(element, options); + return UnknownChatCompletionsToolCall.DeserializeUnknownChatCompletionsToolCall(element, options); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MediaJobOutput)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ChatCompletionsToolCall)} does not support writing '{options.Format}' format."); } } - MediaJobOutput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ChatCompletionsToolCall IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaJobOutput(document.RootElement, options); + return DeserializeChatCompletionsToolCall(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MediaJobOutput)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ChatCompletionsToolCall)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static MediaJobOutput FromResponse(Response response) + internal static ChatCompletionsToolCall FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaJobOutput(document.RootElement); + return DeserializeChatCompletionsToolCall(document.RootElement); } /// Convert into a . diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsToolCall.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsToolCall.cs new file mode 100644 index 000000000000..a6de3a467520 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsToolCall.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// + /// An abstract representation of a tool call that must be resolved in a subsequent request to perform the requested + /// chat completion. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + public abstract partial class ChatCompletionsToolCall + { + /// + /// 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; + + /// Initializes a new instance of . + /// The ID of the tool call. + /// is null. + protected ChatCompletionsToolCall(string id) + { + Argument.AssertNotNull(id, nameof(id)); + + Id = id; + } + + /// Initializes a new instance of . + /// The object type. + /// The ID of the tool call. + /// Keeps track of any properties unknown to the library. + internal ChatCompletionsToolCall(string type, string id, IDictionary serializedAdditionalRawData) + { + Type = type; + Id = id; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ChatCompletionsToolCall() + { + } + + /// The object type. + internal string Type { get; set; } + /// The ID of the tool call. + public string Id { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsToolDefinition.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsToolDefinition.Serialization.cs new file mode 100644 index 000000000000..5f5b24ce4908 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsToolDefinition.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + [PersistableModelProxy(typeof(UnknownChatCompletionsToolDefinition))] + public partial class ChatCompletionsToolDefinition : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsToolDefinition)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ChatCompletionsToolDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsToolDefinition)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatCompletionsToolDefinition(document.RootElement, options); + } + + internal static ChatCompletionsToolDefinition DeserializeChatCompletionsToolDefinition(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "function": return ChatCompletionsFunctionToolDefinition.DeserializeChatCompletionsFunctionToolDefinition(element, options); + } + } + return UnknownChatCompletionsToolDefinition.DeserializeUnknownChatCompletionsToolDefinition(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatCompletionsToolDefinition)} does not support writing '{options.Format}' format."); + } + } + + ChatCompletionsToolDefinition IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatCompletionsToolDefinition(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatCompletionsToolDefinition)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ChatCompletionsToolDefinition FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatCompletionsToolDefinition(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/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsToolDefinition.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsToolDefinition.cs new file mode 100644 index 000000000000..712c79c1aeb9 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsToolDefinition.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// + /// An abstract representation of a tool that can be used by the model to improve a chat completions response. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + public abstract partial class ChatCompletionsToolDefinition + { + /// + /// 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; + + /// Initializes a new instance of . + protected ChatCompletionsToolDefinition() + { + } + + /// Initializes a new instance of . + /// The object type. + /// Keeps track of any properties unknown to the library. + internal ChatCompletionsToolDefinition(string type, IDictionary serializedAdditionalRawData) + { + Type = type; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The object type. + internal string Type { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsToolSelectionPreset.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsToolSelectionPreset.cs new file mode 100644 index 000000000000..9916c3d6a74b --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCompletionsToolSelectionPreset.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// Represents a generic policy for how a chat completions tool may be selected. + public readonly partial struct ChatCompletionsToolSelectionPreset : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ChatCompletionsToolSelectionPreset(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AutoValue = "auto"; + private const string NoneValue = "none"; + private const string RequiredValue = "required"; + + /// + /// Specifies that the model may either use any of the tools provided in this chat completions request or + /// instead return a standard chat completions response as if no tools were provided. + /// + public static ChatCompletionsToolSelectionPreset Auto { get; } = new ChatCompletionsToolSelectionPreset(AutoValue); + /// + /// Specifies that the model should not respond with a tool call and should instead provide a standard chat + /// completions response. Response content may still be influenced by the provided tool definitions. + /// + public static ChatCompletionsToolSelectionPreset None { get; } = new ChatCompletionsToolSelectionPreset(NoneValue); + /// Specifies that the model must call one or more tools. + public static ChatCompletionsToolSelectionPreset Required { get; } = new ChatCompletionsToolSelectionPreset(RequiredValue); + /// Determines if two values are the same. + public static bool operator ==(ChatCompletionsToolSelectionPreset left, ChatCompletionsToolSelectionPreset right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ChatCompletionsToolSelectionPreset left, ChatCompletionsToolSelectionPreset right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ChatCompletionsToolSelectionPreset(string value) => new ChatCompletionsToolSelectionPreset(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ChatCompletionsToolSelectionPreset other && Equals(other); + /// + public bool Equals(ChatCompletionsToolSelectionPreset 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/openai/Azure.AI.OpenAI/src/Generated/ChatDataSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatDataSource.Serialization.cs deleted file mode 100644 index 78dc642677f4..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatDataSource.Serialization.cs +++ /dev/null @@ -1,130 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.AI.OpenAI.Chat -{ - [PersistableModelProxy(typeof(InternalUnknownAzureChatDataSource))] - public partial class ChatDataSource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ChatDataSource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("type") != true) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ChatDataSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ChatDataSource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeChatDataSource(document.RootElement, options); - } - - internal static ChatDataSource DeserializeChatDataSource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("type", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "azure_cosmos_db": return CosmosChatDataSource.DeserializeCosmosChatDataSource(element, options); - case "azure_search": return AzureSearchChatDataSource.DeserializeAzureSearchChatDataSource(element, options); - case "elasticsearch": return ElasticsearchChatDataSource.DeserializeElasticsearchChatDataSource(element, options); - case "mongo_db": return MongoDBChatDataSource.DeserializeMongoDBChatDataSource(element, options); - case "pinecone": return PineconeChatDataSource.DeserializePineconeChatDataSource(element, options); - } - } - return InternalUnknownAzureChatDataSource.DeserializeInternalUnknownAzureChatDataSource(element, options); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ChatDataSource)} does not support writing '{options.Format}' format."); - } - } - - ChatDataSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeChatDataSource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ChatDataSource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static ChatDataSource FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeChatDataSource(document.RootElement); - } - - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatDocumentFilterReason.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatDocumentFilterReason.cs deleted file mode 100644 index 798da3e6725d..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatDocumentFilterReason.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.OpenAI.Chat -{ - /// The AzureChatMessageContextAllRetrievedDocumentsFilterReason. - public readonly partial struct ChatDocumentFilterReason : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ChatDocumentFilterReason(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ScoreValue = "score"; - private const string RerankValue = "rerank"; - - /// score. - public static ChatDocumentFilterReason Score { get; } = new ChatDocumentFilterReason(ScoreValue); - /// rerank. - public static ChatDocumentFilterReason Rerank { get; } = new ChatDocumentFilterReason(RerankValue); - /// Determines if two values are the same. - public static bool operator ==(ChatDocumentFilterReason left, ChatDocumentFilterReason right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ChatDocumentFilterReason left, ChatDocumentFilterReason right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ChatDocumentFilterReason(string value) => new ChatDocumentFilterReason(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ChatDocumentFilterReason other && Equals(other); - /// - public bool Equals(ChatDocumentFilterReason 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/openai/Azure.AI.OpenAI/src/Generated/ChatMessageContentItem.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageContentItem.Serialization.cs new file mode 100644 index 000000000000..6c27a3cf3885 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageContentItem.Serialization.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + [PersistableModelProxy(typeof(UnknownChatMessageContentItem))] + public partial class ChatMessageContentItem : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatMessageContentItem)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ChatMessageContentItem IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatMessageContentItem)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatMessageContentItem(document.RootElement, options); + } + + internal static ChatMessageContentItem DeserializeChatMessageContentItem(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "image_url": return ChatMessageImageContentItem.DeserializeChatMessageImageContentItem(element, options); + case "refusal": return ChatMessageRefusalContentItem.DeserializeChatMessageRefusalContentItem(element, options); + case "text": return ChatMessageTextContentItem.DeserializeChatMessageTextContentItem(element, options); + } + } + return UnknownChatMessageContentItem.DeserializeUnknownChatMessageContentItem(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatMessageContentItem)} does not support writing '{options.Format}' format."); + } + } + + ChatMessageContentItem IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatMessageContentItem(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatMessageContentItem)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ChatMessageContentItem FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatMessageContentItem(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/openai/Azure.AI.OpenAI/src/Generated/ChatMessageContentItem.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageContentItem.cs new file mode 100644 index 000000000000..40a3f4f1679c --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageContentItem.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// + /// An abstract representation of a structured content item within a chat message. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + public abstract partial class ChatMessageContentItem + { + /// + /// 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; + + /// Initializes a new instance of . + protected ChatMessageContentItem() + { + } + + /// Initializes a new instance of . + /// The discriminated object type. + /// Keeps track of any properties unknown to the library. + internal ChatMessageContentItem(string type, IDictionary serializedAdditionalRawData) + { + Type = type; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The discriminated object type. + internal string Type { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageContext.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageContext.Serialization.cs deleted file mode 100644 index 7d8cab801548..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageContext.Serialization.cs +++ /dev/null @@ -1,176 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI.Chat -{ - public partial class ChatMessageContext : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ChatMessageContext)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("intent") != true && Optional.IsDefined(Intent)) - { - writer.WritePropertyName("intent"u8); - writer.WriteStringValue(Intent); - } - if (SerializedAdditionalRawData?.ContainsKey("citations") != true && Optional.IsCollectionDefined(Citations)) - { - writer.WritePropertyName("citations"u8); - writer.WriteStartArray(); - foreach (var item in Citations) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (SerializedAdditionalRawData?.ContainsKey("all_retrieved_documents") != true && Optional.IsDefined(RetrievedDocuments)) - { - writer.WritePropertyName("all_retrieved_documents"u8); - writer.WriteObjectValue(RetrievedDocuments, options); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ChatMessageContext IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ChatMessageContext)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeChatMessageContext(document.RootElement, options); - } - - internal static ChatMessageContext DeserializeChatMessageContext(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string intent = default; - IReadOnlyList citations = default; - ChatRetrievedDocument allRetrievedDocuments = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("intent"u8)) - { - intent = property.Value.GetString(); - continue; - } - if (property.NameEquals("citations"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ChatCitation.DeserializeChatCitation(item, options)); - } - citations = array; - continue; - } - if (property.NameEquals("all_retrieved_documents"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - allRetrievedDocuments = ChatRetrievedDocument.DeserializeChatRetrievedDocument(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ChatMessageContext(intent, citations ?? new ChangeTrackingList(), allRetrievedDocuments, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ChatMessageContext)} does not support writing '{options.Format}' format."); - } - } - - ChatMessageContext IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeChatMessageContext(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ChatMessageContext)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static ChatMessageContext FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeChatMessageContext(document.RootElement); - } - - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageContext.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageContext.cs deleted file mode 100644 index 7a117a45cbe4..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageContext.cs +++ /dev/null @@ -1,71 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI.Chat -{ - /// - /// An additional property, added to chat completion response messages, produced by the Azure OpenAI service when using - /// extension behavior. This includes intent and citation information from the On Your Data feature. - /// - public partial class ChatMessageContext - { - /// - /// 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" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - internal ChatMessageContext() - { - Citations = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The detected intent from the chat history, which is used to carry conversation context between interactions. - /// The citations produced by the data retrieval. - /// Summary information about documents retrieved by the data retrieval operation. - /// Keeps track of any properties unknown to the library. - internal ChatMessageContext(string intent, IReadOnlyList citations, ChatRetrievedDocument retrievedDocuments, IDictionary serializedAdditionalRawData) - { - Intent = intent; - Citations = citations; - RetrievedDocuments = retrievedDocuments; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The detected intent from the chat history, which is used to carry conversation context between interactions. - public string Intent { get; } - /// The citations produced by the data retrieval. - public IReadOnlyList Citations { get; } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobProcessingEventData.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageImageContentItem.Serialization.cs similarity index 57% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobProcessingEventData.Serialization.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageImageContentItem.Serialization.cs index 093588eafc6b..53184aea995f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobProcessingEventData.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageImageContentItem.Serialization.cs @@ -11,13 +11,13 @@ using System.Text.Json; using Azure.Core; -namespace Azure.Messaging.EventGrid.SystemEvents +namespace Azure.AI.OpenAI { - public partial class MediaJobProcessingEventData : IUtf8JsonSerializable, IJsonModel + public partial class ChatMessageImageContentItem : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,28 +28,30 @@ 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobProcessingEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ChatMessageImageContentItem)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("image_url"u8); + writer.WriteObjectValue(ImageUrl, options); } - MediaJobProcessingEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ChatMessageImageContentItem IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobProcessingEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ChatMessageImageContentItem)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaJobProcessingEventData(document.RootElement, options); + return DeserializeChatMessageImageContentItem(document.RootElement, options); } - internal static MediaJobProcessingEventData DeserializeMediaJobProcessingEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static ChatMessageImageContentItem DeserializeChatMessageImageContentItem(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -57,31 +59,20 @@ internal static MediaJobProcessingEventData DeserializeMediaJobProcessingEventDa { return null; } - MediaJobState previousState = default; - MediaJobState state = default; - IReadOnlyDictionary correlationData = default; + ChatMessageImageUrl imageUrl = default; + string type = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("previousState"u8)) + if (property.NameEquals("image_url"u8)) { - previousState = new MediaJobState(property.Value.GetString()); + imageUrl = ChatMessageImageUrl.DeserializeChatMessageImageUrl(property.Value, options); continue; } - if (property.NameEquals("state"u8)) + if (property.NameEquals("type"u8)) { - state = new MediaJobState(property.Value.GetString()); - continue; - } - if (property.NameEquals("correlationData"u8)) - { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - correlationData = dictionary; + type = property.Value.GetString(); continue; } if (options.Format != "W") @@ -90,46 +81,46 @@ internal static MediaJobProcessingEventData DeserializeMediaJobProcessingEventDa } } serializedAdditionalRawData = rawDataDictionary; - return new MediaJobProcessingEventData(previousState, state, correlationData, serializedAdditionalRawData); + return new ChatMessageImageContentItem(type, serializedAdditionalRawData, imageUrl); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MediaJobProcessingEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ChatMessageImageContentItem)} does not support writing '{options.Format}' format."); } } - MediaJobProcessingEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ChatMessageImageContentItem IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaJobProcessingEventData(document.RootElement, options); + return DeserializeChatMessageImageContentItem(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MediaJobProcessingEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ChatMessageImageContentItem)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new MediaJobProcessingEventData FromResponse(Response response) + internal static new ChatMessageImageContentItem FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaJobProcessingEventData(document.RootElement); + return DeserializeChatMessageImageContentItem(document.RootElement); } /// Convert into a . diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageImageContentItem.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageImageContentItem.cs new file mode 100644 index 000000000000..69aaa3ec3cea --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageImageContentItem.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// A structured chat content item containing an image reference. + public partial class ChatMessageImageContentItem : ChatMessageContentItem + { + /// Initializes a new instance of . + /// An internet location, which must be accessible to the model,from which the image may be retrieved. + /// is null. + public ChatMessageImageContentItem(ChatMessageImageUrl imageUrl) + { + Argument.AssertNotNull(imageUrl, nameof(imageUrl)); + + Type = "image_url"; + ImageUrl = imageUrl; + } + + /// Initializes a new instance of . + /// The discriminated object type. + /// Keeps track of any properties unknown to the library. + /// An internet location, which must be accessible to the model,from which the image may be retrieved. + internal ChatMessageImageContentItem(string type, IDictionary serializedAdditionalRawData, ChatMessageImageUrl imageUrl) : base(type, serializedAdditionalRawData) + { + ImageUrl = imageUrl; + } + + /// Initializes a new instance of for deserialization. + internal ChatMessageImageContentItem() + { + } + + /// An internet location, which must be accessible to the model,from which the image may be retrieved. + public ChatMessageImageUrl ImageUrl { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageImageDetailLevel.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageImageDetailLevel.cs new file mode 100644 index 000000000000..bc0649288b24 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageImageDetailLevel.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// A representation of the possible image detail levels for image-based chat completions message content. + public readonly partial struct ChatMessageImageDetailLevel : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ChatMessageImageDetailLevel(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AutoValue = "auto"; + private const string LowValue = "low"; + private const string HighValue = "high"; + + /// Specifies that the model should determine which detail level to apply using heuristics like image size. + public static ChatMessageImageDetailLevel Auto { get; } = new ChatMessageImageDetailLevel(AutoValue); + /// + /// Specifies that image evaluation should be constrained to the 'low-res' model that may be faster and consume fewer + /// tokens but may also be less accurate for highly detailed images. + /// + public static ChatMessageImageDetailLevel Low { get; } = new ChatMessageImageDetailLevel(LowValue); + /// + /// Specifies that image evaluation should enable the 'high-res' model that may be more accurate for highly detailed + /// images but may also be slower and consume more tokens. + /// + public static ChatMessageImageDetailLevel High { get; } = new ChatMessageImageDetailLevel(HighValue); + /// Determines if two values are the same. + public static bool operator ==(ChatMessageImageDetailLevel left, ChatMessageImageDetailLevel right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ChatMessageImageDetailLevel left, ChatMessageImageDetailLevel right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ChatMessageImageDetailLevel(string value) => new ChatMessageImageDetailLevel(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ChatMessageImageDetailLevel other && Equals(other); + /// + public bool Equals(ChatMessageImageDetailLevel 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/MediaJobErrorDetail.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageImageUrl.Serialization.cs similarity index 64% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErrorDetail.Serialization.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageImageUrl.Serialization.cs index 61ea5a6e9dfd..728da1afb3f0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErrorDetail.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageImageUrl.Serialization.cs @@ -11,13 +11,13 @@ using System.Text.Json; using Azure.Core; -namespace Azure.Messaging.EventGrid.SystemEvents +namespace Azure.AI.OpenAI { - public partial class MediaJobErrorDetail : IUtf8JsonSerializable, IJsonModel + public partial class ChatMessageImageUrl : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,21 +28,18 @@ 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobErrorDetail)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ChatMessageImageUrl)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Code)) + writer.WritePropertyName("url"u8); + writer.WriteStringValue(Url.AbsoluteUri); + if (Optional.IsDefined(Detail)) { - writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code); - } - if (Optional.IsDefined(Message)) - { - writer.WritePropertyName("message"u8); - writer.WriteStringValue(Message); + writer.WritePropertyName("detail"u8); + writer.WriteStringValue(Detail.Value.ToString()); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -61,19 +58,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - MediaJobErrorDetail IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ChatMessageImageUrl IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobErrorDetail)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ChatMessageImageUrl)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaJobErrorDetail(document.RootElement, options); + return DeserializeChatMessageImageUrl(document.RootElement, options); } - internal static MediaJobErrorDetail DeserializeMediaJobErrorDetail(JsonElement element, ModelReaderWriterOptions options = null) + internal static ChatMessageImageUrl DeserializeChatMessageImageUrl(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -81,20 +78,24 @@ internal static MediaJobErrorDetail DeserializeMediaJobErrorDetail(JsonElement e { return null; } - string code = default; - string message = default; + Uri url = default; + ChatMessageImageDetailLevel? detail = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("code"u8)) + if (property.NameEquals("url"u8)) { - code = property.Value.GetString(); + url = new Uri(property.Value.GetString()); continue; } - if (property.NameEquals("message"u8)) + if (property.NameEquals("detail"u8)) { - message = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + detail = new ChatMessageImageDetailLevel(property.Value.GetString()); continue; } if (options.Format != "W") @@ -103,46 +104,46 @@ internal static MediaJobErrorDetail DeserializeMediaJobErrorDetail(JsonElement e } } serializedAdditionalRawData = rawDataDictionary; - return new MediaJobErrorDetail(code, message, serializedAdditionalRawData); + return new ChatMessageImageUrl(url, detail, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MediaJobErrorDetail)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ChatMessageImageUrl)} does not support writing '{options.Format}' format."); } } - MediaJobErrorDetail IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ChatMessageImageUrl IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaJobErrorDetail(document.RootElement, options); + return DeserializeChatMessageImageUrl(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MediaJobErrorDetail)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ChatMessageImageUrl)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static MediaJobErrorDetail FromResponse(Response response) + internal static ChatMessageImageUrl FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaJobErrorDetail(document.RootElement); + return DeserializeChatMessageImageUrl(document.RootElement); } /// Convert into a . diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageImageUrl.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageImageUrl.cs new file mode 100644 index 000000000000..ccccaecc34cb --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageImageUrl.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// An internet location from which the model may retrieve an image. + public partial class ChatMessageImageUrl + { + /// + /// 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; + + /// Initializes a new instance of . + /// The URL of the image. + /// is null. + public ChatMessageImageUrl(Uri url) + { + Argument.AssertNotNull(url, nameof(url)); + + Url = url; + } + + /// Initializes a new instance of . + /// The URL of the image. + /// + /// The evaluation quality setting to use, which controls relative prioritization of speed, token consumption, and + /// accuracy. + /// + /// Keeps track of any properties unknown to the library. + internal ChatMessageImageUrl(Uri url, ChatMessageImageDetailLevel? detail, IDictionary serializedAdditionalRawData) + { + Url = url; + Detail = detail; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ChatMessageImageUrl() + { + } + + /// The URL of the image. + public Uri Url { get; } + /// + /// The evaluation quality setting to use, which controls relative prioritization of speed, token consumption, and + /// accuracy. + /// + public ChatMessageImageDetailLevel? Detail { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageRefusalContentItem.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageRefusalContentItem.Serialization.cs new file mode 100644 index 000000000000..acf2cdbef247 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageRefusalContentItem.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ChatMessageRefusalContentItem : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatMessageRefusalContentItem)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("refusal"u8); + writer.WriteStringValue(Refusal); + } + + ChatMessageRefusalContentItem IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatMessageRefusalContentItem)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatMessageRefusalContentItem(document.RootElement, options); + } + + internal static ChatMessageRefusalContentItem DeserializeChatMessageRefusalContentItem(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string refusal = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("refusal"u8)) + { + refusal = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ChatMessageRefusalContentItem(type, serializedAdditionalRawData, refusal); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatMessageRefusalContentItem)} does not support writing '{options.Format}' format."); + } + } + + ChatMessageRefusalContentItem IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatMessageRefusalContentItem(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatMessageRefusalContentItem)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ChatMessageRefusalContentItem FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatMessageRefusalContentItem(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/openai/Azure.AI.OpenAI/src/Generated/ChatMessageRefusalContentItem.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageRefusalContentItem.cs new file mode 100644 index 000000000000..676b07fb5c85 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageRefusalContentItem.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// A structured chat content item containing model refusal information for a structured outputs request. + public partial class ChatMessageRefusalContentItem : ChatMessageContentItem + { + /// Initializes a new instance of . + /// The refusal message. + /// is null. + public ChatMessageRefusalContentItem(string refusal) + { + Argument.AssertNotNull(refusal, nameof(refusal)); + + Type = "refusal"; + Refusal = refusal; + } + + /// Initializes a new instance of . + /// The discriminated object type. + /// Keeps track of any properties unknown to the library. + /// The refusal message. + internal ChatMessageRefusalContentItem(string type, IDictionary serializedAdditionalRawData, string refusal) : base(type, serializedAdditionalRawData) + { + Refusal = refusal; + } + + /// Initializes a new instance of for deserialization. + internal ChatMessageRefusalContentItem() + { + } + + /// The refusal message. + public string Refusal { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCancelingEventData.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageTextContentItem.Serialization.cs similarity index 57% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCancelingEventData.Serialization.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageTextContentItem.Serialization.cs index 45fd962e0fcd..8c21f60593bb 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCancelingEventData.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageTextContentItem.Serialization.cs @@ -11,13 +11,13 @@ using System.Text.Json; using Azure.Core; -namespace Azure.Messaging.EventGrid.SystemEvents +namespace Azure.AI.OpenAI { - public partial class MediaJobCancelingEventData : IUtf8JsonSerializable, IJsonModel + public partial class ChatMessageTextContentItem : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,28 +28,30 @@ 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobCancelingEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ChatMessageTextContentItem)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); } - MediaJobCancelingEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ChatMessageTextContentItem IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobCancelingEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ChatMessageTextContentItem)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaJobCancelingEventData(document.RootElement, options); + return DeserializeChatMessageTextContentItem(document.RootElement, options); } - internal static MediaJobCancelingEventData DeserializeMediaJobCancelingEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static ChatMessageTextContentItem DeserializeChatMessageTextContentItem(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -57,31 +59,20 @@ internal static MediaJobCancelingEventData DeserializeMediaJobCancelingEventData { return null; } - MediaJobState previousState = default; - MediaJobState state = default; - IReadOnlyDictionary correlationData = default; + string text = default; + string type = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("previousState"u8)) + if (property.NameEquals("text"u8)) { - previousState = new MediaJobState(property.Value.GetString()); + text = property.Value.GetString(); continue; } - if (property.NameEquals("state"u8)) + if (property.NameEquals("type"u8)) { - state = new MediaJobState(property.Value.GetString()); - continue; - } - if (property.NameEquals("correlationData"u8)) - { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - correlationData = dictionary; + type = property.Value.GetString(); continue; } if (options.Format != "W") @@ -90,46 +81,46 @@ internal static MediaJobCancelingEventData DeserializeMediaJobCancelingEventData } } serializedAdditionalRawData = rawDataDictionary; - return new MediaJobCancelingEventData(previousState, state, correlationData, serializedAdditionalRawData); + return new ChatMessageTextContentItem(type, serializedAdditionalRawData, text); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MediaJobCancelingEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ChatMessageTextContentItem)} does not support writing '{options.Format}' format."); } } - MediaJobCancelingEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ChatMessageTextContentItem IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaJobCancelingEventData(document.RootElement, options); + return DeserializeChatMessageTextContentItem(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MediaJobCancelingEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ChatMessageTextContentItem)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new MediaJobCancelingEventData FromResponse(Response response) + internal static new ChatMessageTextContentItem FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaJobCancelingEventData(document.RootElement); + return DeserializeChatMessageTextContentItem(document.RootElement); } /// Convert into a . diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageTextContentItem.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageTextContentItem.cs new file mode 100644 index 000000000000..46f0eb167d08 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageTextContentItem.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// A structured chat content item containing plain text. + public partial class ChatMessageTextContentItem : ChatMessageContentItem + { + /// Initializes a new instance of . + /// The content of the message. + /// is null. + public ChatMessageTextContentItem(string text) + { + Argument.AssertNotNull(text, nameof(text)); + + Type = "text"; + Text = text; + } + + /// Initializes a new instance of . + /// The discriminated object type. + /// Keeps track of any properties unknown to the library. + /// The content of the message. + internal ChatMessageTextContentItem(string type, IDictionary serializedAdditionalRawData, string text) : base(type, serializedAdditionalRawData) + { + Text = text; + } + + /// Initializes a new instance of for deserialization. + internal ChatMessageTextContentItem() + { + } + + /// The content of the message. + public string Text { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestAssistantMessage.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestAssistantMessage.Serialization.cs new file mode 100644 index 000000000000..fe1892d9a068 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestAssistantMessage.Serialization.cs @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ChatRequestAssistantMessage : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatRequestAssistantMessage)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Content != null) + { + writer.WritePropertyName("content"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Content); +#else + using (JsonDocument document = JsonDocument.Parse(Content)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + else + { + writer.WriteNull("content"); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsCollectionDefined(ToolCalls)) + { + writer.WritePropertyName("tool_calls"u8); + writer.WriteStartArray(); + foreach (var item in ToolCalls) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(FunctionCall)) + { + writer.WritePropertyName("function_call"u8); + writer.WriteObjectValue(FunctionCall, options); + } + if (Optional.IsDefined(Refusal)) + { + if (Refusal != null) + { + writer.WritePropertyName("refusal"u8); + writer.WriteStringValue(Refusal); + } + else + { + writer.WriteNull("refusal"); + } + } + } + + ChatRequestAssistantMessage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatRequestAssistantMessage)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatRequestAssistantMessage(document.RootElement, options); + } + + internal static ChatRequestAssistantMessage DeserializeChatRequestAssistantMessage(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BinaryData content = default; + string name = default; + IList toolCalls = default; + FunctionCall functionCall = default; + string refusal = default; + ChatRole role = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("content"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + content = null; + continue; + } + content = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("tool_calls"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ChatCompletionsToolCall.DeserializeChatCompletionsToolCall(item, options)); + } + toolCalls = array; + continue; + } + if (property.NameEquals("function_call"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + functionCall = FunctionCall.DeserializeFunctionCall(property.Value, options); + continue; + } + if (property.NameEquals("refusal"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + refusal = null; + continue; + } + refusal = property.Value.GetString(); + continue; + } + if (property.NameEquals("role"u8)) + { + role = new ChatRole(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ChatRequestAssistantMessage( + role, + serializedAdditionalRawData, + content, + name, + toolCalls ?? new ChangeTrackingList(), + functionCall, + refusal); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatRequestAssistantMessage)} does not support writing '{options.Format}' format."); + } + } + + ChatRequestAssistantMessage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatRequestAssistantMessage(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatRequestAssistantMessage)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ChatRequestAssistantMessage FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatRequestAssistantMessage(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/openai/Azure.AI.OpenAI/src/Generated/ChatRequestAssistantMessage.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestAssistantMessage.cs new file mode 100644 index 000000000000..581014adfeed --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestAssistantMessage.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// A request chat message representing response or action from the assistant. + public partial class ChatRequestAssistantMessage : ChatRequestMessage + { + /// Initializes a new instance of . + /// The content of the message. + public ChatRequestAssistantMessage(BinaryData content) + { + Role = ChatRole.Assistant; + Content = content; + ToolCalls = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The chat role associated with this message. + /// Keeps track of any properties unknown to the library. + /// The content of the message. + /// An optional name for the participant. + /// + /// The tool calls that must be resolved and have their outputs appended to subsequent input messages for the chat + /// completions request to resolve as configured. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + /// + /// The function call that must be resolved and have its output appended to subsequent input messages for the chat + /// completions request to resolve as configured. + /// + /// The refusal message by the assistant. + internal ChatRequestAssistantMessage(ChatRole role, IDictionary serializedAdditionalRawData, BinaryData content, string name, IList toolCalls, FunctionCall functionCall, string refusal) : base(role, serializedAdditionalRawData) + { + Content = content; + Name = name; + ToolCalls = toolCalls; + FunctionCall = functionCall; + Refusal = refusal; + } + + /// Initializes a new instance of for deserialization. + internal ChatRequestAssistantMessage() + { + } + + /// + /// The content of the message. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// + /// Supported types: + /// + /// + /// + /// + /// + /// where T is of type + /// + /// + /// where T is of type + /// + /// + /// + /// 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" }. + /// + /// + /// + /// + public BinaryData Content { get; } + /// An optional name for the participant. + public string Name { get; set; } + /// + /// The tool calls that must be resolved and have their outputs appended to subsequent input messages for the chat + /// completions request to resolve as configured. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + public IList ToolCalls { get; } + /// + /// The function call that must be resolved and have its output appended to subsequent input messages for the chat + /// completions request to resolve as configured. + /// + public FunctionCall FunctionCall { get; set; } + /// The refusal message by the assistant. + public string Refusal { get; set; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobScheduledEventData.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestFunctionMessage.Serialization.cs similarity index 58% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobScheduledEventData.Serialization.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestFunctionMessage.Serialization.cs index 3f381fba4854..69bcef782a4f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobScheduledEventData.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestFunctionMessage.Serialization.cs @@ -11,13 +11,13 @@ using System.Text.Json; using Azure.Core; -namespace Azure.Messaging.EventGrid.SystemEvents +namespace Azure.AI.OpenAI { - public partial class MediaJobScheduledEventData : IUtf8JsonSerializable, IJsonModel + public partial class ChatRequestFunctionMessage : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,28 +28,39 @@ 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobScheduledEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ChatRequestFunctionMessage)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Content != null) + { + writer.WritePropertyName("content"u8); + writer.WriteStringValue(Content); + } + else + { + writer.WriteNull("content"); + } } - MediaJobScheduledEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ChatRequestFunctionMessage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobScheduledEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ChatRequestFunctionMessage)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaJobScheduledEventData(document.RootElement, options); + return DeserializeChatRequestFunctionMessage(document.RootElement, options); } - internal static MediaJobScheduledEventData DeserializeMediaJobScheduledEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static ChatRequestFunctionMessage DeserializeChatRequestFunctionMessage(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -57,31 +68,31 @@ internal static MediaJobScheduledEventData DeserializeMediaJobScheduledEventData { return null; } - MediaJobState previousState = default; - MediaJobState state = default; - IReadOnlyDictionary correlationData = default; + string name = default; + string content = default; + ChatRole role = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("previousState"u8)) + if (property.NameEquals("name"u8)) { - previousState = new MediaJobState(property.Value.GetString()); + name = property.Value.GetString(); continue; } - if (property.NameEquals("state"u8)) + if (property.NameEquals("content"u8)) { - state = new MediaJobState(property.Value.GetString()); + if (property.Value.ValueKind == JsonValueKind.Null) + { + content = null; + continue; + } + content = property.Value.GetString(); continue; } - if (property.NameEquals("correlationData"u8)) + if (property.NameEquals("role"u8)) { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - correlationData = dictionary; + role = new ChatRole(property.Value.GetString()); continue; } if (options.Format != "W") @@ -90,46 +101,46 @@ internal static MediaJobScheduledEventData DeserializeMediaJobScheduledEventData } } serializedAdditionalRawData = rawDataDictionary; - return new MediaJobScheduledEventData(previousState, state, correlationData, serializedAdditionalRawData); + return new ChatRequestFunctionMessage(role, serializedAdditionalRawData, name, content); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MediaJobScheduledEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ChatRequestFunctionMessage)} does not support writing '{options.Format}' format."); } } - MediaJobScheduledEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ChatRequestFunctionMessage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaJobScheduledEventData(document.RootElement, options); + return DeserializeChatRequestFunctionMessage(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MediaJobScheduledEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ChatRequestFunctionMessage)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new MediaJobScheduledEventData FromResponse(Response response) + internal static new ChatRequestFunctionMessage FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaJobScheduledEventData(document.RootElement); + return DeserializeChatRequestFunctionMessage(document.RootElement); } /// Convert into a . diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestFunctionMessage.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestFunctionMessage.cs new file mode 100644 index 000000000000..a4588fc56d21 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestFunctionMessage.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// A request chat message representing requested output from a configured function. + public partial class ChatRequestFunctionMessage : ChatRequestMessage + { + /// Initializes a new instance of . + /// The name of the function that was called to produce output. + /// The output of the function as requested by the function call. + /// is null. + public ChatRequestFunctionMessage(string name, string content) + { + Argument.AssertNotNull(name, nameof(name)); + + Role = ChatRole.Function; + Name = name; + Content = content; + } + + /// Initializes a new instance of . + /// The chat role associated with this message. + /// Keeps track of any properties unknown to the library. + /// The name of the function that was called to produce output. + /// The output of the function as requested by the function call. + internal ChatRequestFunctionMessage(ChatRole role, IDictionary serializedAdditionalRawData, string name, string content) : base(role, serializedAdditionalRawData) + { + Name = name; + Content = content; + } + + /// Initializes a new instance of for deserialization. + internal ChatRequestFunctionMessage() + { + } + + /// The name of the function that was called to produce output. + public string Name { get; } + /// The output of the function as requested by the function call. + public string Content { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestMessage.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestMessage.Serialization.cs new file mode 100644 index 000000000000..2f1cc3a8dc3f --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestMessage.Serialization.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + [PersistableModelProxy(typeof(UnknownChatRequestMessage))] + public partial class ChatRequestMessage : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatRequestMessage)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("role"u8); + writer.WriteStringValue(Role.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ChatRequestMessage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatRequestMessage)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatRequestMessage(document.RootElement, options); + } + + internal static ChatRequestMessage DeserializeChatRequestMessage(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("role", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "assistant": return ChatRequestAssistantMessage.DeserializeChatRequestAssistantMessage(element, options); + case "function": return ChatRequestFunctionMessage.DeserializeChatRequestFunctionMessage(element, options); + case "system": return ChatRequestSystemMessage.DeserializeChatRequestSystemMessage(element, options); + case "tool": return ChatRequestToolMessage.DeserializeChatRequestToolMessage(element, options); + case "user": return ChatRequestUserMessage.DeserializeChatRequestUserMessage(element, options); + } + } + return UnknownChatRequestMessage.DeserializeUnknownChatRequestMessage(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatRequestMessage)} does not support writing '{options.Format}' format."); + } + } + + ChatRequestMessage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatRequestMessage(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatRequestMessage)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ChatRequestMessage FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatRequestMessage(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/openai/Azure.AI.OpenAI/src/Generated/ChatRequestMessage.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestMessage.cs new file mode 100644 index 000000000000..31872565f53d --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestMessage.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// + /// An abstract representation of a chat message as provided in a request. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + public abstract partial class ChatRequestMessage + { + /// + /// 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; + + /// Initializes a new instance of . + protected ChatRequestMessage() + { + } + + /// Initializes a new instance of . + /// The chat role associated with this message. + /// Keeps track of any properties unknown to the library. + internal ChatRequestMessage(ChatRole role, IDictionary serializedAdditionalRawData) + { + Role = role; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The chat role associated with this message. + internal ChatRole Role { get; set; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErroredEventData.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestSystemMessage.Serialization.cs similarity index 52% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErroredEventData.Serialization.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestSystemMessage.Serialization.cs index 2453e6462a1e..9d2473cb63f6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErroredEventData.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestSystemMessage.Serialization.cs @@ -11,13 +11,13 @@ using System.Text.Json; using Azure.Core; -namespace Azure.Messaging.EventGrid.SystemEvents +namespace Azure.AI.OpenAI { - public partial class MediaJobErroredEventData : IUtf8JsonSerializable, IJsonModel + public partial class ChatRequestSystemMessage : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,35 +28,42 @@ 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobErroredEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ChatRequestSystemMessage)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("outputs"u8); - writer.WriteStartArray(); - foreach (var item in Outputs) + writer.WritePropertyName("content"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Content); +#else + using (JsonDocument document = JsonDocument.Parse(Content)) { - writer.WriteObjectValue(item, options); + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); } - writer.WriteEndArray(); } - MediaJobErroredEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ChatRequestSystemMessage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobErroredEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ChatRequestSystemMessage)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaJobErroredEventData(document.RootElement, options); + return DeserializeChatRequestSystemMessage(document.RootElement, options); } - internal static MediaJobErroredEventData DeserializeMediaJobErroredEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static ChatRequestSystemMessage DeserializeChatRequestSystemMessage(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -64,42 +71,26 @@ internal static MediaJobErroredEventData DeserializeMediaJobErroredEventData(Jso { return null; } - IReadOnlyList outputs = default; - MediaJobState previousState = default; - MediaJobState state = default; - IReadOnlyDictionary correlationData = default; + BinaryData content = default; + string name = default; + ChatRole role = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("outputs"u8)) + if (property.NameEquals("content"u8)) { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(MediaJobOutput.DeserializeMediaJobOutput(item, options)); - } - outputs = array; + content = BinaryData.FromString(property.Value.GetRawText()); continue; } - if (property.NameEquals("previousState"u8)) + if (property.NameEquals("name"u8)) { - previousState = new MediaJobState(property.Value.GetString()); + name = property.Value.GetString(); continue; } - if (property.NameEquals("state"u8)) + if (property.NameEquals("role"u8)) { - state = new MediaJobState(property.Value.GetString()); - continue; - } - if (property.NameEquals("correlationData"u8)) - { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - correlationData = dictionary; + role = new ChatRole(property.Value.GetString()); continue; } if (options.Format != "W") @@ -108,46 +99,46 @@ internal static MediaJobErroredEventData DeserializeMediaJobErroredEventData(Jso } } serializedAdditionalRawData = rawDataDictionary; - return new MediaJobErroredEventData(previousState, state, correlationData, serializedAdditionalRawData, outputs); + return new ChatRequestSystemMessage(role, serializedAdditionalRawData, content, name); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MediaJobErroredEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ChatRequestSystemMessage)} does not support writing '{options.Format}' format."); } } - MediaJobErroredEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ChatRequestSystemMessage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaJobErroredEventData(document.RootElement, options); + return DeserializeChatRequestSystemMessage(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MediaJobErroredEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ChatRequestSystemMessage)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new MediaJobErroredEventData FromResponse(Response response) + internal static new ChatRequestSystemMessage FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaJobErroredEventData(document.RootElement); + return DeserializeChatRequestSystemMessage(document.RootElement); } /// Convert into a . diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestSystemMessage.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestSystemMessage.cs new file mode 100644 index 000000000000..388061a2d04a --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestSystemMessage.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// + /// A request chat message containing system instructions that influence how the model will generate a chat completions + /// response. + /// + public partial class ChatRequestSystemMessage : ChatRequestMessage + { + /// Initializes a new instance of . + /// The contents of the system message. + /// is null. + public ChatRequestSystemMessage(BinaryData content) + { + Argument.AssertNotNull(content, nameof(content)); + + Role = ChatRole.System; + Content = content; + } + + /// Initializes a new instance of . + /// The chat role associated with this message. + /// Keeps track of any properties unknown to the library. + /// The contents of the system message. + /// An optional name for the participant. + internal ChatRequestSystemMessage(ChatRole role, IDictionary serializedAdditionalRawData, BinaryData content, string name) : base(role, serializedAdditionalRawData) + { + Content = content; + Name = name; + } + + /// Initializes a new instance of for deserialization. + internal ChatRequestSystemMessage() + { + } + + /// + /// The contents of the system message. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// + /// Supported types: + /// + /// + /// + /// + /// + /// where T is of type + /// + /// + /// + /// 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" }. + /// + /// + /// + /// + public BinaryData Content { get; } + /// An optional name for the participant. + public string Name { get; set; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCancelingEventData.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestToolMessage.Serialization.cs similarity index 50% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCancelingEventData.Serialization.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestToolMessage.Serialization.cs index e1447404365e..ce5413427508 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCancelingEventData.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestToolMessage.Serialization.cs @@ -11,13 +11,13 @@ using System.Text.Json; using Azure.Core; -namespace Azure.Messaging.EventGrid.SystemEvents +namespace Azure.AI.OpenAI { - public partial class MediaJobOutputCancelingEventData : IUtf8JsonSerializable, IJsonModel + public partial class ChatRequestToolMessage : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,28 +28,46 @@ 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobOutputCancelingEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ChatRequestToolMessage)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); + if (Content != null) + { + writer.WritePropertyName("content"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Content); +#else + using (JsonDocument document = JsonDocument.Parse(Content)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + else + { + writer.WriteNull("content"); + } + writer.WritePropertyName("tool_call_id"u8); + writer.WriteStringValue(ToolCallId); } - MediaJobOutputCancelingEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ChatRequestToolMessage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobOutputCancelingEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ChatRequestToolMessage)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaJobOutputCancelingEventData(document.RootElement, options); + return DeserializeChatRequestToolMessage(document.RootElement, options); } - internal static MediaJobOutputCancelingEventData DeserializeMediaJobOutputCancelingEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static ChatRequestToolMessage DeserializeChatRequestToolMessage(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -57,31 +75,31 @@ internal static MediaJobOutputCancelingEventData DeserializeMediaJobOutputCancel { return null; } - MediaJobState previousState = default; - MediaJobOutput output = default; - IReadOnlyDictionary jobCorrelationData = default; + BinaryData content = default; + string toolCallId = default; + ChatRole role = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("previousState"u8)) + if (property.NameEquals("content"u8)) { - previousState = new MediaJobState(property.Value.GetString()); + if (property.Value.ValueKind == JsonValueKind.Null) + { + content = null; + continue; + } + content = BinaryData.FromString(property.Value.GetRawText()); continue; } - if (property.NameEquals("output"u8)) + if (property.NameEquals("tool_call_id"u8)) { - output = MediaJobOutput.DeserializeMediaJobOutput(property.Value, options); + toolCallId = property.Value.GetString(); continue; } - if (property.NameEquals("jobCorrelationData"u8)) + if (property.NameEquals("role"u8)) { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - jobCorrelationData = dictionary; + role = new ChatRole(property.Value.GetString()); continue; } if (options.Format != "W") @@ -90,46 +108,46 @@ internal static MediaJobOutputCancelingEventData DeserializeMediaJobOutputCancel } } serializedAdditionalRawData = rawDataDictionary; - return new MediaJobOutputCancelingEventData(previousState, output, jobCorrelationData, serializedAdditionalRawData); + return new ChatRequestToolMessage(role, serializedAdditionalRawData, content, toolCallId); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MediaJobOutputCancelingEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ChatRequestToolMessage)} does not support writing '{options.Format}' format."); } } - MediaJobOutputCancelingEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ChatRequestToolMessage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaJobOutputCancelingEventData(document.RootElement, options); + return DeserializeChatRequestToolMessage(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MediaJobOutputCancelingEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ChatRequestToolMessage)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new MediaJobOutputCancelingEventData FromResponse(Response response) + internal static new ChatRequestToolMessage FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaJobOutputCancelingEventData(document.RootElement); + return DeserializeChatRequestToolMessage(document.RootElement); } /// Convert into a . diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestToolMessage.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestToolMessage.cs new file mode 100644 index 000000000000..62ea4297b93a --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestToolMessage.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// A request chat message representing requested output from a configured tool. + public partial class ChatRequestToolMessage : ChatRequestMessage + { + /// Initializes a new instance of . + /// The content of the message. + /// The ID of the tool call resolved by the provided content. + /// is null. + public ChatRequestToolMessage(BinaryData content, string toolCallId) + { + Argument.AssertNotNull(toolCallId, nameof(toolCallId)); + + Role = ChatRole.Tool; + Content = content; + ToolCallId = toolCallId; + } + + /// Initializes a new instance of . + /// The chat role associated with this message. + /// Keeps track of any properties unknown to the library. + /// The content of the message. + /// The ID of the tool call resolved by the provided content. + internal ChatRequestToolMessage(ChatRole role, IDictionary serializedAdditionalRawData, BinaryData content, string toolCallId) : base(role, serializedAdditionalRawData) + { + Content = content; + ToolCallId = toolCallId; + } + + /// Initializes a new instance of for deserialization. + internal ChatRequestToolMessage() + { + } + + /// + /// The content of the message. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// + /// Supported types: + /// + /// + /// + /// + /// + /// where T is of type + /// + /// + /// + /// 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" }. + /// + /// + /// + /// + public BinaryData Content { get; } + /// The ID of the tool call resolved by the provided content. + public string ToolCallId { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestUserMessage.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestUserMessage.Serialization.cs new file mode 100644 index 000000000000..2a6d1b485ddb --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestUserMessage.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ChatRequestUserMessage : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatRequestUserMessage)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("content"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Content); +#else + using (JsonDocument document = JsonDocument.Parse(Content)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + } + + ChatRequestUserMessage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatRequestUserMessage)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatRequestUserMessage(document.RootElement, options); + } + + internal static ChatRequestUserMessage DeserializeChatRequestUserMessage(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BinaryData content = default; + string name = default; + ChatRole role = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("content"u8)) + { + content = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("role"u8)) + { + role = new ChatRole(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ChatRequestUserMessage(role, serializedAdditionalRawData, content, name); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatRequestUserMessage)} does not support writing '{options.Format}' format."); + } + } + + ChatRequestUserMessage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatRequestUserMessage(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatRequestUserMessage)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ChatRequestUserMessage FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatRequestUserMessage(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/openai/Azure.AI.OpenAI/src/Generated/ChatRequestUserMessage.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestUserMessage.cs new file mode 100644 index 000000000000..8f83ff4940d1 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRequestUserMessage.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// A request chat message representing user input to the assistant. + public partial class ChatRequestUserMessage : ChatRequestMessage + { + /// Initializes a new instance of . + /// The contents of the user message, with available input types varying by selected model. + /// is null. + public ChatRequestUserMessage(BinaryData content) + { + Argument.AssertNotNull(content, nameof(content)); + + Role = ChatRole.User; + Content = content; + } + + /// Initializes a new instance of . + /// The chat role associated with this message. + /// Keeps track of any properties unknown to the library. + /// The contents of the user message, with available input types varying by selected model. + /// An optional name for the participant. + internal ChatRequestUserMessage(ChatRole role, IDictionary serializedAdditionalRawData, BinaryData content, string name) : base(role, serializedAdditionalRawData) + { + Content = content; + Name = name; + } + + /// Initializes a new instance of for deserialization. + internal ChatRequestUserMessage() + { + } + + /// + /// The contents of the user message, with available input types varying by selected model. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// + /// Supported types: + /// + /// + /// + /// + /// + /// where T is of type + /// + /// + /// where T is of type + /// + /// + /// + /// 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" }. + /// + /// + /// + /// + public BinaryData Content { get; } + /// An optional name for the participant. + public string Name { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatResponseMessage.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatResponseMessage.Serialization.cs new file mode 100644 index 000000000000..325bb2173543 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatResponseMessage.Serialization.cs @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ChatResponseMessage : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatResponseMessage)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("role"u8); + writer.WriteStringValue(Role.ToString()); + if (Refusal != null) + { + writer.WritePropertyName("refusal"u8); + writer.WriteStringValue(Refusal); + } + else + { + writer.WriteNull("refusal"); + } + if (Content != null) + { + writer.WritePropertyName("content"u8); + writer.WriteStringValue(Content); + } + else + { + writer.WriteNull("content"); + } + if (Optional.IsCollectionDefined(ToolCalls)) + { + writer.WritePropertyName("tool_calls"u8); + writer.WriteStartArray(); + foreach (var item in ToolCalls) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(FunctionCall)) + { + writer.WritePropertyName("function_call"u8); + writer.WriteObjectValue(FunctionCall, options); + } + if (Optional.IsDefined(AzureExtensionsContext)) + { + writer.WritePropertyName("context"u8); + writer.WriteObjectValue(AzureExtensionsContext, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ChatResponseMessage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatResponseMessage)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatResponseMessage(document.RootElement, options); + } + + internal static ChatResponseMessage DeserializeChatResponseMessage(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ChatRole role = default; + string refusal = default; + string content = default; + IReadOnlyList toolCalls = default; + FunctionCall functionCall = default; + AzureChatExtensionsMessageContext context = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("role"u8)) + { + role = new ChatRole(property.Value.GetString()); + continue; + } + if (property.NameEquals("refusal"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + refusal = null; + continue; + } + refusal = property.Value.GetString(); + continue; + } + if (property.NameEquals("content"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + content = null; + continue; + } + content = property.Value.GetString(); + continue; + } + if (property.NameEquals("tool_calls"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ChatCompletionsToolCall.DeserializeChatCompletionsToolCall(item, options)); + } + toolCalls = array; + continue; + } + if (property.NameEquals("function_call"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + functionCall = FunctionCall.DeserializeFunctionCall(property.Value, options); + continue; + } + if (property.NameEquals("context"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + context = AzureChatExtensionsMessageContext.DeserializeAzureChatExtensionsMessageContext(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ChatResponseMessage( + role, + refusal, + content, + toolCalls ?? new ChangeTrackingList(), + functionCall, + context, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatResponseMessage)} does not support writing '{options.Format}' format."); + } + } + + ChatResponseMessage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatResponseMessage(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatResponseMessage)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ChatResponseMessage FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatResponseMessage(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/openai/Azure.AI.OpenAI/src/Generated/ChatResponseMessage.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatResponseMessage.cs new file mode 100644 index 000000000000..c62e3c7692a3 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatResponseMessage.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// A representation of a chat message as received in a response. + public partial class ChatResponseMessage + { + /// + /// 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; + + /// Initializes a new instance of . + /// The chat role associated with the message. + /// The refusal message generated by the model. + /// The content of the message. + internal ChatResponseMessage(ChatRole role, string refusal, string content) + { + Role = role; + Refusal = refusal; + Content = content; + ToolCalls = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The chat role associated with the message. + /// The refusal message generated by the model. + /// The content of the message. + /// + /// The tool calls that must be resolved and have their outputs appended to subsequent input messages for the chat + /// completions request to resolve as configured. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + /// + /// The function call that must be resolved and have its output appended to subsequent input messages for the chat + /// completions request to resolve as configured. + /// + /// + /// If Azure OpenAI chat extensions are configured, this array represents the incremental steps performed by those + /// extensions while processing the chat completions request. + /// + /// Keeps track of any properties unknown to the library. + internal ChatResponseMessage(ChatRole role, string refusal, string content, IReadOnlyList toolCalls, FunctionCall functionCall, AzureChatExtensionsMessageContext azureExtensionsContext, IDictionary serializedAdditionalRawData) + { + Role = role; + Refusal = refusal; + Content = content; + ToolCalls = toolCalls; + FunctionCall = functionCall; + AzureExtensionsContext = azureExtensionsContext; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ChatResponseMessage() + { + } + + /// The chat role associated with the message. + public ChatRole Role { get; } + /// The refusal message generated by the model. + public string Refusal { get; } + /// The content of the message. + public string Content { get; } + /// + /// The tool calls that must be resolved and have their outputs appended to subsequent input messages for the chat + /// completions request to resolve as configured. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + public IReadOnlyList ToolCalls { get; } + /// + /// The function call that must be resolved and have its output appended to subsequent input messages for the chat + /// completions request to resolve as configured. + /// + public FunctionCall FunctionCall { get; } + /// + /// If Azure OpenAI chat extensions are configured, this array represents the incremental steps performed by those + /// extensions while processing the chat completions request. + /// + public AzureChatExtensionsMessageContext AzureExtensionsContext { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRole.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRole.cs new file mode 100644 index 000000000000..f169dc55ef81 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRole.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// A description of the intended purpose of a message within a chat completions interaction. + public readonly partial struct ChatRole : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ChatRole(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SystemValue = "system"; + private const string AssistantValue = "assistant"; + private const string UserValue = "user"; + private const string FunctionValue = "function"; + private const string ToolValue = "tool"; + + /// The role that instructs or sets the behavior of the assistant. + public static ChatRole System { get; } = new ChatRole(SystemValue); + /// The role that provides responses to system-instructed, user-prompted input. + public static ChatRole Assistant { get; } = new ChatRole(AssistantValue); + /// The role that provides input for chat completions. + public static ChatRole User { get; } = new ChatRole(UserValue); + /// The role that provides function results for chat completions. + public static ChatRole Function { get; } = new ChatRole(FunctionValue); + /// The role that represents extension tool activity within a chat completions operation. + public static ChatRole Tool { get; } = new ChatRole(ToolValue); + /// Determines if two values are the same. + public static bool operator ==(ChatRole left, ChatRole right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ChatRole left, ChatRole right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ChatRole(string value) => new ChatRole(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ChatRole other && Equals(other); + /// + public bool Equals(ChatRole 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/openai/Azure.AI.OpenAI/src/Generated/ChatTokenLogProbabilityInfo.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatTokenLogProbabilityInfo.Serialization.cs new file mode 100644 index 000000000000..45ca26c1bcd2 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatTokenLogProbabilityInfo.Serialization.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ChatTokenLogProbabilityInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatTokenLogProbabilityInfo)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("token"u8); + writer.WriteStringValue(Token); + writer.WritePropertyName("logprob"u8); + writer.WriteNumberValue(LogProbability); + if (Utf8ByteValues != null && Optional.IsCollectionDefined(Utf8ByteValues)) + { + writer.WritePropertyName("bytes"u8); + writer.WriteStartArray(); + foreach (var item in Utf8ByteValues) + { + writer.WriteNumberValue(item); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("bytes"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ChatTokenLogProbabilityInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatTokenLogProbabilityInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatTokenLogProbabilityInfo(document.RootElement, options); + } + + internal static ChatTokenLogProbabilityInfo DeserializeChatTokenLogProbabilityInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string token = default; + float logprob = default; + IReadOnlyList bytes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("token"u8)) + { + token = property.Value.GetString(); + continue; + } + if (property.NameEquals("logprob"u8)) + { + logprob = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("bytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + bytes = new ChangeTrackingList(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetInt32()); + } + bytes = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ChatTokenLogProbabilityInfo(token, logprob, bytes, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatTokenLogProbabilityInfo)} does not support writing '{options.Format}' format."); + } + } + + ChatTokenLogProbabilityInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatTokenLogProbabilityInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatTokenLogProbabilityInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ChatTokenLogProbabilityInfo FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatTokenLogProbabilityInfo(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/openai/Azure.AI.OpenAI/src/Generated/ChatTokenLogProbabilityInfo.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatTokenLogProbabilityInfo.cs new file mode 100644 index 000000000000..7583c16e09ac --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatTokenLogProbabilityInfo.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.OpenAI +{ + /// A representation of the log probability information for a single message content token. + public partial class ChatTokenLogProbabilityInfo + { + /// + /// 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; + + /// Initializes a new instance of . + /// The message content token. + /// The log probability of the message content token. + /// A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be null if there is no bytes representation for the token. + /// is null. + internal ChatTokenLogProbabilityInfo(string token, float logProbability, IEnumerable utf8ByteValues) + { + Argument.AssertNotNull(token, nameof(token)); + + Token = token; + LogProbability = logProbability; + Utf8ByteValues = utf8ByteValues?.ToList(); + } + + /// Initializes a new instance of . + /// The message content token. + /// The log probability of the message content token. + /// A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be null if there is no bytes representation for the token. + /// Keeps track of any properties unknown to the library. + internal ChatTokenLogProbabilityInfo(string token, float logProbability, IReadOnlyList utf8ByteValues, IDictionary serializedAdditionalRawData) + { + Token = token; + LogProbability = logProbability; + Utf8ByteValues = utf8ByteValues; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ChatTokenLogProbabilityInfo() + { + } + + /// The message content token. + public string Token { get; } + /// The log probability of the message content token. + public float LogProbability { get; } + /// A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be null if there is no bytes representation for the token. + public IReadOnlyList Utf8ByteValues { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatTokenLogProbabilityResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatTokenLogProbabilityResult.Serialization.cs new file mode 100644 index 000000000000..28bafb5c6e04 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatTokenLogProbabilityResult.Serialization.cs @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ChatTokenLogProbabilityResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatTokenLogProbabilityResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("token"u8); + writer.WriteStringValue(Token); + writer.WritePropertyName("logprob"u8); + writer.WriteNumberValue(LogProbability); + if (Utf8ByteValues != null && Optional.IsCollectionDefined(Utf8ByteValues)) + { + writer.WritePropertyName("bytes"u8); + writer.WriteStartArray(); + foreach (var item in Utf8ByteValues) + { + writer.WriteNumberValue(item); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("bytes"); + } + if (TopLogProbabilityEntries != null && Optional.IsCollectionDefined(TopLogProbabilityEntries)) + { + writer.WritePropertyName("top_logprobs"u8); + writer.WriteStartArray(); + foreach (var item in TopLogProbabilityEntries) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("top_logprobs"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ChatTokenLogProbabilityResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatTokenLogProbabilityResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatTokenLogProbabilityResult(document.RootElement, options); + } + + internal static ChatTokenLogProbabilityResult DeserializeChatTokenLogProbabilityResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string token = default; + float logprob = default; + IReadOnlyList bytes = default; + IReadOnlyList topLogprobs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("token"u8)) + { + token = property.Value.GetString(); + continue; + } + if (property.NameEquals("logprob"u8)) + { + logprob = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("bytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + bytes = new ChangeTrackingList(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetInt32()); + } + bytes = array; + continue; + } + if (property.NameEquals("top_logprobs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + topLogprobs = new ChangeTrackingList(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ChatTokenLogProbabilityInfo.DeserializeChatTokenLogProbabilityInfo(item, options)); + } + topLogprobs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ChatTokenLogProbabilityResult(token, logprob, bytes, topLogprobs, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatTokenLogProbabilityResult)} does not support writing '{options.Format}' format."); + } + } + + ChatTokenLogProbabilityResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatTokenLogProbabilityResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatTokenLogProbabilityResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ChatTokenLogProbabilityResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChatTokenLogProbabilityResult(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/openai/Azure.AI.OpenAI/src/Generated/ChatTokenLogProbabilityResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatTokenLogProbabilityResult.cs new file mode 100644 index 000000000000..d7fe8b840266 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatTokenLogProbabilityResult.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.OpenAI +{ + /// A representation of the log probability information for a single content token, including a list of most likely tokens if 'top_logprobs' were requested. + public partial class ChatTokenLogProbabilityResult + { + /// + /// 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; + + /// Initializes a new instance of . + /// The message content token. + /// The log probability of the message content token. + /// A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be null if there is no bytes representation for the token. + /// The list of most likely tokens and their log probability information, as requested via 'top_logprobs'. + /// is null. + internal ChatTokenLogProbabilityResult(string token, float logProbability, IEnumerable utf8ByteValues, IEnumerable topLogProbabilityEntries) + { + Argument.AssertNotNull(token, nameof(token)); + + Token = token; + LogProbability = logProbability; + Utf8ByteValues = utf8ByteValues?.ToList(); + TopLogProbabilityEntries = topLogProbabilityEntries?.ToList(); + } + + /// Initializes a new instance of . + /// The message content token. + /// The log probability of the message content token. + /// A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be null if there is no bytes representation for the token. + /// The list of most likely tokens and their log probability information, as requested via 'top_logprobs'. + /// Keeps track of any properties unknown to the library. + internal ChatTokenLogProbabilityResult(string token, float logProbability, IReadOnlyList utf8ByteValues, IReadOnlyList topLogProbabilityEntries, IDictionary serializedAdditionalRawData) + { + Token = token; + LogProbability = logProbability; + Utf8ByteValues = utf8ByteValues; + TopLogProbabilityEntries = topLogProbabilityEntries; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ChatTokenLogProbabilityResult() + { + } + + /// The message content token. + public string Token { get; } + /// The log probability of the message content token. + public float LogProbability { get; } + /// A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be null if there is no bytes representation for the token. + public IReadOnlyList Utf8ByteValues { get; } + /// The list of most likely tokens and their log probability information, as requested via 'top_logprobs'. + public IReadOnlyList TopLogProbabilityEntries { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/Choice.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Choice.Serialization.cs new file mode 100644 index 000000000000..47155fe0072b --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/Choice.Serialization.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class Choice : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(Choice)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + writer.WritePropertyName("index"u8); + writer.WriteNumberValue(Index); + if (Optional.IsDefined(ContentFilterResults)) + { + writer.WritePropertyName("content_filter_results"u8); + writer.WriteObjectValue(ContentFilterResults, options); + } + if (LogProbabilityModel != null) + { + writer.WritePropertyName("logprobs"u8); + writer.WriteObjectValue(LogProbabilityModel, options); + } + else + { + writer.WriteNull("logprobs"); + } + if (FinishReason != null) + { + writer.WritePropertyName("finish_reason"u8); + writer.WriteStringValue(FinishReason.Value.ToString()); + } + else + { + writer.WriteNull("finish_reason"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + Choice IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Choice)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChoice(document.RootElement, options); + } + + internal static Choice DeserializeChoice(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string text = default; + int index = default; + ContentFilterResultsForChoice contentFilterResults = default; + CompletionsLogProbabilityModel logprobs = default; + CompletionsFinishReason? finishReason = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("index"u8)) + { + index = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("content_filter_results"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + contentFilterResults = ContentFilterResultsForChoice.DeserializeContentFilterResultsForChoice(property.Value, options); + continue; + } + if (property.NameEquals("logprobs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + logprobs = null; + continue; + } + logprobs = CompletionsLogProbabilityModel.DeserializeCompletionsLogProbabilityModel(property.Value, options); + continue; + } + if (property.NameEquals("finish_reason"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + finishReason = null; + continue; + } + finishReason = new CompletionsFinishReason(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Choice( + text, + index, + contentFilterResults, + logprobs, + finishReason, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(Choice)} does not support writing '{options.Format}' format."); + } + } + + Choice IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChoice(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Choice)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static Choice FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeChoice(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/openai/Azure.AI.OpenAI/src/Generated/Choice.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Choice.cs new file mode 100644 index 000000000000..167dc6a38b70 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/Choice.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// + /// The representation of a single prompt completion as part of an overall completions request. + /// Generally, `n` choices are generated per provided prompt with a default value of 1. + /// Token limits and other settings may limit the number of choices generated. + /// + public partial class Choice + { + /// + /// 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; + + /// Initializes a new instance of . + /// The generated text for a given completions prompt. + /// The ordered index associated with this completions choice. + /// The log probabilities model for tokens associated with this completions choice. + /// Reason for finishing. + /// is null. + internal Choice(string text, int index, CompletionsLogProbabilityModel logProbabilityModel, CompletionsFinishReason? finishReason) + { + Argument.AssertNotNull(text, nameof(text)); + + Text = text; + Index = index; + LogProbabilityModel = logProbabilityModel; + FinishReason = finishReason; + } + + /// Initializes a new instance of . + /// The generated text for a given completions prompt. + /// The ordered index associated with this completions choice. + /// + /// Information about the content filtering category (hate, sexual, violence, self_harm), if it + /// has been detected, as well as the severity level (very_low, low, medium, high-scale that + /// determines the intensity and risk level of harmful content) and if it has been filtered or not. + /// + /// The log probabilities model for tokens associated with this completions choice. + /// Reason for finishing. + /// Keeps track of any properties unknown to the library. + internal Choice(string text, int index, ContentFilterResultsForChoice contentFilterResults, CompletionsLogProbabilityModel logProbabilityModel, CompletionsFinishReason? finishReason, IDictionary serializedAdditionalRawData) + { + Text = text; + Index = index; + ContentFilterResults = contentFilterResults; + LogProbabilityModel = logProbabilityModel; + FinishReason = finishReason; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal Choice() + { + } + + /// The generated text for a given completions prompt. + public string Text { get; } + /// The ordered index associated with this completions choice. + public int Index { get; } + /// + /// Information about the content filtering category (hate, sexual, violence, self_harm), if it + /// has been detected, as well as the severity level (very_low, low, medium, high-scale that + /// determines the intensity and risk level of harmful content) and if it has been filtered or not. + /// + public ContentFilterResultsForChoice ContentFilterResults { get; } + /// The log probabilities model for tokens associated with this completions choice. + public CompletionsLogProbabilityModel LogProbabilityModel { get; } + /// Reason for finishing. + public CompletionsFinishReason? FinishReason { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/CompleteUploadRequest.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/CompleteUploadRequest.Serialization.cs new file mode 100644 index 000000000000..f88f3d9caafe --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/CompleteUploadRequest.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class CompleteUploadRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(CompleteUploadRequest)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("part_ids"u8); + writer.WriteStartArray(); + foreach (var item in PartIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(Md5)) + { + writer.WritePropertyName("md5"u8); + writer.WriteStringValue(Md5); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CompleteUploadRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CompleteUploadRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCompleteUploadRequest(document.RootElement, options); + } + + internal static CompleteUploadRequest DeserializeCompleteUploadRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList partIds = default; + string md5 = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("part_ids"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + partIds = array; + continue; + } + if (property.NameEquals("md5"u8)) + { + md5 = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CompleteUploadRequest(partIds, md5, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CompleteUploadRequest)} does not support writing '{options.Format}' format."); + } + } + + CompleteUploadRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCompleteUploadRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CompleteUploadRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CompleteUploadRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCompleteUploadRequest(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/openai/Azure.AI.OpenAI/src/Generated/CompleteUploadRequest.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/CompleteUploadRequest.cs new file mode 100644 index 000000000000..0022308524f9 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/CompleteUploadRequest.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.OpenAI +{ + /// The request body of an upload completion request. + public partial class CompleteUploadRequest + { + /// + /// 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; + + /// Initializes a new instance of . + /// The ordered list of Part IDs. + /// is null. + public CompleteUploadRequest(IEnumerable partIds) + { + Argument.AssertNotNull(partIds, nameof(partIds)); + + PartIds = partIds.ToList(); + } + + /// Initializes a new instance of . + /// The ordered list of Part IDs. + /// The optional md5 checksum for the file contents to verify if the bytes uploaded matches what you expect. + /// Keeps track of any properties unknown to the library. + internal CompleteUploadRequest(IList partIds, string md5, IDictionary serializedAdditionalRawData) + { + PartIds = partIds; + Md5 = md5; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CompleteUploadRequest() + { + } + + /// The ordered list of Part IDs. + public IList PartIds { get; } + /// The optional md5 checksum for the file contents to verify if the bytes uploaded matches what you expect. + public string Md5 { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/Completions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Completions.Serialization.cs new file mode 100644 index 000000000000..72508d047634 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/Completions.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class Completions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(Completions)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("created"u8); + writer.WriteNumberValue(Created, "U"); + if (Optional.IsCollectionDefined(PromptFilterResults)) + { + writer.WritePropertyName("prompt_filter_results"u8); + writer.WriteStartArray(); + foreach (var item in PromptFilterResults) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("choices"u8); + writer.WriteStartArray(); + foreach (var item in Choices) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("usage"u8); + writer.WriteObjectValue(Usage, options); + if (Optional.IsDefined(SystemFingerprint)) + { + writer.WritePropertyName("system_fingerprint"u8); + writer.WriteStringValue(SystemFingerprint); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + Completions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Completions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCompletions(document.RootElement, options); + } + + internal static Completions DeserializeCompletions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + DateTimeOffset created = default; + IReadOnlyList promptFilterResults = default; + IReadOnlyList choices = default; + CompletionsUsage usage = default; + string systemFingerprint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("created"u8)) + { + created = DateTimeOffset.FromUnixTimeSeconds(property.Value.GetInt64()); + continue; + } + if (property.NameEquals("prompt_filter_results"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContentFilterResultsForPrompt.DeserializeContentFilterResultsForPrompt(item, options)); + } + promptFilterResults = array; + continue; + } + if (property.NameEquals("choices"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Choice.DeserializeChoice(item, options)); + } + choices = array; + continue; + } + if (property.NameEquals("usage"u8)) + { + usage = CompletionsUsage.DeserializeCompletionsUsage(property.Value, options); + continue; + } + if (property.NameEquals("system_fingerprint"u8)) + { + systemFingerprint = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Completions( + id, + created, + promptFilterResults ?? new ChangeTrackingList(), + choices, + usage, + systemFingerprint, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(Completions)} does not support writing '{options.Format}' format."); + } + } + + Completions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCompletions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Completions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static Completions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCompletions(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/openai/Azure.AI.OpenAI/src/Generated/Completions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Completions.cs new file mode 100644 index 000000000000..005de8a20f34 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/Completions.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.OpenAI +{ + /// + /// Representation of the response data from a completions request. + /// Completions support a wide variety of tasks and generate text that continues from or "completes" + /// provided prompt data. + /// + public partial class Completions + { + /// + /// 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; + + /// Initializes a new instance of . + /// A unique identifier associated with this completions response. + /// + /// The first timestamp associated with generation activity for this completions response, + /// represented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970. + /// + /// + /// The collection of completions choices associated with this completions response. + /// Generally, `n` choices are generated per provided prompt with a default value of 1. + /// Token limits and other settings may limit the number of choices generated. + /// + /// Usage information for tokens processed and generated as part of this completions operation. + /// , or is null. + internal Completions(string id, DateTimeOffset created, IEnumerable choices, CompletionsUsage usage) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(choices, nameof(choices)); + Argument.AssertNotNull(usage, nameof(usage)); + + Id = id; + Created = created; + PromptFilterResults = new ChangeTrackingList(); + Choices = choices.ToList(); + Usage = usage; + } + + /// Initializes a new instance of . + /// A unique identifier associated with this completions response. + /// + /// The first timestamp associated with generation activity for this completions response, + /// represented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970. + /// + /// + /// Content filtering results for zero or more prompts in the request. In a streaming request, + /// results for different prompts may arrive at different times or in different orders. + /// + /// + /// The collection of completions choices associated with this completions response. + /// Generally, `n` choices are generated per provided prompt with a default value of 1. + /// Token limits and other settings may limit the number of choices generated. + /// + /// Usage information for tokens processed and generated as part of this completions operation. + /// + /// This fingerprint represents the backend configuration that the model runs with. + /// + /// Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. + /// + /// Keeps track of any properties unknown to the library. + internal Completions(string id, DateTimeOffset created, IReadOnlyList promptFilterResults, IReadOnlyList choices, CompletionsUsage usage, string systemFingerprint, IDictionary serializedAdditionalRawData) + { + Id = id; + Created = created; + PromptFilterResults = promptFilterResults; + Choices = choices; + Usage = usage; + SystemFingerprint = systemFingerprint; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal Completions() + { + } + + /// A unique identifier associated with this completions response. + public string Id { get; } + /// + /// The first timestamp associated with generation activity for this completions response, + /// represented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970. + /// + public DateTimeOffset Created { get; } + /// + /// Content filtering results for zero or more prompts in the request. In a streaming request, + /// results for different prompts may arrive at different times or in different orders. + /// + public IReadOnlyList PromptFilterResults { get; } + /// + /// The collection of completions choices associated with this completions response. + /// Generally, `n` choices are generated per provided prompt with a default value of 1. + /// Token limits and other settings may limit the number of choices generated. + /// + public IReadOnlyList Choices { get; } + /// Usage information for tokens processed and generated as part of this completions operation. + public CompletionsUsage Usage { get; } + /// + /// This fingerprint represents the backend configuration that the model runs with. + /// + /// Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. + /// + public string SystemFingerprint { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsFinishReason.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsFinishReason.cs new file mode 100644 index 000000000000..4270844fe202 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsFinishReason.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// Representation of the manner in which a completions response concluded. + public readonly partial struct CompletionsFinishReason : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CompletionsFinishReason(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StoppedValue = "stop"; + private const string TokenLimitReachedValue = "length"; + private const string ContentFilteredValue = "content_filter"; + private const string FunctionCallValue = "function_call"; + private const string ToolCallsValue = "tool_calls"; + + /// Completions ended normally and reached its end of token generation. + public static CompletionsFinishReason Stopped { get; } = new CompletionsFinishReason(StoppedValue); + /// Completions exhausted available token limits before generation could complete. + public static CompletionsFinishReason TokenLimitReached { get; } = new CompletionsFinishReason(TokenLimitReachedValue); + /// + /// Completions generated a response that was identified as potentially sensitive per content + /// moderation policies. + /// + public static CompletionsFinishReason ContentFiltered { get; } = new CompletionsFinishReason(ContentFilteredValue); + /// Completion ended normally, with the model requesting a function to be called. + public static CompletionsFinishReason FunctionCall { get; } = new CompletionsFinishReason(FunctionCallValue); + /// Completion ended with the model calling a provided tool for output. + public static CompletionsFinishReason ToolCalls { get; } = new CompletionsFinishReason(ToolCallsValue); + /// Determines if two values are the same. + public static bool operator ==(CompletionsFinishReason left, CompletionsFinishReason right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CompletionsFinishReason left, CompletionsFinishReason right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CompletionsFinishReason(string value) => new CompletionsFinishReason(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CompletionsFinishReason other && Equals(other); + /// + public bool Equals(CompletionsFinishReason 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/openai/Azure.AI.OpenAI/src/Generated/CompletionsLogProbabilityModel.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsLogProbabilityModel.Serialization.cs new file mode 100644 index 000000000000..e08bdc3ac3cc --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsLogProbabilityModel.Serialization.cs @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class CompletionsLogProbabilityModel : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(CompletionsLogProbabilityModel)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("tokens"u8); + writer.WriteStartArray(); + foreach (var item in Tokens) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("token_logprobs"u8); + writer.WriteStartArray(); + foreach (var item in TokenLogProbabilities) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteNumberValue(item.Value); + } + writer.WriteEndArray(); + writer.WritePropertyName("top_logprobs"u8); + writer.WriteStartArray(); + foreach (var item in TopLogProbabilities) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStartObject(); + foreach (var item0 in item) + { + writer.WritePropertyName(item0.Key); + if (item0.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteNumberValue(item0.Value.Value); + } + writer.WriteEndObject(); + } + writer.WriteEndArray(); + writer.WritePropertyName("text_offset"u8); + writer.WriteStartArray(); + foreach (var item in TextOffsets) + { + writer.WriteNumberValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CompletionsLogProbabilityModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CompletionsLogProbabilityModel)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCompletionsLogProbabilityModel(document.RootElement, options); + } + + internal static CompletionsLogProbabilityModel DeserializeCompletionsLogProbabilityModel(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList tokens = default; + IReadOnlyList tokenLogprobs = default; + IReadOnlyList> topLogprobs = default; + IReadOnlyList textOffset = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tokens"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + tokens = array; + continue; + } + if (property.NameEquals("token_logprobs"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetSingle()); + } + } + tokenLogprobs = array; + continue; + } + if (property.NameEquals("top_logprobs"u8)) + { + List> array = new List>(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + Dictionary dictionary = new Dictionary(); + foreach (var property0 in item.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + dictionary.Add(property0.Name, property0.Value.GetSingle()); + } + } + array.Add(dictionary); + } + } + topLogprobs = array; + continue; + } + if (property.NameEquals("text_offset"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetInt32()); + } + textOffset = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CompletionsLogProbabilityModel(tokens, tokenLogprobs, topLogprobs, textOffset, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CompletionsLogProbabilityModel)} does not support writing '{options.Format}' format."); + } + } + + CompletionsLogProbabilityModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCompletionsLogProbabilityModel(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CompletionsLogProbabilityModel)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CompletionsLogProbabilityModel FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCompletionsLogProbabilityModel(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/openai/Azure.AI.OpenAI/src/Generated/CompletionsLogProbabilityModel.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsLogProbabilityModel.cs new file mode 100644 index 000000000000..5b486eac6e8c --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsLogProbabilityModel.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.OpenAI +{ + /// Representation of a log probabilities model for a completions generation. + public partial class CompletionsLogProbabilityModel + { + /// + /// 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; + + /// Initializes a new instance of . + /// The textual forms of tokens evaluated in this probability model. + /// A collection of log probability values for the tokens in this completions data. + /// A mapping of tokens to maximum log probability values in this completions data. + /// The text offsets associated with tokens in this completions data. + /// , , or is null. + internal CompletionsLogProbabilityModel(IEnumerable tokens, IEnumerable tokenLogProbabilities, IEnumerable> topLogProbabilities, IEnumerable textOffsets) + { + Argument.AssertNotNull(tokens, nameof(tokens)); + Argument.AssertNotNull(tokenLogProbabilities, nameof(tokenLogProbabilities)); + Argument.AssertNotNull(topLogProbabilities, nameof(topLogProbabilities)); + Argument.AssertNotNull(textOffsets, nameof(textOffsets)); + + Tokens = tokens.ToList(); + TokenLogProbabilities = tokenLogProbabilities.ToList(); + TopLogProbabilities = topLogProbabilities.ToList(); + TextOffsets = textOffsets.ToList(); + } + + /// Initializes a new instance of . + /// The textual forms of tokens evaluated in this probability model. + /// A collection of log probability values for the tokens in this completions data. + /// A mapping of tokens to maximum log probability values in this completions data. + /// The text offsets associated with tokens in this completions data. + /// Keeps track of any properties unknown to the library. + internal CompletionsLogProbabilityModel(IReadOnlyList tokens, IReadOnlyList tokenLogProbabilities, IReadOnlyList> topLogProbabilities, IReadOnlyList textOffsets, IDictionary serializedAdditionalRawData) + { + Tokens = tokens; + TokenLogProbabilities = tokenLogProbabilities; + TopLogProbabilities = topLogProbabilities; + TextOffsets = textOffsets; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CompletionsLogProbabilityModel() + { + } + + /// The textual forms of tokens evaluated in this probability model. + public IReadOnlyList Tokens { get; } + /// A collection of log probability values for the tokens in this completions data. + public IReadOnlyList TokenLogProbabilities { get; } + /// A mapping of tokens to maximum log probability values in this completions data. + public IReadOnlyList> TopLogProbabilities { get; } + /// The text offsets associated with tokens in this completions data. + public IReadOnlyList TextOffsets { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsOptions.Serialization.cs new file mode 100644 index 000000000000..f4be7e5e69f8 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsOptions.Serialization.cs @@ -0,0 +1,443 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class CompletionsOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(CompletionsOptions)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("prompt"u8); + writer.WriteStartArray(); + foreach (var item in Prompts) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(MaxTokens)) + { + writer.WritePropertyName("max_tokens"u8); + writer.WriteNumberValue(MaxTokens.Value); + } + if (Optional.IsDefined(Temperature)) + { + writer.WritePropertyName("temperature"u8); + writer.WriteNumberValue(Temperature.Value); + } + if (Optional.IsDefined(NucleusSamplingFactor)) + { + writer.WritePropertyName("top_p"u8); + writer.WriteNumberValue(NucleusSamplingFactor.Value); + } + if (Optional.IsCollectionDefined(TokenSelectionBiases)) + { + writer.WritePropertyName("logit_bias"u8); + writer.WriteStartObject(); + foreach (var item in TokenSelectionBiases) + { + writer.WritePropertyName(item.Key); + writer.WriteNumberValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(User)) + { + writer.WritePropertyName("user"u8); + writer.WriteStringValue(User); + } + if (Optional.IsDefined(ChoicesPerPrompt)) + { + writer.WritePropertyName("n"u8); + writer.WriteNumberValue(ChoicesPerPrompt.Value); + } + if (Optional.IsDefined(LogProbabilityCount)) + { + writer.WritePropertyName("logprobs"u8); + writer.WriteNumberValue(LogProbabilityCount.Value); + } + if (Optional.IsDefined(Suffix)) + { + writer.WritePropertyName("suffix"u8); + writer.WriteStringValue(Suffix); + } + if (Optional.IsDefined(Echo)) + { + writer.WritePropertyName("echo"u8); + writer.WriteBooleanValue(Echo.Value); + } + if (Optional.IsCollectionDefined(StopSequences)) + { + writer.WritePropertyName("stop"u8); + writer.WriteStartArray(); + foreach (var item in StopSequences) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(PresencePenalty)) + { + writer.WritePropertyName("presence_penalty"u8); + writer.WriteNumberValue(PresencePenalty.Value); + } + if (Optional.IsDefined(FrequencyPenalty)) + { + writer.WritePropertyName("frequency_penalty"u8); + writer.WriteNumberValue(FrequencyPenalty.Value); + } + if (Optional.IsDefined(GenerationSampleCount)) + { + writer.WritePropertyName("best_of"u8); + writer.WriteNumberValue(GenerationSampleCount.Value); + } + if (Optional.IsDefined(InternalShouldStreamResponse)) + { + writer.WritePropertyName("stream"u8); + writer.WriteBooleanValue(InternalShouldStreamResponse.Value); + } + if (Optional.IsDefined(StreamOptions)) + { + if (StreamOptions != null) + { + writer.WritePropertyName("stream_options"u8); + writer.WriteObjectValue(StreamOptions, options); + } + else + { + writer.WriteNull("stream_options"); + } + } + if (Optional.IsDefined(DeploymentName)) + { + writer.WritePropertyName("model"u8); + writer.WriteStringValue(DeploymentName); + } + if (Optional.IsDefined(Seed)) + { + writer.WritePropertyName("seed"u8); + writer.WriteNumberValue(Seed.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CompletionsOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CompletionsOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCompletionsOptions(document.RootElement, options); + } + + internal static CompletionsOptions DeserializeCompletionsOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList prompt = default; + int? maxTokens = default; + float? temperature = default; + float? topP = default; + IDictionary logitBias = default; + string user = default; + int? n = default; + int? logprobs = default; + string suffix = default; + bool? echo = default; + IList stop = default; + float? presencePenalty = default; + float? frequencyPenalty = default; + int? bestOf = default; + bool? stream = default; + ChatCompletionStreamOptions streamOptions = default; + string model = default; + int? seed = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("prompt"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + prompt = array; + continue; + } + if (property.NameEquals("max_tokens"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxTokens = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("temperature"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + temperature = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("top_p"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + topP = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("logit_bias"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.GetInt32()); + } + logitBias = dictionary; + continue; + } + if (property.NameEquals("user"u8)) + { + user = property.Value.GetString(); + continue; + } + if (property.NameEquals("n"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + n = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("logprobs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + logprobs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("suffix"u8)) + { + suffix = property.Value.GetString(); + continue; + } + if (property.NameEquals("echo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + echo = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("stop"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + stop = array; + continue; + } + if (property.NameEquals("presence_penalty"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + presencePenalty = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("frequency_penalty"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + frequencyPenalty = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("best_of"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bestOf = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("stream"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stream = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("stream_options"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + streamOptions = null; + continue; + } + streamOptions = ChatCompletionStreamOptions.DeserializeChatCompletionStreamOptions(property.Value, options); + continue; + } + if (property.NameEquals("model"u8)) + { + model = property.Value.GetString(); + continue; + } + if (property.NameEquals("seed"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + seed = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CompletionsOptions( + prompt, + maxTokens, + temperature, + topP, + logitBias ?? new ChangeTrackingDictionary(), + user, + n, + logprobs, + suffix, + echo, + stop ?? new ChangeTrackingList(), + presencePenalty, + frequencyPenalty, + bestOf, + stream, + streamOptions, + model, + seed, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CompletionsOptions)} does not support writing '{options.Format}' format."); + } + } + + CompletionsOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCompletionsOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CompletionsOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CompletionsOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCompletionsOptions(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/openai/Azure.AI.OpenAI/src/Generated/CompletionsOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsOptions.cs new file mode 100644 index 000000000000..0e88c5d42c95 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsOptions.cs @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.OpenAI +{ + /// + /// The configuration information for a completions request. + /// Completions support a wide variety of tasks and generate text that continues from or "completes" + /// provided prompt data. + /// + public partial class CompletionsOptions + { + /// + /// 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; + + /// Initializes a new instance of . + /// The prompts to generate completions from. + /// is null. + public CompletionsOptions(IEnumerable prompts) + { + Argument.AssertNotNull(prompts, nameof(prompts)); + + Prompts = prompts.ToList(); + TokenSelectionBiases = new ChangeTrackingDictionary(); + StopSequences = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The prompts to generate completions from. + /// The maximum number of tokens to generate. + /// + /// The sampling temperature to use that controls the apparent creativity of generated completions. + /// Higher values will make output more random while lower values will make results more focused + /// and deterministic. + /// It is not recommended to modify temperature and top_p for the same completions request as the + /// interaction of these two settings is difficult to predict. + /// + /// + /// An alternative to sampling with temperature called nucleus sampling. This value causes the + /// model to consider the results of tokens with the provided probability mass. As an example, a + /// value of 0.15 will cause only the tokens comprising the top 15% of probability mass to be + /// considered. + /// It is not recommended to modify temperature and top_p for the same completions request as the + /// interaction of these two settings is difficult to predict. + /// + /// + /// A map between GPT token IDs and bias scores that influences the probability of specific tokens + /// appearing in a completions response. Token IDs are computed via external tokenizer tools, while + /// bias scores reside in the range of -100 to 100 with minimum and maximum values corresponding to + /// a full ban or exclusive selection of a token, respectively. The exact behavior of a given bias + /// score varies by model. + /// + /// + /// An identifier for the caller or end user of the operation. This may be used for tracking + /// or rate-limiting purposes. + /// + /// + /// The number of completions choices that should be generated per provided prompt as part of an + /// overall completions response. + /// Because this setting can generate many completions, it may quickly consume your token quota. + /// Use carefully and ensure reasonable settings for max_tokens and stop. + /// + /// + /// A value that controls the emission of log probabilities for the provided number of most likely + /// tokens within a completions response. + /// + /// The suffix that comes after a completion of inserted text. + /// + /// A value specifying whether completions responses should include input prompts as prefixes to + /// their generated output. + /// + /// A collection of textual sequences that will end completions generation. + /// + /// A value that influences the probability of generated tokens appearing based on their existing + /// presence in generated text. + /// Positive values will make tokens less likely to appear when they already exist and increase the + /// model's likelihood to output new topics. + /// + /// + /// A value that influences the probability of generated tokens appearing based on their cumulative + /// frequency in generated text. + /// Positive values will make tokens less likely to appear as their frequency increases and + /// decrease the likelihood of the model repeating the same statements verbatim. + /// + /// + /// A value that controls how many completions will be internally generated prior to response + /// formulation. + /// When used together with n, best_of controls the number of candidate completions and must be + /// greater than n. + /// Because this setting can generate many completions, it may quickly consume your token quota. + /// Use carefully and ensure reasonable settings for max_tokens and stop. + /// + /// A value indicating whether chat completions should be streamed for this request. + /// Options for streaming response. Only set this when you set `stream: true`. + /// + /// The model name to provide as part of this completions request. + /// Not applicable to Azure OpenAI, where deployment information should be included in the Azure + /// resource URI that's connected to. + /// + /// + /// If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result. + /// + /// Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend. + /// + /// Keeps track of any properties unknown to the library. + internal CompletionsOptions(IList prompts, int? maxTokens, float? temperature, float? nucleusSamplingFactor, IDictionary tokenSelectionBiases, string user, int? choicesPerPrompt, int? logProbabilityCount, string suffix, bool? echo, IList stopSequences, float? presencePenalty, float? frequencyPenalty, int? generationSampleCount, bool? internalShouldStreamResponse, ChatCompletionStreamOptions streamOptions, string deploymentName, int? seed, IDictionary serializedAdditionalRawData) + { + Prompts = prompts; + MaxTokens = maxTokens; + Temperature = temperature; + NucleusSamplingFactor = nucleusSamplingFactor; + TokenSelectionBiases = tokenSelectionBiases; + User = user; + ChoicesPerPrompt = choicesPerPrompt; + LogProbabilityCount = logProbabilityCount; + Suffix = suffix; + Echo = echo; + StopSequences = stopSequences; + PresencePenalty = presencePenalty; + FrequencyPenalty = frequencyPenalty; + GenerationSampleCount = generationSampleCount; + InternalShouldStreamResponse = internalShouldStreamResponse; + StreamOptions = streamOptions; + DeploymentName = deploymentName; + Seed = seed; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CompletionsOptions() + { + } + + /// The prompts to generate completions from. + public IList Prompts { get; } + /// The maximum number of tokens to generate. + public int? MaxTokens { get; set; } + /// + /// The sampling temperature to use that controls the apparent creativity of generated completions. + /// Higher values will make output more random while lower values will make results more focused + /// and deterministic. + /// It is not recommended to modify temperature and top_p for the same completions request as the + /// interaction of these two settings is difficult to predict. + /// + public float? Temperature { get; set; } + /// + /// An alternative to sampling with temperature called nucleus sampling. This value causes the + /// model to consider the results of tokens with the provided probability mass. As an example, a + /// value of 0.15 will cause only the tokens comprising the top 15% of probability mass to be + /// considered. + /// It is not recommended to modify temperature and top_p for the same completions request as the + /// interaction of these two settings is difficult to predict. + /// + public float? NucleusSamplingFactor { get; set; } + /// + /// A map between GPT token IDs and bias scores that influences the probability of specific tokens + /// appearing in a completions response. Token IDs are computed via external tokenizer tools, while + /// bias scores reside in the range of -100 to 100 with minimum and maximum values corresponding to + /// a full ban or exclusive selection of a token, respectively. The exact behavior of a given bias + /// score varies by model. + /// + public IDictionary TokenSelectionBiases { get; } + /// + /// An identifier for the caller or end user of the operation. This may be used for tracking + /// or rate-limiting purposes. + /// + public string User { get; set; } + /// + /// The number of completions choices that should be generated per provided prompt as part of an + /// overall completions response. + /// Because this setting can generate many completions, it may quickly consume your token quota. + /// Use carefully and ensure reasonable settings for max_tokens and stop. + /// + public int? ChoicesPerPrompt { get; set; } + /// + /// A value that controls the emission of log probabilities for the provided number of most likely + /// tokens within a completions response. + /// + public int? LogProbabilityCount { get; set; } + /// The suffix that comes after a completion of inserted text. + public string Suffix { get; set; } + /// + /// A value specifying whether completions responses should include input prompts as prefixes to + /// their generated output. + /// + public bool? Echo { get; set; } + /// A collection of textual sequences that will end completions generation. + public IList StopSequences { get; } + /// + /// A value that influences the probability of generated tokens appearing based on their existing + /// presence in generated text. + /// Positive values will make tokens less likely to appear when they already exist and increase the + /// model's likelihood to output new topics. + /// + public float? PresencePenalty { get; set; } + /// + /// A value that influences the probability of generated tokens appearing based on their cumulative + /// frequency in generated text. + /// Positive values will make tokens less likely to appear as their frequency increases and + /// decrease the likelihood of the model repeating the same statements verbatim. + /// + public float? FrequencyPenalty { get; set; } + /// + /// A value that controls how many completions will be internally generated prior to response + /// formulation. + /// When used together with n, best_of controls the number of candidate completions and must be + /// greater than n. + /// Because this setting can generate many completions, it may quickly consume your token quota. + /// Use carefully and ensure reasonable settings for max_tokens and stop. + /// + public int? GenerationSampleCount { get; set; } + /// A value indicating whether chat completions should be streamed for this request. + public bool? InternalShouldStreamResponse { get; set; } + /// Options for streaming response. Only set this when you set `stream: true`. + public ChatCompletionStreamOptions StreamOptions { get; set; } + /// + /// The model name to provide as part of this completions request. + /// Not applicable to Azure OpenAI, where deployment information should be included in the Azure + /// resource URI that's connected to. + /// + public string DeploymentName { get; set; } + /// + /// If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result. + /// + /// Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend. + /// + public int? Seed { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsUsage.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsUsage.Serialization.cs new file mode 100644 index 000000000000..d4925598bb74 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsUsage.Serialization.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class CompletionsUsage : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(CompletionsUsage)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("completion_tokens"u8); + writer.WriteNumberValue(CompletionTokens); + writer.WritePropertyName("prompt_tokens"u8); + writer.WriteNumberValue(PromptTokens); + writer.WritePropertyName("total_tokens"u8); + writer.WriteNumberValue(TotalTokens); + if (Optional.IsDefined(PromptTokensDetails)) + { + writer.WritePropertyName("prompt_tokens_details"u8); + writer.WriteObjectValue(PromptTokensDetails, options); + } + if (Optional.IsDefined(CompletionTokensDetails)) + { + writer.WritePropertyName("completion_tokens_details"u8); + writer.WriteObjectValue(CompletionTokensDetails, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CompletionsUsage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CompletionsUsage)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCompletionsUsage(document.RootElement, options); + } + + internal static CompletionsUsage DeserializeCompletionsUsage(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int completionTokens = default; + int promptTokens = default; + int totalTokens = default; + CompletionsUsagePromptTokensDetails promptTokensDetails = default; + CompletionsUsageCompletionTokensDetails completionTokensDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("completion_tokens"u8)) + { + completionTokens = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("prompt_tokens"u8)) + { + promptTokens = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("total_tokens"u8)) + { + totalTokens = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("prompt_tokens_details"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + promptTokensDetails = CompletionsUsagePromptTokensDetails.DeserializeCompletionsUsagePromptTokensDetails(property.Value, options); + continue; + } + if (property.NameEquals("completion_tokens_details"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + completionTokensDetails = CompletionsUsageCompletionTokensDetails.DeserializeCompletionsUsageCompletionTokensDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CompletionsUsage( + completionTokens, + promptTokens, + totalTokens, + promptTokensDetails, + completionTokensDetails, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CompletionsUsage)} does not support writing '{options.Format}' format."); + } + } + + CompletionsUsage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCompletionsUsage(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CompletionsUsage)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CompletionsUsage FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCompletionsUsage(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/openai/Azure.AI.OpenAI/src/Generated/CompletionsUsage.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsUsage.cs new file mode 100644 index 000000000000..4416894b9eeb --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsUsage.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// + /// Representation of the token counts processed for a completions request. + /// Counts consider all tokens across prompts, choices, choice alternates, best_of generations, and + /// other consumers. + /// + public partial class CompletionsUsage + { + /// + /// 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; + + /// Initializes a new instance of . + /// The number of tokens generated across all completions emissions. + /// The number of tokens in the provided prompts for the completions request. + /// The total number of tokens processed for the completions request and response. + internal CompletionsUsage(int completionTokens, int promptTokens, int totalTokens) + { + CompletionTokens = completionTokens; + PromptTokens = promptTokens; + TotalTokens = totalTokens; + } + + /// Initializes a new instance of . + /// The number of tokens generated across all completions emissions. + /// The number of tokens in the provided prompts for the completions request. + /// The total number of tokens processed for the completions request and response. + /// Details of the prompt tokens. + /// Breakdown of tokens used in a completion. + /// Keeps track of any properties unknown to the library. + internal CompletionsUsage(int completionTokens, int promptTokens, int totalTokens, CompletionsUsagePromptTokensDetails promptTokensDetails, CompletionsUsageCompletionTokensDetails completionTokensDetails, IDictionary serializedAdditionalRawData) + { + CompletionTokens = completionTokens; + PromptTokens = promptTokens; + TotalTokens = totalTokens; + PromptTokensDetails = promptTokensDetails; + CompletionTokensDetails = completionTokensDetails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CompletionsUsage() + { + } + + /// The number of tokens generated across all completions emissions. + public int CompletionTokens { get; } + /// The number of tokens in the provided prompts for the completions request. + public int PromptTokens { get; } + /// The total number of tokens processed for the completions request and response. + public int TotalTokens { get; } + /// Details of the prompt tokens. + public CompletionsUsagePromptTokensDetails PromptTokensDetails { get; } + /// Breakdown of tokens used in a completion. + public CompletionsUsageCompletionTokensDetails CompletionTokensDetails { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventEncoderConnectedEventData.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsUsageCompletionTokensDetails.Serialization.cs similarity index 54% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventEncoderConnectedEventData.Serialization.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsUsageCompletionTokensDetails.Serialization.cs index 8caba084c648..b1d5f0430de2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventEncoderConnectedEventData.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsUsageCompletionTokensDetails.Serialization.cs @@ -11,13 +11,13 @@ using System.Text.Json; using Azure.Core; -namespace Azure.Messaging.EventGrid.SystemEvents +namespace Azure.AI.OpenAI { - public partial class MediaLiveEventEncoderConnectedEventData : IUtf8JsonSerializable, IJsonModel + public partial class CompletionsUsageCompletionTokensDetails : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,31 +28,16 @@ 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaLiveEventEncoderConnectedEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(CompletionsUsageCompletionTokensDetails)} does not support writing '{format}' format."); } - if (Optional.IsDefined(IngestUrl)) + if (Optional.IsDefined(ReasoningTokens)) { - writer.WritePropertyName("ingestUrl"u8); - writer.WriteStringValue(IngestUrl); - } - if (Optional.IsDefined(StreamId)) - { - writer.WritePropertyName("streamId"u8); - writer.WriteStringValue(StreamId); - } - if (Optional.IsDefined(EncoderIp)) - { - writer.WritePropertyName("encoderIp"u8); - writer.WriteStringValue(EncoderIp); - } - if (Optional.IsDefined(EncoderPort)) - { - writer.WritePropertyName("encoderPort"u8); - writer.WriteStringValue(EncoderPort); + writer.WritePropertyName("reasoning_tokens"u8); + writer.WriteNumberValue(ReasoningTokens.Value); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -71,19 +56,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - MediaLiveEventEncoderConnectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + CompletionsUsageCompletionTokensDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaLiveEventEncoderConnectedEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(CompletionsUsageCompletionTokensDetails)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaLiveEventEncoderConnectedEventData(document.RootElement, options); + return DeserializeCompletionsUsageCompletionTokensDetails(document.RootElement, options); } - internal static MediaLiveEventEncoderConnectedEventData DeserializeMediaLiveEventEncoderConnectedEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static CompletionsUsageCompletionTokensDetails DeserializeCompletionsUsageCompletionTokensDetails(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -91,32 +76,18 @@ internal static MediaLiveEventEncoderConnectedEventData DeserializeMediaLiveEven { return null; } - string ingestUrl = default; - string streamId = default; - string encoderIp = default; - string encoderPort = default; + int? reasoningTokens = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("ingestUrl"u8)) - { - ingestUrl = property.Value.GetString(); - continue; - } - if (property.NameEquals("streamId"u8)) + if (property.NameEquals("reasoning_tokens"u8)) { - streamId = property.Value.GetString(); - continue; - } - if (property.NameEquals("encoderIp"u8)) - { - encoderIp = property.Value.GetString(); - continue; - } - if (property.NameEquals("encoderPort"u8)) - { - encoderPort = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + reasoningTokens = property.Value.GetInt32(); continue; } if (options.Format != "W") @@ -125,46 +96,46 @@ internal static MediaLiveEventEncoderConnectedEventData DeserializeMediaLiveEven } } serializedAdditionalRawData = rawDataDictionary; - return new MediaLiveEventEncoderConnectedEventData(ingestUrl, streamId, encoderIp, encoderPort, serializedAdditionalRawData); + return new CompletionsUsageCompletionTokensDetails(reasoningTokens, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MediaLiveEventEncoderConnectedEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(CompletionsUsageCompletionTokensDetails)} does not support writing '{options.Format}' format."); } } - MediaLiveEventEncoderConnectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + CompletionsUsageCompletionTokensDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaLiveEventEncoderConnectedEventData(document.RootElement, options); + return DeserializeCompletionsUsageCompletionTokensDetails(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MediaLiveEventEncoderConnectedEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(CompletionsUsageCompletionTokensDetails)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static MediaLiveEventEncoderConnectedEventData FromResponse(Response response) + internal static CompletionsUsageCompletionTokensDetails FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaLiveEventEncoderConnectedEventData(document.RootElement); + return DeserializeCompletionsUsageCompletionTokensDetails(document.RootElement); } /// Convert into a . diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitationResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsUsageCompletionTokensDetails.cs similarity index 62% rename from sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitationResult.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsUsageCompletionTokensDetails.cs index 155740c21393..e2cf5d8994d8 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitationResult.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsUsageCompletionTokensDetails.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable @@ -7,8 +10,8 @@ namespace Azure.AI.OpenAI { - /// The AzureContentFilterResultForChoiceProtectedMaterialCodeCitation. - public partial class ContentFilterProtectedMaterialCitationResult + /// The CompletionsUsageCompletionTokensDetails. + public partial class CompletionsUsageCompletionTokensDetails { /// /// Keeps track of any properties unknown to the library. @@ -40,24 +43,23 @@ public partial class ContentFilterProtectedMaterialCitationResult /// /// /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - internal ContentFilterProtectedMaterialCitationResult() + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal CompletionsUsageCompletionTokensDetails() { } - /// Initializes a new instance of . - /// The name or identifier of the license associated with the detection. - /// The URL associated with the license. + /// Initializes a new instance of . + /// Tokens generated by the model for reasoning. /// Keeps track of any properties unknown to the library. - internal ContentFilterProtectedMaterialCitationResult(string license, Uri uri, IDictionary serializedAdditionalRawData) + internal CompletionsUsageCompletionTokensDetails(int? reasoningTokens, IDictionary serializedAdditionalRawData) { - License = license; - Uri = uri; - SerializedAdditionalRawData = serializedAdditionalRawData; + ReasoningTokens = reasoningTokens; + _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The name or identifier of the license associated with the detection. - public string License { get; } + /// Tokens generated by the model for reasoning. + public int? ReasoningTokens { get; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsUsagePromptTokensDetails.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsUsagePromptTokensDetails.Serialization.cs new file mode 100644 index 000000000000..a41d37aee502 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsUsagePromptTokensDetails.Serialization.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class CompletionsUsagePromptTokensDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(CompletionsUsagePromptTokensDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(CachedTokens)) + { + writer.WritePropertyName("cached_tokens"u8); + writer.WriteNumberValue(CachedTokens.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CompletionsUsagePromptTokensDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CompletionsUsagePromptTokensDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCompletionsUsagePromptTokensDetails(document.RootElement, options); + } + + internal static CompletionsUsagePromptTokensDetails DeserializeCompletionsUsagePromptTokensDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? cachedTokens = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("cached_tokens"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cachedTokens = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CompletionsUsagePromptTokensDetails(cachedTokens, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CompletionsUsagePromptTokensDetails)} does not support writing '{options.Format}' format."); + } + } + + CompletionsUsagePromptTokensDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCompletionsUsagePromptTokensDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CompletionsUsagePromptTokensDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CompletionsUsagePromptTokensDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCompletionsUsagePromptTokensDetails(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/openai/Azure.AI.OpenAI/src/Generated/CompletionsUsagePromptTokensDetails.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsUsagePromptTokensDetails.cs new file mode 100644 index 000000000000..eca6b770013b --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/CompletionsUsagePromptTokensDetails.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// The CompletionsUsagePromptTokensDetails. + public partial class CompletionsUsagePromptTokensDetails + { + /// + /// 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; + + /// Initializes a new instance of . + internal CompletionsUsagePromptTokensDetails() + { + } + + /// Initializes a new instance of . + /// The number of cached prompt tokens. + /// Keeps track of any properties unknown to the library. + internal CompletionsUsagePromptTokensDetails(int? cachedTokens, IDictionary serializedAdditionalRawData) + { + CachedTokens = cachedTokens; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The number of cached prompt tokens. + public int? CachedTokens { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputErroredEventData.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistIdResult.Serialization.cs similarity index 54% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputErroredEventData.Serialization.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistIdResult.Serialization.cs index ee7d8c142784..ee686f2c73bf 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputErroredEventData.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistIdResult.Serialization.cs @@ -11,13 +11,13 @@ using System.Text.Json; using Azure.Core; -namespace Azure.Messaging.EventGrid.SystemEvents +namespace Azure.AI.OpenAI { - public partial class MediaJobOutputErroredEventData : IUtf8JsonSerializable, IJsonModel + public partial class ContentFilterBlocklistIdResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -26,30 +26,48 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobOutputErroredEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ContentFilterBlocklistIdResult)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("filtered"u8); + writer.WriteBooleanValue(Filtered); + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } - MediaJobOutputErroredEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ContentFilterBlocklistIdResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobOutputErroredEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ContentFilterBlocklistIdResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaJobOutputErroredEventData(document.RootElement, options); + return DeserializeContentFilterBlocklistIdResult(document.RootElement, options); } - internal static MediaJobOutputErroredEventData DeserializeMediaJobOutputErroredEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static ContentFilterBlocklistIdResult DeserializeContentFilterBlocklistIdResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -57,31 +75,20 @@ internal static MediaJobOutputErroredEventData DeserializeMediaJobOutputErroredE { return null; } - MediaJobState previousState = default; - MediaJobOutput output = default; - IReadOnlyDictionary jobCorrelationData = default; + bool filtered = default; + string id = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("previousState"u8)) + if (property.NameEquals("filtered"u8)) { - previousState = new MediaJobState(property.Value.GetString()); + filtered = property.Value.GetBoolean(); continue; } - if (property.NameEquals("output"u8)) + if (property.NameEquals("id"u8)) { - output = MediaJobOutput.DeserializeMediaJobOutput(property.Value, options); - continue; - } - if (property.NameEquals("jobCorrelationData"u8)) - { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - jobCorrelationData = dictionary; + id = property.Value.GetString(); continue; } if (options.Format != "W") @@ -90,50 +97,50 @@ internal static MediaJobOutputErroredEventData DeserializeMediaJobOutputErroredE } } serializedAdditionalRawData = rawDataDictionary; - return new MediaJobOutputErroredEventData(previousState, output, jobCorrelationData, serializedAdditionalRawData); + return new ContentFilterBlocklistIdResult(filtered, id, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MediaJobOutputErroredEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ContentFilterBlocklistIdResult)} does not support writing '{options.Format}' format."); } } - MediaJobOutputErroredEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ContentFilterBlocklistIdResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaJobOutputErroredEventData(document.RootElement, options); + return DeserializeContentFilterBlocklistIdResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MediaJobOutputErroredEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ContentFilterBlocklistIdResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new MediaJobOutputErroredEventData FromResponse(Response response) + internal static ContentFilterBlocklistIdResult FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaJobOutputErroredEventData(document.RootElement); + return DeserializeContentFilterBlocklistIdResult(document.RootElement); } /// Convert into a . - internal override RequestContent ToRequestContent() + internal virtual RequestContent ToRequestContent() { var content = new Utf8JsonRequestContent(); content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistIdResult.cs similarity index 59% rename from sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistIdResult.cs index 57e5e5ea6570..012d845ccce3 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistIdResult.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable @@ -7,8 +10,8 @@ namespace Azure.AI.OpenAI { - /// The AzureContentFilterBlocklistResultDetail. - internal partial class InternalAzureContentFilterBlocklistResultDetail + /// Represents the outcome of an evaluation against a custom blocklist as performed by content filtering. + public partial class ContentFilterBlocklistIdResult { /// /// Keeps track of any properties unknown to the library. @@ -40,12 +43,13 @@ internal partial class InternalAzureContentFilterBlocklistResultDetail /// /// /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// A value indicating whether the blocklist produced a filtering action. + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// A value indicating whether or not the content has been filtered. /// The ID of the custom blocklist evaluated. /// is null. - internal InternalAzureContentFilterBlocklistResultDetail(bool filtered, string id) + internal ContentFilterBlocklistIdResult(bool filtered, string id) { Argument.AssertNotNull(id, nameof(id)); @@ -53,25 +57,25 @@ internal InternalAzureContentFilterBlocklistResultDetail(bool filtered, string i Id = id; } - /// Initializes a new instance of . - /// A value indicating whether the blocklist produced a filtering action. + /// Initializes a new instance of . + /// A value indicating whether or not the content has been filtered. /// The ID of the custom blocklist evaluated. /// Keeps track of any properties unknown to the library. - internal InternalAzureContentFilterBlocklistResultDetail(bool filtered, string id, IDictionary serializedAdditionalRawData) + internal ContentFilterBlocklistIdResult(bool filtered, string id, IDictionary serializedAdditionalRawData) { Filtered = filtered; Id = id; - SerializedAdditionalRawData = serializedAdditionalRawData; + _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal InternalAzureContentFilterBlocklistResultDetail() + /// Initializes a new instance of for deserialization. + internal ContentFilterBlocklistIdResult() { } - /// A value indicating whether the blocklist produced a filtering action. - internal bool Filtered { get; set; } + /// A value indicating whether or not the content has been filtered. + public bool Filtered { get; } /// The ID of the custom blocklist evaluated. - internal string Id { get; set; } + public string Id { get; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.Serialization.cs deleted file mode 100644 index a2f4dd0e63c4..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.Serialization.cs +++ /dev/null @@ -1,161 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI -{ - public partial class ContentFilterBlocklistResult : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContentFilterBlocklistResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("filtered") != true) - { - writer.WritePropertyName("filtered"u8); - writer.WriteBooleanValue(Filtered); - } - if (SerializedAdditionalRawData?.ContainsKey("details") != true && Optional.IsCollectionDefined(InternalDetails)) - { - writer.WritePropertyName("details"u8); - writer.WriteStartArray(); - foreach (var item in InternalDetails) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContentFilterBlocklistResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContentFilterBlocklistResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContentFilterBlocklistResult(document.RootElement, options); - } - - internal static ContentFilterBlocklistResult DeserializeContentFilterBlocklistResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - bool filtered = default; - IReadOnlyList details = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("filtered"u8)) - { - filtered = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("details"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(InternalAzureContentFilterBlocklistResultDetail.DeserializeInternalAzureContentFilterBlocklistResultDetail(item, options)); - } - details = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ContentFilterBlocklistResult(filtered, details ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ContentFilterBlocklistResult)} does not support writing '{options.Format}' format."); - } - } - - ContentFilterBlocklistResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContentFilterBlocklistResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContentFilterBlocklistResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static ContentFilterBlocklistResult FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeContentFilterBlocklistResult(document.RootElement); - } - - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterCitedDetectionResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterCitedDetectionResult.Serialization.cs new file mode 100644 index 000000000000..156af61e7fd2 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterCitedDetectionResult.Serialization.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ContentFilterCitedDetectionResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContentFilterCitedDetectionResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("filtered"u8); + writer.WriteBooleanValue(Filtered); + writer.WritePropertyName("detected"u8); + writer.WriteBooleanValue(Detected); + if (Optional.IsDefined(Url)) + { + writer.WritePropertyName("URL"u8); + writer.WriteStringValue(Url.AbsoluteUri); + } + if (Optional.IsDefined(License)) + { + writer.WritePropertyName("license"u8); + writer.WriteStringValue(License); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContentFilterCitedDetectionResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContentFilterCitedDetectionResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContentFilterCitedDetectionResult(document.RootElement, options); + } + + internal static ContentFilterCitedDetectionResult DeserializeContentFilterCitedDetectionResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool filtered = default; + bool detected = default; + Uri url = default; + string license = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("filtered"u8)) + { + filtered = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("detected"u8)) + { + detected = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("URL"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + url = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("license"u8)) + { + license = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContentFilterCitedDetectionResult(filtered, detected, url, license, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ContentFilterCitedDetectionResult)} does not support writing '{options.Format}' format."); + } + } + + ContentFilterCitedDetectionResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContentFilterCitedDetectionResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContentFilterCitedDetectionResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ContentFilterCitedDetectionResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeContentFilterCitedDetectionResult(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/openai/Azure.AI.OpenAI/src/Generated/ContentFilterCitedDetectionResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterCitedDetectionResult.cs new file mode 100644 index 000000000000..5e73e0beb4b2 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterCitedDetectionResult.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Represents the outcome of a detection operation against protected resources as performed by content filtering. + public partial class ContentFilterCitedDetectionResult + { + /// + /// 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; + + /// Initializes a new instance of . + /// A value indicating whether or not the content has been filtered. + /// A value indicating whether detection occurred, irrespective of severity or whether the content was filtered. + internal ContentFilterCitedDetectionResult(bool filtered, bool detected) + { + Filtered = filtered; + Detected = detected; + } + + /// Initializes a new instance of . + /// A value indicating whether or not the content has been filtered. + /// A value indicating whether detection occurred, irrespective of severity or whether the content was filtered. + /// The internet location associated with the detection. + /// The license description associated with the detection. + /// Keeps track of any properties unknown to the library. + internal ContentFilterCitedDetectionResult(bool filtered, bool detected, Uri url, string license, IDictionary serializedAdditionalRawData) + { + Filtered = filtered; + Detected = detected; + Url = url; + License = license; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ContentFilterCitedDetectionResult() + { + } + + /// A value indicating whether or not the content has been filtered. + public bool Filtered { get; } + /// A value indicating whether detection occurred, irrespective of severity or whether the content was filtered. + public bool Detected { get; } + /// The internet location associated with the detection. + public Uri Url { get; } + /// The license description associated with the detection. + public string License { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterCompletionTextSpan.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterCompletionTextSpan.Serialization.cs new file mode 100644 index 000000000000..0ba756fda669 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterCompletionTextSpan.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ContentFilterCompletionTextSpan : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContentFilterCompletionTextSpan)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("completion_start_offset"u8); + writer.WriteNumberValue(CompletionStartOffset); + writer.WritePropertyName("completion_end_offset"u8); + writer.WriteNumberValue(CompletionEndOffset); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContentFilterCompletionTextSpan IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContentFilterCompletionTextSpan)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContentFilterCompletionTextSpan(document.RootElement, options); + } + + internal static ContentFilterCompletionTextSpan DeserializeContentFilterCompletionTextSpan(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int completionStartOffset = default; + int completionEndOffset = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("completion_start_offset"u8)) + { + completionStartOffset = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("completion_end_offset"u8)) + { + completionEndOffset = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContentFilterCompletionTextSpan(completionStartOffset, completionEndOffset, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ContentFilterCompletionTextSpan)} does not support writing '{options.Format}' format."); + } + } + + ContentFilterCompletionTextSpan IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContentFilterCompletionTextSpan(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContentFilterCompletionTextSpan)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ContentFilterCompletionTextSpan FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeContentFilterCompletionTextSpan(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/openai/Azure.AI.OpenAI/src/Generated/ContentFilterCompletionTextSpan.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterCompletionTextSpan.cs new file mode 100644 index 000000000000..ff2b77e48291 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterCompletionTextSpan.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Describes a span within generated completion text. Offset 0 is the first UTF32 code point of the completion text. + public partial class ContentFilterCompletionTextSpan + { + /// + /// 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; + + /// Initializes a new instance of . + /// Offset of the UTF32 code point which begins the span. + /// + /// Offset of the first UTF32 code point which is excluded from the span. + /// This field is always equal to completion_start_offset for empty spans. + /// This field is always larger than completion_start_offset for non-empty spans. + /// + internal ContentFilterCompletionTextSpan(int completionStartOffset, int completionEndOffset) + { + CompletionStartOffset = completionStartOffset; + CompletionEndOffset = completionEndOffset; + } + + /// Initializes a new instance of . + /// Offset of the UTF32 code point which begins the span. + /// + /// Offset of the first UTF32 code point which is excluded from the span. + /// This field is always equal to completion_start_offset for empty spans. + /// This field is always larger than completion_start_offset for non-empty spans. + /// + /// Keeps track of any properties unknown to the library. + internal ContentFilterCompletionTextSpan(int completionStartOffset, int completionEndOffset, IDictionary serializedAdditionalRawData) + { + CompletionStartOffset = completionStartOffset; + CompletionEndOffset = completionEndOffset; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ContentFilterCompletionTextSpan() + { + } + + /// Offset of the UTF32 code point which begins the span. + public int CompletionStartOffset { get; } + /// + /// Offset of the first UTF32 code point which is excluded from the span. + /// This field is always equal to completion_start_offset for empty spans. + /// This field is always larger than completion_start_offset for non-empty spans. + /// + public int CompletionEndOffset { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterCompletionTextSpanResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterCompletionTextSpanResult.Serialization.cs new file mode 100644 index 000000000000..55e6d55f218c --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterCompletionTextSpanResult.Serialization.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ContentFilterCompletionTextSpanResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContentFilterCompletionTextSpanResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("filtered"u8); + writer.WriteBooleanValue(Filtered); + writer.WritePropertyName("detected"u8); + writer.WriteBooleanValue(Detected); + writer.WritePropertyName("details"u8); + writer.WriteStartArray(); + foreach (var item in Details) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContentFilterCompletionTextSpanResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContentFilterCompletionTextSpanResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContentFilterCompletionTextSpanResult(document.RootElement, options); + } + + internal static ContentFilterCompletionTextSpanResult DeserializeContentFilterCompletionTextSpanResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool filtered = default; + bool detected = default; + IReadOnlyList details = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("filtered"u8)) + { + filtered = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("detected"u8)) + { + detected = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("details"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContentFilterCompletionTextSpan.DeserializeContentFilterCompletionTextSpan(item, options)); + } + details = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContentFilterCompletionTextSpanResult(filtered, detected, details, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ContentFilterCompletionTextSpanResult)} does not support writing '{options.Format}' format."); + } + } + + ContentFilterCompletionTextSpanResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContentFilterCompletionTextSpanResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContentFilterCompletionTextSpanResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ContentFilterCompletionTextSpanResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeContentFilterCompletionTextSpanResult(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/openai/Azure.AI.OpenAI/src/Generated/ContentFilterCompletionTextSpanResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterCompletionTextSpanResult.cs new file mode 100644 index 000000000000..6232e7fc70b0 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterCompletionTextSpanResult.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.OpenAI +{ + /// Describes a span within generated completion text. + public partial class ContentFilterCompletionTextSpanResult + { + /// + /// 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; + + /// Initializes a new instance of . + /// A value indicating whether or not the content has been filtered. + /// A value indicating whether detection occurred, irrespective of severity or whether the content was filtered. + /// The collection of completion text spans. + /// is null. + internal ContentFilterCompletionTextSpanResult(bool filtered, bool detected, IEnumerable details) + { + Argument.AssertNotNull(details, nameof(details)); + + Filtered = filtered; + Detected = detected; + Details = details.ToList(); + } + + /// Initializes a new instance of . + /// A value indicating whether or not the content has been filtered. + /// A value indicating whether detection occurred, irrespective of severity or whether the content was filtered. + /// The collection of completion text spans. + /// Keeps track of any properties unknown to the library. + internal ContentFilterCompletionTextSpanResult(bool filtered, bool detected, IReadOnlyList details, IDictionary serializedAdditionalRawData) + { + Filtered = filtered; + Detected = detected; + Details = details; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ContentFilterCompletionTextSpanResult() + { + } + + /// A value indicating whether or not the content has been filtered. + public bool Filtered { get; } + /// A value indicating whether detection occurred, irrespective of severity or whether the content was filtered. + public bool Detected { get; } + /// The collection of completion text spans. + public IReadOnlyList Details { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobStateChangeEventData.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetailedResults.Serialization.cs similarity index 56% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobStateChangeEventData.Serialization.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetailedResults.Serialization.cs index 65b844ceb28b..2474b37819ff 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobStateChangeEventData.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetailedResults.Serialization.cs @@ -11,13 +11,13 @@ using System.Text.Json; using Azure.Core; -namespace Azure.Messaging.EventGrid.SystemEvents +namespace Azure.AI.OpenAI { - public partial class MediaJobStateChangeEventData : IUtf8JsonSerializable, IJsonModel + public partial class ContentFilterDetailedResults : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,24 +28,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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobStateChangeEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ContentFilterDetailedResults)} does not support writing '{format}' format."); } - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToString()); - writer.WritePropertyName("correlationData"u8); - writer.WriteStartObject(); - foreach (var item in CorrelationData) + writer.WritePropertyName("filtered"u8); + writer.WriteBooleanValue(Filtered); + writer.WritePropertyName("details"u8); + writer.WriteStartArray(); + foreach (var item in Details) { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); + writer.WriteObjectValue(item, options); } - writer.WriteEndObject(); + writer.WriteEndArray(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -63,19 +60,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - MediaJobStateChangeEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ContentFilterDetailedResults IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobStateChangeEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ContentFilterDetailedResults)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaJobStateChangeEventData(document.RootElement, options); + return DeserializeContentFilterDetailedResults(document.RootElement, options); } - internal static MediaJobStateChangeEventData DeserializeMediaJobStateChangeEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static ContentFilterDetailedResults DeserializeContentFilterDetailedResults(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -83,31 +80,25 @@ internal static MediaJobStateChangeEventData DeserializeMediaJobStateChangeEvent { return null; } - MediaJobState previousState = default; - MediaJobState state = default; - IReadOnlyDictionary correlationData = default; + bool filtered = default; + IReadOnlyList details = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("previousState"u8)) - { - previousState = new MediaJobState(property.Value.GetString()); - continue; - } - if (property.NameEquals("state"u8)) + if (property.NameEquals("filtered"u8)) { - state = new MediaJobState(property.Value.GetString()); + filtered = property.Value.GetBoolean(); continue; } - if (property.NameEquals("correlationData"u8)) + if (property.NameEquals("details"u8)) { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + array.Add(ContentFilterBlocklistIdResult.DeserializeContentFilterBlocklistIdResult(item, options)); } - correlationData = dictionary; + details = array; continue; } if (options.Format != "W") @@ -116,46 +107,46 @@ internal static MediaJobStateChangeEventData DeserializeMediaJobStateChangeEvent } } serializedAdditionalRawData = rawDataDictionary; - return new MediaJobStateChangeEventData(previousState, state, correlationData, serializedAdditionalRawData); + return new ContentFilterDetailedResults(filtered, details, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MediaJobStateChangeEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ContentFilterDetailedResults)} does not support writing '{options.Format}' format."); } } - MediaJobStateChangeEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ContentFilterDetailedResults IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaJobStateChangeEventData(document.RootElement, options); + return DeserializeContentFilterDetailedResults(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MediaJobStateChangeEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ContentFilterDetailedResults)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static MediaJobStateChangeEventData FromResponse(Response response) + internal static ContentFilterDetailedResults FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaJobStateChangeEventData(document.RootElement); + return DeserializeContentFilterDetailedResults(document.RootElement); } /// Convert into a . diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetailedResults.cs similarity index 50% rename from sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetailedResults.cs index d033e0e34b57..05de806d7b90 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetailedResults.cs @@ -1,14 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable using System; using System.Collections.Generic; +using System.Linq; namespace Azure.AI.OpenAI { - /// A collection of true/false filtering results for configured custom blocklists. - public partial class ContentFilterBlocklistResult + /// Represents a structured collection of result details for content filtering. + public partial class ContentFilterDetailedResults { /// /// Keeps track of any properties unknown to the library. @@ -40,32 +44,39 @@ public partial class ContentFilterBlocklistResult /// /// /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// A value indicating whether any of the detailed blocklists resulted in a filtering action. - internal ContentFilterBlocklistResult(bool filtered) + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// A value indicating whether or not the content has been filtered. + /// The collection of detailed blocklist result information. + /// is null. + internal ContentFilterDetailedResults(bool filtered, IEnumerable details) { + Argument.AssertNotNull(details, nameof(details)); + Filtered = filtered; - InternalDetails = new ChangeTrackingList(); + Details = details.ToList(); } - /// Initializes a new instance of . - /// A value indicating whether any of the detailed blocklists resulted in a filtering action. - /// The pairs of individual blocklist IDs and whether they resulted in a filtering action. + /// Initializes a new instance of . + /// A value indicating whether or not the content has been filtered. + /// The collection of detailed blocklist result information. /// Keeps track of any properties unknown to the library. - internal ContentFilterBlocklistResult(bool filtered, IReadOnlyList internalDetails, IDictionary serializedAdditionalRawData) + internal ContentFilterDetailedResults(bool filtered, IReadOnlyList details, IDictionary serializedAdditionalRawData) { Filtered = filtered; - InternalDetails = internalDetails; - SerializedAdditionalRawData = serializedAdditionalRawData; + Details = details; + _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ContentFilterBlocklistResult() + /// Initializes a new instance of for deserialization. + internal ContentFilterDetailedResults() { } - /// A value indicating whether any of the detailed blocklists resulted in a filtering action. + /// A value indicating whether or not the content has been filtered. public bool Filtered { get; } + /// The collection of detailed blocklist result information. + public IReadOnlyList Details { get; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.Serialization.cs index 9c520fede22f..caebda468731 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.Serialization.cs @@ -1,18 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable using System; -using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.Core; namespace Azure.AI.OpenAI { - public partial class ContentFilterDetectionResult : IJsonModel + public partial class ContentFilterDetectionResult : IUtf8JsonSerializable, IJsonModel { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; if (format != "J") @@ -20,25 +34,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(ContentFilterDetectionResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("filtered") != true) + writer.WritePropertyName("filtered"u8); + writer.WriteBooleanValue(Filtered); + writer.WritePropertyName("detected"u8); + writer.WriteBooleanValue(Detected); + if (options.Format != "W" && _serializedAdditionalRawData != null) { - writer.WritePropertyName("filtered"u8); - writer.WriteBooleanValue(Filtered); - } - if (SerializedAdditionalRawData?.ContainsKey("detected") != true) - { - writer.WritePropertyName("detected"u8); - writer.WriteBooleanValue(Detected); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _serializedAdditionalRawData) { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -50,7 +53,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } ContentFilterDetectionResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -91,7 +93,6 @@ internal static ContentFilterDetectionResult DeserializeContentFilterDetectionRe } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } @@ -131,17 +132,19 @@ ContentFilterDetectionResult IPersistableModel.Cre string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static ContentFilterDetectionResult FromResponse(PipelineResponse response) + /// The response to deserialize the model from. + internal static ContentFilterDetectionResult FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); return DeserializeContentFilterDetectionResult(document.RootElement); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// Convert into a . + internal virtual RequestContent ToRequestContent() { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.cs index 34aab24008fd..eed9a9faac26 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable @@ -7,10 +10,7 @@ namespace Azure.AI.OpenAI { - /// - /// A labeled content filter result item that indicates whether the content was detected and whether the content was - /// filtered. - /// + /// Represents the outcome of a detection operation performed by content filtering. public partial class ContentFilterDetectionResult { /// @@ -43,10 +43,11 @@ public partial class ContentFilterDetectionResult /// /// /// - internal IDictionary SerializedAdditionalRawData { get; set; } + private IDictionary _serializedAdditionalRawData; + /// Initializes a new instance of . - /// Whether the content detection resulted in a content filtering action. - /// Whether the labeled content category was detected in the content. + /// A value indicating whether or not the content has been filtered. + /// A value indicating whether detection occurred, irrespective of severity or whether the content was filtered. internal ContentFilterDetectionResult(bool filtered, bool detected) { Filtered = filtered; @@ -54,14 +55,14 @@ internal ContentFilterDetectionResult(bool filtered, bool detected) } /// Initializes a new instance of . - /// Whether the content detection resulted in a content filtering action. - /// Whether the labeled content category was detected in the content. + /// A value indicating whether or not the content has been filtered. + /// A value indicating whether detection occurred, irrespective of severity or whether the content was filtered. /// Keeps track of any properties unknown to the library. internal ContentFilterDetectionResult(bool filtered, bool detected, IDictionary serializedAdditionalRawData) { Filtered = filtered; Detected = detected; - SerializedAdditionalRawData = serializedAdditionalRawData; + _serializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. @@ -69,9 +70,9 @@ internal ContentFilterDetectionResult() { } - /// Whether the content detection resulted in a content filtering action. + /// A value indicating whether or not the content has been filtered. public bool Filtered { get; } - /// Whether the labeled content category was detected in the content. + /// A value indicating whether detection occurred, irrespective of severity or whether the content was filtered. public bool Detected { get; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitationResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitationResult.Serialization.cs deleted file mode 100644 index 6847bd6a8e6b..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitationResult.Serialization.cs +++ /dev/null @@ -1,151 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI -{ - public partial class ContentFilterProtectedMaterialCitationResult : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContentFilterProtectedMaterialCitationResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("license") != true && Optional.IsDefined(License)) - { - writer.WritePropertyName("license"u8); - writer.WriteStringValue(License); - } - if (SerializedAdditionalRawData?.ContainsKey("URL") != true && Optional.IsDefined(Uri)) - { - writer.WritePropertyName("URL"u8); - writer.WriteStringValue(Uri.AbsoluteUri); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContentFilterProtectedMaterialCitationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContentFilterProtectedMaterialCitationResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContentFilterProtectedMaterialCitationResult(document.RootElement, options); - } - - internal static ContentFilterProtectedMaterialCitationResult DeserializeContentFilterProtectedMaterialCitationResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string license = default; - Uri url = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("license"u8)) - { - license = property.Value.GetString(); - continue; - } - if (property.NameEquals("URL"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - url = new Uri(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ContentFilterProtectedMaterialCitationResult(license, url, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ContentFilterProtectedMaterialCitationResult)} does not support writing '{options.Format}' format."); - } - } - - ContentFilterProtectedMaterialCitationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContentFilterProtectedMaterialCitationResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContentFilterProtectedMaterialCitationResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static ContentFilterProtectedMaterialCitationResult FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeContentFilterProtectedMaterialCitationResult(document.RootElement); - } - - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.Serialization.cs deleted file mode 100644 index 96ed6972ea3c..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.Serialization.cs +++ /dev/null @@ -1,162 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI -{ - public partial class ContentFilterProtectedMaterialResult : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContentFilterProtectedMaterialResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("filtered") != true) - { - writer.WritePropertyName("filtered"u8); - writer.WriteBooleanValue(Filtered); - } - if (SerializedAdditionalRawData?.ContainsKey("detected") != true) - { - writer.WritePropertyName("detected"u8); - writer.WriteBooleanValue(Detected); - } - if (SerializedAdditionalRawData?.ContainsKey("citation") != true && Optional.IsDefined(Citation)) - { - writer.WritePropertyName("citation"u8); - writer.WriteObjectValue(Citation, options); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContentFilterProtectedMaterialResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContentFilterProtectedMaterialResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContentFilterProtectedMaterialResult(document.RootElement, options); - } - - internal static ContentFilterProtectedMaterialResult DeserializeContentFilterProtectedMaterialResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - bool filtered = default; - bool detected = default; - ContentFilterProtectedMaterialCitationResult citation = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("filtered"u8)) - { - filtered = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("detected"u8)) - { - detected = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("citation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - citation = ContentFilterProtectedMaterialCitationResult.DeserializeContentFilterProtectedMaterialCitationResult(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ContentFilterProtectedMaterialResult(filtered, detected, citation, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ContentFilterProtectedMaterialResult)} does not support writing '{options.Format}' format."); - } - } - - ContentFilterProtectedMaterialResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContentFilterProtectedMaterialResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContentFilterProtectedMaterialResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static ContentFilterProtectedMaterialResult FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeContentFilterProtectedMaterialResult(document.RootElement); - } - - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.cs deleted file mode 100644 index 533e4b11b32b..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.cs +++ /dev/null @@ -1,78 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI -{ - /// The AzureContentFilterResultForChoiceProtectedMaterialCode. - public partial class ContentFilterProtectedMaterialResult - { - /// - /// 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" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// Whether the content detection resulted in a content filtering action. - /// Whether the labeled content category was detected in the content. - internal ContentFilterProtectedMaterialResult(bool filtered, bool detected) - { - Filtered = filtered; - Detected = detected; - } - - /// Initializes a new instance of . - /// Whether the content detection resulted in a content filtering action. - /// Whether the labeled content category was detected in the content. - /// If available, the citation details describing the associated license and its location. - /// Keeps track of any properties unknown to the library. - internal ContentFilterProtectedMaterialResult(bool filtered, bool detected, ContentFilterProtectedMaterialCitationResult citation, IDictionary serializedAdditionalRawData) - { - Filtered = filtered; - Detected = detected; - Citation = citation; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContentFilterProtectedMaterialResult() - { - } - - /// Whether the content detection resulted in a content filtering action. - public bool Filtered { get; } - /// Whether the labeled content category was detected in the content. - public bool Detected { get; } - /// If available, the citation details describing the associated license and its location. - public ContentFilterProtectedMaterialCitationResult Citation { get; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResult.Serialization.cs new file mode 100644 index 000000000000..aa527ffafa79 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResult.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ContentFilterResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContentFilterResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("filtered"u8); + writer.WriteBooleanValue(Filtered); + writer.WritePropertyName("severity"u8); + writer.WriteStringValue(Severity.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContentFilterResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContentFilterResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContentFilterResult(document.RootElement, options); + } + + internal static ContentFilterResult DeserializeContentFilterResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool filtered = default; + ContentFilterSeverity severity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("filtered"u8)) + { + filtered = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("severity"u8)) + { + severity = new ContentFilterSeverity(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContentFilterResult(filtered, severity, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ContentFilterResult)} does not support writing '{options.Format}' format."); + } + } + + ContentFilterResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContentFilterResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContentFilterResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ContentFilterResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeContentFilterResult(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/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResult.cs similarity index 57% rename from sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResult.cs index 95f0fa1bca5a..ea7952376a34 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResult.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable @@ -7,11 +10,8 @@ namespace Azure.AI.OpenAI { - /// - /// A labeled content filter result item that indicates whether the content was filtered and what the qualitative - /// severity level of the content was, as evaluated against content filter configuration for the category. - /// - public partial class ContentFilterSeverityResult + /// Information about filtered content severity level and if it has been filtered or not. + public partial class ContentFilterResult { /// /// Keeps track of any properties unknown to the library. @@ -43,33 +43,36 @@ public partial class ContentFilterSeverityResult /// /// /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// Whether the content severity resulted in a content filtering action. - /// The labeled severity of the content. - internal ContentFilterSeverityResult(bool filtered, ContentFilterSeverity severity) + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// A value indicating whether or not the content has been filtered. + /// Ratings for the intensity and risk level of filtered content. + internal ContentFilterResult(bool filtered, ContentFilterSeverity severity) { Filtered = filtered; Severity = severity; } - /// Initializes a new instance of . - /// Whether the content severity resulted in a content filtering action. - /// The labeled severity of the content. + /// Initializes a new instance of . + /// A value indicating whether or not the content has been filtered. + /// Ratings for the intensity and risk level of filtered content. /// Keeps track of any properties unknown to the library. - internal ContentFilterSeverityResult(bool filtered, ContentFilterSeverity severity, IDictionary serializedAdditionalRawData) + internal ContentFilterResult(bool filtered, ContentFilterSeverity severity, IDictionary serializedAdditionalRawData) { Filtered = filtered; Severity = severity; - SerializedAdditionalRawData = serializedAdditionalRawData; + _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ContentFilterSeverityResult() + /// Initializes a new instance of for deserialization. + internal ContentFilterResult() { } - /// Whether the content severity resulted in a content filtering action. + /// A value indicating whether or not the content has been filtered. public bool Filtered { get; } + /// Ratings for the intensity and risk level of filtered content. + public ContentFilterSeverity Severity { get; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultDetailsForPrompt.Serialization.cs similarity index 55% rename from sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.Serialization.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultDetailsForPrompt.Serialization.cs index 936b782da8cd..0496f21f4522 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultDetailsForPrompt.Serialization.cs @@ -1,79 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable using System; -using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.Core; namespace Azure.AI.OpenAI { - internal partial class InternalAzureContentFilterResultForPromptContentFilterResults : IJsonModel + public partial class ContentFilterResultDetailsForPrompt : IUtf8JsonSerializable, IJsonModel { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; if (format != "J") { - throw new FormatException($"The model {nameof(InternalAzureContentFilterResultForPromptContentFilterResults)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ContentFilterResultDetailsForPrompt)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("sexual") != true && Optional.IsDefined(Sexual)) + if (Optional.IsDefined(Sexual)) { writer.WritePropertyName("sexual"u8); writer.WriteObjectValue(Sexual, options); } - if (SerializedAdditionalRawData?.ContainsKey("hate") != true && Optional.IsDefined(Hate)) - { - writer.WritePropertyName("hate"u8); - writer.WriteObjectValue(Hate, options); - } - if (SerializedAdditionalRawData?.ContainsKey("violence") != true && Optional.IsDefined(Violence)) + if (Optional.IsDefined(Violence)) { writer.WritePropertyName("violence"u8); writer.WriteObjectValue(Violence, options); } - if (SerializedAdditionalRawData?.ContainsKey("self_harm") != true && Optional.IsDefined(SelfHarm)) + if (Optional.IsDefined(Hate)) + { + writer.WritePropertyName("hate"u8); + writer.WriteObjectValue(Hate, options); + } + if (Optional.IsDefined(SelfHarm)) { writer.WritePropertyName("self_harm"u8); writer.WriteObjectValue(SelfHarm, options); } - if (SerializedAdditionalRawData?.ContainsKey("profanity") != true && Optional.IsDefined(Profanity)) + if (Optional.IsDefined(Profanity)) { writer.WritePropertyName("profanity"u8); writer.WriteObjectValue(Profanity, options); } - if (SerializedAdditionalRawData?.ContainsKey("custom_blocklists") != true && Optional.IsDefined(CustomBlocklists)) + if (Optional.IsDefined(CustomBlocklists)) { writer.WritePropertyName("custom_blocklists"u8); writer.WriteObjectValue(CustomBlocklists, options); } - if (SerializedAdditionalRawData?.ContainsKey("error") != true && Optional.IsDefined(Error)) + if (Optional.IsDefined(Error)) { writer.WritePropertyName("error"u8); - writer.WriteObjectValue(Error, options); + JsonSerializer.Serialize(writer, Error); } - if (SerializedAdditionalRawData?.ContainsKey("jailbreak") != true) + if (Optional.IsDefined(Jailbreak)) { writer.WritePropertyName("jailbreak"u8); writer.WriteObjectValue(Jailbreak, options); } - if (SerializedAdditionalRawData?.ContainsKey("indirect_attack") != true) + if (Optional.IsDefined(IndirectAttack)) { writer.WritePropertyName("indirect_attack"u8); writer.WriteObjectValue(IndirectAttack, options); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _serializedAdditionalRawData != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _serializedAdditionalRawData) { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -85,22 +94,21 @@ void IJsonModel.W #endif } } - writer.WriteEndObject(); } - InternalAzureContentFilterResultForPromptContentFilterResults IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ContentFilterResultDetailsForPrompt IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(InternalAzureContentFilterResultForPromptContentFilterResults)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ContentFilterResultDetailsForPrompt)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInternalAzureContentFilterResultForPromptContentFilterResults(document.RootElement, options); + return DeserializeContentFilterResultDetailsForPrompt(document.RootElement, options); } - internal static InternalAzureContentFilterResultForPromptContentFilterResults DeserializeInternalAzureContentFilterResultForPromptContentFilterResults(JsonElement element, ModelReaderWriterOptions options = null) + internal static ContentFilterResultDetailsForPrompt DeserializeContentFilterResultDetailsForPrompt(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -108,13 +116,13 @@ internal static InternalAzureContentFilterResultForPromptContentFilterResults De { return null; } - ContentFilterSeverityResult sexual = default; - ContentFilterSeverityResult hate = default; - ContentFilterSeverityResult violence = default; - ContentFilterSeverityResult selfHarm = default; + ContentFilterResult sexual = default; + ContentFilterResult violence = default; + ContentFilterResult hate = default; + ContentFilterResult selfHarm = default; ContentFilterDetectionResult profanity = default; - ContentFilterBlocklistResult customBlocklists = default; - InternalAzureContentFilterResultForPromptContentFilterResultsError error = default; + ContentFilterDetailedResults customBlocklists = default; + ResponseError error = default; ContentFilterDetectionResult jailbreak = default; ContentFilterDetectionResult indirectAttack = default; IDictionary serializedAdditionalRawData = default; @@ -127,25 +135,25 @@ internal static InternalAzureContentFilterResultForPromptContentFilterResults De { continue; } - sexual = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); + sexual = ContentFilterResult.DeserializeContentFilterResult(property.Value, options); continue; } - if (property.NameEquals("hate"u8)) + if (property.NameEquals("violence"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - hate = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); + violence = ContentFilterResult.DeserializeContentFilterResult(property.Value, options); continue; } - if (property.NameEquals("violence"u8)) + if (property.NameEquals("hate"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - violence = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); + hate = ContentFilterResult.DeserializeContentFilterResult(property.Value, options); continue; } if (property.NameEquals("self_harm"u8)) @@ -154,7 +162,7 @@ internal static InternalAzureContentFilterResultForPromptContentFilterResults De { continue; } - selfHarm = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); + selfHarm = ContentFilterResult.DeserializeContentFilterResult(property.Value, options); continue; } if (property.NameEquals("profanity"u8)) @@ -172,7 +180,7 @@ internal static InternalAzureContentFilterResultForPromptContentFilterResults De { continue; } - customBlocklists = ContentFilterBlocklistResult.DeserializeContentFilterBlocklistResult(property.Value, options); + customBlocklists = ContentFilterDetailedResults.DeserializeContentFilterDetailedResults(property.Value, options); continue; } if (property.NameEquals("error"u8)) @@ -181,30 +189,37 @@ internal static InternalAzureContentFilterResultForPromptContentFilterResults De { continue; } - error = InternalAzureContentFilterResultForPromptContentFilterResultsError.DeserializeInternalAzureContentFilterResultForPromptContentFilterResultsError(property.Value, options); + error = JsonSerializer.Deserialize(property.Value.GetRawText()); continue; } if (property.NameEquals("jailbreak"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } jailbreak = ContentFilterDetectionResult.DeserializeContentFilterDetectionResult(property.Value, options); continue; } if (property.NameEquals("indirect_attack"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } indirectAttack = ContentFilterDetectionResult.DeserializeContentFilterDetectionResult(property.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureContentFilterResultForPromptContentFilterResults( + return new ContentFilterResultDetailsForPrompt( sexual, - hate, violence, + hate, selfHarm, profanity, customBlocklists, @@ -214,49 +229,51 @@ internal static InternalAzureContentFilterResultForPromptContentFilterResults De serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(InternalAzureContentFilterResultForPromptContentFilterResults)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ContentFilterResultDetailsForPrompt)} does not support writing '{options.Format}' format."); } } - InternalAzureContentFilterResultForPromptContentFilterResults IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ContentFilterResultDetailsForPrompt IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInternalAzureContentFilterResultForPromptContentFilterResults(document.RootElement, options); + return DeserializeContentFilterResultDetailsForPrompt(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(InternalAzureContentFilterResultForPromptContentFilterResults)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ContentFilterResultDetailsForPrompt)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static InternalAzureContentFilterResultForPromptContentFilterResults FromResponse(PipelineResponse response) + /// The response to deserialize the model from. + internal static ContentFilterResultDetailsForPrompt FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureContentFilterResultForPromptContentFilterResults(document.RootElement); + return DeserializeContentFilterResultDetailsForPrompt(document.RootElement); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// Convert into a . + internal virtual RequestContent ToRequestContent() { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultDetailsForPrompt.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultDetailsForPrompt.cs new file mode 100644 index 000000000000..acec97c64cc9 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultDetailsForPrompt.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Information about content filtering evaluated against input data to Azure OpenAI. + public partial class ContentFilterResultDetailsForPrompt + { + /// + /// 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; + + /// Initializes a new instance of . + internal ContentFilterResultDetailsForPrompt() + { + } + + /// Initializes a new instance of . + /// + /// Describes language related to anatomical organs and genitals, romantic relationships, + /// acts portrayed in erotic or affectionate terms, physical sexual acts, including + /// those portrayed as an assault or a forced sexual violent act against one’s will, + /// prostitution, pornography, and abuse. + /// + /// + /// Describes language related to physical actions intended to hurt, injure, damage, or + /// kill someone or something; describes weapons, etc. + /// + /// + /// Describes language attacks or uses that include pejorative or discriminatory language + /// with reference to a person or identity group on the basis of certain differentiating + /// attributes of these groups including but not limited to race, ethnicity, nationality, + /// gender identity and expression, sexual orientation, religion, immigration status, ability + /// status, personal appearance, and body size. + /// + /// + /// Describes language related to physical actions intended to purposely hurt, injure, + /// or damage one’s body, or kill oneself. + /// + /// Describes whether profanity was detected. + /// Describes detection results against configured custom blocklists. + /// + /// Describes an error returned if the content filtering system is + /// down or otherwise unable to complete the operation in time. + /// + /// Whether a jailbreak attempt was detected in the prompt. + /// Whether an indirect attack was detected in the prompt. + /// Keeps track of any properties unknown to the library. + internal ContentFilterResultDetailsForPrompt(ContentFilterResult sexual, ContentFilterResult violence, ContentFilterResult hate, ContentFilterResult selfHarm, ContentFilterDetectionResult profanity, ContentFilterDetailedResults customBlocklists, ResponseError error, ContentFilterDetectionResult jailbreak, ContentFilterDetectionResult indirectAttack, IDictionary serializedAdditionalRawData) + { + Sexual = sexual; + Violence = violence; + Hate = hate; + SelfHarm = selfHarm; + Profanity = profanity; + CustomBlocklists = customBlocklists; + Error = error; + Jailbreak = jailbreak; + IndirectAttack = indirectAttack; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Describes language related to anatomical organs and genitals, romantic relationships, + /// acts portrayed in erotic or affectionate terms, physical sexual acts, including + /// those portrayed as an assault or a forced sexual violent act against one’s will, + /// prostitution, pornography, and abuse. + /// + public ContentFilterResult Sexual { get; } + /// + /// Describes language related to physical actions intended to hurt, injure, damage, or + /// kill someone or something; describes weapons, etc. + /// + public ContentFilterResult Violence { get; } + /// + /// Describes language attacks or uses that include pejorative or discriminatory language + /// with reference to a person or identity group on the basis of certain differentiating + /// attributes of these groups including but not limited to race, ethnicity, nationality, + /// gender identity and expression, sexual orientation, religion, immigration status, ability + /// status, personal appearance, and body size. + /// + public ContentFilterResult Hate { get; } + /// + /// Describes language related to physical actions intended to purposely hurt, injure, + /// or damage one’s body, or kill oneself. + /// + public ContentFilterResult SelfHarm { get; } + /// Describes whether profanity was detected. + public ContentFilterDetectionResult Profanity { get; } + /// Describes detection results against configured custom blocklists. + public ContentFilterDetailedResults CustomBlocklists { get; } + /// + /// Describes an error returned if the content filtering system is + /// down or otherwise unable to complete the operation in time. + /// + public ResponseError Error { get; } + /// Whether a jailbreak attempt was detected in the prompt. + public ContentFilterDetectionResult Jailbreak { get; } + /// Whether an indirect attack was detected in the prompt. + public ContentFilterDetectionResult IndirectAttack { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseContentFilterResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultsForChoice.Serialization.cs similarity index 55% rename from sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseContentFilterResult.Serialization.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultsForChoice.Serialization.cs index 5e9da43d62eb..ae4626d5af22 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseContentFilterResult.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultsForChoice.Serialization.cs @@ -1,79 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable using System; -using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.Core; namespace Azure.AI.OpenAI { - public partial class ResponseContentFilterResult : IJsonModel + public partial class ContentFilterResultsForChoice : IUtf8JsonSerializable, IJsonModel { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; if (format != "J") { - throw new FormatException($"The model {nameof(ResponseContentFilterResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ContentFilterResultsForChoice)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("sexual") != true && Optional.IsDefined(Sexual)) + if (Optional.IsDefined(Sexual)) { writer.WritePropertyName("sexual"u8); writer.WriteObjectValue(Sexual, options); } - if (SerializedAdditionalRawData?.ContainsKey("hate") != true && Optional.IsDefined(Hate)) - { - writer.WritePropertyName("hate"u8); - writer.WriteObjectValue(Hate, options); - } - if (SerializedAdditionalRawData?.ContainsKey("violence") != true && Optional.IsDefined(Violence)) + if (Optional.IsDefined(Violence)) { writer.WritePropertyName("violence"u8); writer.WriteObjectValue(Violence, options); } - if (SerializedAdditionalRawData?.ContainsKey("self_harm") != true && Optional.IsDefined(SelfHarm)) + if (Optional.IsDefined(Hate)) + { + writer.WritePropertyName("hate"u8); + writer.WriteObjectValue(Hate, options); + } + if (Optional.IsDefined(SelfHarm)) { writer.WritePropertyName("self_harm"u8); writer.WriteObjectValue(SelfHarm, options); } - if (SerializedAdditionalRawData?.ContainsKey("profanity") != true && Optional.IsDefined(Profanity)) + if (Optional.IsDefined(Profanity)) { writer.WritePropertyName("profanity"u8); writer.WriteObjectValue(Profanity, options); } - if (SerializedAdditionalRawData?.ContainsKey("custom_blocklists") != true && Optional.IsDefined(CustomBlocklists)) + if (Optional.IsDefined(CustomBlocklists)) { writer.WritePropertyName("custom_blocklists"u8); writer.WriteObjectValue(CustomBlocklists, options); } - if (SerializedAdditionalRawData?.ContainsKey("error") != true && Optional.IsDefined(Error)) + if (Optional.IsDefined(Error)) { writer.WritePropertyName("error"u8); - writer.WriteObjectValue(Error, options); + JsonSerializer.Serialize(writer, Error); } - if (SerializedAdditionalRawData?.ContainsKey("protected_material_text") != true && Optional.IsDefined(ProtectedMaterialText)) + if (Optional.IsDefined(ProtectedMaterialText)) { writer.WritePropertyName("protected_material_text"u8); writer.WriteObjectValue(ProtectedMaterialText, options); } - if (SerializedAdditionalRawData?.ContainsKey("protected_material_code") != true && Optional.IsDefined(ProtectedMaterialCode)) + if (Optional.IsDefined(ProtectedMaterialCode)) { writer.WritePropertyName("protected_material_code"u8); writer.WriteObjectValue(ProtectedMaterialCode, options); } - if (SerializedAdditionalRawData != null) + if (Optional.IsDefined(UngroundedMaterial)) + { + writer.WritePropertyName("ungrounded_material"u8); + writer.WriteObjectValue(UngroundedMaterial, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _serializedAdditionalRawData) { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -85,22 +99,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR #endif } } - writer.WriteEndObject(); } - ResponseContentFilterResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ContentFilterResultsForChoice IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ResponseContentFilterResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ContentFilterResultsForChoice)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeResponseContentFilterResult(document.RootElement, options); + return DeserializeContentFilterResultsForChoice(document.RootElement, options); } - internal static ResponseContentFilterResult DeserializeResponseContentFilterResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static ContentFilterResultsForChoice DeserializeContentFilterResultsForChoice(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -108,15 +121,16 @@ internal static ResponseContentFilterResult DeserializeResponseContentFilterResu { return null; } - ContentFilterSeverityResult sexual = default; - ContentFilterSeverityResult hate = default; - ContentFilterSeverityResult violence = default; - ContentFilterSeverityResult selfHarm = default; + ContentFilterResult sexual = default; + ContentFilterResult violence = default; + ContentFilterResult hate = default; + ContentFilterResult selfHarm = default; ContentFilterDetectionResult profanity = default; - ContentFilterBlocklistResult customBlocklists = default; - InternalAzureContentFilterResultForPromptContentFilterResultsError error = default; + ContentFilterDetailedResults customBlocklists = default; + ResponseError error = default; ContentFilterDetectionResult protectedMaterialText = default; - ContentFilterProtectedMaterialResult protectedMaterialCode = default; + ContentFilterCitedDetectionResult protectedMaterialCode = default; + ContentFilterCompletionTextSpanResult ungroundedMaterial = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -127,25 +141,25 @@ internal static ResponseContentFilterResult DeserializeResponseContentFilterResu { continue; } - sexual = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); + sexual = ContentFilterResult.DeserializeContentFilterResult(property.Value, options); continue; } - if (property.NameEquals("hate"u8)) + if (property.NameEquals("violence"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - hate = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); + violence = ContentFilterResult.DeserializeContentFilterResult(property.Value, options); continue; } - if (property.NameEquals("violence"u8)) + if (property.NameEquals("hate"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - violence = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); + hate = ContentFilterResult.DeserializeContentFilterResult(property.Value, options); continue; } if (property.NameEquals("self_harm"u8)) @@ -154,7 +168,7 @@ internal static ResponseContentFilterResult DeserializeResponseContentFilterResu { continue; } - selfHarm = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); + selfHarm = ContentFilterResult.DeserializeContentFilterResult(property.Value, options); continue; } if (property.NameEquals("profanity"u8)) @@ -172,7 +186,7 @@ internal static ResponseContentFilterResult DeserializeResponseContentFilterResu { continue; } - customBlocklists = ContentFilterBlocklistResult.DeserializeContentFilterBlocklistResult(property.Value, options); + customBlocklists = ContentFilterDetailedResults.DeserializeContentFilterDetailedResults(property.Value, options); continue; } if (property.NameEquals("error"u8)) @@ -181,7 +195,7 @@ internal static ResponseContentFilterResult DeserializeResponseContentFilterResu { continue; } - error = InternalAzureContentFilterResultForPromptContentFilterResultsError.DeserializeInternalAzureContentFilterResultForPromptContentFilterResultsError(property.Value, options); + error = JsonSerializer.Deserialize(property.Value.GetRawText()); continue; } if (property.NameEquals("protected_material_text"u8)) @@ -199,72 +213,83 @@ internal static ResponseContentFilterResult DeserializeResponseContentFilterResu { continue; } - protectedMaterialCode = ContentFilterProtectedMaterialResult.DeserializeContentFilterProtectedMaterialResult(property.Value, options); + protectedMaterialCode = ContentFilterCitedDetectionResult.DeserializeContentFilterCitedDetectionResult(property.Value, options); + continue; + } + if (property.NameEquals("ungrounded_material"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ungroundedMaterial = ContentFilterCompletionTextSpanResult.DeserializeContentFilterCompletionTextSpanResult(property.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new ResponseContentFilterResult( + return new ContentFilterResultsForChoice( sexual, - hate, violence, + hate, selfHarm, profanity, customBlocklists, error, protectedMaterialText, protectedMaterialCode, + ungroundedMaterial, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ResponseContentFilterResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ContentFilterResultsForChoice)} does not support writing '{options.Format}' format."); } } - ResponseContentFilterResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ContentFilterResultsForChoice IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeResponseContentFilterResult(document.RootElement, options); + return DeserializeContentFilterResultsForChoice(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ResponseContentFilterResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ContentFilterResultsForChoice)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static ResponseContentFilterResult FromResponse(PipelineResponse response) + /// The response to deserialize the model from. + internal static ContentFilterResultsForChoice FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeResponseContentFilterResult(document.RootElement); + return DeserializeContentFilterResultsForChoice(document.RootElement); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// Convert into a . + internal virtual RequestContent ToRequestContent() { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultsForChoice.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultsForChoice.cs new file mode 100644 index 000000000000..5b7638e9d998 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultsForChoice.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Information about content filtering evaluated against generated model output. + public partial class ContentFilterResultsForChoice + { + /// + /// 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; + + /// Initializes a new instance of . + internal ContentFilterResultsForChoice() + { + } + + /// Initializes a new instance of . + /// + /// Describes language related to anatomical organs and genitals, romantic relationships, + /// acts portrayed in erotic or affectionate terms, physical sexual acts, including + /// those portrayed as an assault or a forced sexual violent act against one’s will, + /// prostitution, pornography, and abuse. + /// + /// + /// Describes language related to physical actions intended to hurt, injure, damage, or + /// kill someone or something; describes weapons, etc. + /// + /// + /// Describes language attacks or uses that include pejorative or discriminatory language + /// with reference to a person or identity group on the basis of certain differentiating + /// attributes of these groups including but not limited to race, ethnicity, nationality, + /// gender identity and expression, sexual orientation, religion, immigration status, ability + /// status, personal appearance, and body size. + /// + /// + /// Describes language related to physical actions intended to purposely hurt, injure, + /// or damage one’s body, or kill oneself. + /// + /// Describes whether profanity was detected. + /// Describes detection results against configured custom blocklists. + /// + /// Describes an error returned if the content filtering system is + /// down or otherwise unable to complete the operation in time. + /// + /// Information about detection of protected text material. + /// Information about detection of protected code material. + /// Information about detection of ungrounded material. + /// Keeps track of any properties unknown to the library. + internal ContentFilterResultsForChoice(ContentFilterResult sexual, ContentFilterResult violence, ContentFilterResult hate, ContentFilterResult selfHarm, ContentFilterDetectionResult profanity, ContentFilterDetailedResults customBlocklists, ResponseError error, ContentFilterDetectionResult protectedMaterialText, ContentFilterCitedDetectionResult protectedMaterialCode, ContentFilterCompletionTextSpanResult ungroundedMaterial, IDictionary serializedAdditionalRawData) + { + Sexual = sexual; + Violence = violence; + Hate = hate; + SelfHarm = selfHarm; + Profanity = profanity; + CustomBlocklists = customBlocklists; + Error = error; + ProtectedMaterialText = protectedMaterialText; + ProtectedMaterialCode = protectedMaterialCode; + UngroundedMaterial = ungroundedMaterial; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Describes language related to anatomical organs and genitals, romantic relationships, + /// acts portrayed in erotic or affectionate terms, physical sexual acts, including + /// those portrayed as an assault or a forced sexual violent act against one’s will, + /// prostitution, pornography, and abuse. + /// + public ContentFilterResult Sexual { get; } + /// + /// Describes language related to physical actions intended to hurt, injure, damage, or + /// kill someone or something; describes weapons, etc. + /// + public ContentFilterResult Violence { get; } + /// + /// Describes language attacks or uses that include pejorative or discriminatory language + /// with reference to a person or identity group on the basis of certain differentiating + /// attributes of these groups including but not limited to race, ethnicity, nationality, + /// gender identity and expression, sexual orientation, religion, immigration status, ability + /// status, personal appearance, and body size. + /// + public ContentFilterResult Hate { get; } + /// + /// Describes language related to physical actions intended to purposely hurt, injure, + /// or damage one’s body, or kill oneself. + /// + public ContentFilterResult SelfHarm { get; } + /// Describes whether profanity was detected. + public ContentFilterDetectionResult Profanity { get; } + /// Describes detection results against configured custom blocklists. + public ContentFilterDetailedResults CustomBlocklists { get; } + /// + /// Describes an error returned if the content filtering system is + /// down or otherwise unable to complete the operation in time. + /// + public ResponseError Error { get; } + /// Information about detection of protected text material. + public ContentFilterDetectionResult ProtectedMaterialText { get; } + /// Information about detection of protected code material. + public ContentFilterCitedDetectionResult ProtectedMaterialCode { get; } + /// Information about detection of ungrounded material. + public ContentFilterCompletionTextSpanResult UngroundedMaterial { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultsForPrompt.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultsForPrompt.Serialization.cs new file mode 100644 index 000000000000..d1f9d530dc6e --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultsForPrompt.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ContentFilterResultsForPrompt : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContentFilterResultsForPrompt)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("prompt_index"u8); + writer.WriteNumberValue(PromptIndex); + writer.WritePropertyName("content_filter_results"u8); + writer.WriteObjectValue(ContentFilterResults, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContentFilterResultsForPrompt IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContentFilterResultsForPrompt)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContentFilterResultsForPrompt(document.RootElement, options); + } + + internal static ContentFilterResultsForPrompt DeserializeContentFilterResultsForPrompt(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int promptIndex = default; + ContentFilterResultDetailsForPrompt contentFilterResults = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("prompt_index"u8)) + { + promptIndex = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("content_filter_results"u8)) + { + contentFilterResults = ContentFilterResultDetailsForPrompt.DeserializeContentFilterResultDetailsForPrompt(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContentFilterResultsForPrompt(promptIndex, contentFilterResults, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ContentFilterResultsForPrompt)} does not support writing '{options.Format}' format."); + } + } + + ContentFilterResultsForPrompt IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContentFilterResultsForPrompt(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContentFilterResultsForPrompt)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ContentFilterResultsForPrompt FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeContentFilterResultsForPrompt(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/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultsForPrompt.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultsForPrompt.cs new file mode 100644 index 000000000000..4e411955a776 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultsForPrompt.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Content filtering results for a single prompt in the request. + public partial class ContentFilterResultsForPrompt + { + /// + /// 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; + + /// Initializes a new instance of . + /// The index of this prompt in the set of prompt results. + /// Content filtering results for this prompt. + /// is null. + internal ContentFilterResultsForPrompt(int promptIndex, ContentFilterResultDetailsForPrompt contentFilterResults) + { + Argument.AssertNotNull(contentFilterResults, nameof(contentFilterResults)); + + PromptIndex = promptIndex; + ContentFilterResults = contentFilterResults; + } + + /// Initializes a new instance of . + /// The index of this prompt in the set of prompt results. + /// Content filtering results for this prompt. + /// Keeps track of any properties unknown to the library. + internal ContentFilterResultsForPrompt(int promptIndex, ContentFilterResultDetailsForPrompt contentFilterResults, IDictionary serializedAdditionalRawData) + { + PromptIndex = promptIndex; + ContentFilterResults = contentFilterResults; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ContentFilterResultsForPrompt() + { + } + + /// The index of this prompt in the set of prompt results. + public int PromptIndex { get; } + /// Content filtering results for this prompt. + public ContentFilterResultDetailsForPrompt ContentFilterResults { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverity.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverity.cs index 91a9f01a8528..4c49dd0aec22 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverity.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverity.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable @@ -7,7 +10,7 @@ namespace Azure.AI.OpenAI { - /// The AzureContentFilterSeverityResultSeverity. + /// Ratings for the intensity and risk level of harmful content. public readonly partial struct ContentFilterSeverity : IEquatable { private readonly string _value; @@ -24,19 +27,36 @@ public ContentFilterSeverity(string value) private const string MediumValue = "medium"; private const string HighValue = "high"; - /// safe. + /// + /// Content may be related to violence, self-harm, sexual, or hate categories but the terms + /// are used in general, journalistic, scientific, medical, and similar professional contexts, + /// which are appropriate for most audiences. + /// public static ContentFilterSeverity Safe { get; } = new ContentFilterSeverity(SafeValue); - /// low. + /// + /// Content that expresses prejudiced, judgmental, or opinionated views, includes offensive + /// use of language, stereotyping, use cases exploring a fictional world (for example, gaming, + /// literature) and depictions at low intensity. + /// public static ContentFilterSeverity Low { get; } = new ContentFilterSeverity(LowValue); - /// medium. + /// + /// Content that uses offensive, insulting, mocking, intimidating, or demeaning language + /// towards specific identity groups, includes depictions of seeking and executing harmful + /// instructions, fantasies, glorification, promotion of harm at medium intensity. + /// public static ContentFilterSeverity Medium { get; } = new ContentFilterSeverity(MediumValue); - /// high. + /// + /// Content that displays explicit and severe harmful instructions, actions, + /// damage, or abuse; includes endorsement, glorification, or promotion of severe + /// harmful acts, extreme or illegal forms of harm, radicalization, or non-consensual + /// power exchange or abuse. + /// public static ContentFilterSeverity High { get; } = new ContentFilterSeverity(HighValue); /// Determines if two values are the same. public static bool operator ==(ContentFilterSeverity left, ContentFilterSeverity right) => left.Equals(right); /// Determines if two values are not the same. public static bool operator !=(ContentFilterSeverity left, ContentFilterSeverity right) => !left.Equals(right); - /// Converts a string to a . + /// Converts a to a . public static implicit operator ContentFilterSeverity(string value) => new ContentFilterSeverity(value); /// diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.Serialization.cs deleted file mode 100644 index 6f7da3ac8cab..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI -{ - public partial class ContentFilterSeverityResult : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContentFilterSeverityResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("filtered") != true) - { - writer.WritePropertyName("filtered"u8); - writer.WriteBooleanValue(Filtered); - } - if (SerializedAdditionalRawData?.ContainsKey("severity") != true) - { - writer.WritePropertyName("severity"u8); - writer.WriteStringValue(Severity.ToString()); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContentFilterSeverityResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContentFilterSeverityResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContentFilterSeverityResult(document.RootElement, options); - } - - internal static ContentFilterSeverityResult DeserializeContentFilterSeverityResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - bool filtered = default; - ContentFilterSeverity severity = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("filtered"u8)) - { - filtered = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("severity"u8)) - { - severity = new ContentFilterSeverity(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ContentFilterSeverityResult(filtered, severity, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ContentFilterSeverityResult)} does not support writing '{options.Format}' format."); - } - } - - ContentFilterSeverityResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContentFilterSeverityResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContentFilterSeverityResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static ContentFilterSeverityResult FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeContentFilterSeverityResult(document.RootElement); - } - - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/CosmosChatDataSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/CosmosChatDataSource.Serialization.cs deleted file mode 100644 index 7330e9d27e85..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/CosmosChatDataSource.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI.Chat -{ - public partial class CosmosChatDataSource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosChatDataSource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("parameters") != true) - { - writer.WritePropertyName("parameters"u8); - writer.WriteObjectValue(InternalParameters, options); - } - if (SerializedAdditionalRawData?.ContainsKey("type") != true) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CosmosChatDataSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosChatDataSource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCosmosChatDataSource(document.RootElement, options); - } - - internal static CosmosChatDataSource DeserializeCosmosChatDataSource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - InternalAzureCosmosDBChatDataSourceParameters parameters = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("parameters"u8)) - { - parameters = InternalAzureCosmosDBChatDataSourceParameters.DeserializeInternalAzureCosmosDBChatDataSourceParameters(property.Value, options); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosChatDataSource(type, serializedAdditionalRawData, parameters); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(CosmosChatDataSource)} does not support writing '{options.Format}' format."); - } - } - - CosmosChatDataSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCosmosChatDataSource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CosmosChatDataSource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new CosmosChatDataSource FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeCosmosChatDataSource(document.RootElement); - } - - /// Convert into a . - internal override BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/CosmosChatDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/CosmosChatDataSource.cs deleted file mode 100644 index 779961ba9e04..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/CosmosChatDataSource.cs +++ /dev/null @@ -1,14 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI.Chat -{ - /// Represents a data source configuration that will use an Azure CosmosDB resource. - public partial class CosmosChatDataSource : ChatDataSource - { - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/CreateUploadRequest.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/CreateUploadRequest.Serialization.cs new file mode 100644 index 000000000000..e3920aa33b96 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/CreateUploadRequest.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class CreateUploadRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(CreateUploadRequest)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("filename"u8); + writer.WriteStringValue(Filename); + writer.WritePropertyName("purpose"u8); + writer.WriteStringValue(Purpose.ToString()); + writer.WritePropertyName("bytes"u8); + writer.WriteNumberValue(Bytes); + writer.WritePropertyName("mime_type"u8); + writer.WriteStringValue(MimeType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CreateUploadRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CreateUploadRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCreateUploadRequest(document.RootElement, options); + } + + internal static CreateUploadRequest DeserializeCreateUploadRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string filename = default; + CreateUploadRequestPurpose purpose = default; + int bytes = default; + string mimeType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("filename"u8)) + { + filename = property.Value.GetString(); + continue; + } + if (property.NameEquals("purpose"u8)) + { + purpose = new CreateUploadRequestPurpose(property.Value.GetString()); + continue; + } + if (property.NameEquals("bytes"u8)) + { + bytes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("mime_type"u8)) + { + mimeType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CreateUploadRequest(filename, purpose, bytes, mimeType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CreateUploadRequest)} does not support writing '{options.Format}' format."); + } + } + + CreateUploadRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCreateUploadRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CreateUploadRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CreateUploadRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCreateUploadRequest(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/openai/Azure.AI.OpenAI/src/Generated/CreateUploadRequest.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/CreateUploadRequest.cs new file mode 100644 index 000000000000..a48d33b00bf1 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/CreateUploadRequest.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// The request body of an upload creation operation. + public partial class CreateUploadRequest + { + /// + /// 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; + + /// Initializes a new instance of . + /// The name of the file to upload. + /// + /// The intended purpose of the uploaded file. + /// + /// Use 'assistants' for Assistants and Message files, 'vision' for Assistants image file inputs, 'batch' for Batch API, and 'fine-tune' for Fine-tuning. + /// + /// The number of bytes in the file you are uploading. + /// + /// The MIME type of the file. + /// + /// This must fall within the supported MIME types for your file purpose. See the supported MIME types for assistants and vision. + /// + /// or is null. + public CreateUploadRequest(string filename, CreateUploadRequestPurpose purpose, int bytes, string mimeType) + { + Argument.AssertNotNull(filename, nameof(filename)); + Argument.AssertNotNull(mimeType, nameof(mimeType)); + + Filename = filename; + Purpose = purpose; + Bytes = bytes; + MimeType = mimeType; + } + + /// Initializes a new instance of . + /// The name of the file to upload. + /// + /// The intended purpose of the uploaded file. + /// + /// Use 'assistants' for Assistants and Message files, 'vision' for Assistants image file inputs, 'batch' for Batch API, and 'fine-tune' for Fine-tuning. + /// + /// The number of bytes in the file you are uploading. + /// + /// The MIME type of the file. + /// + /// This must fall within the supported MIME types for your file purpose. See the supported MIME types for assistants and vision. + /// + /// Keeps track of any properties unknown to the library. + internal CreateUploadRequest(string filename, CreateUploadRequestPurpose purpose, int bytes, string mimeType, IDictionary serializedAdditionalRawData) + { + Filename = filename; + Purpose = purpose; + Bytes = bytes; + MimeType = mimeType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CreateUploadRequest() + { + } + + /// The name of the file to upload. + public string Filename { get; } + /// + /// The intended purpose of the uploaded file. + /// + /// Use 'assistants' for Assistants and Message files, 'vision' for Assistants image file inputs, 'batch' for Batch API, and 'fine-tune' for Fine-tuning. + /// + public CreateUploadRequestPurpose Purpose { get; } + /// The number of bytes in the file you are uploading. + public int Bytes { get; } + /// + /// The MIME type of the file. + /// + /// This must fall within the supported MIME types for your file purpose. See the supported MIME types for assistants and vision. + /// + public string MimeType { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/CreateUploadRequestPurpose.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/CreateUploadRequestPurpose.cs new file mode 100644 index 000000000000..c729a2f7df13 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/CreateUploadRequestPurpose.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// The CreateUploadRequestPurpose. + public readonly partial struct CreateUploadRequestPurpose : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CreateUploadRequestPurpose(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AssistantsValue = "assistants"; + private const string BatchValue = "batch"; + private const string FineTuneValue = "fine-tune"; + private const string VisionValue = "vision"; + + /// assistants. + public static CreateUploadRequestPurpose Assistants { get; } = new CreateUploadRequestPurpose(AssistantsValue); + /// batch. + public static CreateUploadRequestPurpose Batch { get; } = new CreateUploadRequestPurpose(BatchValue); + /// fine-tune. + public static CreateUploadRequestPurpose FineTune { get; } = new CreateUploadRequestPurpose(FineTuneValue); + /// vision. + public static CreateUploadRequestPurpose Vision { get; } = new CreateUploadRequestPurpose(VisionValue); + /// Determines if two values are the same. + public static bool operator ==(CreateUploadRequestPurpose left, CreateUploadRequestPurpose right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CreateUploadRequestPurpose left, CreateUploadRequestPurpose right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CreateUploadRequestPurpose(string value) => new CreateUploadRequestPurpose(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CreateUploadRequestPurpose other && Equals(other); + /// + public bool Equals(CreateUploadRequestPurpose 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/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.Serialization.cs deleted file mode 100644 index da7309b6f794..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.Serialization.cs +++ /dev/null @@ -1,133 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.AI.OpenAI.Chat -{ - [PersistableModelProxy(typeof(InternalUnknownAzureChatDataSourceAuthenticationOptions))] - public partial class DataSourceAuthentication : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataSourceAuthentication)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("type") != true) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - DataSourceAuthentication IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataSourceAuthentication)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataSourceAuthentication(document.RootElement, options); - } - - internal static DataSourceAuthentication DeserializeDataSourceAuthentication(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("type", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "access_token": return InternalAzureChatDataSourceAccessTokenAuthenticationOptions.DeserializeInternalAzureChatDataSourceAccessTokenAuthenticationOptions(element, options); - case "api_key": return InternalAzureChatDataSourceApiKeyAuthenticationOptions.DeserializeInternalAzureChatDataSourceApiKeyAuthenticationOptions(element, options); - case "connection_string": return InternalAzureChatDataSourceConnectionStringAuthenticationOptions.DeserializeInternalAzureChatDataSourceConnectionStringAuthenticationOptions(element, options); - case "encoded_api_key": return InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.DeserializeInternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions(element, options); - case "key_and_key_id": return InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.DeserializeInternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions(element, options); - case "system_assigned_managed_identity": return InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.DeserializeInternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions(element, options); - case "user_assigned_managed_identity": return InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.DeserializeInternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions(element, options); - case "username_and_password": return InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.DeserializeInternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions(element, options); - } - } - return InternalUnknownAzureChatDataSourceAuthenticationOptions.DeserializeInternalUnknownAzureChatDataSourceAuthenticationOptions(element, options); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DataSourceAuthentication)} does not support writing '{options.Format}' format."); - } - } - - DataSourceAuthentication IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDataSourceAuthentication(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DataSourceAuthentication)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static DataSourceAuthentication FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDataSourceAuthentication(document.RootElement); - } - - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceQueryType.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceQueryType.cs deleted file mode 100644 index 1f05c54d6d19..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceQueryType.cs +++ /dev/null @@ -1,57 +0,0 @@ -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.OpenAI.Chat -{ - /// The AzureSearchChatDataSourceParametersQueryType. - public readonly partial struct DataSourceQueryType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DataSourceQueryType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string SimpleValue = "simple"; - private const string SemanticValue = "semantic"; - private const string VectorValue = "vector"; - private const string VectorSimpleHybridValue = "vector_simple_hybrid"; - private const string VectorSemanticHybridValue = "vector_semantic_hybrid"; - - /// simple. - public static DataSourceQueryType Simple { get; } = new DataSourceQueryType(SimpleValue); - /// semantic. - public static DataSourceQueryType Semantic { get; } = new DataSourceQueryType(SemanticValue); - /// vector. - public static DataSourceQueryType Vector { get; } = new DataSourceQueryType(VectorValue); - /// vector_simple_hybrid. - public static DataSourceQueryType VectorSimpleHybrid { get; } = new DataSourceQueryType(VectorSimpleHybridValue); - /// vector_semantic_hybrid. - public static DataSourceQueryType VectorSemanticHybrid { get; } = new DataSourceQueryType(VectorSemanticHybridValue); - /// Determines if two values are the same. - public static bool operator ==(DataSourceQueryType left, DataSourceQueryType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DataSourceQueryType left, DataSourceQueryType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator DataSourceQueryType(string value) => new DataSourceQueryType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DataSourceQueryType other && Equals(other); - /// - public bool Equals(DataSourceQueryType 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/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.Serialization.cs deleted file mode 100644 index c6e4b24822ee..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.Serialization.cs +++ /dev/null @@ -1,129 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.AI.OpenAI.Chat -{ - [PersistableModelProxy(typeof(InternalUnknownAzureChatDataSourceVectorizationSource))] - public partial class DataSourceVectorizer : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataSourceVectorizer)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("type") != true) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - DataSourceVectorizer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataSourceVectorizer)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataSourceVectorizer(document.RootElement, options); - } - - internal static DataSourceVectorizer DeserializeDataSourceVectorizer(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("type", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "deployment_name": return InternalAzureChatDataSourceDeploymentNameVectorizationSource.DeserializeInternalAzureChatDataSourceDeploymentNameVectorizationSource(element, options); - case "endpoint": return InternalAzureChatDataSourceEndpointVectorizationSource.DeserializeInternalAzureChatDataSourceEndpointVectorizationSource(element, options); - case "integrated": return InternalAzureChatDataSourceIntegratedVectorizationSource.DeserializeInternalAzureChatDataSourceIntegratedVectorizationSource(element, options); - case "model_id": return InternalAzureChatDataSourceModelIdVectorizationSource.DeserializeInternalAzureChatDataSourceModelIdVectorizationSource(element, options); - } - } - return InternalUnknownAzureChatDataSourceVectorizationSource.DeserializeInternalUnknownAzureChatDataSourceVectorizationSource(element, options); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DataSourceVectorizer)} does not support writing '{options.Format}' format."); - } - } - - DataSourceVectorizer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDataSourceVectorizer(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DataSourceVectorizer)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static DataSourceVectorizer FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDataSourceVectorizer(document.RootElement); - } - - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.cs deleted file mode 100644 index 474c2459025b..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.cs +++ /dev/null @@ -1,64 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI.Chat -{ - /// - /// A representation of a data vectorization source usable as an embedding resource with a data source. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - public abstract partial class DataSourceVectorizer - { - /// - /// 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" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - protected DataSourceVectorizer() - { - } - - /// Initializes a new instance of . - /// The differentiating identifier for the concrete vectorization source. - /// Keeps track of any properties unknown to the library. - internal DataSourceVectorizer(string type, IDictionary serializedAdditionalRawData) - { - Type = type; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The differentiating identifier for the concrete vectorization source. - internal string Type { get; set; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.Serialization.cs deleted file mode 100644 index 5265a931500b..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI.Chat -{ - public partial class ElasticsearchChatDataSource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ElasticsearchChatDataSource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("parameters") != true) - { - writer.WritePropertyName("parameters"u8); - writer.WriteObjectValue(InternalParameters, options); - } - if (SerializedAdditionalRawData?.ContainsKey("type") != true) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ElasticsearchChatDataSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ElasticsearchChatDataSource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeElasticsearchChatDataSource(document.RootElement, options); - } - - internal static ElasticsearchChatDataSource DeserializeElasticsearchChatDataSource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - InternalElasticsearchChatDataSourceParameters parameters = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("parameters"u8)) - { - parameters = InternalElasticsearchChatDataSourceParameters.DeserializeInternalElasticsearchChatDataSourceParameters(property.Value, options); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ElasticsearchChatDataSource(type, serializedAdditionalRawData, parameters); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ElasticsearchChatDataSource)} does not support writing '{options.Format}' format."); - } - } - - ElasticsearchChatDataSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeElasticsearchChatDataSource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ElasticsearchChatDataSource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new ElasticsearchChatDataSource FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeElasticsearchChatDataSource(document.RootElement); - } - - /// Convert into a . - internal override BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.cs deleted file mode 100644 index a3c0db4133ef..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.cs +++ /dev/null @@ -1,14 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI.Chat -{ - /// The ElasticsearchChatDataSource. - public partial class ElasticsearchChatDataSource : ChatDataSource - { - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatExtensionConfiguration.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatExtensionConfiguration.Serialization.cs new file mode 100644 index 000000000000..b558d775dcdd --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatExtensionConfiguration.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ElasticsearchChatExtensionConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ElasticsearchChatExtensionConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("parameters"u8); + writer.WriteObjectValue(Parameters, options); + } + + ElasticsearchChatExtensionConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ElasticsearchChatExtensionConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeElasticsearchChatExtensionConfiguration(document.RootElement, options); + } + + internal static ElasticsearchChatExtensionConfiguration DeserializeElasticsearchChatExtensionConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ElasticsearchChatExtensionParameters parameters = default; + AzureChatExtensionType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("parameters"u8)) + { + parameters = ElasticsearchChatExtensionParameters.DeserializeElasticsearchChatExtensionParameters(property.Value, options); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new AzureChatExtensionType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ElasticsearchChatExtensionConfiguration(type, serializedAdditionalRawData, parameters); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ElasticsearchChatExtensionConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ElasticsearchChatExtensionConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeElasticsearchChatExtensionConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ElasticsearchChatExtensionConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ElasticsearchChatExtensionConfiguration FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeElasticsearchChatExtensionConfiguration(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/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatExtensionConfiguration.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatExtensionConfiguration.cs new file mode 100644 index 000000000000..c02c027fb162 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatExtensionConfiguration.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// + /// A specific representation of configurable options for Elasticsearch when using it as an Azure OpenAI chat + /// extension. + /// + public partial class ElasticsearchChatExtensionConfiguration : AzureChatExtensionConfiguration + { + /// Initializes a new instance of . + /// The parameters to use when configuring Elasticsearch®. + /// is null. + public ElasticsearchChatExtensionConfiguration(ElasticsearchChatExtensionParameters parameters) + { + Argument.AssertNotNull(parameters, nameof(parameters)); + + Type = AzureChatExtensionType.Elasticsearch; + Parameters = parameters; + } + + /// Initializes a new instance of . + /// + /// The label for the type of an Azure chat extension. This typically corresponds to a matching Azure resource. + /// Azure chat extensions are only compatible with Azure OpenAI. + /// + /// Keeps track of any properties unknown to the library. + /// The parameters to use when configuring Elasticsearch®. + internal ElasticsearchChatExtensionConfiguration(AzureChatExtensionType type, IDictionary serializedAdditionalRawData, ElasticsearchChatExtensionParameters parameters) : base(type, serializedAdditionalRawData) + { + Parameters = parameters; + } + + /// Initializes a new instance of for deserialization. + internal ElasticsearchChatExtensionConfiguration() + { + } + + /// The parameters to use when configuring Elasticsearch®. + public ElasticsearchChatExtensionParameters Parameters { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatExtensionParameters.Serialization.cs similarity index 56% rename from sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.Serialization.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatExtensionParameters.Serialization.cs index 058247fcf132..5c4ae1822d0d 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatExtensionParameters.Serialization.cs @@ -1,99 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable using System; -using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.Core; -namespace Azure.AI.OpenAI.Chat +namespace Azure.AI.OpenAI { - internal partial class InternalElasticsearchChatDataSourceParameters : IJsonModel + public partial class ElasticsearchChatExtensionParameters : IUtf8JsonSerializable, IJsonModel { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(InternalElasticsearchChatDataSourceParameters)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ElasticsearchChatExtensionParameters)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("top_n_documents") != true && Optional.IsDefined(TopNDocuments)) + if (Optional.IsDefined(DocumentCount)) { writer.WritePropertyName("top_n_documents"u8); - writer.WriteNumberValue(TopNDocuments.Value); + writer.WriteNumberValue(DocumentCount.Value); } - if (SerializedAdditionalRawData?.ContainsKey("in_scope") != true && Optional.IsDefined(InScope)) + if (Optional.IsDefined(ShouldRestrictResultScope)) { writer.WritePropertyName("in_scope"u8); - writer.WriteBooleanValue(InScope.Value); + writer.WriteBooleanValue(ShouldRestrictResultScope.Value); } - if (SerializedAdditionalRawData?.ContainsKey("strictness") != true && Optional.IsDefined(Strictness)) + if (Optional.IsDefined(Strictness)) { writer.WritePropertyName("strictness"u8); writer.WriteNumberValue(Strictness.Value); } - if (SerializedAdditionalRawData?.ContainsKey("max_search_queries") != true && Optional.IsDefined(MaxSearchQueries)) + if (Optional.IsDefined(MaxSearchQueries)) { writer.WritePropertyName("max_search_queries"u8); writer.WriteNumberValue(MaxSearchQueries.Value); } - if (SerializedAdditionalRawData?.ContainsKey("allow_partial_result") != true && Optional.IsDefined(AllowPartialResult)) + if (Optional.IsDefined(AllowPartialResult)) { writer.WritePropertyName("allow_partial_result"u8); writer.WriteBooleanValue(AllowPartialResult.Value); } - if (SerializedAdditionalRawData?.ContainsKey("include_contexts") != true && Optional.IsCollectionDefined(_internalIncludeContexts)) + if (Optional.IsCollectionDefined(IncludeContexts)) { writer.WritePropertyName("include_contexts"u8); writer.WriteStartArray(); - foreach (var item in _internalIncludeContexts) + foreach (var item in IncludeContexts) { - writer.WriteStringValue(item); + writer.WriteStringValue(item.ToString()); } writer.WriteEndArray(); } - if (SerializedAdditionalRawData?.ContainsKey("endpoint") != true) - { - writer.WritePropertyName("endpoint"u8); - writer.WriteStringValue(Endpoint.AbsoluteUri); - } - if (SerializedAdditionalRawData?.ContainsKey("index_name") != true) - { - writer.WritePropertyName("index_name"u8); - writer.WriteStringValue(IndexName); - } - if (SerializedAdditionalRawData?.ContainsKey("authentication") != true) + if (Optional.IsDefined(Authentication)) { writer.WritePropertyName("authentication"u8); - writer.WriteObjectValue(Authentication, options); + writer.WriteObjectValue(Authentication, options); } - if (SerializedAdditionalRawData?.ContainsKey("fields_mapping") != true && Optional.IsDefined(FieldMappings)) + writer.WritePropertyName("endpoint"u8); + writer.WriteStringValue(Endpoint.AbsoluteUri); + writer.WritePropertyName("index_name"u8); + writer.WriteStringValue(IndexName); + if (Optional.IsDefined(FieldMappingOptions)) { writer.WritePropertyName("fields_mapping"u8); - writer.WriteObjectValue(FieldMappings, options); + writer.WriteObjectValue(FieldMappingOptions, options); } - if (SerializedAdditionalRawData?.ContainsKey("query_type") != true && Optional.IsDefined(QueryType)) + if (Optional.IsDefined(QueryType)) { writer.WritePropertyName("query_type"u8); writer.WriteStringValue(QueryType.Value.ToString()); } - if (SerializedAdditionalRawData?.ContainsKey("embedding_dependency") != true && Optional.IsDefined(VectorizationSource)) + if (Optional.IsDefined(EmbeddingDependency)) { writer.WritePropertyName("embedding_dependency"u8); - writer.WriteObjectValue(VectorizationSource, options); + writer.WriteObjectValue(EmbeddingDependency, options); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _serializedAdditionalRawData != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _serializedAdditionalRawData) { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -105,22 +108,21 @@ void IJsonModel.Write(Utf8JsonWri #endif } } - writer.WriteEndObject(); } - InternalElasticsearchChatDataSourceParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ElasticsearchChatExtensionParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(InternalElasticsearchChatDataSourceParameters)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ElasticsearchChatExtensionParameters)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInternalElasticsearchChatDataSourceParameters(document.RootElement, options); + return DeserializeElasticsearchChatExtensionParameters(document.RootElement, options); } - internal static InternalElasticsearchChatDataSourceParameters DeserializeInternalElasticsearchChatDataSourceParameters(JsonElement element, ModelReaderWriterOptions options = null) + internal static ElasticsearchChatExtensionParameters DeserializeElasticsearchChatExtensionParameters(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -133,13 +135,13 @@ internal static InternalElasticsearchChatDataSourceParameters DeserializeInterna int? strictness = default; int? maxSearchQueries = default; bool? allowPartialResult = default; - IList includeContexts = default; + IList includeContexts = default; + OnYourDataAuthenticationOptions authentication = default; Uri endpoint = default; string indexName = default; - DataSourceAuthentication authentication = default; - DataSourceFieldMappings fieldsMapping = default; - DataSourceQueryType? queryType = default; - DataSourceVectorizer embeddingDependency = default; + ElasticsearchIndexFieldMappingOptions fieldsMapping = default; + ElasticsearchQueryType? queryType = default; + OnYourDataVectorizationSource embeddingDependency = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -195,14 +197,23 @@ internal static InternalElasticsearchChatDataSourceParameters DeserializeInterna { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(item.GetString()); + array.Add(new OnYourDataContextProperty(item.GetString())); } includeContexts = array; continue; } + if (property.NameEquals("authentication"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authentication = OnYourDataAuthenticationOptions.DeserializeOnYourDataAuthenticationOptions(property.Value, options); + continue; + } if (property.NameEquals("endpoint"u8)) { endpoint = new Uri(property.Value.GetString()); @@ -213,18 +224,13 @@ internal static InternalElasticsearchChatDataSourceParameters DeserializeInterna indexName = property.Value.GetString(); continue; } - if (property.NameEquals("authentication"u8)) - { - authentication = DataSourceAuthentication.DeserializeDataSourceAuthentication(property.Value, options); - continue; - } if (property.NameEquals("fields_mapping"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - fieldsMapping = DataSourceFieldMappings.DeserializeDataSourceFieldMappings(property.Value, options); + fieldsMapping = ElasticsearchIndexFieldMappingOptions.DeserializeElasticsearchIndexFieldMappingOptions(property.Value, options); continue; } if (property.NameEquals("query_type"u8)) @@ -233,7 +239,7 @@ internal static InternalElasticsearchChatDataSourceParameters DeserializeInterna { continue; } - queryType = new DataSourceQueryType(property.Value.GetString()); + queryType = new ElasticsearchQueryType(property.Value.GetString()); continue; } if (property.NameEquals("embedding_dependency"u8)) @@ -242,75 +248,76 @@ internal static InternalElasticsearchChatDataSourceParameters DeserializeInterna { continue; } - embeddingDependency = DataSourceVectorizer.DeserializeDataSourceVectorizer(property.Value, options); + embeddingDependency = OnYourDataVectorizationSource.DeserializeOnYourDataVectorizationSource(property.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new InternalElasticsearchChatDataSourceParameters( + return new ElasticsearchChatExtensionParameters( topNDocuments, inScope, strictness, maxSearchQueries, allowPartialResult, - includeContexts ?? new ChangeTrackingList(), + includeContexts ?? new ChangeTrackingList(), + authentication, endpoint, indexName, - authentication, fieldsMapping, queryType, embeddingDependency, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(InternalElasticsearchChatDataSourceParameters)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ElasticsearchChatExtensionParameters)} does not support writing '{options.Format}' format."); } } - InternalElasticsearchChatDataSourceParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ElasticsearchChatExtensionParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInternalElasticsearchChatDataSourceParameters(document.RootElement, options); + return DeserializeElasticsearchChatExtensionParameters(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(InternalElasticsearchChatDataSourceParameters)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ElasticsearchChatExtensionParameters)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static InternalElasticsearchChatDataSourceParameters FromResponse(PipelineResponse response) + /// The response to deserialize the model from. + internal static ElasticsearchChatExtensionParameters FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalElasticsearchChatDataSourceParameters(document.RootElement); + return DeserializeElasticsearchChatExtensionParameters(document.RootElement); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// Convert into a . + internal virtual RequestContent ToRequestContent() { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatExtensionParameters.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatExtensionParameters.cs new file mode 100644 index 000000000000..ce7080e5d85f --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatExtensionParameters.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Parameters to use when configuring Elasticsearch® as an Azure OpenAI chat extension. The supported authentication types are KeyAndKeyId and EncodedAPIKey. + public partial class ElasticsearchChatExtensionParameters + { + /// + /// 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; + + /// Initializes a new instance of . + /// The endpoint of Elasticsearch®. + /// The index name of Elasticsearch®. + /// or is null. + public ElasticsearchChatExtensionParameters(Uri endpoint, string indexName) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(indexName, nameof(indexName)); + + IncludeContexts = new ChangeTrackingList(); + Endpoint = endpoint; + IndexName = indexName; + } + + /// Initializes a new instance of . + /// The configured top number of documents to feature for the configured query. + /// Whether queries should be restricted to use of indexed data. + /// The configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but lower recall of the answer. + /// + /// The max number of rewritten queries should be send to search provider for one user message. If not specified, + /// the system will decide the number of queries to send. + /// + /// + /// If specified as true, the system will allow partial search results to be used and the request fails if all the queries fail. + /// If not specified, or specified as false, the request will fail if any search query fails. + /// + /// The included properties of the output context. If not specified, the default value is `citations` and `intent`. + /// + /// The authentication method to use when accessing the defined data source. + /// Each data source type supports a specific set of available authentication methods; please see the documentation of + /// the data source for supported mechanisms. + /// If not otherwise provided, On Your Data will attempt to use System Managed Identity (default credential) + /// authentication. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , and . + /// + /// The endpoint of Elasticsearch®. + /// The index name of Elasticsearch®. + /// The index field mapping options of Elasticsearch®. + /// The query type of Elasticsearch®. + /// + /// The embedding dependency for vector search. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + /// Keeps track of any properties unknown to the library. + internal ElasticsearchChatExtensionParameters(int? documentCount, bool? shouldRestrictResultScope, int? strictness, int? maxSearchQueries, bool? allowPartialResult, IList includeContexts, OnYourDataAuthenticationOptions authentication, Uri endpoint, string indexName, ElasticsearchIndexFieldMappingOptions fieldMappingOptions, ElasticsearchQueryType? queryType, OnYourDataVectorizationSource embeddingDependency, IDictionary serializedAdditionalRawData) + { + DocumentCount = documentCount; + ShouldRestrictResultScope = shouldRestrictResultScope; + Strictness = strictness; + MaxSearchQueries = maxSearchQueries; + AllowPartialResult = allowPartialResult; + IncludeContexts = includeContexts; + Authentication = authentication; + Endpoint = endpoint; + IndexName = indexName; + FieldMappingOptions = fieldMappingOptions; + QueryType = queryType; + EmbeddingDependency = embeddingDependency; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ElasticsearchChatExtensionParameters() + { + } + + /// The configured top number of documents to feature for the configured query. + public int? DocumentCount { get; set; } + /// Whether queries should be restricted to use of indexed data. + public bool? ShouldRestrictResultScope { get; set; } + /// The configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but lower recall of the answer. + public int? Strictness { get; set; } + /// + /// The max number of rewritten queries should be send to search provider for one user message. If not specified, + /// the system will decide the number of queries to send. + /// + public int? MaxSearchQueries { get; set; } + /// + /// If specified as true, the system will allow partial search results to be used and the request fails if all the queries fail. + /// If not specified, or specified as false, the request will fail if any search query fails. + /// + public bool? AllowPartialResult { get; set; } + /// The included properties of the output context. If not specified, the default value is `citations` and `intent`. + public IList IncludeContexts { get; } + /// + /// The authentication method to use when accessing the defined data source. + /// Each data source type supports a specific set of available authentication methods; please see the documentation of + /// the data source for supported mechanisms. + /// If not otherwise provided, On Your Data will attempt to use System Managed Identity (default credential) + /// authentication. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , and . + /// + public OnYourDataAuthenticationOptions Authentication { get; set; } + /// The endpoint of Elasticsearch®. + public Uri Endpoint { get; } + /// The index name of Elasticsearch®. + public string IndexName { get; } + /// The index field mapping options of Elasticsearch®. + public ElasticsearchIndexFieldMappingOptions FieldMappingOptions { get; set; } + /// The query type of Elasticsearch®. + public ElasticsearchQueryType? QueryType { get; set; } + /// + /// The embedding dependency for vector search. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + public OnYourDataVectorizationSource EmbeddingDependency { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchIndexFieldMappingOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchIndexFieldMappingOptions.Serialization.cs new file mode 100644 index 000000000000..3bc44f546567 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchIndexFieldMappingOptions.Serialization.cs @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ElasticsearchIndexFieldMappingOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ElasticsearchIndexFieldMappingOptions)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(TitleFieldName)) + { + writer.WritePropertyName("title_field"u8); + writer.WriteStringValue(TitleFieldName); + } + if (Optional.IsDefined(UrlFieldName)) + { + writer.WritePropertyName("url_field"u8); + writer.WriteStringValue(UrlFieldName); + } + if (Optional.IsDefined(FilepathFieldName)) + { + writer.WritePropertyName("filepath_field"u8); + writer.WriteStringValue(FilepathFieldName); + } + if (Optional.IsCollectionDefined(ContentFieldNames)) + { + writer.WritePropertyName("content_fields"u8); + writer.WriteStartArray(); + foreach (var item in ContentFieldNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ContentFieldSeparator)) + { + writer.WritePropertyName("content_fields_separator"u8); + writer.WriteStringValue(ContentFieldSeparator); + } + if (Optional.IsCollectionDefined(VectorFieldNames)) + { + writer.WritePropertyName("vector_fields"u8); + writer.WriteStartArray(); + foreach (var item in VectorFieldNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ElasticsearchIndexFieldMappingOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ElasticsearchIndexFieldMappingOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeElasticsearchIndexFieldMappingOptions(document.RootElement, options); + } + + internal static ElasticsearchIndexFieldMappingOptions DeserializeElasticsearchIndexFieldMappingOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string titleField = default; + string urlField = default; + string filepathField = default; + IList contentFields = default; + string contentFieldsSeparator = default; + IList vectorFields = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("title_field"u8)) + { + titleField = property.Value.GetString(); + continue; + } + if (property.NameEquals("url_field"u8)) + { + urlField = property.Value.GetString(); + continue; + } + if (property.NameEquals("filepath_field"u8)) + { + filepathField = property.Value.GetString(); + continue; + } + if (property.NameEquals("content_fields"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + contentFields = array; + continue; + } + if (property.NameEquals("content_fields_separator"u8)) + { + contentFieldsSeparator = property.Value.GetString(); + continue; + } + if (property.NameEquals("vector_fields"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + vectorFields = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ElasticsearchIndexFieldMappingOptions( + titleField, + urlField, + filepathField, + contentFields ?? new ChangeTrackingList(), + contentFieldsSeparator, + vectorFields ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ElasticsearchIndexFieldMappingOptions)} does not support writing '{options.Format}' format."); + } + } + + ElasticsearchIndexFieldMappingOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeElasticsearchIndexFieldMappingOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ElasticsearchIndexFieldMappingOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ElasticsearchIndexFieldMappingOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeElasticsearchIndexFieldMappingOptions(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/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchIndexFieldMappingOptions.cs similarity index 52% rename from sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchIndexFieldMappingOptions.cs index 7a7d022310ae..6213ad25cb49 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchIndexFieldMappingOptions.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable @@ -5,10 +8,10 @@ using System; using System.Collections.Generic; -namespace Azure.AI.OpenAI.Chat +namespace Azure.AI.OpenAI { - /// The AzureSearchChatDataSourceParametersFieldsMapping. - public partial class DataSourceFieldMappings + /// Optional settings to control how fields are processed when using a configured Elasticsearch® resource. + public partial class ElasticsearchIndexFieldMappingOptions { /// /// Keeps track of any properties unknown to the library. @@ -40,27 +43,45 @@ public partial class DataSourceFieldMappings /// /// /// - internal IDictionary SerializedAdditionalRawData { get; set; } + private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . + public ElasticsearchIndexFieldMappingOptions() + { + ContentFieldNames = new ChangeTrackingList(); + VectorFieldNames = new ChangeTrackingList(); + } + + /// Initializes a new instance of . /// The name of the index field to use as a title. /// The name of the index field to use as a URL. - /// The name of the index field to use as a filepath. + /// The name of the index field to use as a filepath. /// The names of index fields that should be treated as content. /// The separator pattern that content fields should use. /// The names of fields that represent vector data. - /// The names of fields that represent image vector data. /// Keeps track of any properties unknown to the library. - internal DataSourceFieldMappings(string titleFieldName, string urlFieldName, string filePathFieldName, IList contentFieldNames, string contentFieldSeparator, IList vectorFieldNames, IList imageVectorFieldNames, IDictionary serializedAdditionalRawData) + internal ElasticsearchIndexFieldMappingOptions(string titleFieldName, string urlFieldName, string filepathFieldName, IList contentFieldNames, string contentFieldSeparator, IList vectorFieldNames, IDictionary serializedAdditionalRawData) { TitleFieldName = titleFieldName; UrlFieldName = urlFieldName; - FilePathFieldName = filePathFieldName; + FilepathFieldName = filepathFieldName; ContentFieldNames = contentFieldNames; ContentFieldSeparator = contentFieldSeparator; VectorFieldNames = vectorFieldNames; - ImageVectorFieldNames = imageVectorFieldNames; - SerializedAdditionalRawData = serializedAdditionalRawData; + _serializedAdditionalRawData = serializedAdditionalRawData; } + + /// The name of the index field to use as a title. + public string TitleFieldName { get; set; } + /// The name of the index field to use as a URL. + public string UrlFieldName { get; set; } + /// The name of the index field to use as a filepath. + public string FilepathFieldName { get; set; } + /// The names of index fields that should be treated as content. + public IList ContentFieldNames { get; } + /// The separator pattern that content fields should use. + public string ContentFieldSeparator { get; set; } + /// The names of fields that represent vector data. + public IList VectorFieldNames { get; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchQueryType.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchQueryType.cs new file mode 100644 index 000000000000..d8588a637f6d --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchQueryType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// The type of Elasticsearch® retrieval query that should be executed when using it as an Azure OpenAI chat extension. + public readonly partial struct ElasticsearchQueryType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ElasticsearchQueryType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SimpleValue = "simple"; + private const string VectorValue = "vector"; + + /// Represents the default, simple query parser. + public static ElasticsearchQueryType Simple { get; } = new ElasticsearchQueryType(SimpleValue); + /// Represents vector search over computed data. + public static ElasticsearchQueryType Vector { get; } = new ElasticsearchQueryType(VectorValue); + /// Determines if two values are the same. + public static bool operator ==(ElasticsearchQueryType left, ElasticsearchQueryType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ElasticsearchQueryType left, ElasticsearchQueryType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ElasticsearchQueryType(string value) => new ElasticsearchQueryType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ElasticsearchQueryType other && Equals(other); + /// + public bool Equals(ElasticsearchQueryType 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/openai/Azure.AI.OpenAI/src/Generated/EmbeddingEncodingFormat.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/EmbeddingEncodingFormat.cs new file mode 100644 index 000000000000..213af80cfdb5 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/EmbeddingEncodingFormat.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// Represents the available formats for embeddings data on responses. + public readonly partial struct EmbeddingEncodingFormat : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public EmbeddingEncodingFormat(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string FloatValue = "float"; + private const string Base64Value = "base64"; + + /// Specifies that responses should provide arrays of floats for each embedding. + public static EmbeddingEncodingFormat Float { get; } = new EmbeddingEncodingFormat(FloatValue); + /// Specifies that responses should provide a base64-encoded string for each embedding. + public static EmbeddingEncodingFormat Base64 { get; } = new EmbeddingEncodingFormat(Base64Value); + /// Determines if two values are the same. + public static bool operator ==(EmbeddingEncodingFormat left, EmbeddingEncodingFormat right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EmbeddingEncodingFormat left, EmbeddingEncodingFormat right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator EmbeddingEncodingFormat(string value) => new EmbeddingEncodingFormat(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EmbeddingEncodingFormat other && Equals(other); + /// + public bool Equals(EmbeddingEncodingFormat 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/MediaJobError.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/EmbeddingItem.Serialization.cs similarity index 56% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobError.Serialization.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/EmbeddingItem.Serialization.cs index c3fae6ec7856..f02e72d78dce 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobError.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/EmbeddingItem.Serialization.cs @@ -11,13 +11,13 @@ using System.Text.Json; using Azure.Core; -namespace Azure.Messaging.EventGrid.SystemEvents +namespace Azure.AI.OpenAI { - public partial class MediaJobError : IUtf8JsonSerializable, IJsonModel + internal partial class EmbeddingItem : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,30 +28,23 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpt /// 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobError)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(EmbeddingItem)} does not support writing '{format}' format."); } - writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code.ToString()); - if (Optional.IsDefined(Message)) - { - writer.WritePropertyName("message"u8); - writer.WriteStringValue(Message); - } - writer.WritePropertyName("category"u8); - writer.WriteStringValue(Category.ToString()); - writer.WritePropertyName("retry"u8); - writer.WriteStringValue(Retry.ToString()); - writer.WritePropertyName("details"u8); + writer.WritePropertyName("embedding"u8); writer.WriteStartArray(); - foreach (var item in Details) + foreach (var item in Embedding) { - writer.WriteObjectValue(item, options); + writer.WriteNumberValue(item); } writer.WriteEndArray(); + writer.WritePropertyName("index"u8); + writer.WriteNumberValue(Index); + writer.WritePropertyName("object"u8); + writer.WriteStringValue(Object.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -69,19 +62,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - MediaJobError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + EmbeddingItem IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobError)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(EmbeddingItem)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaJobError(document.RootElement, options); + return DeserializeEmbeddingItem(document.RootElement, options); } - internal static MediaJobError DeserializeMediaJobError(JsonElement element, ModelReaderWriterOptions options = null) + internal static EmbeddingItem DeserializeEmbeddingItem(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -89,43 +82,31 @@ internal static MediaJobError DeserializeMediaJobError(JsonElement element, Mode { return null; } - MediaJobErrorCode code = default; - string message = default; - MediaJobErrorCategory category = default; - MediaJobRetry retry = default; - IReadOnlyList details = default; + IReadOnlyList embedding = default; + int index = default; + EmbeddingItemObject @object = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("code"u8)) - { - code = new MediaJobErrorCode(property.Value.GetString()); - continue; - } - if (property.NameEquals("message"u8)) - { - message = property.Value.GetString(); - continue; - } - if (property.NameEquals("category"u8)) + if (property.NameEquals("embedding"u8)) { - category = new MediaJobErrorCategory(property.Value.GetString()); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetSingle()); + } + embedding = array; continue; } - if (property.NameEquals("retry"u8)) + if (property.NameEquals("index"u8)) { - retry = new MediaJobRetry(property.Value.GetString()); + index = property.Value.GetInt32(); continue; } - if (property.NameEquals("details"u8)) + if (property.NameEquals("object"u8)) { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(MediaJobErrorDetail.DeserializeMediaJobErrorDetail(item, options)); - } - details = array; + @object = new EmbeddingItemObject(property.Value.GetString()); continue; } if (options.Format != "W") @@ -134,52 +115,46 @@ internal static MediaJobError DeserializeMediaJobError(JsonElement element, Mode } } serializedAdditionalRawData = rawDataDictionary; - return new MediaJobError( - code, - message, - category, - retry, - details, - serializedAdditionalRawData); + return new EmbeddingItem(embedding, index, @object, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MediaJobError)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(EmbeddingItem)} does not support writing '{options.Format}' format."); } } - MediaJobError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + EmbeddingItem IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaJobError(document.RootElement, options); + return DeserializeEmbeddingItem(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MediaJobError)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(EmbeddingItem)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static MediaJobError FromResponse(Response response) + internal static EmbeddingItem FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaJobError(document.RootElement); + return DeserializeEmbeddingItem(document.RootElement); } /// Convert into a . diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/EmbeddingItem.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/EmbeddingItem.cs new file mode 100644 index 000000000000..047042d2c0f5 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/EmbeddingItem.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.OpenAI +{ + /// Representation of a single embeddings relatedness comparison. + internal partial class EmbeddingItem + { + /// + /// 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; + + /// Initializes a new instance of . + /// + /// List of embeddings value for the input prompt. These represent a measurement of the + /// vector-based relatedness of the provided input. + /// + /// Index of the prompt to which the EmbeddingItem corresponds. + /// is null. + internal EmbeddingItem(IEnumerable embedding, int index) + { + Argument.AssertNotNull(embedding, nameof(embedding)); + + Embedding = embedding.ToList(); + Index = index; + } + + /// Initializes a new instance of . + /// + /// List of embeddings value for the input prompt. These represent a measurement of the + /// vector-based relatedness of the provided input. + /// + /// Index of the prompt to which the EmbeddingItem corresponds. + /// The object type which is always 'embedding'. + /// Keeps track of any properties unknown to the library. + internal EmbeddingItem(IReadOnlyList embedding, int index, EmbeddingItemObject @object, IDictionary serializedAdditionalRawData) + { + Embedding = embedding; + Index = index; + Object = @object; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EmbeddingItem() + { + } + + /// + /// List of embeddings value for the input prompt. These represent a measurement of the + /// vector-based relatedness of the provided input. + /// + public IReadOnlyList Embedding { get; } + /// Index of the prompt to which the EmbeddingItem corresponds. + public int Index { get; } + /// The object type which is always 'embedding'. + public EmbeddingItemObject Object { get; } = EmbeddingItemObject.Embedding; + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/EmbeddingItemObject.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/EmbeddingItemObject.cs new file mode 100644 index 000000000000..6d8867c0c41e --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/EmbeddingItemObject.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// The EmbeddingItem_object. + internal readonly partial struct EmbeddingItemObject : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public EmbeddingItemObject(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EmbeddingValue = "embedding"; + + /// embedding. + public static EmbeddingItemObject Embedding { get; } = new EmbeddingItemObject(EmbeddingValue); + /// Determines if two values are the same. + public static bool operator ==(EmbeddingItemObject left, EmbeddingItemObject right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EmbeddingItemObject left, EmbeddingItemObject right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator EmbeddingItemObject(string value) => new EmbeddingItemObject(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EmbeddingItemObject other && Equals(other); + /// + public bool Equals(EmbeddingItemObject 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/openai/Azure.AI.OpenAI/src/Generated/Embeddings.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Embeddings.Serialization.cs new file mode 100644 index 000000000000..243e35d7b6dc --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/Embeddings.Serialization.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + internal partial class Embeddings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenAI.Embeddings)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("data"u8); + writer.WriteStartArray(); + foreach (var item in Data) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("usage"u8); + writer.WriteObjectValue(Usage, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OpenAI.Embeddings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenAI.Embeddings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return OpenAI.Embeddings.DeserializeEmbeddings(document.RootElement, options); + } + + internal static OpenAI.Embeddings DeserializeEmbeddings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList data = default; + EmbeddingsUsage usage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("data"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EmbeddingItem.DeserializeEmbeddingItem(item, options)); + } + data = array; + continue; + } + if (property.NameEquals("usage"u8)) + { + usage = EmbeddingsUsage.DeserializeEmbeddingsUsage(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OpenAI.Embeddings(data, usage, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OpenAI.Embeddings)} does not support writing '{options.Format}' format."); + } + } + + OpenAI.Embeddings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return OpenAI.Embeddings.DeserializeEmbeddings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OpenAI.Embeddings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static OpenAI.Embeddings FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return OpenAI.Embeddings.DeserializeEmbeddings(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/MediaJobOutputProgressEventData.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Embeddings.cs similarity index 50% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProgressEventData.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/Embeddings.cs index ea1d37aa0f91..f6c3403bd45e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProgressEventData.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/Embeddings.cs @@ -7,14 +7,16 @@ using System; using System.Collections.Generic; +using System.Linq; -namespace Azure.Messaging.EventGrid.SystemEvents +namespace Azure.AI.OpenAI { /// - /// Job Output Progress Event Data. Schema of the Data property of an - /// EventGridEvent for a Microsoft.Media.JobOutputProgress event. + /// Representation of the response data from an embeddings request. + /// Embeddings measure the relatedness of text strings and are commonly used for search, clustering, + /// recommendations, and other similar scenarios. /// - public partial class MediaJobOutputProgressEventData + internal partial class Embeddings { /// /// Keeps track of any properties unknown to the library. @@ -48,39 +50,38 @@ public partial class MediaJobOutputProgressEventData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// Gets the Job correlation data. - /// is null. - internal MediaJobOutputProgressEventData(IReadOnlyDictionary jobCorrelationData) + /// Initializes a new instance of . + /// Embedding values for the prompts submitted in the request. + /// Usage counts for tokens input using the embeddings API. + /// or is null. + internal Embeddings(IEnumerable data, EmbeddingsUsage usage) { - Argument.AssertNotNull(jobCorrelationData, nameof(jobCorrelationData)); + Argument.AssertNotNull(data, nameof(data)); + Argument.AssertNotNull(usage, nameof(usage)); - JobCorrelationData = jobCorrelationData; + Data = data.ToList(); + Usage = usage; } - /// Initializes a new instance of . - /// Gets the Job output label. - /// Gets the Job output progress. - /// Gets the Job correlation data. + /// Initializes a new instance of . + /// Embedding values for the prompts submitted in the request. + /// Usage counts for tokens input using the embeddings API. /// Keeps track of any properties unknown to the library. - internal MediaJobOutputProgressEventData(string label, long? progress, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) + internal Embeddings(IReadOnlyList data, EmbeddingsUsage usage, IDictionary serializedAdditionalRawData) { - Label = label; - Progress = progress; - JobCorrelationData = jobCorrelationData; + Data = data; + Usage = usage; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal MediaJobOutputProgressEventData() + /// Initializes a new instance of for deserialization. + internal Embeddings() { } - /// Gets the Job output label. - public string Label { get; } - /// Gets the Job output progress. - public long? Progress { get; } - /// Gets the Job correlation data. - public IReadOnlyDictionary JobCorrelationData { get; } + /// Embedding values for the prompts submitted in the request. + public IReadOnlyList Data { get; } + /// Usage counts for tokens input using the embeddings API. + public EmbeddingsUsage Usage { get; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/EmbeddingsOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/EmbeddingsOptions.Serialization.cs new file mode 100644 index 000000000000..556494b1a0e5 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/EmbeddingsOptions.Serialization.cs @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class EmbeddingsOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(EmbeddingsOptions)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(User)) + { + writer.WritePropertyName("user"u8); + writer.WriteStringValue(User); + } + if (Optional.IsDefined(DeploymentName)) + { + writer.WritePropertyName("model"u8); + writer.WriteStringValue(DeploymentName); + } + writer.WritePropertyName("input"u8); + writer.WriteStartArray(); + foreach (var item in Input) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(EncodingFormat)) + { + writer.WritePropertyName("encoding_format"u8); + writer.WriteStringValue(EncodingFormat.Value.ToString()); + } + if (Optional.IsDefined(Dimensions)) + { + writer.WritePropertyName("dimensions"u8); + writer.WriteNumberValue(Dimensions.Value); + } + if (Optional.IsDefined(InputType)) + { + writer.WritePropertyName("input_type"u8); + writer.WriteStringValue(InputType); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EmbeddingsOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EmbeddingsOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEmbeddingsOptions(document.RootElement, options); + } + + internal static EmbeddingsOptions DeserializeEmbeddingsOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string user = default; + string model = default; + IList input = default; + EmbeddingEncodingFormat? encodingFormat = default; + int? dimensions = default; + string inputType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("user"u8)) + { + user = property.Value.GetString(); + continue; + } + if (property.NameEquals("model"u8)) + { + model = property.Value.GetString(); + continue; + } + if (property.NameEquals("input"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + input = array; + continue; + } + if (property.NameEquals("encoding_format"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encodingFormat = new EmbeddingEncodingFormat(property.Value.GetString()); + continue; + } + if (property.NameEquals("dimensions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dimensions = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("input_type"u8)) + { + inputType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EmbeddingsOptions( + user, + model, + input, + encodingFormat, + dimensions, + inputType, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EmbeddingsOptions)} does not support writing '{options.Format}' format."); + } + } + + EmbeddingsOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEmbeddingsOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EmbeddingsOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static EmbeddingsOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeEmbeddingsOptions(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/openai/Azure.AI.OpenAI/src/Generated/EmbeddingsOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/EmbeddingsOptions.cs new file mode 100644 index 000000000000..7a25f39f4f5a --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/EmbeddingsOptions.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.OpenAI +{ + /// + /// The configuration information for an embeddings request. + /// Embeddings measure the relatedness of text strings and are commonly used for search, clustering, + /// recommendations, and other similar scenarios. + /// + public partial class EmbeddingsOptions + { + /// + /// 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; + + /// Initializes a new instance of . + /// + /// Input texts to get embeddings for, encoded as a an array of strings. + /// Each input must not exceed 2048 tokens in length. + /// + /// Unless you are embedding code, we suggest replacing newlines (\n) in your input with a single space, + /// as we have observed inferior results when newlines are present. + /// + /// is null. + public EmbeddingsOptions(IEnumerable input) + { + Argument.AssertNotNull(input, nameof(input)); + + Input = input.ToList(); + } + + /// Initializes a new instance of . + /// + /// An identifier for the caller or end user of the operation. This may be used for tracking + /// or rate-limiting purposes. + /// + /// + /// The model name to provide as part of this embeddings request. + /// Not applicable to Azure OpenAI, where deployment information should be included in the Azure + /// resource URI that's connected to. + /// + /// + /// Input texts to get embeddings for, encoded as a an array of strings. + /// Each input must not exceed 2048 tokens in length. + /// + /// Unless you are embedding code, we suggest replacing newlines (\n) in your input with a single space, + /// as we have observed inferior results when newlines are present. + /// + /// The response encoding format to use for embedding data. + /// The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models. + /// When using Azure OpenAI, specifies the input type to use for embedding search. + /// Keeps track of any properties unknown to the library. + internal EmbeddingsOptions(string user, string deploymentName, IList input, EmbeddingEncodingFormat? encodingFormat, int? dimensions, string inputType, IDictionary serializedAdditionalRawData) + { + User = user; + DeploymentName = deploymentName; + Input = input; + EncodingFormat = encodingFormat; + Dimensions = dimensions; + InputType = inputType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EmbeddingsOptions() + { + } + + /// + /// An identifier for the caller or end user of the operation. This may be used for tracking + /// or rate-limiting purposes. + /// + public string User { get; set; } + /// + /// The model name to provide as part of this embeddings request. + /// Not applicable to Azure OpenAI, where deployment information should be included in the Azure + /// resource URI that's connected to. + /// + public string DeploymentName { get; set; } + /// + /// Input texts to get embeddings for, encoded as a an array of strings. + /// Each input must not exceed 2048 tokens in length. + /// + /// Unless you are embedding code, we suggest replacing newlines (\n) in your input with a single space, + /// as we have observed inferior results when newlines are present. + /// + public IList Input { get; } + /// The response encoding format to use for embedding data. + public EmbeddingEncodingFormat? EncodingFormat { get; set; } + /// The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models. + public int? Dimensions { get; set; } + /// When using Azure OpenAI, specifies the input type to use for embedding search. + public string InputType { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/EmbeddingsUsage.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/EmbeddingsUsage.Serialization.cs new file mode 100644 index 000000000000..b87dc7d5fe1e --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/EmbeddingsUsage.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + internal partial class EmbeddingsUsage : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(EmbeddingsUsage)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("prompt_tokens"u8); + writer.WriteNumberValue(PromptTokens); + writer.WritePropertyName("total_tokens"u8); + writer.WriteNumberValue(TotalTokens); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EmbeddingsUsage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EmbeddingsUsage)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEmbeddingsUsage(document.RootElement, options); + } + + internal static EmbeddingsUsage DeserializeEmbeddingsUsage(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int promptTokens = default; + int totalTokens = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("prompt_tokens"u8)) + { + promptTokens = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("total_tokens"u8)) + { + totalTokens = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EmbeddingsUsage(promptTokens, totalTokens, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EmbeddingsUsage)} does not support writing '{options.Format}' format."); + } + } + + EmbeddingsUsage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEmbeddingsUsage(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EmbeddingsUsage)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static EmbeddingsUsage FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeEmbeddingsUsage(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/openai/Azure.AI.OpenAI/src/Generated/EmbeddingsUsage.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/EmbeddingsUsage.cs new file mode 100644 index 000000000000..00f0ce06d636 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/EmbeddingsUsage.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Measurement of the amount of tokens used in this request and response. + internal partial class EmbeddingsUsage + { + /// + /// 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; + + /// Initializes a new instance of . + /// Number of tokens sent in the original request. + /// Total number of tokens transacted in this request/response. + internal EmbeddingsUsage(int promptTokens, int totalTokens) + { + PromptTokens = promptTokens; + TotalTokens = totalTokens; + } + + /// Initializes a new instance of . + /// Number of tokens sent in the original request. + /// Total number of tokens transacted in this request/response. + /// Keeps track of any properties unknown to the library. + internal EmbeddingsUsage(int promptTokens, int totalTokens, IDictionary serializedAdditionalRawData) + { + PromptTokens = promptTokens; + TotalTokens = totalTokens; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EmbeddingsUsage() + { + } + + /// Number of tokens sent in the original request. + public int PromptTokens { get; } + /// Total number of tokens transacted in this request/response. + public int TotalTokens { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/FileDeletionStatus.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/FileDeletionStatus.Serialization.cs new file mode 100644 index 000000000000..0782bdfede84 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/FileDeletionStatus.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class FileDeletionStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(FileDeletionStatus)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("deleted"u8); + writer.WriteBooleanValue(Deleted); + writer.WritePropertyName("object"u8); + writer.WriteStringValue(Object.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FileDeletionStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FileDeletionStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFileDeletionStatus(document.RootElement, options); + } + + internal static FileDeletionStatus DeserializeFileDeletionStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + bool deleted = default; + FileDeletionStatusObject @object = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("deleted"u8)) + { + deleted = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("object"u8)) + { + @object = new FileDeletionStatusObject(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FileDeletionStatus(id, deleted, @object, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FileDeletionStatus)} does not support writing '{options.Format}' format."); + } + } + + FileDeletionStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFileDeletionStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FileDeletionStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static FileDeletionStatus FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFileDeletionStatus(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/openai/Azure.AI.OpenAI/src/Generated/FileDeletionStatus.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/FileDeletionStatus.cs new file mode 100644 index 000000000000..1ffbf9b3ebf9 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/FileDeletionStatus.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// A status response from a file deletion operation. + public partial class FileDeletionStatus + { + /// + /// 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; + + /// Initializes a new instance of . + /// The ID of the resource specified for deletion. + /// A value indicating whether deletion was successful. + /// is null. + internal FileDeletionStatus(string id, bool deleted) + { + Argument.AssertNotNull(id, nameof(id)); + + Id = id; + Deleted = deleted; + } + + /// Initializes a new instance of . + /// The ID of the resource specified for deletion. + /// A value indicating whether deletion was successful. + /// The object type, which is always 'file'. + /// Keeps track of any properties unknown to the library. + internal FileDeletionStatus(string id, bool deleted, FileDeletionStatusObject @object, IDictionary serializedAdditionalRawData) + { + Id = id; + Deleted = deleted; + Object = @object; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FileDeletionStatus() + { + } + + /// The ID of the resource specified for deletion. + public string Id { get; } + /// A value indicating whether deletion was successful. + public bool Deleted { get; } + /// The object type, which is always 'file'. + public FileDeletionStatusObject Object { get; } = FileDeletionStatusObject.File; + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/FileDeletionStatusObject.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/FileDeletionStatusObject.cs new file mode 100644 index 000000000000..7023f72b90f5 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/FileDeletionStatusObject.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// The FileDeletionStatus_object. + public readonly partial struct FileDeletionStatusObject : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FileDeletionStatusObject(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string FileValue = "file"; + + /// file. + public static FileDeletionStatusObject File { get; } = new FileDeletionStatusObject(FileValue); + /// Determines if two values are the same. + public static bool operator ==(FileDeletionStatusObject left, FileDeletionStatusObject right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FileDeletionStatusObject left, FileDeletionStatusObject right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator FileDeletionStatusObject(string value) => new FileDeletionStatusObject(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FileDeletionStatusObject other && Equals(other); + /// + public bool Equals(FileDeletionStatusObject 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/openai/Azure.AI.OpenAI/src/Generated/FileListResponse.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/FileListResponse.Serialization.cs new file mode 100644 index 000000000000..4a08fd9db4b7 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/FileListResponse.Serialization.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class FileListResponse : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(FileListResponse)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("object"u8); + writer.WriteStringValue(Object.ToString()); + writer.WritePropertyName("data"u8); + writer.WriteStartArray(); + foreach (var item in Data) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FileListResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FileListResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFileListResponse(document.RootElement, options); + } + + internal static FileListResponse DeserializeFileListResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FileListResponseObject @object = default; + IReadOnlyList data = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("object"u8)) + { + @object = new FileListResponseObject(property.Value.GetString()); + continue; + } + if (property.NameEquals("data"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OpenAIFile.DeserializeOpenAIFile(item, options)); + } + data = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FileListResponse(@object, data, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FileListResponse)} does not support writing '{options.Format}' format."); + } + } + + FileListResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFileListResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FileListResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static FileListResponse FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFileListResponse(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/openai/Azure.AI.OpenAI/src/Generated/FileListResponse.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/FileListResponse.cs new file mode 100644 index 000000000000..bcd03986f3fc --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/FileListResponse.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.OpenAI +{ + /// The response data from a file list operation. + public partial class FileListResponse + { + /// + /// 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; + + /// Initializes a new instance of . + /// The files returned for the request. + /// is null. + internal FileListResponse(IEnumerable data) + { + Argument.AssertNotNull(data, nameof(data)); + + Data = data.ToList(); + } + + /// Initializes a new instance of . + /// The object type, which is always 'list'. + /// The files returned for the request. + /// Keeps track of any properties unknown to the library. + internal FileListResponse(FileListResponseObject @object, IReadOnlyList data, IDictionary serializedAdditionalRawData) + { + Object = @object; + Data = data; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FileListResponse() + { + } + + /// The object type, which is always 'list'. + public FileListResponseObject Object { get; } = FileListResponseObject.List; + + /// The files returned for the request. + public IReadOnlyList Data { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/FileListResponseObject.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/FileListResponseObject.cs new file mode 100644 index 000000000000..4d72d8c6702d --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/FileListResponseObject.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// The FileListResponse_object. + public readonly partial struct FileListResponseObject : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FileListResponseObject(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ListValue = "list"; + + /// list. + public static FileListResponseObject List { get; } = new FileListResponseObject(ListValue); + /// Determines if two values are the same. + public static bool operator ==(FileListResponseObject left, FileListResponseObject right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FileListResponseObject left, FileListResponseObject right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator FileListResponseObject(string value) => new FileListResponseObject(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FileListResponseObject other && Equals(other); + /// + public bool Equals(FileListResponseObject 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/openai/Azure.AI.OpenAI/src/Generated/FilePurpose.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/FilePurpose.cs new file mode 100644 index 000000000000..a77cbe48fa1b --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/FilePurpose.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// The possible values denoting the intended usage of a file. + public readonly partial struct FilePurpose : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FilePurpose(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string FineTuneValue = "fine-tune"; + private const string FineTuneResultsValue = "fine-tune-results"; + private const string AssistantsValue = "assistants"; + private const string AssistantsOutputValue = "assistants_output"; + private const string BatchValue = "batch"; + private const string BatchOutputValue = "batch_output"; + private const string VisionValue = "vision"; + + /// Indicates a file is used for fine tuning input. + public static FilePurpose FineTune { get; } = new FilePurpose(FineTuneValue); + /// Indicates a file is used for fine tuning results. + public static FilePurpose FineTuneResults { get; } = new FilePurpose(FineTuneResultsValue); + /// Indicates a file is used as input to assistants. + public static FilePurpose Assistants { get; } = new FilePurpose(AssistantsValue); + /// Indicates a file is used as output by assistants. + public static FilePurpose AssistantsOutput { get; } = new FilePurpose(AssistantsOutputValue); + /// Indicates a file is used as input to . + public static FilePurpose Batch { get; } = new FilePurpose(BatchValue); + /// Indicates a file is used as output by a vector store batch operation. + public static FilePurpose BatchOutput { get; } = new FilePurpose(BatchOutputValue); + /// Indicates a file is used as input to a vision operation. + public static FilePurpose Vision { get; } = new FilePurpose(VisionValue); + /// Determines if two values are the same. + public static bool operator ==(FilePurpose left, FilePurpose right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FilePurpose left, FilePurpose right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator FilePurpose(string value) => new FilePurpose(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FilePurpose other && Equals(other); + /// + public bool Equals(FilePurpose 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/openai/Azure.AI.OpenAI/src/Generated/FileState.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/FileState.cs new file mode 100644 index 000000000000..637802d9dee3 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/FileState.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// The state of the file. + public readonly partial struct FileState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FileState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UploadedValue = "uploaded"; + private const string PendingValue = "pending"; + private const string RunningValue = "running"; + private const string ProcessedValue = "processed"; + private const string ErrorValue = "error"; + private const string DeletingValue = "deleting"; + private const string DeletedValue = "deleted"; + + /// + /// The file has been uploaded but it's not yet processed. This state is not returned by Azure OpenAI and exposed only for + /// compatibility. It can be categorized as an inactive state. + /// + public static FileState Uploaded { get; } = new FileState(UploadedValue); + /// The operation was created and is not queued to be processed in the future. It can be categorized as an inactive state. + public static FileState Pending { get; } = new FileState(PendingValue); + /// The operation has started to be processed. It can be categorized as an active state. + public static FileState Running { get; } = new FileState(RunningValue); + /// The operation has successfully processed and is ready for consumption. It can be categorized as a terminal state. + public static FileState Processed { get; } = new FileState(ProcessedValue); + /// The operation has completed processing with a failure and cannot be further consumed. It can be categorized as a terminal state. + public static FileState Error { get; } = new FileState(ErrorValue); + /// + /// The entity is in the process to be deleted. This state is not returned by Azure OpenAI and exposed only for compatibility. + /// It can be categorized as an active state. + /// + public static FileState Deleting { get; } = new FileState(DeletingValue); + /// + /// The entity has been deleted but may still be referenced by other entities predating the deletion. It can be categorized as a + /// terminal state. + /// + public static FileState Deleted { get; } = new FileState(DeletedValue); + /// Determines if two values are the same. + public static bool operator ==(FileState left, FileState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FileState left, FileState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator FileState(string value) => new FileState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FileState other && Equals(other); + /// + public bool Equals(FileState 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/openai/Azure.AI.OpenAI/src/Generated/FunctionCall.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/FunctionCall.Serialization.cs new file mode 100644 index 000000000000..8432c162692d --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/FunctionCall.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class FunctionCall : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(FunctionCall)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("arguments"u8); + writer.WriteStringValue(Arguments); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FunctionCall IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FunctionCall)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFunctionCall(document.RootElement, options); + } + + internal static FunctionCall DeserializeFunctionCall(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string arguments = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("arguments"u8)) + { + arguments = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FunctionCall(name, arguments, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FunctionCall)} does not support writing '{options.Format}' format."); + } + } + + FunctionCall IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFunctionCall(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FunctionCall)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static FunctionCall FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFunctionCall(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/openai/Azure.AI.OpenAI/src/Generated/FunctionCall.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/FunctionCall.cs new file mode 100644 index 000000000000..2a2534aebe1e --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/FunctionCall.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// The name and arguments of a function that should be called, as generated by the model. + public partial class FunctionCall + { + /// + /// 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; + + /// Initializes a new instance of . + /// The name of the function to call. + /// + /// The arguments to call the function with, as generated by the model in JSON format. + /// Note that the model does not always generate valid JSON, and may hallucinate parameters + /// not defined by your function schema. Validate the arguments in your code before calling + /// your function. + /// + /// or is null. + public FunctionCall(string name, string arguments) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(arguments, nameof(arguments)); + + Name = name; + Arguments = arguments; + } + + /// Initializes a new instance of . + /// The name of the function to call. + /// + /// The arguments to call the function with, as generated by the model in JSON format. + /// Note that the model does not always generate valid JSON, and may hallucinate parameters + /// not defined by your function schema. Validate the arguments in your code before calling + /// your function. + /// + /// Keeps track of any properties unknown to the library. + internal FunctionCall(string name, string arguments, IDictionary serializedAdditionalRawData) + { + Name = name; + Arguments = arguments; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FunctionCall() + { + } + + /// The name of the function to call. + public string Name { get; set; } + /// + /// The arguments to call the function with, as generated by the model in JSON format. + /// Note that the model does not always generate valid JSON, and may hallucinate parameters + /// not defined by your function schema. Validate the arguments in your code before calling + /// your function. + /// + public string Arguments { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/FunctionCallPreset.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/FunctionCallPreset.cs new file mode 100644 index 000000000000..6e15f0039916 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/FunctionCallPreset.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// + /// The collection of predefined behaviors for handling request-provided function information in a chat completions + /// operation. + /// + public readonly partial struct FunctionCallPreset : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FunctionCallPreset(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AutoValue = "auto"; + private const string NoneValue = "none"; + + /// + /// Specifies that the model may either use any of the functions provided in this chat completions request or + /// instead return a standard chat completions response as if no functions were provided. + /// + public static FunctionCallPreset Auto { get; } = new FunctionCallPreset(AutoValue); + /// + /// Specifies that the model should not respond with a function call and should instead provide a standard chat + /// completions response. Response content may still be influenced by the provided function information. + /// + public static FunctionCallPreset None { get; } = new FunctionCallPreset(NoneValue); + /// Determines if two values are the same. + public static bool operator ==(FunctionCallPreset left, FunctionCallPreset right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FunctionCallPreset left, FunctionCallPreset right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator FunctionCallPreset(string value) => new FunctionCallPreset(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FunctionCallPreset other && Equals(other); + /// + public bool Equals(FunctionCallPreset 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/openai/Azure.AI.OpenAI/src/Generated/FunctionDefinition.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/FunctionDefinition.Serialization.cs new file mode 100644 index 000000000000..8bb45a88c663 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/FunctionDefinition.Serialization.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class FunctionDefinition : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(FunctionDefinition)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(Parameters)) + { + writer.WritePropertyName("parameters"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Parameters); +#else + using (JsonDocument document = JsonDocument.Parse(Parameters)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FunctionDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FunctionDefinition)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFunctionDefinition(document.RootElement, options); + } + + internal static FunctionDefinition DeserializeFunctionDefinition(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string description = default; + BinaryData parameters = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("parameters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + parameters = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FunctionDefinition(name, description, parameters, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FunctionDefinition)} does not support writing '{options.Format}' format."); + } + } + + FunctionDefinition IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFunctionDefinition(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FunctionDefinition)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static FunctionDefinition FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFunctionDefinition(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/openai/Azure.AI.OpenAI/src/Generated/FunctionDefinition.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/FunctionDefinition.cs new file mode 100644 index 000000000000..1de7bfba323c --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/FunctionDefinition.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// The definition of a caller-specified function that chat completions may invoke in response to matching user input. + public partial class FunctionDefinition + { + /// + /// 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; + + /// Initializes a new instance of . + /// The name of the function to be called. + /// is null. + public FunctionDefinition(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of . + /// The name of the function to be called. + /// + /// A description of what the function does. The model will use this description when selecting the function and + /// interpreting its parameters. + /// + /// The parameters the function accepts, described as a JSON Schema object. + /// Keeps track of any properties unknown to the library. + internal FunctionDefinition(string name, string description, BinaryData parameters, IDictionary serializedAdditionalRawData) + { + Name = name; + Description = description; + Parameters = parameters; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FunctionDefinition() + { + } + + /// The name of the function to be called. + public string Name { get; } + /// + /// A description of what the function does. The model will use this description when selecting the function and + /// interpreting its parameters. + /// + public string Description { get; set; } + /// + /// The parameters the function accepts, described as a JSON Schema object. + /// + /// To assign an object to 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" }. + /// + /// + /// + /// + public BinaryData Parameters { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/FunctionName.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/FunctionName.Serialization.cs new file mode 100644 index 000000000000..3f9c6cf67328 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/FunctionName.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class FunctionName : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(FunctionName)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FunctionName IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FunctionName)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFunctionName(document.RootElement, options); + } + + internal static FunctionName DeserializeFunctionName(JsonElement element, ModelReaderWriterOptions options = null) + { + 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()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FunctionName(name, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FunctionName)} does not support writing '{options.Format}' format."); + } + } + + FunctionName IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFunctionName(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FunctionName)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static FunctionName FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFunctionName(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/openai/Azure.AI.OpenAI/src/Generated/FunctionName.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/FunctionName.cs new file mode 100644 index 000000000000..14ca22fb4973 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/FunctionName.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// + /// A structure that specifies the exact name of a specific, request-provided function to use when processing a chat + /// completions operation. + /// + public partial class FunctionName + { + /// + /// 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; + + /// Initializes a new instance of . + /// The name of the function to call. + /// is null. + public FunctionName(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of . + /// The name of the function to call. + /// Keeps track of any properties unknown to the library. + internal FunctionName(string name, IDictionary serializedAdditionalRawData) + { + Name = name; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FunctionName() + { + } + + /// The name of the function to call. + public string Name { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationContentFilterResults.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationContentFilterResults.Serialization.cs new file mode 100644 index 000000000000..41fed347c4da --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationContentFilterResults.Serialization.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ImageGenerationContentFilterResults : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImageGenerationContentFilterResults)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Sexual)) + { + writer.WritePropertyName("sexual"u8); + writer.WriteObjectValue(Sexual, options); + } + if (Optional.IsDefined(Violence)) + { + writer.WritePropertyName("violence"u8); + writer.WriteObjectValue(Violence, options); + } + if (Optional.IsDefined(Hate)) + { + writer.WritePropertyName("hate"u8); + writer.WriteObjectValue(Hate, options); + } + if (Optional.IsDefined(SelfHarm)) + { + writer.WritePropertyName("self_harm"u8); + writer.WriteObjectValue(SelfHarm, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ImageGenerationContentFilterResults IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImageGenerationContentFilterResults)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImageGenerationContentFilterResults(document.RootElement, options); + } + + internal static ImageGenerationContentFilterResults DeserializeImageGenerationContentFilterResults(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ContentFilterResult sexual = default; + ContentFilterResult violence = default; + ContentFilterResult hate = default; + ContentFilterResult selfHarm = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sexual"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sexual = ContentFilterResult.DeserializeContentFilterResult(property.Value, options); + continue; + } + if (property.NameEquals("violence"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + violence = ContentFilterResult.DeserializeContentFilterResult(property.Value, options); + continue; + } + if (property.NameEquals("hate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hate = ContentFilterResult.DeserializeContentFilterResult(property.Value, options); + continue; + } + if (property.NameEquals("self_harm"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + selfHarm = ContentFilterResult.DeserializeContentFilterResult(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ImageGenerationContentFilterResults(sexual, violence, hate, selfHarm, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ImageGenerationContentFilterResults)} does not support writing '{options.Format}' format."); + } + } + + ImageGenerationContentFilterResults IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeImageGenerationContentFilterResults(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImageGenerationContentFilterResults)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ImageGenerationContentFilterResults FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeImageGenerationContentFilterResults(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/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationContentFilterResults.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationContentFilterResults.cs new file mode 100644 index 000000000000..a9dd21aaaa9d --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationContentFilterResults.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Describes the content filtering result for the image generation request. + public partial class ImageGenerationContentFilterResults + { + /// + /// 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; + + /// Initializes a new instance of . + internal ImageGenerationContentFilterResults() + { + } + + /// Initializes a new instance of . + /// + /// Describes language related to anatomical organs and genitals, romantic relationships, + /// acts portrayed in erotic or affectionate terms, physical sexual acts, including + /// those portrayed as an assault or a forced sexual violent act against one’s will, + /// prostitution, pornography, and abuse. + /// + /// + /// Describes language related to physical actions intended to hurt, injure, damage, or + /// kill someone or something; describes weapons, etc. + /// + /// + /// Describes language attacks or uses that include pejorative or discriminatory language + /// with reference to a person or identity group on the basis of certain differentiating + /// attributes of these groups including but not limited to race, ethnicity, nationality, + /// gender identity and expression, sexual orientation, religion, immigration status, ability + /// status, personal appearance, and body size. + /// + /// + /// Describes language related to physical actions intended to purposely hurt, injure, + /// or damage one’s body, or kill oneself. + /// + /// Keeps track of any properties unknown to the library. + internal ImageGenerationContentFilterResults(ContentFilterResult sexual, ContentFilterResult violence, ContentFilterResult hate, ContentFilterResult selfHarm, IDictionary serializedAdditionalRawData) + { + Sexual = sexual; + Violence = violence; + Hate = hate; + SelfHarm = selfHarm; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Describes language related to anatomical organs and genitals, romantic relationships, + /// acts portrayed in erotic or affectionate terms, physical sexual acts, including + /// those portrayed as an assault or a forced sexual violent act against one’s will, + /// prostitution, pornography, and abuse. + /// + public ContentFilterResult Sexual { get; } + /// + /// Describes language related to physical actions intended to hurt, injure, damage, or + /// kill someone or something; describes weapons, etc. + /// + public ContentFilterResult Violence { get; } + /// + /// Describes language attacks or uses that include pejorative or discriminatory language + /// with reference to a person or identity group on the basis of certain differentiating + /// attributes of these groups including but not limited to race, ethnicity, nationality, + /// gender identity and expression, sexual orientation, religion, immigration status, ability + /// status, personal appearance, and body size. + /// + public ContentFilterResult Hate { get; } + /// + /// Describes language related to physical actions intended to purposely hurt, injure, + /// or damage one’s body, or kill oneself. + /// + public ContentFilterResult SelfHarm { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationData.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationData.Serialization.cs new file mode 100644 index 000000000000..8ed222504518 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationData.Serialization.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ImageGenerationData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImageGenerationData)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Url)) + { + writer.WritePropertyName("url"u8); + writer.WriteStringValue(Url.AbsoluteUri); + } + if (Optional.IsDefined(Base64Data)) + { + writer.WritePropertyName("b64_json"u8); + writer.WriteStringValue(Base64Data); + } + if (Optional.IsDefined(ContentFilterResults)) + { + writer.WritePropertyName("content_filter_results"u8); + writer.WriteObjectValue(ContentFilterResults, options); + } + if (Optional.IsDefined(RevisedPrompt)) + { + writer.WritePropertyName("revised_prompt"u8); + writer.WriteStringValue(RevisedPrompt); + } + if (Optional.IsDefined(PromptFilterResults)) + { + writer.WritePropertyName("prompt_filter_results"u8); + writer.WriteObjectValue(PromptFilterResults, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ImageGenerationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImageGenerationData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImageGenerationData(document.RootElement, options); + } + + internal static ImageGenerationData DeserializeImageGenerationData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri url = default; + string b64Json = default; + ImageGenerationContentFilterResults contentFilterResults = default; + string revisedPrompt = default; + ImageGenerationPromptFilterResults promptFilterResults = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("url"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + url = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("b64_json"u8)) + { + b64Json = property.Value.GetString(); + continue; + } + if (property.NameEquals("content_filter_results"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + contentFilterResults = ImageGenerationContentFilterResults.DeserializeImageGenerationContentFilterResults(property.Value, options); + continue; + } + if (property.NameEquals("revised_prompt"u8)) + { + revisedPrompt = property.Value.GetString(); + continue; + } + if (property.NameEquals("prompt_filter_results"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + promptFilterResults = ImageGenerationPromptFilterResults.DeserializeImageGenerationPromptFilterResults(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ImageGenerationData( + url, + b64Json, + contentFilterResults, + revisedPrompt, + promptFilterResults, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ImageGenerationData)} does not support writing '{options.Format}' format."); + } + } + + ImageGenerationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeImageGenerationData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImageGenerationData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ImageGenerationData FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeImageGenerationData(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/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationData.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationData.cs new file mode 100644 index 000000000000..63091f309bba --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationData.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// + /// A representation of a single generated image, provided as either base64-encoded data or as a URL from which the image + /// may be retrieved. + /// + public partial class ImageGenerationData + { + /// + /// 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; + + /// Initializes a new instance of . + internal ImageGenerationData() + { + } + + /// Initializes a new instance of . + /// The URL that provides temporary access to download the generated image. + /// The complete data for an image, represented as a base64-encoded string. + /// Information about the content filtering results. + /// + /// The final prompt used by the model to generate the image. + /// Only provided with dall-3-models and only when revisions were made to the prompt. + /// + /// + /// Information about the content filtering category (hate, sexual, violence, self_harm), if + /// it has been detected, as well as the severity level (very_low, low, medium, high-scale + /// that determines the intensity and risk level of harmful content) and if it has been + /// filtered or not. Information about jailbreak content and profanity, if it has been detected, + /// and if it has been filtered or not. And information about customer block list, if it has + /// been filtered and its id. + /// + /// Keeps track of any properties unknown to the library. + internal ImageGenerationData(Uri url, string base64Data, ImageGenerationContentFilterResults contentFilterResults, string revisedPrompt, ImageGenerationPromptFilterResults promptFilterResults, IDictionary serializedAdditionalRawData) + { + Url = url; + Base64Data = base64Data; + ContentFilterResults = contentFilterResults; + RevisedPrompt = revisedPrompt; + PromptFilterResults = promptFilterResults; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The URL that provides temporary access to download the generated image. + public Uri Url { get; } + /// The complete data for an image, represented as a base64-encoded string. + public string Base64Data { get; } + /// Information about the content filtering results. + public ImageGenerationContentFilterResults ContentFilterResults { get; } + /// + /// The final prompt used by the model to generate the image. + /// Only provided with dall-3-models and only when revisions were made to the prompt. + /// + public string RevisedPrompt { get; } + /// + /// Information about the content filtering category (hate, sexual, violence, self_harm), if + /// it has been detected, as well as the severity level (very_low, low, medium, high-scale + /// that determines the intensity and risk level of harmful content) and if it has been + /// filtered or not. Information about jailbreak content and profanity, if it has been detected, + /// and if it has been filtered or not. And information about customer block list, if it has + /// been filtered and its id. + /// + public ImageGenerationPromptFilterResults PromptFilterResults { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationOptions.Serialization.cs new file mode 100644 index 000000000000..f3f66ad3800f --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationOptions.Serialization.cs @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ImageGenerationOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImageGenerationOptions)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DeploymentName)) + { + writer.WritePropertyName("model"u8); + writer.WriteStringValue(DeploymentName); + } + writer.WritePropertyName("prompt"u8); + writer.WriteStringValue(Prompt); + if (Optional.IsDefined(ImageCount)) + { + writer.WritePropertyName("n"u8); + writer.WriteNumberValue(ImageCount.Value); + } + if (Optional.IsDefined(Size)) + { + writer.WritePropertyName("size"u8); + writer.WriteStringValue(Size.Value.ToString()); + } + if (Optional.IsDefined(ResponseFormat)) + { + writer.WritePropertyName("response_format"u8); + writer.WriteStringValue(ResponseFormat.Value.ToString()); + } + if (Optional.IsDefined(Quality)) + { + writer.WritePropertyName("quality"u8); + writer.WriteStringValue(Quality.Value.ToString()); + } + if (Optional.IsDefined(Style)) + { + writer.WritePropertyName("style"u8); + writer.WriteStringValue(Style.Value.ToString()); + } + if (Optional.IsDefined(User)) + { + writer.WritePropertyName("user"u8); + writer.WriteStringValue(User); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ImageGenerationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImageGenerationOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImageGenerationOptions(document.RootElement, options); + } + + internal static ImageGenerationOptions DeserializeImageGenerationOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string model = default; + string prompt = default; + int? n = default; + ImageSize? size = default; + ImageGenerationResponseFormat? responseFormat = default; + ImageGenerationQuality? quality = default; + ImageGenerationStyle? style = default; + string user = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("model"u8)) + { + model = property.Value.GetString(); + continue; + } + if (property.NameEquals("prompt"u8)) + { + prompt = property.Value.GetString(); + continue; + } + if (property.NameEquals("n"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + n = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("size"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + size = new ImageSize(property.Value.GetString()); + continue; + } + if (property.NameEquals("response_format"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + responseFormat = new ImageGenerationResponseFormat(property.Value.GetString()); + continue; + } + if (property.NameEquals("quality"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + quality = new ImageGenerationQuality(property.Value.GetString()); + continue; + } + if (property.NameEquals("style"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + style = new ImageGenerationStyle(property.Value.GetString()); + continue; + } + if (property.NameEquals("user"u8)) + { + user = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ImageGenerationOptions( + model, + prompt, + n, + size, + responseFormat, + quality, + style, + user, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ImageGenerationOptions)} does not support writing '{options.Format}' format."); + } + } + + ImageGenerationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeImageGenerationOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImageGenerationOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ImageGenerationOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeImageGenerationOptions(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/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationOptions.cs new file mode 100644 index 000000000000..d5756901ef45 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationOptions.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Represents the request data used to generate images. + public partial class ImageGenerationOptions + { + /// + /// 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; + + /// Initializes a new instance of . + /// A description of the desired images. + /// is null. + public ImageGenerationOptions(string prompt) + { + Argument.AssertNotNull(prompt, nameof(prompt)); + + Prompt = prompt; + } + + /// Initializes a new instance of . + /// + /// The model name or Azure OpenAI model deployment name to use for image generation. If not specified, dall-e-2 will be + /// inferred as a default. + /// + /// A description of the desired images. + /// + /// The number of images to generate. + /// Dall-e-2 models support values between 1 and 10. + /// Dall-e-3 models only support a value of 1. + /// + /// + /// The desired dimensions for generated images. + /// Dall-e-2 models support 256x256, 512x512, or 1024x1024. + /// Dall-e-3 models support 1024x1024, 1792x1024, or 1024x1792. + /// + /// The format in which image generation response items should be presented. + /// + /// The desired image generation quality level to use. + /// Only configurable with dall-e-3 models. + /// + /// + /// The desired image generation style to use. + /// Only configurable with dall-e-3 models. + /// + /// A unique identifier representing your end-user, which can help to monitor and detect abuse. + /// Keeps track of any properties unknown to the library. + internal ImageGenerationOptions(string deploymentName, string prompt, int? imageCount, ImageSize? size, ImageGenerationResponseFormat? responseFormat, ImageGenerationQuality? quality, ImageGenerationStyle? style, string user, IDictionary serializedAdditionalRawData) + { + DeploymentName = deploymentName; + Prompt = prompt; + ImageCount = imageCount; + Size = size; + ResponseFormat = responseFormat; + Quality = quality; + Style = style; + User = user; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ImageGenerationOptions() + { + } + + /// + /// The model name or Azure OpenAI model deployment name to use for image generation. If not specified, dall-e-2 will be + /// inferred as a default. + /// + public string DeploymentName { get; set; } + /// A description of the desired images. + public string Prompt { get; set; } + /// + /// The number of images to generate. + /// Dall-e-2 models support values between 1 and 10. + /// Dall-e-3 models only support a value of 1. + /// + public int? ImageCount { get; set; } + /// + /// The desired dimensions for generated images. + /// Dall-e-2 models support 256x256, 512x512, or 1024x1024. + /// Dall-e-3 models support 1024x1024, 1792x1024, or 1024x1792. + /// + public ImageSize? Size { get; set; } + /// The format in which image generation response items should be presented. + public ImageGenerationResponseFormat? ResponseFormat { get; set; } + /// + /// The desired image generation quality level to use. + /// Only configurable with dall-e-3 models. + /// + public ImageGenerationQuality? Quality { get; set; } + /// + /// The desired image generation style to use. + /// Only configurable with dall-e-3 models. + /// + public ImageGenerationStyle? Style { get; set; } + /// A unique identifier representing your end-user, which can help to monitor and detect abuse. + public string User { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestImageContentFilterResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationPromptFilterResults.Serialization.cs similarity index 56% rename from sdk/openai/Azure.AI.OpenAI/src/Generated/RequestImageContentFilterResult.Serialization.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationPromptFilterResults.Serialization.cs index 150a5f9d7775..29224e525a31 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestImageContentFilterResult.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationPromptFilterResults.Serialization.cs @@ -1,69 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable using System; -using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.Core; namespace Azure.AI.OpenAI { - public partial class RequestImageContentFilterResult : IJsonModel + public partial class ImageGenerationPromptFilterResults : IUtf8JsonSerializable, IJsonModel { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(RequestImageContentFilterResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ImageGenerationPromptFilterResults)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("profanity") != true && Optional.IsDefined(Profanity)) - { - writer.WritePropertyName("profanity"u8); - writer.WriteObjectValue(Profanity, options); - } - if (SerializedAdditionalRawData?.ContainsKey("custom_blocklists") != true && Optional.IsDefined(CustomBlocklists)) - { - writer.WritePropertyName("custom_blocklists"u8); - writer.WriteObjectValue(CustomBlocklists, options); - } - if (SerializedAdditionalRawData?.ContainsKey("jailbreak") != true) - { - writer.WritePropertyName("jailbreak"u8); - writer.WriteObjectValue(Jailbreak, options); - } - if (SerializedAdditionalRawData?.ContainsKey("sexual") != true && Optional.IsDefined(Sexual)) + if (Optional.IsDefined(Sexual)) { writer.WritePropertyName("sexual"u8); writer.WriteObjectValue(Sexual, options); } - if (SerializedAdditionalRawData?.ContainsKey("violence") != true && Optional.IsDefined(Violence)) + if (Optional.IsDefined(Violence)) { writer.WritePropertyName("violence"u8); writer.WriteObjectValue(Violence, options); } - if (SerializedAdditionalRawData?.ContainsKey("hate") != true && Optional.IsDefined(Hate)) + if (Optional.IsDefined(Hate)) { writer.WritePropertyName("hate"u8); writer.WriteObjectValue(Hate, options); } - if (SerializedAdditionalRawData?.ContainsKey("self_harm") != true && Optional.IsDefined(SelfHarm)) + if (Optional.IsDefined(SelfHarm)) { writer.WritePropertyName("self_harm"u8); writer.WriteObjectValue(SelfHarm, options); } - if (SerializedAdditionalRawData != null) + if (Optional.IsDefined(Profanity)) + { + writer.WritePropertyName("profanity"u8); + writer.WriteObjectValue(Profanity, options); + } + if (Optional.IsDefined(Jailbreak)) + { + writer.WritePropertyName("jailbreak"u8); + writer.WriteObjectValue(Jailbreak, options); + } + if (Optional.IsDefined(CustomBlocklists)) + { + writer.WritePropertyName("custom_blocklists"u8); + writer.WriteObjectValue(CustomBlocklists, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _serializedAdditionalRawData) { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -75,22 +84,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo #endif } } - writer.WriteEndObject(); } - RequestImageContentFilterResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ImageGenerationPromptFilterResults IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(RequestImageContentFilterResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ImageGenerationPromptFilterResults)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRequestImageContentFilterResult(document.RootElement, options); + return DeserializeImageGenerationPromptFilterResults(document.RootElement, options); } - internal static RequestImageContentFilterResult DeserializeRequestImageContentFilterResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static ImageGenerationPromptFilterResults DeserializeImageGenerationPromptFilterResults(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -98,137 +106,142 @@ internal static RequestImageContentFilterResult DeserializeRequestImageContentFi { return null; } + ContentFilterResult sexual = default; + ContentFilterResult violence = default; + ContentFilterResult hate = default; + ContentFilterResult selfHarm = default; ContentFilterDetectionResult profanity = default; - ContentFilterBlocklistResult customBlocklists = default; ContentFilterDetectionResult jailbreak = default; - ContentFilterSeverityResult sexual = default; - ContentFilterSeverityResult violence = default; - ContentFilterSeverityResult hate = default; - ContentFilterSeverityResult selfHarm = default; + ContentFilterDetailedResults customBlocklists = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("profanity"u8)) + if (property.NameEquals("sexual"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - profanity = ContentFilterDetectionResult.DeserializeContentFilterDetectionResult(property.Value, options); + sexual = ContentFilterResult.DeserializeContentFilterResult(property.Value, options); continue; } - if (property.NameEquals("custom_blocklists"u8)) + if (property.NameEquals("violence"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - customBlocklists = ContentFilterBlocklistResult.DeserializeContentFilterBlocklistResult(property.Value, options); + violence = ContentFilterResult.DeserializeContentFilterResult(property.Value, options); continue; } - if (property.NameEquals("jailbreak"u8)) + if (property.NameEquals("hate"u8)) { - jailbreak = ContentFilterDetectionResult.DeserializeContentFilterDetectionResult(property.Value, options); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hate = ContentFilterResult.DeserializeContentFilterResult(property.Value, options); continue; } - if (property.NameEquals("sexual"u8)) + if (property.NameEquals("self_harm"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - sexual = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); + selfHarm = ContentFilterResult.DeserializeContentFilterResult(property.Value, options); continue; } - if (property.NameEquals("violence"u8)) + if (property.NameEquals("profanity"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - violence = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); + profanity = ContentFilterDetectionResult.DeserializeContentFilterDetectionResult(property.Value, options); continue; } - if (property.NameEquals("hate"u8)) + if (property.NameEquals("jailbreak"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - hate = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); + jailbreak = ContentFilterDetectionResult.DeserializeContentFilterDetectionResult(property.Value, options); continue; } - if (property.NameEquals("self_harm"u8)) + if (property.NameEquals("custom_blocklists"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - selfHarm = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); + customBlocklists = ContentFilterDetailedResults.DeserializeContentFilterDetailedResults(property.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new RequestImageContentFilterResult( + return new ImageGenerationPromptFilterResults( sexual, violence, hate, selfHarm, - serializedAdditionalRawData, profanity, + jailbreak, customBlocklists, - jailbreak); + serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(RequestImageContentFilterResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ImageGenerationPromptFilterResults)} does not support writing '{options.Format}' format."); } } - RequestImageContentFilterResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ImageGenerationPromptFilterResults IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRequestImageContentFilterResult(document.RootElement, options); + return DeserializeImageGenerationPromptFilterResults(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(RequestImageContentFilterResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ImageGenerationPromptFilterResults)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new RequestImageContentFilterResult FromResponse(PipelineResponse response) + /// The response to deserialize the model from. + internal static ImageGenerationPromptFilterResults FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeRequestImageContentFilterResult(document.RootElement); + return DeserializeImageGenerationPromptFilterResults(document.RootElement); } - /// Convert into a . - internal override BinaryContent ToBinaryContent() + /// Convert into a . + internal virtual RequestContent ToRequestContent() { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationPromptFilterResults.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationPromptFilterResults.cs new file mode 100644 index 000000000000..e66c52bc7c1f --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationPromptFilterResults.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Describes the content filtering results for the prompt of a image generation request. + public partial class ImageGenerationPromptFilterResults + { + /// + /// 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; + + /// Initializes a new instance of . + internal ImageGenerationPromptFilterResults() + { + } + + /// Initializes a new instance of . + /// + /// Describes language related to anatomical organs and genitals, romantic relationships, + /// acts portrayed in erotic or affectionate terms, physical sexual acts, including + /// those portrayed as an assault or a forced sexual violent act against one’s will, + /// prostitution, pornography, and abuse. + /// + /// + /// Describes language related to physical actions intended to hurt, injure, damage, or + /// kill someone or something; describes weapons, etc. + /// + /// + /// Describes language attacks or uses that include pejorative or discriminatory language + /// with reference to a person or identity group on the basis of certain differentiating + /// attributes of these groups including but not limited to race, ethnicity, nationality, + /// gender identity and expression, sexual orientation, religion, immigration status, ability + /// status, personal appearance, and body size. + /// + /// + /// Describes language related to physical actions intended to purposely hurt, injure, + /// or damage one’s body, or kill oneself. + /// + /// Describes whether profanity was detected. + /// Whether a jailbreak attempt was detected in the prompt. + /// Information about customer block lists and if something was detected the associated list ID. + /// Keeps track of any properties unknown to the library. + internal ImageGenerationPromptFilterResults(ContentFilterResult sexual, ContentFilterResult violence, ContentFilterResult hate, ContentFilterResult selfHarm, ContentFilterDetectionResult profanity, ContentFilterDetectionResult jailbreak, ContentFilterDetailedResults customBlocklists, IDictionary serializedAdditionalRawData) + { + Sexual = sexual; + Violence = violence; + Hate = hate; + SelfHarm = selfHarm; + Profanity = profanity; + Jailbreak = jailbreak; + CustomBlocklists = customBlocklists; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Describes language related to anatomical organs and genitals, romantic relationships, + /// acts portrayed in erotic or affectionate terms, physical sexual acts, including + /// those portrayed as an assault or a forced sexual violent act against one’s will, + /// prostitution, pornography, and abuse. + /// + public ContentFilterResult Sexual { get; } + /// + /// Describes language related to physical actions intended to hurt, injure, damage, or + /// kill someone or something; describes weapons, etc. + /// + public ContentFilterResult Violence { get; } + /// + /// Describes language attacks or uses that include pejorative or discriminatory language + /// with reference to a person or identity group on the basis of certain differentiating + /// attributes of these groups including but not limited to race, ethnicity, nationality, + /// gender identity and expression, sexual orientation, religion, immigration status, ability + /// status, personal appearance, and body size. + /// + public ContentFilterResult Hate { get; } + /// + /// Describes language related to physical actions intended to purposely hurt, injure, + /// or damage one’s body, or kill oneself. + /// + public ContentFilterResult SelfHarm { get; } + /// Describes whether profanity was detected. + public ContentFilterDetectionResult Profanity { get; } + /// Whether a jailbreak attempt was detected in the prompt. + public ContentFilterDetectionResult Jailbreak { get; } + /// Information about customer block lists and if something was detected the associated list ID. + public ContentFilterDetailedResults CustomBlocklists { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationQuality.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationQuality.cs new file mode 100644 index 000000000000..31d282d1a6db --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationQuality.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// + /// An image generation configuration that specifies how the model should prioritize quality, cost, and speed. + /// Only configurable with dall-e-3 models. + /// + public readonly partial struct ImageGenerationQuality : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ImageGenerationQuality(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StandardValue = "standard"; + private const string HdValue = "hd"; + + /// Requests image generation with standard, balanced characteristics of quality, cost, and speed. + public static ImageGenerationQuality Standard { get; } = new ImageGenerationQuality(StandardValue); + /// Requests image generation with higher quality, higher cost and lower speed relative to standard. + public static ImageGenerationQuality Hd { get; } = new ImageGenerationQuality(HdValue); + /// Determines if two values are the same. + public static bool operator ==(ImageGenerationQuality left, ImageGenerationQuality right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ImageGenerationQuality left, ImageGenerationQuality right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ImageGenerationQuality(string value) => new ImageGenerationQuality(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ImageGenerationQuality other && Equals(other); + /// + public bool Equals(ImageGenerationQuality 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/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationResponseFormat.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationResponseFormat.cs new file mode 100644 index 000000000000..b4445f444a22 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationResponseFormat.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// The format in which the generated images are returned. + internal readonly partial struct ImageGenerationResponseFormat : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ImageGenerationResponseFormat(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UrlValue = "url"; + private const string Base64Value = "b64_json"; + + /// Image generation response items should provide a URL from which the image may be retrieved. + public static ImageGenerationResponseFormat Url { get; } = new ImageGenerationResponseFormat(UrlValue); + /// Image generation response items should provide image data as a base64-encoded string. + public static ImageGenerationResponseFormat Base64 { get; } = new ImageGenerationResponseFormat(Base64Value); + /// Determines if two values are the same. + public static bool operator ==(ImageGenerationResponseFormat left, ImageGenerationResponseFormat right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ImageGenerationResponseFormat left, ImageGenerationResponseFormat right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ImageGenerationResponseFormat(string value) => new ImageGenerationResponseFormat(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ImageGenerationResponseFormat other && Equals(other); + /// + public bool Equals(ImageGenerationResponseFormat 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/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationStyle.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationStyle.cs new file mode 100644 index 000000000000..800d3ae8e5bf --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationStyle.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// + /// An image generation configuration that specifies how the model should incorporate realism and other visual characteristics. + /// Only configurable with dall-e-3 models. + /// + public readonly partial struct ImageGenerationStyle : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ImageGenerationStyle(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NaturalValue = "natural"; + private const string VividValue = "vivid"; + + /// Requests image generation in a natural style with less preference for dramatic and hyper-realistic characteristics. + public static ImageGenerationStyle Natural { get; } = new ImageGenerationStyle(NaturalValue); + /// + /// Requests image generation in a vivid style with a higher preference for dramatic and hyper-realistic + /// characteristics. + /// + public static ImageGenerationStyle Vivid { get; } = new ImageGenerationStyle(VividValue); + /// Determines if two values are the same. + public static bool operator ==(ImageGenerationStyle left, ImageGenerationStyle right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ImageGenerationStyle left, ImageGenerationStyle right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ImageGenerationStyle(string value) => new ImageGenerationStyle(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ImageGenerationStyle other && Equals(other); + /// + public bool Equals(ImageGenerationStyle 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/openai/Azure.AI.OpenAI/src/Generated/ImageGenerations.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerations.Serialization.cs new file mode 100644 index 000000000000..024f1d2d24da --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerations.Serialization.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class ImageGenerations : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImageGenerations)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("created"u8); + writer.WriteNumberValue(Created, "U"); + writer.WritePropertyName("data"u8); + writer.WriteStartArray(); + foreach (var item in Data) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ImageGenerations IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImageGenerations)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImageGenerations(document.RootElement, options); + } + + internal static ImageGenerations DeserializeImageGenerations(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset created = default; + IReadOnlyList data = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("created"u8)) + { + created = DateTimeOffset.FromUnixTimeSeconds(property.Value.GetInt64()); + continue; + } + if (property.NameEquals("data"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ImageGenerationData.DeserializeImageGenerationData(item, options)); + } + data = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ImageGenerations(created, data, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ImageGenerations)} does not support writing '{options.Format}' format."); + } + } + + ImageGenerations IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeImageGenerations(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImageGenerations)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ImageGenerations FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeImageGenerations(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/openai/Azure.AI.OpenAI/src/Generated/ImageGenerations.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerations.cs new file mode 100644 index 000000000000..66823f093e60 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerations.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.OpenAI +{ + /// The result of a successful image generation operation. + public partial class ImageGenerations + { + /// + /// 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; + + /// Initializes a new instance of . + /// + /// A timestamp representing when this operation was started. + /// Expressed in seconds since the Unix epoch of 1970-01-01T00:00:00+0000. + /// + /// The images generated by the operation. + /// is null. + internal ImageGenerations(DateTimeOffset created, IEnumerable data) + { + Argument.AssertNotNull(data, nameof(data)); + + Created = created; + Data = data.ToList(); + } + + /// Initializes a new instance of . + /// + /// A timestamp representing when this operation was started. + /// Expressed in seconds since the Unix epoch of 1970-01-01T00:00:00+0000. + /// + /// The images generated by the operation. + /// Keeps track of any properties unknown to the library. + internal ImageGenerations(DateTimeOffset created, IReadOnlyList data, IDictionary serializedAdditionalRawData) + { + Created = created; + Data = data; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ImageGenerations() + { + } + + /// + /// A timestamp representing when this operation was started. + /// Expressed in seconds since the Unix epoch of 1970-01-01T00:00:00+0000. + /// + public DateTimeOffset Created { get; } + /// The images generated by the operation. + public IReadOnlyList Data { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageSize.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageSize.cs new file mode 100644 index 000000000000..46b72f092ac6 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageSize.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// The desired size of generated images. + public readonly partial struct ImageSize : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ImageSize(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string Size256x256Value = "256x256"; + private const string Size512x512Value = "512x512"; + private const string Size1024x1024Value = "1024x1024"; + private const string Size1792x1024Value = "1792x1024"; + private const string Size1024x1792Value = "1024x1792"; + + /// + /// Very small image size of 256x256 pixels. + /// Only supported with dall-e-2 models. + /// + public static ImageSize Size256x256 { get; } = new ImageSize(Size256x256Value); + /// + /// A smaller image size of 512x512 pixels. + /// Only supported with dall-e-2 models. + /// + public static ImageSize Size512x512 { get; } = new ImageSize(Size512x512Value); + /// + /// A standard, square image size of 1024x1024 pixels. + /// Supported by both dall-e-2 and dall-e-3 models. + /// + public static ImageSize Size1024x1024 { get; } = new ImageSize(Size1024x1024Value); + /// + /// A wider image size of 1024x1792 pixels. + /// Only supported with dall-e-3 models. + /// + public static ImageSize Size1792x1024 { get; } = new ImageSize(Size1792x1024Value); + /// + /// A taller image size of 1792x1024 pixels. + /// Only supported with dall-e-3 models. + /// + public static ImageSize Size1024x1792 { get; } = new ImageSize(Size1024x1792Value); + /// Determines if two values are the same. + public static bool operator ==(ImageSize left, ImageSize right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ImageSize left, ImageSize right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ImageSize(string value) => new ImageSize(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ImageSize other && Equals(other); + /// + public bool Equals(ImageSize 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/openai/Azure.AI.OpenAI/src/Generated/Internal/Argument.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/Argument.cs index 5a8ab138b061..21077f384b16 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/Argument.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/Argument.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/BinaryContentHelper.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/BinaryContentHelper.cs deleted file mode 100644 index 94ae48ee4fd1..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/BinaryContentHelper.cs +++ /dev/null @@ -1,133 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI -{ - internal static class BinaryContentHelper - { - public static BinaryContent FromEnumerable(IEnumerable enumerable) - where T : notnull - { - Utf8JsonBinaryContent content = new Utf8JsonBinaryContent(); - content.JsonWriter.WriteStartArray(); - foreach (var item in enumerable) - { - content.JsonWriter.WriteObjectValue(item, ModelSerializationExtensions.WireOptions); - } - content.JsonWriter.WriteEndArray(); - - return content; - } - - public static BinaryContent FromEnumerable(IEnumerable enumerable) - { - Utf8JsonBinaryContent content = new Utf8JsonBinaryContent(); - content.JsonWriter.WriteStartArray(); - foreach (var item in enumerable) - { - if (item == null) - { - content.JsonWriter.WriteNullValue(); - } - else - { -#if NET6_0_OR_GREATER - content.JsonWriter.WriteRawValue(item); -#else - using (JsonDocument document = JsonDocument.Parse(item)) - { - JsonSerializer.Serialize(content.JsonWriter, document.RootElement); - } -#endif - } - } - content.JsonWriter.WriteEndArray(); - - return content; - } - - public static BinaryContent FromEnumerable(ReadOnlySpan span) - where T : notnull - { - Utf8JsonBinaryContent content = new Utf8JsonBinaryContent(); - content.JsonWriter.WriteStartArray(); - for (int i = 0; i < span.Length; i++) - { - content.JsonWriter.WriteObjectValue(span[i], ModelSerializationExtensions.WireOptions); - } - content.JsonWriter.WriteEndArray(); - - return content; - } - - public static BinaryContent FromDictionary(IDictionary dictionary) - where TValue : notnull - { - Utf8JsonBinaryContent content = new Utf8JsonBinaryContent(); - content.JsonWriter.WriteStartObject(); - foreach (var item in dictionary) - { - content.JsonWriter.WritePropertyName(item.Key); - content.JsonWriter.WriteObjectValue(item.Value, ModelSerializationExtensions.WireOptions); - } - content.JsonWriter.WriteEndObject(); - - return content; - } - - public static BinaryContent FromDictionary(IDictionary dictionary) - { - Utf8JsonBinaryContent content = new Utf8JsonBinaryContent(); - content.JsonWriter.WriteStartObject(); - foreach (var item in dictionary) - { - content.JsonWriter.WritePropertyName(item.Key); - if (item.Value == null) - { - content.JsonWriter.WriteNullValue(); - } - else - { -#if NET6_0_OR_GREATER - content.JsonWriter.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(content.JsonWriter, document.RootElement); - } -#endif - } - } - content.JsonWriter.WriteEndObject(); - - return content; - } - - public static BinaryContent FromObject(object value) - { - Utf8JsonBinaryContent content = new Utf8JsonBinaryContent(); - content.JsonWriter.WriteObjectValue(value, ModelSerializationExtensions.WireOptions); - return content; - } - - public static BinaryContent FromObject(BinaryData value) - { - Utf8JsonBinaryContent content = new Utf8JsonBinaryContent(); -#if NET6_0_OR_GREATER - content.JsonWriter.WriteRawValue(value); -#else - using (JsonDocument document = JsonDocument.Parse(value)) - { - JsonSerializer.Serialize(content.JsonWriter, document.RootElement); - } -#endif - return content; - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ChangeTrackingDictionary.cs index 058e71abee85..8bd92c447cd8 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ChangeTrackingDictionary.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ChangeTrackingList.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ChangeTrackingList.cs index 9c6986a3ad4a..b06e0a43ffe7 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ChangeTrackingList.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ChangeTrackingList.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ClientPipelineExtensions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ClientPipelineExtensions.cs deleted file mode 100644 index e1d028882494..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ClientPipelineExtensions.cs +++ /dev/null @@ -1,41 +0,0 @@ -// - -#nullable disable - -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Threading.Tasks; - -namespace Azure.AI.OpenAI -{ - internal static partial class ClientPipelineExtensions - { - public static async ValueTask> ProcessHeadAsBoolMessageAsync(this ClientPipeline pipeline, PipelineMessage message, RequestOptions options) - { - PipelineResponse response = await pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false); - switch (response.Status) - { - case >= 200 and < 300: - return ClientResult.FromValue(true, response); - case >= 400 and < 500: - return ClientResult.FromValue(false, response); - default: - return new ErrorResult(response, new ClientResultException(response)); - } - } - - public static ClientResult ProcessHeadAsBoolMessage(this ClientPipeline pipeline, PipelineMessage message, RequestOptions options) - { - PipelineResponse response = pipeline.ProcessMessage(message, options); - switch (response.Status) - { - case >= 200 and < 300: - return ClientResult.FromValue(true, response); - case >= 400 and < 500: - return ClientResult.FromValue(false, response); - default: - return new ErrorResult(response, new ClientResultException(response)); - } - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ClientUriBuilder.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ClientUriBuilder.cs deleted file mode 100644 index aa2ae4da331e..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ClientUriBuilder.cs +++ /dev/null @@ -1,190 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Azure.AI.OpenAI -{ - internal partial class ClientUriBuilder - { - private UriBuilder _uriBuilder; - private StringBuilder _pathBuilder; - private StringBuilder _queryBuilder; - - public ClientUriBuilder() - { - } - - private UriBuilder UriBuilder => _uriBuilder ??= new UriBuilder(); - - private StringBuilder PathBuilder => _pathBuilder ??= new StringBuilder(UriBuilder.Path); - - private StringBuilder QueryBuilder => _queryBuilder ??= new StringBuilder(UriBuilder.Query); - - public void Reset(Uri uri) - { - _uriBuilder = new UriBuilder(uri); - _pathBuilder = new StringBuilder(UriBuilder.Path); - _queryBuilder = new StringBuilder(UriBuilder.Query); - } - - public void AppendPath(string value, bool escape) - { - Argument.AssertNotNullOrWhiteSpace(value, nameof(value)); - - if (escape) - { - value = Uri.EscapeDataString(value); - } - - if (PathBuilder.Length > 0 && PathBuilder[PathBuilder.Length - 1] == '/' && value[0] == '/') - { - PathBuilder.Remove(PathBuilder.Length - 1, 1); - } - - PathBuilder.Append(value); - UriBuilder.Path = PathBuilder.ToString(); - } - - public void AppendPath(bool value, bool escape = false) - { - AppendPath(ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } - - public void AppendPath(float value, bool escape = true) - { - AppendPath(ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } - - public void AppendPath(double value, bool escape = true) - { - AppendPath(ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } - - public void AppendPath(int value, bool escape = true) - { - AppendPath(ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } - - public void AppendPath(byte[] value, string format, bool escape = true) - { - AppendPath(ModelSerializationExtensions.TypeFormatters.ConvertToString(value, format), escape); - } - - public void AppendPath(IEnumerable value, bool escape = true) - { - AppendPath(ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } - - public void AppendPath(DateTimeOffset value, string format, bool escape = true) - { - AppendPath(ModelSerializationExtensions.TypeFormatters.ConvertToString(value, format), escape); - } - - public void AppendPath(TimeSpan value, string format, bool escape = true) - { - AppendPath(ModelSerializationExtensions.TypeFormatters.ConvertToString(value, format), escape); - } - - public void AppendPath(Guid value, bool escape = true) - { - AppendPath(ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } - - public void AppendPath(long value, bool escape = true) - { - AppendPath(ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } - - public void AppendQuery(string name, string value, bool escape) - { - Argument.AssertNotNullOrWhiteSpace(name, nameof(name)); - Argument.AssertNotNullOrWhiteSpace(value, nameof(value)); - - if (QueryBuilder.Length > 0) - { - QueryBuilder.Append('&'); - } - - if (escape) - { - value = Uri.EscapeDataString(value); - } - - QueryBuilder.Append(name); - QueryBuilder.Append('='); - QueryBuilder.Append(value); - } - - public void AppendQuery(string name, bool value, bool escape = false) - { - AppendQuery(name, ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } - - public void AppendQuery(string name, float value, bool escape = true) - { - AppendQuery(name, ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } - - public void AppendQuery(string name, DateTimeOffset value, string format, bool escape = true) - { - AppendQuery(name, ModelSerializationExtensions.TypeFormatters.ConvertToString(value, format), escape); - } - - public void AppendQuery(string name, TimeSpan value, string format, bool escape = true) - { - AppendQuery(name, ModelSerializationExtensions.TypeFormatters.ConvertToString(value, format), escape); - } - - public void AppendQuery(string name, double value, bool escape = true) - { - AppendQuery(name, ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } - - public void AppendQuery(string name, decimal value, bool escape = true) - { - AppendQuery(name, ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } - - public void AppendQuery(string name, int value, bool escape = true) - { - AppendQuery(name, ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } - - public void AppendQuery(string name, long value, bool escape = true) - { - AppendQuery(name, ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } - - public void AppendQuery(string name, TimeSpan value, bool escape = true) - { - AppendQuery(name, ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } - - public void AppendQuery(string name, byte[] value, string format, bool escape = true) - { - AppendQuery(name, ModelSerializationExtensions.TypeFormatters.ConvertToString(value, format), escape); - } - - public void AppendQuery(string name, Guid value, bool escape = true) - { - AppendQuery(name, ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } - - public void AppendQueryDelimited(string name, IEnumerable value, string delimiter, bool escape = true) - { - var stringValues = value.Select(v => ModelSerializationExtensions.TypeFormatters.ConvertToString(v)); - AppendQuery(name, string.Join(delimiter, stringValues), escape); - } - - public void AppendQueryDelimited(string name, IEnumerable value, string delimiter, string format, bool escape = true) - { - var stringValues = value.Select(v => ModelSerializationExtensions.TypeFormatters.ConvertToString(v, format)); - AppendQuery(name, string.Join(delimiter, stringValues), escape); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ErrorResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ErrorResult.cs deleted file mode 100644 index f9ea3276e769..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ErrorResult.cs +++ /dev/null @@ -1,23 +0,0 @@ -// - -#nullable disable - -using System.ClientModel; -using System.ClientModel.Primitives; - -namespace Azure.AI.OpenAI -{ - internal class ErrorResult : ClientResult - { - private readonly PipelineResponse _response; - private readonly ClientResultException _exception; - - public ErrorResult(PipelineResponse response, ClientResultException exception) : base(default, response) - { - _response = response; - _exception = exception; - } - - public override T Value => throw _exception; - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ModelSerializationExtensions.cs index f4286bb0eeca..4a45f613de8c 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ModelSerializationExtensions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ModelSerializationExtensions.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable @@ -9,13 +12,13 @@ using System.Globalization; using System.Text.Json; using System.Xml; +using Azure.Core; namespace Azure.AI.OpenAI { internal static class ModelSerializationExtensions { internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); - internal static readonly BinaryData SentinelValue = BinaryData.FromObjectAsJson("__EMPTY__"); public static object GetObject(this JsonElement element) { @@ -174,6 +177,9 @@ 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; @@ -250,13 +256,6 @@ 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"; @@ -267,7 +266,7 @@ internal static class TypeFormatters 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.") + _ => 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 diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/MultipartFormDataBinaryContent.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/MultipartFormDataRequestContent.cs similarity index 92% rename from sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/MultipartFormDataBinaryContent.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/MultipartFormDataRequestContent.cs index 43825f6b4a86..68d9091c6708 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/MultipartFormDataBinaryContent.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/MultipartFormDataRequestContent.cs @@ -1,27 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable using System; -using System.ClientModel; using System.Globalization; using System.IO; using System.Net.Http; using System.Net.Http.Headers; using System.Threading; using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; namespace Azure.AI.OpenAI { - internal class MultipartFormDataBinaryContent : BinaryContent + internal class MultipartFormDataRequestContent : RequestContent { - private readonly MultipartFormDataContent _multipartContent; + private readonly System.Net.Http.MultipartFormDataContent _multipartContent; private static readonly Random _random = new Random(); private static readonly char[] _boundaryValues = "0123456789=ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".ToCharArray(); - public MultipartFormDataBinaryContent() + public MultipartFormDataRequestContent() { - _multipartContent = new MultipartFormDataContent(CreateBoundary()); + _multipartContent = new System.Net.Http.MultipartFormDataContent(CreateBoundary()); } public string ContentType @@ -176,7 +180,9 @@ public override void WriteTo(Stream stream, CancellationToken cancellationToken #if NET6_0_OR_GREATER _multipartContent.CopyTo(stream, default, cancellationToken); #else - _multipartContent.CopyToAsync(stream).GetAwaiter().GetResult(); +#pragma warning disable AZC0107 + _multipartContent.CopyToAsync(stream).EnsureCompleted(); +#pragma warning restore AZC0107 #endif } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/Optional.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/Optional.cs index 56bba5f656ac..a58dc86ec6a1 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/Optional.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/Optional.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/Utf8JsonBinaryContent.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/Utf8JsonRequestContent.cs similarity index 82% rename from sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/Utf8JsonBinaryContent.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/Utf8JsonRequestContent.cs index 7f70307bf7f8..62b7404a506e 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/Utf8JsonBinaryContent.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -1,21 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable -using System.ClientModel; using System.IO; using System.Text.Json; using System.Threading; using System.Threading.Tasks; +using Azure.Core; namespace Azure.AI.OpenAI { - internal class Utf8JsonBinaryContent : BinaryContent + internal class Utf8JsonRequestContent : RequestContent { private readonly MemoryStream _stream; - private readonly BinaryContent _content; + private readonly RequestContent _content; - public Utf8JsonBinaryContent() + public Utf8JsonRequestContent() { _stream = new MemoryStream(); _content = Create(_stream); diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.Serialization.cs deleted file mode 100644 index e8c214ce91ac..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI.Chat -{ - internal partial class InternalAzureChatDataSourceAccessTokenAuthenticationOptions : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceAccessTokenAuthenticationOptions)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("access_token") != true) - { - writer.WritePropertyName("access_token"u8); - writer.WriteStringValue(AccessToken); - } - if (SerializedAdditionalRawData?.ContainsKey("type") != true) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - InternalAzureChatDataSourceAccessTokenAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceAccessTokenAuthenticationOptions)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInternalAzureChatDataSourceAccessTokenAuthenticationOptions(document.RootElement, options); - } - - internal static InternalAzureChatDataSourceAccessTokenAuthenticationOptions DeserializeInternalAzureChatDataSourceAccessTokenAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string accessToken = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("access_token"u8)) - { - accessToken = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureChatDataSourceAccessTokenAuthenticationOptions(type, serializedAdditionalRawData, accessToken); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceAccessTokenAuthenticationOptions)} does not support writing '{options.Format}' format."); - } - } - - InternalAzureChatDataSourceAccessTokenAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInternalAzureChatDataSourceAccessTokenAuthenticationOptions(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceAccessTokenAuthenticationOptions)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalAzureChatDataSourceAccessTokenAuthenticationOptions FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureChatDataSourceAccessTokenAuthenticationOptions(document.RootElement); - } - - /// Convert into a . - internal override BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.cs deleted file mode 100644 index 53b7f23f8c73..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.cs +++ /dev/null @@ -1,41 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI.Chat -{ - /// The AzureChatDataSourceAccessTokenAuthenticationOptions. - internal partial class InternalAzureChatDataSourceAccessTokenAuthenticationOptions : DataSourceAuthentication - { - /// Initializes a new instance of . - /// - /// is null. - public InternalAzureChatDataSourceAccessTokenAuthenticationOptions(string accessToken) - { - Argument.AssertNotNull(accessToken, nameof(accessToken)); - - Type = "access_token"; - AccessToken = accessToken; - } - - /// Initializes a new instance of . - /// Discriminator. - /// Keeps track of any properties unknown to the library. - /// - internal InternalAzureChatDataSourceAccessTokenAuthenticationOptions(string type, IDictionary serializedAdditionalRawData, string accessToken) : base(type, serializedAdditionalRawData) - { - AccessToken = accessToken; - } - - /// Initializes a new instance of for deserialization. - internal InternalAzureChatDataSourceAccessTokenAuthenticationOptions() - { - } - - /// Gets the access token. - internal string AccessToken { get; set; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.Serialization.cs deleted file mode 100644 index 2dcb1342683a..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI.Chat -{ - internal partial class InternalAzureChatDataSourceApiKeyAuthenticationOptions : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceApiKeyAuthenticationOptions)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("key") != true) - { - writer.WritePropertyName("key"u8); - writer.WriteStringValue(Key); - } - if (SerializedAdditionalRawData?.ContainsKey("type") != true) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - InternalAzureChatDataSourceApiKeyAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceApiKeyAuthenticationOptions)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInternalAzureChatDataSourceApiKeyAuthenticationOptions(document.RootElement, options); - } - - internal static InternalAzureChatDataSourceApiKeyAuthenticationOptions DeserializeInternalAzureChatDataSourceApiKeyAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string key = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("key"u8)) - { - key = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureChatDataSourceApiKeyAuthenticationOptions(type, serializedAdditionalRawData, key); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceApiKeyAuthenticationOptions)} does not support writing '{options.Format}' format."); - } - } - - InternalAzureChatDataSourceApiKeyAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInternalAzureChatDataSourceApiKeyAuthenticationOptions(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceApiKeyAuthenticationOptions)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalAzureChatDataSourceApiKeyAuthenticationOptions FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureChatDataSourceApiKeyAuthenticationOptions(document.RootElement); - } - - /// Convert into a . - internal override BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.cs deleted file mode 100644 index 1a4a6f838576..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.cs +++ /dev/null @@ -1,41 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI.Chat -{ - /// The AzureChatDataSourceApiKeyAuthenticationOptions. - internal partial class InternalAzureChatDataSourceApiKeyAuthenticationOptions : DataSourceAuthentication - { - /// Initializes a new instance of . - /// - /// is null. - public InternalAzureChatDataSourceApiKeyAuthenticationOptions(string key) - { - Argument.AssertNotNull(key, nameof(key)); - - Type = "api_key"; - Key = key; - } - - /// Initializes a new instance of . - /// Discriminator. - /// Keeps track of any properties unknown to the library. - /// - internal InternalAzureChatDataSourceApiKeyAuthenticationOptions(string type, IDictionary serializedAdditionalRawData, string key) : base(type, serializedAdditionalRawData) - { - Key = key; - } - - /// Initializes a new instance of for deserialization. - internal InternalAzureChatDataSourceApiKeyAuthenticationOptions() - { - } - - /// Gets the key. - internal string Key { get; set; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.Serialization.cs deleted file mode 100644 index 71afd3915803..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI.Chat -{ - internal partial class InternalAzureChatDataSourceConnectionStringAuthenticationOptions : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceConnectionStringAuthenticationOptions)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("connection_string") != true) - { - writer.WritePropertyName("connection_string"u8); - writer.WriteStringValue(ConnectionString); - } - if (SerializedAdditionalRawData?.ContainsKey("type") != true) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - InternalAzureChatDataSourceConnectionStringAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceConnectionStringAuthenticationOptions)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInternalAzureChatDataSourceConnectionStringAuthenticationOptions(document.RootElement, options); - } - - internal static InternalAzureChatDataSourceConnectionStringAuthenticationOptions DeserializeInternalAzureChatDataSourceConnectionStringAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string connectionString = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("connection_string"u8)) - { - connectionString = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureChatDataSourceConnectionStringAuthenticationOptions(type, serializedAdditionalRawData, connectionString); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceConnectionStringAuthenticationOptions)} does not support writing '{options.Format}' format."); - } - } - - InternalAzureChatDataSourceConnectionStringAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInternalAzureChatDataSourceConnectionStringAuthenticationOptions(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceConnectionStringAuthenticationOptions)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalAzureChatDataSourceConnectionStringAuthenticationOptions FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureChatDataSourceConnectionStringAuthenticationOptions(document.RootElement); - } - - /// Convert into a . - internal override BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.cs deleted file mode 100644 index f50be4aea567..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.cs +++ /dev/null @@ -1,41 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI.Chat -{ - /// The AzureChatDataSourceConnectionStringAuthenticationOptions. - internal partial class InternalAzureChatDataSourceConnectionStringAuthenticationOptions : DataSourceAuthentication - { - /// Initializes a new instance of . - /// - /// is null. - public InternalAzureChatDataSourceConnectionStringAuthenticationOptions(string connectionString) - { - Argument.AssertNotNull(connectionString, nameof(connectionString)); - - Type = "connection_string"; - ConnectionString = connectionString; - } - - /// Initializes a new instance of . - /// Discriminator. - /// Keeps track of any properties unknown to the library. - /// - internal InternalAzureChatDataSourceConnectionStringAuthenticationOptions(string type, IDictionary serializedAdditionalRawData, string connectionString) : base(type, serializedAdditionalRawData) - { - ConnectionString = connectionString; - } - - /// Initializes a new instance of for deserialization. - internal InternalAzureChatDataSourceConnectionStringAuthenticationOptions() - { - } - - /// Gets the connection string. - internal string ConnectionString { get; set; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.Serialization.cs deleted file mode 100644 index c4adb5301c7f..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.Serialization.cs +++ /dev/null @@ -1,162 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI.Chat -{ - internal partial class InternalAzureChatDataSourceDeploymentNameVectorizationSource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceDeploymentNameVectorizationSource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("deployment_name") != true) - { - writer.WritePropertyName("deployment_name"u8); - writer.WriteStringValue(DeploymentName); - } - if (SerializedAdditionalRawData?.ContainsKey("dimensions") != true && Optional.IsDefined(Dimensions)) - { - writer.WritePropertyName("dimensions"u8); - writer.WriteNumberValue(Dimensions.Value); - } - if (SerializedAdditionalRawData?.ContainsKey("type") != true) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - InternalAzureChatDataSourceDeploymentNameVectorizationSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceDeploymentNameVectorizationSource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInternalAzureChatDataSourceDeploymentNameVectorizationSource(document.RootElement, options); - } - - internal static InternalAzureChatDataSourceDeploymentNameVectorizationSource DeserializeInternalAzureChatDataSourceDeploymentNameVectorizationSource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string deploymentName = default; - int? dimensions = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("deployment_name"u8)) - { - deploymentName = property.Value.GetString(); - continue; - } - if (property.NameEquals("dimensions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - dimensions = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureChatDataSourceDeploymentNameVectorizationSource(type, serializedAdditionalRawData, deploymentName, dimensions); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceDeploymentNameVectorizationSource)} does not support writing '{options.Format}' format."); - } - } - - InternalAzureChatDataSourceDeploymentNameVectorizationSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInternalAzureChatDataSourceDeploymentNameVectorizationSource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceDeploymentNameVectorizationSource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalAzureChatDataSourceDeploymentNameVectorizationSource FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureChatDataSourceDeploymentNameVectorizationSource(document.RootElement); - } - - /// Convert into a . - internal override BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.cs deleted file mode 100644 index f900a3451948..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.cs +++ /dev/null @@ -1,64 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI.Chat -{ - /// - /// Represents a vectorization source that makes internal service calls against an Azure OpenAI embedding model - /// deployment. In contrast with the endpoint-based vectorization source, a deployment-name-based vectorization source - /// must be part of the same Azure OpenAI resource but can be used even in private networks. - /// - internal partial class InternalAzureChatDataSourceDeploymentNameVectorizationSource : DataSourceVectorizer - { - /// Initializes a new instance of . - /// - /// The embedding model deployment to use for vectorization. This deployment must exist within the same Azure OpenAI - /// resource as the model deployment being used for chat completions. - /// - /// is null. - public InternalAzureChatDataSourceDeploymentNameVectorizationSource(string deploymentName) - { - Argument.AssertNotNull(deploymentName, nameof(deploymentName)); - - Type = "deployment_name"; - DeploymentName = deploymentName; - } - - /// Initializes a new instance of . - /// The differentiating identifier for the concrete vectorization source. - /// Keeps track of any properties unknown to the library. - /// - /// The embedding model deployment to use for vectorization. This deployment must exist within the same Azure OpenAI - /// resource as the model deployment being used for chat completions. - /// - /// - /// The number of dimensions to request on embeddings. - /// Only supported in 'text-embedding-3' and later models. - /// - internal InternalAzureChatDataSourceDeploymentNameVectorizationSource(string type, IDictionary serializedAdditionalRawData, string deploymentName, int? dimensions) : base(type, serializedAdditionalRawData) - { - DeploymentName = deploymentName; - Dimensions = dimensions; - } - - /// Initializes a new instance of for deserialization. - internal InternalAzureChatDataSourceDeploymentNameVectorizationSource() - { - } - - /// - /// The embedding model deployment to use for vectorization. This deployment must exist within the same Azure OpenAI - /// resource as the model deployment being used for chat completions. - /// - internal string DeploymentName { get; set; } - /// - /// The number of dimensions to request on embeddings. - /// Only supported in 'text-embedding-3' and later models. - /// - public int? Dimensions { get; set; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.Serialization.cs deleted file mode 100644 index 1f5b75133597..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI.Chat -{ - internal partial class InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("encoded_api_key") != true) - { - writer.WritePropertyName("encoded_api_key"u8); - writer.WriteStringValue(EncodedApiKey); - } - if (SerializedAdditionalRawData?.ContainsKey("type") != true) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions(document.RootElement, options); - } - - internal static InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions DeserializeInternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string encodedApiKey = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("encoded_api_key"u8)) - { - encodedApiKey = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions(type, serializedAdditionalRawData, encodedApiKey); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions)} does not support writing '{options.Format}' format."); - } - } - - InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions(document.RootElement); - } - - /// Convert into a . - internal override BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.cs deleted file mode 100644 index 2a4b3ff8c987..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.cs +++ /dev/null @@ -1,41 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI.Chat -{ - /// The AzureChatDataSourceEncodedApiKeyAuthenticationOptions. - internal partial class InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions : DataSourceAuthentication - { - /// Initializes a new instance of . - /// - /// is null. - public InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions(string encodedApiKey) - { - Argument.AssertNotNull(encodedApiKey, nameof(encodedApiKey)); - - Type = "encoded_api_key"; - EncodedApiKey = encodedApiKey; - } - - /// Initializes a new instance of . - /// Discriminator. - /// Keeps track of any properties unknown to the library. - /// - internal InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions(string type, IDictionary serializedAdditionalRawData, string encodedApiKey) : base(type, serializedAdditionalRawData) - { - EncodedApiKey = encodedApiKey; - } - - /// Initializes a new instance of for deserialization. - internal InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions() - { - } - - /// Gets the encoded api key. - internal string EncodedApiKey { get; set; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.Serialization.cs deleted file mode 100644 index 0a3bc0f5c9fe..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.Serialization.cs +++ /dev/null @@ -1,173 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI.Chat -{ - internal partial class InternalAzureChatDataSourceEndpointVectorizationSource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceEndpointVectorizationSource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("endpoint") != true) - { - writer.WritePropertyName("endpoint"u8); - writer.WriteStringValue(Endpoint.AbsoluteUri); - } - if (SerializedAdditionalRawData?.ContainsKey("authentication") != true) - { - writer.WritePropertyName("authentication"u8); - writer.WriteObjectValue(Authentication, options); - } - if (SerializedAdditionalRawData?.ContainsKey("dimensions") != true && Optional.IsDefined(Dimensions)) - { - writer.WritePropertyName("dimensions"u8); - writer.WriteNumberValue(Dimensions.Value); - } - if (SerializedAdditionalRawData?.ContainsKey("type") != true) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - InternalAzureChatDataSourceEndpointVectorizationSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceEndpointVectorizationSource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInternalAzureChatDataSourceEndpointVectorizationSource(document.RootElement, options); - } - - internal static InternalAzureChatDataSourceEndpointVectorizationSource DeserializeInternalAzureChatDataSourceEndpointVectorizationSource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Uri endpoint = default; - DataSourceAuthentication authentication = default; - int? dimensions = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("endpoint"u8)) - { - endpoint = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("authentication"u8)) - { - authentication = DataSourceAuthentication.DeserializeDataSourceAuthentication(property.Value, options); - continue; - } - if (property.NameEquals("dimensions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - dimensions = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureChatDataSourceEndpointVectorizationSource(type, serializedAdditionalRawData, endpoint, authentication, dimensions); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceEndpointVectorizationSource)} does not support writing '{options.Format}' format."); - } - } - - InternalAzureChatDataSourceEndpointVectorizationSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInternalAzureChatDataSourceEndpointVectorizationSource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceEndpointVectorizationSource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalAzureChatDataSourceEndpointVectorizationSource FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureChatDataSourceEndpointVectorizationSource(document.RootElement); - } - - /// Convert into a . - internal override BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.cs deleted file mode 100644 index c66ca6f7380e..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.cs +++ /dev/null @@ -1,79 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI.Chat -{ - /// Represents a vectorization source that makes public service calls against an Azure OpenAI embedding model deployment. - internal partial class InternalAzureChatDataSourceEndpointVectorizationSource : DataSourceVectorizer - { - /// Initializes a new instance of . - /// - /// Specifies the resource endpoint URL from which embeddings should be retrieved. - /// It should be in the format of: - /// https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/embeddings. - /// The api-version query parameter is not allowed. - /// - /// - /// The authentication mechanism to use with the endpoint-based vectorization source. - /// Endpoint authentication supports API key and access token mechanisms. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// or is null. - public InternalAzureChatDataSourceEndpointVectorizationSource(Uri endpoint, DataSourceAuthentication authentication) - { - Argument.AssertNotNull(endpoint, nameof(endpoint)); - Argument.AssertNotNull(authentication, nameof(authentication)); - - Type = "endpoint"; - Endpoint = endpoint; - Authentication = authentication; - } - - /// Initializes a new instance of . - /// The differentiating identifier for the concrete vectorization source. - /// Keeps track of any properties unknown to the library. - /// - /// Specifies the resource endpoint URL from which embeddings should be retrieved. - /// It should be in the format of: - /// https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/embeddings. - /// The api-version query parameter is not allowed. - /// - /// - /// The authentication mechanism to use with the endpoint-based vectorization source. - /// Endpoint authentication supports API key and access token mechanisms. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// - /// The number of dimensions to request on embeddings. - /// Only supported in 'text-embedding-3' and later models. - /// - internal InternalAzureChatDataSourceEndpointVectorizationSource(string type, IDictionary serializedAdditionalRawData, Uri endpoint, DataSourceAuthentication authentication, int? dimensions) : base(type, serializedAdditionalRawData) - { - Endpoint = endpoint; - Authentication = authentication; - Dimensions = dimensions; - } - - /// Initializes a new instance of for deserialization. - internal InternalAzureChatDataSourceEndpointVectorizationSource() - { - } - - /// - /// Specifies the resource endpoint URL from which embeddings should be retrieved. - /// It should be in the format of: - /// https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/embeddings. - /// The api-version query parameter is not allowed. - /// - internal Uri Endpoint { get; set; } - /// - /// The number of dimensions to request on embeddings. - /// Only supported in 'text-embedding-3' and later models. - /// - public int? Dimensions { get; set; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceIntegratedVectorizationSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceIntegratedVectorizationSource.Serialization.cs deleted file mode 100644 index 7880eecc84fe..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceIntegratedVectorizationSource.Serialization.cs +++ /dev/null @@ -1,136 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI.Chat -{ - internal partial class InternalAzureChatDataSourceIntegratedVectorizationSource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceIntegratedVectorizationSource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("type") != true) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - InternalAzureChatDataSourceIntegratedVectorizationSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceIntegratedVectorizationSource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInternalAzureChatDataSourceIntegratedVectorizationSource(document.RootElement, options); - } - - internal static InternalAzureChatDataSourceIntegratedVectorizationSource DeserializeInternalAzureChatDataSourceIntegratedVectorizationSource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureChatDataSourceIntegratedVectorizationSource(type, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceIntegratedVectorizationSource)} does not support writing '{options.Format}' format."); - } - } - - InternalAzureChatDataSourceIntegratedVectorizationSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInternalAzureChatDataSourceIntegratedVectorizationSource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceIntegratedVectorizationSource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalAzureChatDataSourceIntegratedVectorizationSource FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureChatDataSourceIntegratedVectorizationSource(document.RootElement); - } - - /// Convert into a . - internal override BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceIntegratedVectorizationSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceIntegratedVectorizationSource.cs deleted file mode 100644 index d72e6eda8f48..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceIntegratedVectorizationSource.cs +++ /dev/null @@ -1,26 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI.Chat -{ - /// Represents an integrated vectorization source as defined within the supporting search resource. - internal partial class InternalAzureChatDataSourceIntegratedVectorizationSource : DataSourceVectorizer - { - /// Initializes a new instance of . - public InternalAzureChatDataSourceIntegratedVectorizationSource() - { - Type = "integrated"; - } - - /// Initializes a new instance of . - /// The differentiating identifier for the concrete vectorization source. - /// Keeps track of any properties unknown to the library. - internal InternalAzureChatDataSourceIntegratedVectorizationSource(string type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) - { - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.Serialization.cs deleted file mode 100644 index 8bbae28863af..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.Serialization.cs +++ /dev/null @@ -1,158 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI.Chat -{ - internal partial class InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("key") != true) - { - writer.WritePropertyName("key"u8); - writer.WriteStringValue(Key); - } - if (SerializedAdditionalRawData?.ContainsKey("key_id") != true) - { - writer.WritePropertyName("key_id"u8); - writer.WriteStringValue(KeyId); - } - if (SerializedAdditionalRawData?.ContainsKey("type") != true) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions(document.RootElement, options); - } - - internal static InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions DeserializeInternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string key = default; - string keyId = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("key"u8)) - { - key = property.Value.GetString(); - continue; - } - if (property.NameEquals("key_id"u8)) - { - keyId = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions(type, serializedAdditionalRawData, key, keyId); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions)} does not support writing '{options.Format}' format."); - } - } - - InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions(document.RootElement); - } - - /// Convert into a . - internal override BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.cs deleted file mode 100644 index 426de4609525..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI.Chat -{ - /// The AzureChatDataSourceKeyAndKeyIdAuthenticationOptions. - internal partial class InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions : DataSourceAuthentication - { - /// Initializes a new instance of . - /// - /// - /// or is null. - public InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions(string key, string keyId) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(keyId, nameof(keyId)); - - Type = "key_and_key_id"; - Key = key; - KeyId = keyId; - } - - /// Initializes a new instance of . - /// Discriminator. - /// Keeps track of any properties unknown to the library. - /// - /// - internal InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions(string type, IDictionary serializedAdditionalRawData, string key, string keyId) : base(type, serializedAdditionalRawData) - { - Key = key; - KeyId = keyId; - } - - /// Initializes a new instance of for deserialization. - internal InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions() - { - } - - /// Gets the key. - internal string Key { get; set; } - /// Gets the key id. - internal string KeyId { get; set; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.Serialization.cs deleted file mode 100644 index 0cac82ddd684..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI.Chat -{ - internal partial class InternalAzureChatDataSourceModelIdVectorizationSource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceModelIdVectorizationSource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("model_id") != true) - { - writer.WritePropertyName("model_id"u8); - writer.WriteStringValue(ModelId); - } - if (SerializedAdditionalRawData?.ContainsKey("type") != true) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - InternalAzureChatDataSourceModelIdVectorizationSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceModelIdVectorizationSource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInternalAzureChatDataSourceModelIdVectorizationSource(document.RootElement, options); - } - - internal static InternalAzureChatDataSourceModelIdVectorizationSource DeserializeInternalAzureChatDataSourceModelIdVectorizationSource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string modelId = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("model_id"u8)) - { - modelId = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureChatDataSourceModelIdVectorizationSource(type, serializedAdditionalRawData, modelId); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceModelIdVectorizationSource)} does not support writing '{options.Format}' format."); - } - } - - InternalAzureChatDataSourceModelIdVectorizationSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInternalAzureChatDataSourceModelIdVectorizationSource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceModelIdVectorizationSource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalAzureChatDataSourceModelIdVectorizationSource FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureChatDataSourceModelIdVectorizationSource(document.RootElement); - } - - /// Convert into a . - internal override BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.cs deleted file mode 100644 index 5db5e3c5e523..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.cs +++ /dev/null @@ -1,44 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI.Chat -{ - /// - /// Represents a vectorization source that makes service calls based on a search service model ID. - /// This source type is currently only supported by Elasticsearch. - /// - internal partial class InternalAzureChatDataSourceModelIdVectorizationSource : DataSourceVectorizer - { - /// Initializes a new instance of . - /// The embedding model build ID to use for vectorization. - /// is null. - internal InternalAzureChatDataSourceModelIdVectorizationSource(string modelId) - { - Argument.AssertNotNull(modelId, nameof(modelId)); - - Type = "model_id"; - ModelId = modelId; - } - - /// Initializes a new instance of . - /// The differentiating identifier for the concrete vectorization source. - /// Keeps track of any properties unknown to the library. - /// The embedding model build ID to use for vectorization. - internal InternalAzureChatDataSourceModelIdVectorizationSource(string type, IDictionary serializedAdditionalRawData, string modelId) : base(type, serializedAdditionalRawData) - { - ModelId = modelId; - } - - /// Initializes a new instance of for deserialization. - internal InternalAzureChatDataSourceModelIdVectorizationSource() - { - } - - /// The embedding model build ID to use for vectorization. - internal string ModelId { get; set; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs deleted file mode 100644 index db765e8d174d..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs +++ /dev/null @@ -1,136 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI.Chat -{ - internal partial class InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("type") != true) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions(document.RootElement, options); - } - - internal static InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions DeserializeInternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions(type, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions)} does not support writing '{options.Format}' format."); - } - } - - InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions(document.RootElement); - } - - /// Convert into a . - internal override BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.cs deleted file mode 100644 index 52d75514184f..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.cs +++ /dev/null @@ -1,26 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI.Chat -{ - /// The AzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions. - internal partial class InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions : DataSourceAuthentication - { - /// Initializes a new instance of . - public InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions() - { - Type = "system_assigned_managed_identity"; - } - - /// Initializes a new instance of . - /// Discriminator. - /// Keeps track of any properties unknown to the library. - internal InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions(string type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) - { - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs deleted file mode 100644 index dceed3714c4a..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI.Chat -{ - internal partial class InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("managed_identity_resource_id") != true) - { - writer.WritePropertyName("managed_identity_resource_id"u8); - writer.WriteStringValue(ManagedIdentityResourceId); - } - if (SerializedAdditionalRawData?.ContainsKey("type") != true) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions(document.RootElement, options); - } - - internal static InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions DeserializeInternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string managedIdentityResourceId = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("managed_identity_resource_id"u8)) - { - managedIdentityResourceId = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions(type, serializedAdditionalRawData, managedIdentityResourceId); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions)} does not support writing '{options.Format}' format."); - } - } - - InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions(document.RootElement); - } - - /// Convert into a . - internal override BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.cs deleted file mode 100644 index dafba9a8ec27..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.cs +++ /dev/null @@ -1,41 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI.Chat -{ - /// The AzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions. - internal partial class InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions : DataSourceAuthentication - { - /// Initializes a new instance of . - /// - /// is null. - public InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions(string managedIdentityResourceId) - { - Argument.AssertNotNull(managedIdentityResourceId, nameof(managedIdentityResourceId)); - - Type = "user_assigned_managed_identity"; - ManagedIdentityResourceId = managedIdentityResourceId; - } - - /// Initializes a new instance of . - /// Discriminator. - /// Keeps track of any properties unknown to the library. - /// - internal InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions(string type, IDictionary serializedAdditionalRawData, string managedIdentityResourceId) : base(type, serializedAdditionalRawData) - { - ManagedIdentityResourceId = managedIdentityResourceId; - } - - /// Initializes a new instance of for deserialization. - internal InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions() - { - } - - /// Gets the managed identity resource id. - internal string ManagedIdentityResourceId { get; set; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.Serialization.cs deleted file mode 100644 index 13dc6a14a391..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.Serialization.cs +++ /dev/null @@ -1,158 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI.Chat -{ - internal partial class InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("username") != true) - { - writer.WritePropertyName("username"u8); - writer.WriteStringValue(Username); - } - if (SerializedAdditionalRawData?.ContainsKey("password") != true) - { - writer.WritePropertyName("password"u8); - writer.WriteStringValue(Password); - } - if (SerializedAdditionalRawData?.ContainsKey("type") != true) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions(document.RootElement, options); - } - - internal static InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions DeserializeInternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string username = default; - string password = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("username"u8)) - { - username = property.Value.GetString(); - continue; - } - if (property.NameEquals("password"u8)) - { - password = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions(type, serializedAdditionalRawData, username, password); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions)} does not support writing '{options.Format}' format."); - } - } - - InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions(document.RootElement); - } - - /// Convert into a . - internal override BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.cs deleted file mode 100644 index d47f5a241c45..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI.Chat -{ - /// The AzureChatDataSourceUsernameAndPasswordAuthenticationOptions. - internal partial class InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions : DataSourceAuthentication - { - /// Initializes a new instance of . - /// - /// - /// or is null. - public InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions(string username, string password) - { - Argument.AssertNotNull(username, nameof(username)); - Argument.AssertNotNull(password, nameof(password)); - - Type = "username_and_password"; - Username = username; - Password = password; - } - - /// Initializes a new instance of . - /// Discriminator. - /// Keeps track of any properties unknown to the library. - /// - /// - internal InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions(string type, IDictionary serializedAdditionalRawData, string username, string password) : base(type, serializedAdditionalRawData) - { - Username = username; - Password = password; - } - - /// Initializes a new instance of for deserialization. - internal InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions() - { - } - - /// Gets the username. - internal string Username { get; set; } - /// Gets the password. - internal string Password { get; set; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.Serialization.cs deleted file mode 100644 index 7ad7d81738a4..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI -{ - internal partial class InternalAzureContentFilterBlocklistIdResult : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureContentFilterBlocklistIdResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("id") != true) - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (SerializedAdditionalRawData?.ContainsKey("filtered") != true) - { - writer.WritePropertyName("filtered"u8); - writer.WriteBooleanValue(Filtered); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - InternalAzureContentFilterBlocklistIdResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureContentFilterBlocklistIdResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInternalAzureContentFilterBlocklistIdResult(document.RootElement, options); - } - - internal static InternalAzureContentFilterBlocklistIdResult DeserializeInternalAzureContentFilterBlocklistIdResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string id = default; - bool filtered = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("filtered"u8)) - { - filtered = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureContentFilterBlocklistIdResult(id, filtered, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(InternalAzureContentFilterBlocklistIdResult)} does not support writing '{options.Format}' format."); - } - } - - InternalAzureContentFilterBlocklistIdResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInternalAzureContentFilterBlocklistIdResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(InternalAzureContentFilterBlocklistIdResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static InternalAzureContentFilterBlocklistIdResult FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureContentFilterBlocklistIdResult(document.RootElement); - } - - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.cs deleted file mode 100644 index 6a0b6caccf3d..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.cs +++ /dev/null @@ -1,80 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI -{ - /// - /// A content filter result item that associates an existing custom blocklist ID with a value indicating whether or not - /// the corresponding blocklist resulted in content being filtered. - /// - internal partial class InternalAzureContentFilterBlocklistIdResult - { - /// - /// 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" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// The ID of the custom blocklist associated with the filtered status. - /// Whether the associated blocklist resulted in the content being filtered. - /// is null. - internal InternalAzureContentFilterBlocklistIdResult(string id, bool filtered) - { - Argument.AssertNotNull(id, nameof(id)); - - Id = id; - Filtered = filtered; - } - - /// Initializes a new instance of . - /// The ID of the custom blocklist associated with the filtered status. - /// Whether the associated blocklist resulted in the content being filtered. - /// Keeps track of any properties unknown to the library. - internal InternalAzureContentFilterBlocklistIdResult(string id, bool filtered, IDictionary serializedAdditionalRawData) - { - Id = id; - Filtered = filtered; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal InternalAzureContentFilterBlocklistIdResult() - { - } - - /// The ID of the custom blocklist associated with the filtered status. - internal string Id { get; set; } - /// Whether the associated blocklist resulted in the content being filtered. - internal bool Filtered { get; set; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.Serialization.cs deleted file mode 100644 index 48a2417a5707..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI -{ - internal partial class InternalAzureContentFilterBlocklistResultDetail : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureContentFilterBlocklistResultDetail)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("filtered") != true) - { - writer.WritePropertyName("filtered"u8); - writer.WriteBooleanValue(Filtered); - } - if (SerializedAdditionalRawData?.ContainsKey("id") != true) - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - InternalAzureContentFilterBlocklistResultDetail IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureContentFilterBlocklistResultDetail)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInternalAzureContentFilterBlocklistResultDetail(document.RootElement, options); - } - - internal static InternalAzureContentFilterBlocklistResultDetail DeserializeInternalAzureContentFilterBlocklistResultDetail(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - bool filtered = default; - string id = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("filtered"u8)) - { - filtered = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureContentFilterBlocklistResultDetail(filtered, id, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(InternalAzureContentFilterBlocklistResultDetail)} does not support writing '{options.Format}' format."); - } - } - - InternalAzureContentFilterBlocklistResultDetail IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInternalAzureContentFilterBlocklistResultDetail(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(InternalAzureContentFilterBlocklistResultDetail)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static InternalAzureContentFilterBlocklistResultDetail FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureContentFilterBlocklistResultDetail(document.RootElement); - } - - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.cs deleted file mode 100644 index b45626184ea2..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.cs +++ /dev/null @@ -1,168 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI -{ - /// The AzureContentFilterResultForPromptContentFilterResults. - internal partial class InternalAzureContentFilterResultForPromptContentFilterResults - { - /// - /// 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" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// - /// A detection result that describes user prompt injection attacks, where malicious users deliberately exploit - /// system vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content - /// generation or violations of system-imposed restrictions. - /// - /// - /// A detection result that describes attacks on systems powered by Generative AI models that can happen every time - /// an application processes information that wasn’t directly authored by either the developer of the application or - /// the user. - /// - /// or is null. - internal InternalAzureContentFilterResultForPromptContentFilterResults(ContentFilterDetectionResult jailbreak, ContentFilterDetectionResult indirectAttack) - { - Argument.AssertNotNull(jailbreak, nameof(jailbreak)); - Argument.AssertNotNull(indirectAttack, nameof(indirectAttack)); - - Jailbreak = jailbreak; - IndirectAttack = indirectAttack; - } - - /// Initializes a new instance of . - /// - /// A content filter category for language related to anatomical organs and genitals, romantic relationships, acts - /// portrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an - /// assault or a forced sexual violent act against one's will, prostitution, pornography, and abuse. - /// - /// - /// A content filter category that can refer to any content that attacks or uses pejorative or discriminatory - /// language with reference to a person or identity group based on certain differentiating attributes of these groups - /// including but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation, - /// religion, immigration status, ability status, personal appearance, and body size. - /// - /// - /// A content filter category for language related to physical actions intended to hurt, injure, damage, or kill - /// someone or something; describes weapons, guns and related entities, such as manufactures, associations, - /// legislation, and so on. - /// - /// - /// A content filter category that describes language related to physical actions intended to purposely hurt, injure, - /// damage one's body or kill oneself. - /// - /// - /// A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the - /// content. - /// - /// A collection of binary filtering outcomes for configured custom blocklists. - /// If present, details about an error that prevented content filtering from completing its evaluation. - /// - /// A detection result that describes user prompt injection attacks, where malicious users deliberately exploit - /// system vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content - /// generation or violations of system-imposed restrictions. - /// - /// - /// A detection result that describes attacks on systems powered by Generative AI models that can happen every time - /// an application processes information that wasn’t directly authored by either the developer of the application or - /// the user. - /// - /// Keeps track of any properties unknown to the library. - internal InternalAzureContentFilterResultForPromptContentFilterResults(ContentFilterSeverityResult sexual, ContentFilterSeverityResult hate, ContentFilterSeverityResult violence, ContentFilterSeverityResult selfHarm, ContentFilterDetectionResult profanity, ContentFilterBlocklistResult customBlocklists, InternalAzureContentFilterResultForPromptContentFilterResultsError error, ContentFilterDetectionResult jailbreak, ContentFilterDetectionResult indirectAttack, IDictionary serializedAdditionalRawData) - { - Sexual = sexual; - Hate = hate; - Violence = violence; - SelfHarm = selfHarm; - Profanity = profanity; - CustomBlocklists = customBlocklists; - Error = error; - Jailbreak = jailbreak; - IndirectAttack = indirectAttack; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal InternalAzureContentFilterResultForPromptContentFilterResults() - { - } - - /// - /// A content filter category for language related to anatomical organs and genitals, romantic relationships, acts - /// portrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an - /// assault or a forced sexual violent act against one's will, prostitution, pornography, and abuse. - /// - internal ContentFilterSeverityResult Sexual { get; set; } - /// - /// A content filter category that can refer to any content that attacks or uses pejorative or discriminatory - /// language with reference to a person or identity group based on certain differentiating attributes of these groups - /// including but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation, - /// religion, immigration status, ability status, personal appearance, and body size. - /// - internal ContentFilterSeverityResult Hate { get; set; } - /// - /// A content filter category for language related to physical actions intended to hurt, injure, damage, or kill - /// someone or something; describes weapons, guns and related entities, such as manufactures, associations, - /// legislation, and so on. - /// - internal ContentFilterSeverityResult Violence { get; set; } - /// - /// A content filter category that describes language related to physical actions intended to purposely hurt, injure, - /// damage one's body or kill oneself. - /// - internal ContentFilterSeverityResult SelfHarm { get; set; } - /// - /// A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the - /// content. - /// - internal ContentFilterDetectionResult Profanity { get; set; } - /// A collection of binary filtering outcomes for configured custom blocklists. - internal ContentFilterBlocklistResult CustomBlocklists { get; set; } - /// If present, details about an error that prevented content filtering from completing its evaluation. - internal InternalAzureContentFilterResultForPromptContentFilterResultsError Error { get; set; } - /// - /// A detection result that describes user prompt injection attacks, where malicious users deliberately exploit - /// system vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content - /// generation or violations of system-imposed restrictions. - /// - internal ContentFilterDetectionResult Jailbreak { get; set; } - /// - /// A detection result that describes attacks on systems powered by Generative AI models that can happen every time - /// an application processes information that wasn’t directly authored by either the developer of the application or - /// the user. - /// - internal ContentFilterDetectionResult IndirectAttack { get; set; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.Serialization.cs deleted file mode 100644 index 48b505fb8b41..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI -{ - internal partial class InternalAzureContentFilterResultForPromptContentFilterResultsError : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureContentFilterResultForPromptContentFilterResultsError)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("code") != true) - { - writer.WritePropertyName("code"u8); - writer.WriteNumberValue(Code); - } - if (SerializedAdditionalRawData?.ContainsKey("message") != true) - { - writer.WritePropertyName("message"u8); - writer.WriteStringValue(Message); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - InternalAzureContentFilterResultForPromptContentFilterResultsError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureContentFilterResultForPromptContentFilterResultsError)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInternalAzureContentFilterResultForPromptContentFilterResultsError(document.RootElement, options); - } - - internal static InternalAzureContentFilterResultForPromptContentFilterResultsError DeserializeInternalAzureContentFilterResultForPromptContentFilterResultsError(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int code = default; - string message = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code"u8)) - { - code = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("message"u8)) - { - message = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureContentFilterResultForPromptContentFilterResultsError(code, message, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(InternalAzureContentFilterResultForPromptContentFilterResultsError)} does not support writing '{options.Format}' format."); - } - } - - InternalAzureContentFilterResultForPromptContentFilterResultsError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInternalAzureContentFilterResultForPromptContentFilterResultsError(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(InternalAzureContentFilterResultForPromptContentFilterResultsError)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static InternalAzureContentFilterResultForPromptContentFilterResultsError FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureContentFilterResultForPromptContentFilterResultsError(document.RootElement); - } - - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.cs deleted file mode 100644 index 212b8c2844e4..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.cs +++ /dev/null @@ -1,77 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI -{ - /// The AzureContentFilterResultForPromptContentFilterResultsError. - internal partial class InternalAzureContentFilterResultForPromptContentFilterResultsError - { - /// - /// 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" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// A distinct, machine-readable code associated with the error. - /// A human-readable message associated with the error. - /// is null. - internal InternalAzureContentFilterResultForPromptContentFilterResultsError(int code, string message) - { - Argument.AssertNotNull(message, nameof(message)); - - Code = code; - Message = message; - } - - /// Initializes a new instance of . - /// A distinct, machine-readable code associated with the error. - /// A human-readable message associated with the error. - /// Keeps track of any properties unknown to the library. - internal InternalAzureContentFilterResultForPromptContentFilterResultsError(int code, string message, IDictionary serializedAdditionalRawData) - { - Code = code; - Message = message; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal InternalAzureContentFilterResultForPromptContentFilterResultsError() - { - } - - /// A distinct, machine-readable code associated with the error. - internal int Code { get; set; } - /// A human-readable message associated with the error. - internal string Message { get; set; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.cs deleted file mode 100644 index 766b29fbd6dd..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.cs +++ /dev/null @@ -1,152 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI.Chat -{ - /// The AzureCosmosDBChatDataSourceParameters. - internal partial class InternalAzureCosmosDBChatDataSourceParameters - { - /// - /// 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" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// - /// - /// - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// - /// - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// - /// , , , , or is null. - public InternalAzureCosmosDBChatDataSourceParameters(string containerName, string databaseName, DataSourceVectorizer vectorizationSource, string indexName, DataSourceAuthentication authentication, DataSourceFieldMappings fieldMappings) - { - Argument.AssertNotNull(containerName, nameof(containerName)); - Argument.AssertNotNull(databaseName, nameof(databaseName)); - Argument.AssertNotNull(vectorizationSource, nameof(vectorizationSource)); - Argument.AssertNotNull(indexName, nameof(indexName)); - Argument.AssertNotNull(authentication, nameof(authentication)); - Argument.AssertNotNull(fieldMappings, nameof(fieldMappings)); - - _internalIncludeContexts = new ChangeTrackingList(); - ContainerName = containerName; - DatabaseName = databaseName; - VectorizationSource = vectorizationSource; - IndexName = indexName; - Authentication = authentication; - FieldMappings = fieldMappings; - } - - /// Initializes a new instance of . - /// The configured number of documents to feature in the query. - /// Whether queries should be restricted to use of the indexed data. - /// - /// The configured strictness of the search relevance filtering. - /// Higher strictness will increase precision but lower recall of the answer. - /// - /// - /// The maximum number of rewritten queries that should be sent to the search provider for a single user message. - /// By default, the system will make an automatic determination. - /// - /// - /// If set to true, the system will allow partial search results to be used and the request will fail if all - /// partial queries fail. If not specified or specified as false, the request will fail if any search query fails. - /// - /// - /// The output context properties to include on the response. - /// By default, citations and intent will be requested. - /// - /// - /// - /// - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// - /// - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// - /// Keeps track of any properties unknown to the library. - internal InternalAzureCosmosDBChatDataSourceParameters(int? topNDocuments, bool? inScope, int? strictness, int? maxSearchQueries, bool? allowPartialResult, IList internalIncludeContexts, string containerName, string databaseName, DataSourceVectorizer vectorizationSource, string indexName, DataSourceAuthentication authentication, DataSourceFieldMappings fieldMappings, IDictionary serializedAdditionalRawData) - { - TopNDocuments = topNDocuments; - InScope = inScope; - Strictness = strictness; - MaxSearchQueries = maxSearchQueries; - AllowPartialResult = allowPartialResult; - _internalIncludeContexts = internalIncludeContexts; - ContainerName = containerName; - DatabaseName = databaseName; - VectorizationSource = vectorizationSource; - IndexName = indexName; - Authentication = authentication; - FieldMappings = fieldMappings; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal InternalAzureCosmosDBChatDataSourceParameters() - { - } - - /// The configured number of documents to feature in the query. - public int? TopNDocuments { get; set; } - /// Whether queries should be restricted to use of the indexed data. - public bool? InScope { get; set; } - /// - /// The configured strictness of the search relevance filtering. - /// Higher strictness will increase precision but lower recall of the answer. - /// - public int? Strictness { get; set; } - /// - /// The maximum number of rewritten queries that should be sent to the search provider for a single user message. - /// By default, the system will make an automatic determination. - /// - public int? MaxSearchQueries { get; set; } - /// - /// If set to true, the system will allow partial search results to be used and the request will fail if all - /// partial queries fail. If not specified or specified as false, the request will fail if any search query fails. - /// - public bool? AllowPartialResult { get; set; } - /// Gets the container name. - internal string ContainerName { get; set; } - /// Gets the database name. - internal string DatabaseName { get; set; } - /// Gets the index name. - internal string IndexName { get; set; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.Serialization.cs deleted file mode 100644 index add450e67f4f..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.Serialization.cs +++ /dev/null @@ -1,166 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI -{ - internal partial class InternalAzureOpenAIChatErrorInnerError : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureOpenAIChatErrorInnerError)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("code") != true && Optional.IsDefined(Code)) - { - writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code.Value.ToString()); - } - if (SerializedAdditionalRawData?.ContainsKey("revised_prompt") != true && Optional.IsDefined(RevisedPrompt)) - { - writer.WritePropertyName("revised_prompt"u8); - writer.WriteStringValue(RevisedPrompt); - } - if (SerializedAdditionalRawData?.ContainsKey("content_filter_results") != true && Optional.IsDefined(ContentFilterResults)) - { - writer.WritePropertyName("content_filter_results"u8); - writer.WriteObjectValue(ContentFilterResults, options); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - InternalAzureOpenAIChatErrorInnerError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureOpenAIChatErrorInnerError)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInternalAzureOpenAIChatErrorInnerError(document.RootElement, options); - } - - internal static InternalAzureOpenAIChatErrorInnerError DeserializeInternalAzureOpenAIChatErrorInnerError(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - InternalAzureOpenAIChatErrorInnerErrorCode? code = default; - string revisedPrompt = default; - RequestContentFilterResult contentFilterResults = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - code = new InternalAzureOpenAIChatErrorInnerErrorCode(property.Value.GetString()); - continue; - } - if (property.NameEquals("revised_prompt"u8)) - { - revisedPrompt = property.Value.GetString(); - continue; - } - if (property.NameEquals("content_filter_results"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - contentFilterResults = RequestContentFilterResult.DeserializeRequestContentFilterResult(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureOpenAIChatErrorInnerError(code, revisedPrompt, contentFilterResults, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(InternalAzureOpenAIChatErrorInnerError)} does not support writing '{options.Format}' format."); - } - } - - InternalAzureOpenAIChatErrorInnerError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInternalAzureOpenAIChatErrorInnerError(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(InternalAzureOpenAIChatErrorInnerError)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static InternalAzureOpenAIChatErrorInnerError FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureOpenAIChatErrorInnerError(document.RootElement); - } - - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.cs deleted file mode 100644 index 94f1da0eb40e..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.cs +++ /dev/null @@ -1,69 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI -{ - /// The AzureOpenAIChatErrorInnerError. - internal partial class InternalAzureOpenAIChatErrorInnerError - { - /// - /// 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" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - internal InternalAzureOpenAIChatErrorInnerError() - { - } - - /// Initializes a new instance of . - /// The code associated with the inner error. - /// If applicable, the modified prompt used for generation. - /// The content filter result details associated with the inner error. - /// Keeps track of any properties unknown to the library. - internal InternalAzureOpenAIChatErrorInnerError(InternalAzureOpenAIChatErrorInnerErrorCode? code, string revisedPrompt, RequestContentFilterResult contentFilterResults, IDictionary serializedAdditionalRawData) - { - Code = code; - RevisedPrompt = revisedPrompt; - ContentFilterResults = contentFilterResults; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The code associated with the inner error. - internal InternalAzureOpenAIChatErrorInnerErrorCode? Code { get; set; } - /// If applicable, the modified prompt used for generation. - internal string RevisedPrompt { get; set; } - /// The content filter result details associated with the inner error. - internal RequestContentFilterResult ContentFilterResults { get; set; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerErrorCode.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerErrorCode.cs deleted file mode 100644 index 155e4eb0189c..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerErrorCode.cs +++ /dev/null @@ -1,45 +0,0 @@ -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.OpenAI -{ - /// The AzureOpenAIChatErrorInnerError_code. - internal readonly partial struct InternalAzureOpenAIChatErrorInnerErrorCode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public InternalAzureOpenAIChatErrorInnerErrorCode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ResponsibleAIPolicyViolationValue = "ResponsibleAIPolicyViolation"; - - /// ResponsibleAIPolicyViolation. - internal static InternalAzureOpenAIChatErrorInnerErrorCode ResponsibleAIPolicyViolation { get; set; } = new InternalAzureOpenAIChatErrorInnerErrorCode(ResponsibleAIPolicyViolationValue); - /// Determines if two values are the same. - public static bool operator ==(InternalAzureOpenAIChatErrorInnerErrorCode left, InternalAzureOpenAIChatErrorInnerErrorCode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(InternalAzureOpenAIChatErrorInnerErrorCode left, InternalAzureOpenAIChatErrorInnerErrorCode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator InternalAzureOpenAIChatErrorInnerErrorCode(string value) => new InternalAzureOpenAIChatErrorInnerErrorCode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is InternalAzureOpenAIChatErrorInnerErrorCode other && Equals(other); - /// - public bool Equals(InternalAzureOpenAIChatErrorInnerErrorCode 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/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.Serialization.cs deleted file mode 100644 index 2fce6545c60a..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.Serialization.cs +++ /dev/null @@ -1,166 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI -{ - internal partial class InternalAzureOpenAIDalleErrorInnerError : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureOpenAIDalleErrorInnerError)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("code") != true && Optional.IsDefined(Code)) - { - writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code.Value.ToString()); - } - if (SerializedAdditionalRawData?.ContainsKey("revised_prompt") != true && Optional.IsDefined(RevisedPrompt)) - { - writer.WritePropertyName("revised_prompt"u8); - writer.WriteStringValue(RevisedPrompt); - } - if (SerializedAdditionalRawData?.ContainsKey("content_filter_results") != true && Optional.IsDefined(ContentFilterResults)) - { - writer.WritePropertyName("content_filter_results"u8); - writer.WriteObjectValue(ContentFilterResults, options); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - InternalAzureOpenAIDalleErrorInnerError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(InternalAzureOpenAIDalleErrorInnerError)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInternalAzureOpenAIDalleErrorInnerError(document.RootElement, options); - } - - internal static InternalAzureOpenAIDalleErrorInnerError DeserializeInternalAzureOpenAIDalleErrorInnerError(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - InternalAzureOpenAIDalleErrorInnerErrorCode? code = default; - string revisedPrompt = default; - RequestImageContentFilterResult contentFilterResults = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - code = new InternalAzureOpenAIDalleErrorInnerErrorCode(property.Value.GetString()); - continue; - } - if (property.NameEquals("revised_prompt"u8)) - { - revisedPrompt = property.Value.GetString(); - continue; - } - if (property.NameEquals("content_filter_results"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - contentFilterResults = RequestImageContentFilterResult.DeserializeRequestImageContentFilterResult(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureOpenAIDalleErrorInnerError(code, revisedPrompt, contentFilterResults, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(InternalAzureOpenAIDalleErrorInnerError)} does not support writing '{options.Format}' format."); - } - } - - InternalAzureOpenAIDalleErrorInnerError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInternalAzureOpenAIDalleErrorInnerError(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(InternalAzureOpenAIDalleErrorInnerError)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static InternalAzureOpenAIDalleErrorInnerError FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureOpenAIDalleErrorInnerError(document.RootElement); - } - - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.cs deleted file mode 100644 index d600b81cfcf1..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.cs +++ /dev/null @@ -1,69 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI -{ - /// The AzureOpenAIDalleErrorInnerError. - internal partial class InternalAzureOpenAIDalleErrorInnerError - { - /// - /// 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" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - internal InternalAzureOpenAIDalleErrorInnerError() - { - } - - /// Initializes a new instance of . - /// The code associated with the inner error. - /// If applicable, the modified prompt used for generation. - /// The content filter result details associated with the inner error. - /// Keeps track of any properties unknown to the library. - internal InternalAzureOpenAIDalleErrorInnerError(InternalAzureOpenAIDalleErrorInnerErrorCode? code, string revisedPrompt, RequestImageContentFilterResult contentFilterResults, IDictionary serializedAdditionalRawData) - { - Code = code; - RevisedPrompt = revisedPrompt; - ContentFilterResults = contentFilterResults; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The code associated with the inner error. - internal InternalAzureOpenAIDalleErrorInnerErrorCode? Code { get; set; } - /// If applicable, the modified prompt used for generation. - internal string RevisedPrompt { get; set; } - /// The content filter result details associated with the inner error. - internal RequestImageContentFilterResult ContentFilterResults { get; set; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerErrorCode.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerErrorCode.cs deleted file mode 100644 index 95c39267783c..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerErrorCode.cs +++ /dev/null @@ -1,45 +0,0 @@ -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.OpenAI -{ - /// The AzureOpenAIDalleErrorInnerError_code. - internal readonly partial struct InternalAzureOpenAIDalleErrorInnerErrorCode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public InternalAzureOpenAIDalleErrorInnerErrorCode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ResponsibleAIPolicyViolationValue = "ResponsibleAIPolicyViolation"; - - /// ResponsibleAIPolicyViolation. - internal static InternalAzureOpenAIDalleErrorInnerErrorCode ResponsibleAIPolicyViolation { get; set; } = new InternalAzureOpenAIDalleErrorInnerErrorCode(ResponsibleAIPolicyViolationValue); - /// Determines if two values are the same. - public static bool operator ==(InternalAzureOpenAIDalleErrorInnerErrorCode left, InternalAzureOpenAIDalleErrorInnerErrorCode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(InternalAzureOpenAIDalleErrorInnerErrorCode left, InternalAzureOpenAIDalleErrorInnerErrorCode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator InternalAzureOpenAIDalleErrorInnerErrorCode(string value) => new InternalAzureOpenAIDalleErrorInnerErrorCode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is InternalAzureOpenAIDalleErrorInnerErrorCode other && Equals(other); - /// - public bool Equals(InternalAzureOpenAIDalleErrorInnerErrorCode 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/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.cs deleted file mode 100644 index cbd3f5dcca50..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.cs +++ /dev/null @@ -1,151 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI.Chat -{ - /// The AzureSearchChatDataSourceParameters. - internal partial class InternalAzureSearchChatDataSourceParameters - { - /// - /// 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" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// The absolute endpoint path for the Azure Search resource to use. - /// The name of the index to use, as specified in the Azure Search resource. - /// - /// The authentication mechanism to use with Azure Search. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// , or is null. - public InternalAzureSearchChatDataSourceParameters(Uri endpoint, string indexName, DataSourceAuthentication authentication) - { - Argument.AssertNotNull(endpoint, nameof(endpoint)); - Argument.AssertNotNull(indexName, nameof(indexName)); - Argument.AssertNotNull(authentication, nameof(authentication)); - - _internalIncludeContexts = new ChangeTrackingList(); - Endpoint = endpoint; - IndexName = indexName; - Authentication = authentication; - } - - /// Initializes a new instance of . - /// The configured number of documents to feature in the query. - /// Whether queries should be restricted to use of the indexed data. - /// - /// The configured strictness of the search relevance filtering. - /// Higher strictness will increase precision but lower recall of the answer. - /// - /// - /// The maximum number of rewritten queries that should be sent to the search provider for a single user message. - /// By default, the system will make an automatic determination. - /// - /// - /// If set to true, the system will allow partial search results to be used and the request will fail if all - /// partial queries fail. If not specified or specified as false, the request will fail if any search query fails. - /// - /// - /// The output context properties to include on the response. - /// By default, citations and intent will be requested. - /// - /// The absolute endpoint path for the Azure Search resource to use. - /// The name of the index to use, as specified in the Azure Search resource. - /// - /// The authentication mechanism to use with Azure Search. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// The field mappings to use with the Azure Search resource. - /// The query type for the Azure Search resource to use. - /// Additional semantic configuration for the query. - /// A filter to apply to the search. - /// - /// The vectorization source to use with Azure Search. - /// Supported sources for Azure Search include endpoint, deployment name, and integrated. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// Keeps track of any properties unknown to the library. - internal InternalAzureSearchChatDataSourceParameters(int? topNDocuments, bool? inScope, int? strictness, int? maxSearchQueries, bool? allowPartialResult, IList internalIncludeContexts, Uri endpoint, string indexName, DataSourceAuthentication authentication, DataSourceFieldMappings fieldMappings, DataSourceQueryType? queryType, string semanticConfiguration, string filter, DataSourceVectorizer vectorizationSource, IDictionary serializedAdditionalRawData) - { - TopNDocuments = topNDocuments; - InScope = inScope; - Strictness = strictness; - MaxSearchQueries = maxSearchQueries; - AllowPartialResult = allowPartialResult; - _internalIncludeContexts = internalIncludeContexts; - Endpoint = endpoint; - IndexName = indexName; - Authentication = authentication; - FieldMappings = fieldMappings; - QueryType = queryType; - SemanticConfiguration = semanticConfiguration; - Filter = filter; - VectorizationSource = vectorizationSource; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal InternalAzureSearchChatDataSourceParameters() - { - } - - /// The configured number of documents to feature in the query. - public int? TopNDocuments { get; set; } - /// Whether queries should be restricted to use of the indexed data. - public bool? InScope { get; set; } - /// - /// The configured strictness of the search relevance filtering. - /// Higher strictness will increase precision but lower recall of the answer. - /// - public int? Strictness { get; set; } - /// - /// The maximum number of rewritten queries that should be sent to the search provider for a single user message. - /// By default, the system will make an automatic determination. - /// - public int? MaxSearchQueries { get; set; } - /// - /// If set to true, the system will allow partial search results to be used and the request will fail if all - /// partial queries fail. If not specified or specified as false, the request will fail if any search query fails. - /// - public bool? AllowPartialResult { get; set; } - /// The absolute endpoint path for the Azure Search resource to use. - internal Uri Endpoint { get; set; } - /// The name of the index to use, as specified in the Azure Search resource. - internal string IndexName { get; set; } - /// Additional semantic configuration for the query. - public string SemanticConfiguration { get; set; } - /// A filter to apply to the search. - public string Filter { get; set; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParametersIncludeContext.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParametersIncludeContext.cs deleted file mode 100644 index f8290caaec9d..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParametersIncludeContext.cs +++ /dev/null @@ -1,51 +0,0 @@ -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.OpenAI.Chat -{ - /// The AzureSearchChatDataSourceParametersIncludeContext. - internal readonly partial struct InternalAzureSearchChatDataSourceParametersIncludeContext : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public InternalAzureSearchChatDataSourceParametersIncludeContext(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string CitationsValue = "citations"; - private const string IntentValue = "intent"; - private const string AllRetrievedDocumentsValue = "all_retrieved_documents"; - - /// citations. - internal static InternalAzureSearchChatDataSourceParametersIncludeContext Citations { get; set; } = new InternalAzureSearchChatDataSourceParametersIncludeContext(CitationsValue); - /// intent. - internal static InternalAzureSearchChatDataSourceParametersIncludeContext Intent { get; set; } = new InternalAzureSearchChatDataSourceParametersIncludeContext(IntentValue); - /// all_retrieved_documents. - internal static InternalAzureSearchChatDataSourceParametersIncludeContext AllRetrievedDocuments { get; set; } = new InternalAzureSearchChatDataSourceParametersIncludeContext(AllRetrievedDocumentsValue); - /// Determines if two values are the same. - public static bool operator ==(InternalAzureSearchChatDataSourceParametersIncludeContext left, InternalAzureSearchChatDataSourceParametersIncludeContext right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(InternalAzureSearchChatDataSourceParametersIncludeContext left, InternalAzureSearchChatDataSourceParametersIncludeContext right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator InternalAzureSearchChatDataSourceParametersIncludeContext(string value) => new InternalAzureSearchChatDataSourceParametersIncludeContext(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is InternalAzureSearchChatDataSourceParametersIncludeContext other && Equals(other); - /// - public bool Equals(InternalAzureSearchChatDataSourceParametersIncludeContext 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/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.cs deleted file mode 100644 index f82b1889d191..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.cs +++ /dev/null @@ -1,139 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI.Chat -{ - /// The ElasticsearchChatDataSourceParameters. - internal partial class InternalElasticsearchChatDataSourceParameters - { - /// - /// 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" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// - /// - /// - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// , or is null. - public InternalElasticsearchChatDataSourceParameters(Uri endpoint, string indexName, DataSourceAuthentication authentication) - { - Argument.AssertNotNull(endpoint, nameof(endpoint)); - Argument.AssertNotNull(indexName, nameof(indexName)); - Argument.AssertNotNull(authentication, nameof(authentication)); - - _internalIncludeContexts = new ChangeTrackingList(); - Endpoint = endpoint; - IndexName = indexName; - Authentication = authentication; - } - - /// Initializes a new instance of . - /// The configured number of documents to feature in the query. - /// Whether queries should be restricted to use of the indexed data. - /// - /// The configured strictness of the search relevance filtering. - /// Higher strictness will increase precision but lower recall of the answer. - /// - /// - /// The maximum number of rewritten queries that should be sent to the search provider for a single user message. - /// By default, the system will make an automatic determination. - /// - /// - /// If set to true, the system will allow partial search results to be used and the request will fail if all - /// partial queries fail. If not specified or specified as false, the request will fail if any search query fails. - /// - /// - /// The output context properties to include on the response. - /// By default, citations and intent will be requested. - /// - /// - /// - /// - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// - /// - /// - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// Keeps track of any properties unknown to the library. - internal InternalElasticsearchChatDataSourceParameters(int? topNDocuments, bool? inScope, int? strictness, int? maxSearchQueries, bool? allowPartialResult, IList internalIncludeContexts, Uri endpoint, string indexName, DataSourceAuthentication authentication, DataSourceFieldMappings fieldMappings, DataSourceQueryType? queryType, DataSourceVectorizer vectorizationSource, IDictionary serializedAdditionalRawData) - { - TopNDocuments = topNDocuments; - InScope = inScope; - Strictness = strictness; - MaxSearchQueries = maxSearchQueries; - AllowPartialResult = allowPartialResult; - _internalIncludeContexts = internalIncludeContexts; - Endpoint = endpoint; - IndexName = indexName; - Authentication = authentication; - FieldMappings = fieldMappings; - QueryType = queryType; - VectorizationSource = vectorizationSource; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal InternalElasticsearchChatDataSourceParameters() - { - } - - /// The configured number of documents to feature in the query. - public int? TopNDocuments { get; set; } - /// Whether queries should be restricted to use of the indexed data. - public bool? InScope { get; set; } - /// - /// The configured strictness of the search relevance filtering. - /// Higher strictness will increase precision but lower recall of the answer. - /// - public int? Strictness { get; set; } - /// - /// The maximum number of rewritten queries that should be sent to the search provider for a single user message. - /// By default, the system will make an automatic determination. - /// - public int? MaxSearchQueries { get; set; } - /// - /// If set to true, the system will allow partial search results to be used and the request will fail if all - /// partial queries fail. If not specified or specified as false, the request will fail if any search query fails. - /// - public bool? AllowPartialResult { get; set; } - /// Gets the endpoint. - internal Uri Endpoint { get; set; } - /// Gets the index name. - internal string IndexName { get; set; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalMongoDBChatDataSourceParameters.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalMongoDBChatDataSourceParameters.cs deleted file mode 100644 index 5b79c3c25d33..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalMongoDBChatDataSourceParameters.cs +++ /dev/null @@ -1,180 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI.Chat -{ - /// The MongoDBChatDataSourceParameters. - internal partial class InternalMongoDBChatDataSourceParameters - { - /// - /// 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" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// The name of the MongoDB cluster endpoint. - /// The name of the MongoDB database. - /// The name of the MongoDB collection. - /// The name of the MongoDB application. - /// The name of the MongoDB index. - /// - /// The authentication mechanism to use with Pinecone. - /// Supported authentication mechanisms for Pinecone include: username and password. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// - /// The vectorization source to use as an embedding dependency for the MongoDB data source. - /// Supported vectorization sources for MongoDB include: endpoint, deployment name. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// - /// Field mappings to apply to data used by the MongoDB data source. - /// Note that content and vector field mappings are required for MongoDB. - /// - /// , , , , , , or is null. - public InternalMongoDBChatDataSourceParameters(string endpoint, string databaseName, string collectionName, string appName, string indexName, DataSourceAuthentication authentication, DataSourceVectorizer embeddingDependency, DataSourceFieldMappings fieldMappings) - { - Argument.AssertNotNull(endpoint, nameof(endpoint)); - Argument.AssertNotNull(databaseName, nameof(databaseName)); - Argument.AssertNotNull(collectionName, nameof(collectionName)); - Argument.AssertNotNull(appName, nameof(appName)); - Argument.AssertNotNull(indexName, nameof(indexName)); - Argument.AssertNotNull(authentication, nameof(authentication)); - Argument.AssertNotNull(embeddingDependency, nameof(embeddingDependency)); - Argument.AssertNotNull(fieldMappings, nameof(fieldMappings)); - - _internalIncludeContexts = new ChangeTrackingList(); - Endpoint = endpoint; - DatabaseName = databaseName; - CollectionName = collectionName; - AppName = appName; - IndexName = indexName; - Authentication = authentication; - EmbeddingDependency = embeddingDependency; - FieldMappings = fieldMappings; - } - - /// Initializes a new instance of . - /// The configured number of documents to feature in the query. - /// Whether queries should be restricted to use of the indexed data. - /// - /// The configured strictness of the search relevance filtering. - /// Higher strictness will increase precision but lower recall of the answer. - /// - /// - /// The maximum number of rewritten queries that should be sent to the search provider for a single user message. - /// By default, the system will make an automatic determination. - /// - /// - /// If set to true, the system will allow partial search results to be used and the request will fail if all - /// partial queries fail. If not specified or specified as false, the request will fail if any search query fails. - /// - /// - /// The output context properties to include on the response. - /// By default, citations and intent will be requested. - /// - /// The name of the MongoDB cluster endpoint. - /// The name of the MongoDB database. - /// The name of the MongoDB collection. - /// The name of the MongoDB application. - /// The name of the MongoDB index. - /// - /// The authentication mechanism to use with Pinecone. - /// Supported authentication mechanisms for Pinecone include: username and password. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// - /// The vectorization source to use as an embedding dependency for the MongoDB data source. - /// Supported vectorization sources for MongoDB include: endpoint, deployment name. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// - /// Field mappings to apply to data used by the MongoDB data source. - /// Note that content and vector field mappings are required for MongoDB. - /// - /// Keeps track of any properties unknown to the library. - internal InternalMongoDBChatDataSourceParameters(int? topNDocuments, bool? inScope, int? strictness, int? maxSearchQueries, bool? allowPartialResult, IList internalIncludeContexts, string endpoint, string databaseName, string collectionName, string appName, string indexName, DataSourceAuthentication authentication, DataSourceVectorizer embeddingDependency, DataSourceFieldMappings fieldMappings, IDictionary serializedAdditionalRawData) - { - TopNDocuments = topNDocuments; - InScope = inScope; - Strictness = strictness; - MaxSearchQueries = maxSearchQueries; - AllowPartialResult = allowPartialResult; - _internalIncludeContexts = internalIncludeContexts; - Endpoint = endpoint; - DatabaseName = databaseName; - CollectionName = collectionName; - AppName = appName; - IndexName = indexName; - Authentication = authentication; - EmbeddingDependency = embeddingDependency; - FieldMappings = fieldMappings; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal InternalMongoDBChatDataSourceParameters() - { - } - - /// The configured number of documents to feature in the query. - public int? TopNDocuments { get; set; } - /// Whether queries should be restricted to use of the indexed data. - public bool? InScope { get; set; } - /// - /// The configured strictness of the search relevance filtering. - /// Higher strictness will increase precision but lower recall of the answer. - /// - public int? Strictness { get; set; } - /// - /// The maximum number of rewritten queries that should be sent to the search provider for a single user message. - /// By default, the system will make an automatic determination. - /// - public int? MaxSearchQueries { get; set; } - /// - /// If set to true, the system will allow partial search results to be used and the request will fail if all - /// partial queries fail. If not specified or specified as false, the request will fail if any search query fails. - /// - public bool? AllowPartialResult { get; set; } - /// The name of the MongoDB cluster endpoint. - internal string Endpoint { get; set; } - /// The name of the MongoDB database. - internal string DatabaseName { get; set; } - /// The name of the MongoDB collection. - internal string CollectionName { get; set; } - /// The name of the MongoDB application. - internal string AppName { get; set; } - /// The name of the MongoDB index. - internal string IndexName { get; set; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.cs deleted file mode 100644 index a559fbb2e9ce..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.cs +++ /dev/null @@ -1,159 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI.Chat -{ - /// The PineconeChatDataSourceParameters. - internal partial class InternalPineconeChatDataSourceParameters - { - /// - /// 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" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// The environment name to use with Pinecone. - /// The name of the Pinecone database index to use. - /// - /// The authentication mechanism to use with Pinecone. - /// Supported authentication mechanisms for Pinecone include: API key. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// - /// The vectorization source to use as an embedding dependency for the Pinecone data source. - /// Supported vectorization sources for Pinecone include: deployment name. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// - /// Field mappings to apply to data used by the Pinecone data source. - /// Note that content field mappings are required for Pinecone. - /// - /// , , , or is null. - public InternalPineconeChatDataSourceParameters(string environment, string indexName, DataSourceAuthentication authentication, DataSourceVectorizer vectorizationSource, DataSourceFieldMappings fieldMappings) - { - Argument.AssertNotNull(environment, nameof(environment)); - Argument.AssertNotNull(indexName, nameof(indexName)); - Argument.AssertNotNull(authentication, nameof(authentication)); - Argument.AssertNotNull(vectorizationSource, nameof(vectorizationSource)); - Argument.AssertNotNull(fieldMappings, nameof(fieldMappings)); - - _internalIncludeContexts = new ChangeTrackingList(); - Environment = environment; - IndexName = indexName; - Authentication = authentication; - VectorizationSource = vectorizationSource; - FieldMappings = fieldMappings; - } - - /// Initializes a new instance of . - /// The configured number of documents to feature in the query. - /// Whether queries should be restricted to use of the indexed data. - /// - /// The configured strictness of the search relevance filtering. - /// Higher strictness will increase precision but lower recall of the answer. - /// - /// - /// The maximum number of rewritten queries that should be sent to the search provider for a single user message. - /// By default, the system will make an automatic determination. - /// - /// - /// If set to true, the system will allow partial search results to be used and the request will fail if all - /// partial queries fail. If not specified or specified as false, the request will fail if any search query fails. - /// - /// - /// The output context properties to include on the response. - /// By default, citations and intent will be requested. - /// - /// The environment name to use with Pinecone. - /// The name of the Pinecone database index to use. - /// - /// The authentication mechanism to use with Pinecone. - /// Supported authentication mechanisms for Pinecone include: API key. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// - /// The vectorization source to use as an embedding dependency for the Pinecone data source. - /// Supported vectorization sources for Pinecone include: deployment name. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// - /// Field mappings to apply to data used by the Pinecone data source. - /// Note that content field mappings are required for Pinecone. - /// - /// Keeps track of any properties unknown to the library. - internal InternalPineconeChatDataSourceParameters(int? topNDocuments, bool? inScope, int? strictness, int? maxSearchQueries, bool? allowPartialResult, IList internalIncludeContexts, string environment, string indexName, DataSourceAuthentication authentication, DataSourceVectorizer vectorizationSource, DataSourceFieldMappings fieldMappings, IDictionary serializedAdditionalRawData) - { - TopNDocuments = topNDocuments; - InScope = inScope; - Strictness = strictness; - MaxSearchQueries = maxSearchQueries; - AllowPartialResult = allowPartialResult; - _internalIncludeContexts = internalIncludeContexts; - Environment = environment; - IndexName = indexName; - Authentication = authentication; - VectorizationSource = vectorizationSource; - FieldMappings = fieldMappings; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal InternalPineconeChatDataSourceParameters() - { - } - - /// The configured number of documents to feature in the query. - public int? TopNDocuments { get; set; } - /// Whether queries should be restricted to use of the indexed data. - public bool? InScope { get; set; } - /// - /// The configured strictness of the search relevance filtering. - /// Higher strictness will increase precision but lower recall of the answer. - /// - public int? Strictness { get; set; } - /// - /// The maximum number of rewritten queries that should be sent to the search provider for a single user message. - /// By default, the system will make an automatic determination. - /// - public int? MaxSearchQueries { get; set; } - /// - /// If set to true, the system will allow partial search results to be used and the request will fail if all - /// partial queries fail. If not specified or specified as false, the request will fail if any search query fails. - /// - public bool? AllowPartialResult { get; set; } - /// The environment name to use with Pinecone. - internal string Environment { get; set; } - /// The name of the Pinecone database index to use. - internal string IndexName { get; set; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.Serialization.cs deleted file mode 100644 index 712e1700496e..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.Serialization.cs +++ /dev/null @@ -1,136 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI.Chat -{ - internal partial class InternalUnknownAzureChatDataSource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ChatDataSource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("type") != true) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ChatDataSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ChatDataSource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeChatDataSource(document.RootElement, options); - } - - internal static InternalUnknownAzureChatDataSource DeserializeInternalUnknownAzureChatDataSource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string type = "Unknown"; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new InternalUnknownAzureChatDataSource(type, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ChatDataSource)} does not support writing '{options.Format}' format."); - } - } - - ChatDataSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeChatDataSource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ChatDataSource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalUnknownAzureChatDataSource FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalUnknownAzureChatDataSource(document.RootElement); - } - - /// Convert into a . - internal override BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.cs deleted file mode 100644 index 4d8d34f5dd76..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.cs +++ /dev/null @@ -1,25 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI.Chat -{ - /// Unknown version of AzureChatDataSource. - internal partial class InternalUnknownAzureChatDataSource : ChatDataSource - { - /// Initializes a new instance of . - /// The differentiating type identifier for the data source. - /// Keeps track of any properties unknown to the library. - internal InternalUnknownAzureChatDataSource(string type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal InternalUnknownAzureChatDataSource() - { - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.Serialization.cs deleted file mode 100644 index 80d03d0db336..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.Serialization.cs +++ /dev/null @@ -1,136 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI.Chat -{ - internal partial class InternalUnknownAzureChatDataSourceAuthenticationOptions : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataSourceAuthentication)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("type") != true) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - DataSourceAuthentication IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataSourceAuthentication)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataSourceAuthentication(document.RootElement, options); - } - - internal static InternalUnknownAzureChatDataSourceAuthenticationOptions DeserializeInternalUnknownAzureChatDataSourceAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string type = "Unknown"; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new InternalUnknownAzureChatDataSourceAuthenticationOptions(type, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DataSourceAuthentication)} does not support writing '{options.Format}' format."); - } - } - - DataSourceAuthentication IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDataSourceAuthentication(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DataSourceAuthentication)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalUnknownAzureChatDataSourceAuthenticationOptions FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalUnknownAzureChatDataSourceAuthenticationOptions(document.RootElement); - } - - /// Convert into a . - internal override BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.cs deleted file mode 100644 index 4bd41a7041f4..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI.Chat -{ - /// Unknown version of AzureChatDataSourceAuthenticationOptions. - internal partial class InternalUnknownAzureChatDataSourceAuthenticationOptions : DataSourceAuthentication - { - /// Initializes a new instance of . - /// Discriminator. - /// Keeps track of any properties unknown to the library. - internal InternalUnknownAzureChatDataSourceAuthenticationOptions(string type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal InternalUnknownAzureChatDataSourceAuthenticationOptions() - { - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.Serialization.cs deleted file mode 100644 index be1a50c9d1dd..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.Serialization.cs +++ /dev/null @@ -1,136 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI.Chat -{ - internal partial class InternalUnknownAzureChatDataSourceVectorizationSource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataSourceVectorizer)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("type") != true) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - DataSourceVectorizer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataSourceVectorizer)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataSourceVectorizer(document.RootElement, options); - } - - internal static InternalUnknownAzureChatDataSourceVectorizationSource DeserializeInternalUnknownAzureChatDataSourceVectorizationSource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string type = "Unknown"; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new InternalUnknownAzureChatDataSourceVectorizationSource(type, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(DataSourceVectorizer)} does not support writing '{options.Format}' format."); - } - } - - DataSourceVectorizer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDataSourceVectorizer(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DataSourceVectorizer)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalUnknownAzureChatDataSourceVectorizationSource FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalUnknownAzureChatDataSourceVectorizationSource(document.RootElement); - } - - /// Convert into a . - internal override BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.cs deleted file mode 100644 index 6b9910a124ee..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.cs +++ /dev/null @@ -1,25 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI.Chat -{ - /// Unknown version of AzureChatDataSourceVectorizationSource. - internal partial class InternalUnknownAzureChatDataSourceVectorizationSource : DataSourceVectorizer - { - /// Initializes a new instance of . - /// The differentiating identifier for the concrete vectorization source. - /// Keeps track of any properties unknown to the library. - internal InternalUnknownAzureChatDataSourceVectorizationSource(string type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal InternalUnknownAzureChatDataSourceVectorizationSource() - { - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatDataSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatDataSource.Serialization.cs deleted file mode 100644 index f3101a5b54ed..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatDataSource.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI.Chat -{ - public partial class MongoDBChatDataSource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MongoDBChatDataSource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("parameters") != true) - { - writer.WritePropertyName("parameters"u8); - writer.WriteObjectValue(InternalParameters, options); - } - if (SerializedAdditionalRawData?.ContainsKey("type") != true) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - MongoDBChatDataSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MongoDBChatDataSource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMongoDBChatDataSource(document.RootElement, options); - } - - internal static MongoDBChatDataSource DeserializeMongoDBChatDataSource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - InternalMongoDBChatDataSourceParameters parameters = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("parameters"u8)) - { - parameters = InternalMongoDBChatDataSourceParameters.DeserializeInternalMongoDBChatDataSourceParameters(property.Value, options); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MongoDBChatDataSource(type, serializedAdditionalRawData, parameters); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MongoDBChatDataSource)} does not support writing '{options.Format}' format."); - } - } - - MongoDBChatDataSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMongoDBChatDataSource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MongoDBChatDataSource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new MongoDBChatDataSource FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeMongoDBChatDataSource(document.RootElement); - } - - /// Convert into a . - internal override BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatDataSource.cs deleted file mode 100644 index 9a483cc28639..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatDataSource.cs +++ /dev/null @@ -1,14 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI.Chat -{ - /// The MongoDBChatDataSource. - public partial class MongoDBChatDataSource : ChatDataSource - { - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProcessingEventData.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatExtensionConfiguration.Serialization.cs similarity index 56% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProcessingEventData.Serialization.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatExtensionConfiguration.Serialization.cs index c07318cc5eab..4032dea6320a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProcessingEventData.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatExtensionConfiguration.Serialization.cs @@ -11,13 +11,13 @@ using System.Text.Json; using Azure.Core; -namespace Azure.Messaging.EventGrid.SystemEvents +namespace Azure.AI.OpenAI { - public partial class MediaJobOutputProcessingEventData : IUtf8JsonSerializable, IJsonModel + public partial class MongoDBChatExtensionConfiguration : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,28 +28,30 @@ 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobOutputProcessingEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(MongoDBChatExtensionConfiguration)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("parameters"u8); + writer.WriteObjectValue(Parameters, options); } - MediaJobOutputProcessingEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + MongoDBChatExtensionConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobOutputProcessingEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(MongoDBChatExtensionConfiguration)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaJobOutputProcessingEventData(document.RootElement, options); + return DeserializeMongoDBChatExtensionConfiguration(document.RootElement, options); } - internal static MediaJobOutputProcessingEventData DeserializeMediaJobOutputProcessingEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static MongoDBChatExtensionConfiguration DeserializeMongoDBChatExtensionConfiguration(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -57,31 +59,20 @@ internal static MediaJobOutputProcessingEventData DeserializeMediaJobOutputProce { return null; } - MediaJobState previousState = default; - MediaJobOutput output = default; - IReadOnlyDictionary jobCorrelationData = default; + MongoDBChatExtensionParameters parameters = default; + AzureChatExtensionType type = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("previousState"u8)) + if (property.NameEquals("parameters"u8)) { - previousState = new MediaJobState(property.Value.GetString()); + parameters = MongoDBChatExtensionParameters.DeserializeMongoDBChatExtensionParameters(property.Value, options); continue; } - if (property.NameEquals("output"u8)) + if (property.NameEquals("type"u8)) { - output = MediaJobOutput.DeserializeMediaJobOutput(property.Value, options); - continue; - } - if (property.NameEquals("jobCorrelationData"u8)) - { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - jobCorrelationData = dictionary; + type = new AzureChatExtensionType(property.Value.GetString()); continue; } if (options.Format != "W") @@ -90,46 +81,46 @@ internal static MediaJobOutputProcessingEventData DeserializeMediaJobOutputProce } } serializedAdditionalRawData = rawDataDictionary; - return new MediaJobOutputProcessingEventData(previousState, output, jobCorrelationData, serializedAdditionalRawData); + return new MongoDBChatExtensionConfiguration(type, serializedAdditionalRawData, parameters); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MediaJobOutputProcessingEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(MongoDBChatExtensionConfiguration)} does not support writing '{options.Format}' format."); } } - MediaJobOutputProcessingEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + MongoDBChatExtensionConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaJobOutputProcessingEventData(document.RootElement, options); + return DeserializeMongoDBChatExtensionConfiguration(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MediaJobOutputProcessingEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(MongoDBChatExtensionConfiguration)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new MediaJobOutputProcessingEventData FromResponse(Response response) + internal static new MongoDBChatExtensionConfiguration FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaJobOutputProcessingEventData(document.RootElement); + return DeserializeMongoDBChatExtensionConfiguration(document.RootElement); } /// Convert into a . diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatExtensionConfiguration.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatExtensionConfiguration.cs new file mode 100644 index 000000000000..d83d67452853 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatExtensionConfiguration.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// A specific representation of configurable options for a MongoDB chat extension configuration. + public partial class MongoDBChatExtensionConfiguration : AzureChatExtensionConfiguration + { + /// Initializes a new instance of . + /// The parameters for the MongoDB chat extension. + /// is null. + public MongoDBChatExtensionConfiguration(MongoDBChatExtensionParameters parameters) + { + Argument.AssertNotNull(parameters, nameof(parameters)); + + Type = AzureChatExtensionType.MongoDB; + Parameters = parameters; + } + + /// Initializes a new instance of . + /// + /// The label for the type of an Azure chat extension. This typically corresponds to a matching Azure resource. + /// Azure chat extensions are only compatible with Azure OpenAI. + /// + /// Keeps track of any properties unknown to the library. + /// The parameters for the MongoDB chat extension. + internal MongoDBChatExtensionConfiguration(AzureChatExtensionType type, IDictionary serializedAdditionalRawData, MongoDBChatExtensionParameters parameters) : base(type, serializedAdditionalRawData) + { + Parameters = parameters; + } + + /// Initializes a new instance of for deserialization. + internal MongoDBChatExtensionConfiguration() + { + } + + /// The parameters for the MongoDB chat extension. + public MongoDBChatExtensionParameters Parameters { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalMongoDBChatDataSourceParameters.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatExtensionParameters.Serialization.cs similarity index 54% rename from sdk/openai/Azure.AI.OpenAI/src/Generated/InternalMongoDBChatDataSourceParameters.Serialization.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatExtensionParameters.Serialization.cs index 4b033c4facfa..7ccd711b83ee 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalMongoDBChatDataSourceParameters.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatExtensionParameters.Serialization.cs @@ -1,109 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable using System; -using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.Core; -namespace Azure.AI.OpenAI.Chat +namespace Azure.AI.OpenAI { - internal partial class InternalMongoDBChatDataSourceParameters : IJsonModel + public partial class MongoDBChatExtensionParameters : IUtf8JsonSerializable, IJsonModel { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(InternalMongoDBChatDataSourceParameters)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(MongoDBChatExtensionParameters)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("top_n_documents") != true && Optional.IsDefined(TopNDocuments)) + if (Optional.IsDefined(DocumentCount)) { writer.WritePropertyName("top_n_documents"u8); - writer.WriteNumberValue(TopNDocuments.Value); + writer.WriteNumberValue(DocumentCount.Value); } - if (SerializedAdditionalRawData?.ContainsKey("in_scope") != true && Optional.IsDefined(InScope)) + if (Optional.IsDefined(ShouldRestrictResultScope)) { writer.WritePropertyName("in_scope"u8); - writer.WriteBooleanValue(InScope.Value); + writer.WriteBooleanValue(ShouldRestrictResultScope.Value); } - if (SerializedAdditionalRawData?.ContainsKey("strictness") != true && Optional.IsDefined(Strictness)) + if (Optional.IsDefined(Strictness)) { writer.WritePropertyName("strictness"u8); writer.WriteNumberValue(Strictness.Value); } - if (SerializedAdditionalRawData?.ContainsKey("max_search_queries") != true && Optional.IsDefined(MaxSearchQueries)) + if (Optional.IsDefined(MaxSearchQueries)) { writer.WritePropertyName("max_search_queries"u8); writer.WriteNumberValue(MaxSearchQueries.Value); } - if (SerializedAdditionalRawData?.ContainsKey("allow_partial_result") != true && Optional.IsDefined(AllowPartialResult)) + if (Optional.IsDefined(AllowPartialResult)) { writer.WritePropertyName("allow_partial_result"u8); writer.WriteBooleanValue(AllowPartialResult.Value); } - if (SerializedAdditionalRawData?.ContainsKey("include_contexts") != true && Optional.IsCollectionDefined(_internalIncludeContexts)) + if (Optional.IsCollectionDefined(IncludeContexts)) { writer.WritePropertyName("include_contexts"u8); writer.WriteStartArray(); - foreach (var item in _internalIncludeContexts) + foreach (var item in IncludeContexts) { - writer.WriteStringValue(item); + writer.WriteStringValue(item.ToString()); } writer.WriteEndArray(); } - if (SerializedAdditionalRawData?.ContainsKey("endpoint") != true) - { - writer.WritePropertyName("endpoint"u8); - writer.WriteStringValue(Endpoint); - } - if (SerializedAdditionalRawData?.ContainsKey("database_name") != true) - { - writer.WritePropertyName("database_name"u8); - writer.WriteStringValue(DatabaseName); - } - if (SerializedAdditionalRawData?.ContainsKey("collection_name") != true) - { - writer.WritePropertyName("collection_name"u8); - writer.WriteStringValue(CollectionName); - } - if (SerializedAdditionalRawData?.ContainsKey("app_name") != true) - { - writer.WritePropertyName("app_name"u8); - writer.WriteStringValue(AppName); - } - if (SerializedAdditionalRawData?.ContainsKey("index_name") != true) - { - writer.WritePropertyName("index_name"u8); - writer.WriteStringValue(IndexName); - } - if (SerializedAdditionalRawData?.ContainsKey("authentication") != true) + if (Optional.IsDefined(Authentication)) { writer.WritePropertyName("authentication"u8); - writer.WriteObjectValue(Authentication, options); + writer.WriteObjectValue(Authentication, options); } - if (SerializedAdditionalRawData?.ContainsKey("embedding_dependency") != true) - { - writer.WritePropertyName("embedding_dependency"u8); - writer.WriteObjectValue(EmbeddingDependency, options); - } - if (SerializedAdditionalRawData?.ContainsKey("fields_mapping") != true) + writer.WritePropertyName("endpoint"u8); + writer.WriteStringValue(Endpoint); + writer.WritePropertyName("collection_name"u8); + writer.WriteStringValue(CollectionName); + writer.WritePropertyName("database_name"u8); + writer.WriteStringValue(DatabaseName); + writer.WritePropertyName("app_name"u8); + writer.WriteStringValue(AppName); + writer.WritePropertyName("index_name"u8); + writer.WriteStringValue(IndexName); + writer.WritePropertyName("fields_mapping"u8); + writer.WriteObjectValue(FieldsMapping, options); + writer.WritePropertyName("embedding_dependency"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(EmbeddingDependency); +#else + using (JsonDocument document = JsonDocument.Parse(EmbeddingDependency)) { - writer.WritePropertyName("fields_mapping"u8); - writer.WriteObjectValue(FieldMappings, options); + JsonSerializer.Serialize(writer, document.RootElement); } - if (SerializedAdditionalRawData != null) +#endif + if (options.Format != "W" && _serializedAdditionalRawData != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _serializedAdditionalRawData) { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -115,22 +110,21 @@ void IJsonModel.Write(Utf8JsonWriter wr #endif } } - writer.WriteEndObject(); } - InternalMongoDBChatDataSourceParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + MongoDBChatExtensionParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(InternalMongoDBChatDataSourceParameters)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(MongoDBChatExtensionParameters)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInternalMongoDBChatDataSourceParameters(document.RootElement, options); + return DeserializeMongoDBChatExtensionParameters(document.RootElement, options); } - internal static InternalMongoDBChatDataSourceParameters DeserializeInternalMongoDBChatDataSourceParameters(JsonElement element, ModelReaderWriterOptions options = null) + internal static MongoDBChatExtensionParameters DeserializeMongoDBChatExtensionParameters(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -143,15 +137,15 @@ internal static InternalMongoDBChatDataSourceParameters DeserializeInternalMongo int? strictness = default; int? maxSearchQueries = default; bool? allowPartialResult = default; - IList includeContexts = default; + IList includeContexts = default; + OnYourDataUsernameAndPasswordAuthenticationOptions authentication = default; string endpoint = default; - string databaseName = default; string collectionName = default; + string databaseName = default; string appName = default; string indexName = default; - DataSourceAuthentication authentication = default; - DataSourceVectorizer embeddingDependency = default; - DataSourceFieldMappings fieldsMapping = default; + MongoDBChatExtensionParametersFieldsMapping fieldsMapping = default; + BinaryData embeddingDependency = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -207,22 +201,26 @@ internal static InternalMongoDBChatDataSourceParameters DeserializeInternalMongo { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(item.GetString()); + array.Add(new OnYourDataContextProperty(item.GetString())); } includeContexts = array; continue; } - if (property.NameEquals("endpoint"u8)) + if (property.NameEquals("authentication"u8)) { - endpoint = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authentication = OnYourDataUsernameAndPasswordAuthenticationOptions.DeserializeOnYourDataUsernameAndPasswordAuthenticationOptions(property.Value, options); continue; } - if (property.NameEquals("database_name"u8)) + if (property.NameEquals("endpoint"u8)) { - databaseName = property.Value.GetString(); + endpoint = property.Value.GetString(); continue; } if (property.NameEquals("collection_name"u8)) @@ -230,6 +228,11 @@ internal static InternalMongoDBChatDataSourceParameters DeserializeInternalMongo collectionName = property.Value.GetString(); continue; } + if (property.NameEquals("database_name"u8)) + { + databaseName = property.Value.GetString(); + continue; + } if (property.NameEquals("app_name"u8)) { appName = property.Value.GetString(); @@ -240,89 +243,85 @@ internal static InternalMongoDBChatDataSourceParameters DeserializeInternalMongo indexName = property.Value.GetString(); continue; } - if (property.NameEquals("authentication"u8)) + if (property.NameEquals("fields_mapping"u8)) { - authentication = DataSourceAuthentication.DeserializeDataSourceAuthentication(property.Value, options); + fieldsMapping = MongoDBChatExtensionParametersFieldsMapping.DeserializeMongoDBChatExtensionParametersFieldsMapping(property.Value, options); continue; } if (property.NameEquals("embedding_dependency"u8)) { - embeddingDependency = DataSourceVectorizer.DeserializeDataSourceVectorizer(property.Value, options); - continue; - } - if (property.NameEquals("fields_mapping"u8)) - { - fieldsMapping = DataSourceFieldMappings.DeserializeDataSourceFieldMappings(property.Value, options); + embeddingDependency = BinaryData.FromString(property.Value.GetRawText()); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new InternalMongoDBChatDataSourceParameters( + return new MongoDBChatExtensionParameters( topNDocuments, inScope, strictness, maxSearchQueries, allowPartialResult, - includeContexts ?? new ChangeTrackingList(), + includeContexts ?? new ChangeTrackingList(), + authentication, endpoint, - databaseName, collectionName, + databaseName, appName, indexName, - authentication, - embeddingDependency, fieldsMapping, + embeddingDependency, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(InternalMongoDBChatDataSourceParameters)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(MongoDBChatExtensionParameters)} does not support writing '{options.Format}' format."); } } - InternalMongoDBChatDataSourceParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + MongoDBChatExtensionParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInternalMongoDBChatDataSourceParameters(document.RootElement, options); + return DeserializeMongoDBChatExtensionParameters(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(InternalMongoDBChatDataSourceParameters)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(MongoDBChatExtensionParameters)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static InternalMongoDBChatDataSourceParameters FromResponse(PipelineResponse response) + /// The response to deserialize the model from. + internal static MongoDBChatExtensionParameters FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalMongoDBChatDataSourceParameters(document.RootElement); + return DeserializeMongoDBChatExtensionParameters(document.RootElement); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// Convert into a . + internal virtual RequestContent ToRequestContent() { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatExtensionParameters.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatExtensionParameters.cs new file mode 100644 index 000000000000..2bcbfbd262e3 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatExtensionParameters.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Parameters for the MongoDB chat extension. The supported authentication types are AccessToken, SystemAssignedManagedIdentity and UserAssignedManagedIdentity. + public partial class MongoDBChatExtensionParameters + { + /// + /// 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; + + /// Initializes a new instance of . + /// The endpoint name for MongoDB. + /// The collection name for MongoDB. + /// The database name for MongoDB. + /// The app name for MongoDB. + /// The name of the MongoDB index. + /// + /// Field mappings to apply to data used by the MongoDB data source. + /// Note that content and vector field mappings are required for MongoDB. + /// + /// The vectorization source to use with the MongoDB chat extension. + /// , , , , , or is null. + public MongoDBChatExtensionParameters(string endpoint, string collectionName, string databaseName, string appName, string indexName, MongoDBChatExtensionParametersFieldsMapping fieldsMapping, BinaryData embeddingDependency) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(collectionName, nameof(collectionName)); + Argument.AssertNotNull(databaseName, nameof(databaseName)); + Argument.AssertNotNull(appName, nameof(appName)); + Argument.AssertNotNull(indexName, nameof(indexName)); + Argument.AssertNotNull(fieldsMapping, nameof(fieldsMapping)); + Argument.AssertNotNull(embeddingDependency, nameof(embeddingDependency)); + + IncludeContexts = new ChangeTrackingList(); + Endpoint = endpoint; + CollectionName = collectionName; + DatabaseName = databaseName; + AppName = appName; + IndexName = indexName; + FieldsMapping = fieldsMapping; + EmbeddingDependency = embeddingDependency; + } + + /// Initializes a new instance of . + /// The configured top number of documents to feature for the configured query. + /// Whether queries should be restricted to use of indexed data. + /// The configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but lower recall of the answer. + /// + /// The max number of rewritten queries should be send to search provider for one user message. If not specified, + /// the system will decide the number of queries to send. + /// + /// + /// If specified as true, the system will allow partial search results to be used and the request fails if all the queries fail. + /// If not specified, or specified as false, the request will fail if any search query fails. + /// + /// The included properties of the output context. If not specified, the default value is `citations` and `intent`. + /// + /// The authentication method to use when accessing the defined data source. + /// Each data source type supports a specific set of available authentication methods; please see the documentation of + /// the data source for supported mechanisms. + /// If not otherwise provided, On Your Data will attempt to use System Managed Identity (default credential) + /// authentication. + /// + /// The endpoint name for MongoDB. + /// The collection name for MongoDB. + /// The database name for MongoDB. + /// The app name for MongoDB. + /// The name of the MongoDB index. + /// + /// Field mappings to apply to data used by the MongoDB data source. + /// Note that content and vector field mappings are required for MongoDB. + /// + /// The vectorization source to use with the MongoDB chat extension. + /// Keeps track of any properties unknown to the library. + internal MongoDBChatExtensionParameters(int? documentCount, bool? shouldRestrictResultScope, int? strictness, int? maxSearchQueries, bool? allowPartialResult, IList includeContexts, OnYourDataUsernameAndPasswordAuthenticationOptions authentication, string endpoint, string collectionName, string databaseName, string appName, string indexName, MongoDBChatExtensionParametersFieldsMapping fieldsMapping, BinaryData embeddingDependency, IDictionary serializedAdditionalRawData) + { + DocumentCount = documentCount; + ShouldRestrictResultScope = shouldRestrictResultScope; + Strictness = strictness; + MaxSearchQueries = maxSearchQueries; + AllowPartialResult = allowPartialResult; + IncludeContexts = includeContexts; + Authentication = authentication; + Endpoint = endpoint; + CollectionName = collectionName; + DatabaseName = databaseName; + AppName = appName; + IndexName = indexName; + FieldsMapping = fieldsMapping; + EmbeddingDependency = embeddingDependency; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MongoDBChatExtensionParameters() + { + } + + /// The configured top number of documents to feature for the configured query. + public int? DocumentCount { get; set; } + /// Whether queries should be restricted to use of indexed data. + public bool? ShouldRestrictResultScope { get; set; } + /// The configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but lower recall of the answer. + public int? Strictness { get; set; } + /// + /// The max number of rewritten queries should be send to search provider for one user message. If not specified, + /// the system will decide the number of queries to send. + /// + public int? MaxSearchQueries { get; set; } + /// + /// If specified as true, the system will allow partial search results to be used and the request fails if all the queries fail. + /// If not specified, or specified as false, the request will fail if any search query fails. + /// + public bool? AllowPartialResult { get; set; } + /// The included properties of the output context. If not specified, the default value is `citations` and `intent`. + public IList IncludeContexts { get; } + /// + /// The authentication method to use when accessing the defined data source. + /// Each data source type supports a specific set of available authentication methods; please see the documentation of + /// the data source for supported mechanisms. + /// If not otherwise provided, On Your Data will attempt to use System Managed Identity (default credential) + /// authentication. + /// + public OnYourDataUsernameAndPasswordAuthenticationOptions Authentication { get; set; } + /// The endpoint name for MongoDB. + public string Endpoint { get; } + /// The collection name for MongoDB. + public string CollectionName { get; } + /// The database name for MongoDB. + public string DatabaseName { get; } + /// The app name for MongoDB. + public string AppName { get; } + /// The name of the MongoDB index. + public string IndexName { get; } + /// + /// Field mappings to apply to data used by the MongoDB data source. + /// Note that content and vector field mappings are required for MongoDB. + /// + public MongoDBChatExtensionParametersFieldsMapping FieldsMapping { get; } + /// + /// The vectorization source to use with the MongoDB chat extension. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// + /// Supported types: + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// 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" }. + /// + /// + /// + /// + public BinaryData EmbeddingDependency { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatExtensionParametersFieldsMapping.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatExtensionParametersFieldsMapping.Serialization.cs new file mode 100644 index 000000000000..89d15fb28f03 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatExtensionParametersFieldsMapping.Serialization.cs @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class MongoDBChatExtensionParametersFieldsMapping : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(MongoDBChatExtensionParametersFieldsMapping)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("content_fields"u8); + writer.WriteStartArray(); + foreach (var item in ContentFields) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("vector_fields"u8); + writer.WriteStartArray(); + foreach (var item in VectorFields) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(TitleField)) + { + writer.WritePropertyName("title_field"u8); + writer.WriteStringValue(TitleField); + } + if (Optional.IsDefined(UrlField)) + { + writer.WritePropertyName("url_field"u8); + writer.WriteStringValue(UrlField); + } + if (Optional.IsDefined(FilepathField)) + { + writer.WritePropertyName("filepath_field"u8); + writer.WriteStringValue(FilepathField); + } + if (Optional.IsDefined(ContentFieldsSeparator)) + { + writer.WritePropertyName("content_fields_separator"u8); + writer.WriteStringValue(ContentFieldsSeparator); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MongoDBChatExtensionParametersFieldsMapping IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MongoDBChatExtensionParametersFieldsMapping)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMongoDBChatExtensionParametersFieldsMapping(document.RootElement, options); + } + + internal static MongoDBChatExtensionParametersFieldsMapping DeserializeMongoDBChatExtensionParametersFieldsMapping(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList contentFields = default; + IList vectorFields = default; + string titleField = default; + string urlField = default; + string filepathField = default; + string contentFieldsSeparator = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("content_fields"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + contentFields = array; + continue; + } + if (property.NameEquals("vector_fields"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + vectorFields = array; + continue; + } + if (property.NameEquals("title_field"u8)) + { + titleField = property.Value.GetString(); + continue; + } + if (property.NameEquals("url_field"u8)) + { + urlField = property.Value.GetString(); + continue; + } + if (property.NameEquals("filepath_field"u8)) + { + filepathField = property.Value.GetString(); + continue; + } + if (property.NameEquals("content_fields_separator"u8)) + { + contentFieldsSeparator = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MongoDBChatExtensionParametersFieldsMapping( + contentFields, + vectorFields, + titleField, + urlField, + filepathField, + contentFieldsSeparator, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MongoDBChatExtensionParametersFieldsMapping)} does not support writing '{options.Format}' format."); + } + } + + MongoDBChatExtensionParametersFieldsMapping IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMongoDBChatExtensionParametersFieldsMapping(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MongoDBChatExtensionParametersFieldsMapping)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static MongoDBChatExtensionParametersFieldsMapping FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeMongoDBChatExtensionParametersFieldsMapping(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/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatExtensionParametersFieldsMapping.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatExtensionParametersFieldsMapping.cs new file mode 100644 index 000000000000..bfe79488c08c --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatExtensionParametersFieldsMapping.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.OpenAI +{ + /// The MongoDBChatExtensionParametersFieldsMapping. + public partial class MongoDBChatExtensionParametersFieldsMapping + { + /// + /// 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; + + /// Initializes a new instance of . + /// + /// + /// or is null. + public MongoDBChatExtensionParametersFieldsMapping(IEnumerable contentFields, IEnumerable vectorFields) + { + Argument.AssertNotNull(contentFields, nameof(contentFields)); + Argument.AssertNotNull(vectorFields, nameof(vectorFields)); + + ContentFields = contentFields.ToList(); + VectorFields = vectorFields.ToList(); + } + + /// Initializes a new instance of . + /// + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + internal MongoDBChatExtensionParametersFieldsMapping(IList contentFields, IList vectorFields, string titleField, string urlField, string filepathField, string contentFieldsSeparator, IDictionary serializedAdditionalRawData) + { + ContentFields = contentFields; + VectorFields = vectorFields; + TitleField = titleField; + UrlField = urlField; + FilepathField = filepathField; + ContentFieldsSeparator = contentFieldsSeparator; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MongoDBChatExtensionParametersFieldsMapping() + { + } + + /// Gets the content fields. + public IList ContentFields { get; } + /// Gets the vector fields. + public IList VectorFields { get; } + /// Gets or sets the title field. + public string TitleField { get; set; } + /// Gets or sets the url field. + public string UrlField { get; set; } + /// Gets or sets the filepath field. + public string FilepathField { get; set; } + /// Gets or sets the content fields separator. + public string ContentFieldsSeparator { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataAccessTokenAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataAccessTokenAuthenticationOptions.Serialization.cs new file mode 100644 index 000000000000..1b3936a18e79 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataAccessTokenAuthenticationOptions.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class OnYourDataAccessTokenAuthenticationOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataAccessTokenAuthenticationOptions)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("access_token"u8); + writer.WriteStringValue(AccessToken); + } + + OnYourDataAccessTokenAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataAccessTokenAuthenticationOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOnYourDataAccessTokenAuthenticationOptions(document.RootElement, options); + } + + internal static OnYourDataAccessTokenAuthenticationOptions DeserializeOnYourDataAccessTokenAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string accessToken = default; + OnYourDataAuthenticationType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("access_token"u8)) + { + accessToken = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new OnYourDataAuthenticationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OnYourDataAccessTokenAuthenticationOptions(type, serializedAdditionalRawData, accessToken); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OnYourDataAccessTokenAuthenticationOptions)} does not support writing '{options.Format}' format."); + } + } + + OnYourDataAccessTokenAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOnYourDataAccessTokenAuthenticationOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OnYourDataAccessTokenAuthenticationOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new OnYourDataAccessTokenAuthenticationOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOnYourDataAccessTokenAuthenticationOptions(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/openai/Azure.AI.OpenAI/src/Generated/OnYourDataAccessTokenAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataAccessTokenAuthenticationOptions.cs new file mode 100644 index 000000000000..50ccaddc9fd2 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataAccessTokenAuthenticationOptions.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// The authentication options for Azure OpenAI On Your Data when using access token. + public partial class OnYourDataAccessTokenAuthenticationOptions : OnYourDataAuthenticationOptions + { + /// Initializes a new instance of . + /// The access token to use for authentication. + /// is null. + public OnYourDataAccessTokenAuthenticationOptions(string accessToken) + { + Argument.AssertNotNull(accessToken, nameof(accessToken)); + + Type = OnYourDataAuthenticationType.AccessToken; + AccessToken = accessToken; + } + + /// Initializes a new instance of . + /// The authentication type. + /// Keeps track of any properties unknown to the library. + /// The access token to use for authentication. + internal OnYourDataAccessTokenAuthenticationOptions(OnYourDataAuthenticationType type, IDictionary serializedAdditionalRawData, string accessToken) : base(type, serializedAdditionalRawData) + { + AccessToken = accessToken; + } + + /// Initializes a new instance of for deserialization. + internal OnYourDataAccessTokenAuthenticationOptions() + { + } + + /// The access token to use for authentication. + public string AccessToken { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataApiKeyAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataApiKeyAuthenticationOptions.Serialization.cs new file mode 100644 index 000000000000..e6fe383b2fd7 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataApiKeyAuthenticationOptions.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class OnYourDataApiKeyAuthenticationOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataApiKeyAuthenticationOptions)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + } + + OnYourDataApiKeyAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataApiKeyAuthenticationOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOnYourDataApiKeyAuthenticationOptions(document.RootElement, options); + } + + internal static OnYourDataApiKeyAuthenticationOptions DeserializeOnYourDataApiKeyAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string key = default; + OnYourDataAuthenticationType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("key"u8)) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new OnYourDataAuthenticationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OnYourDataApiKeyAuthenticationOptions(type, serializedAdditionalRawData, key); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OnYourDataApiKeyAuthenticationOptions)} does not support writing '{options.Format}' format."); + } + } + + OnYourDataApiKeyAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOnYourDataApiKeyAuthenticationOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OnYourDataApiKeyAuthenticationOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new OnYourDataApiKeyAuthenticationOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOnYourDataApiKeyAuthenticationOptions(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/openai/Azure.AI.OpenAI/src/Generated/OnYourDataApiKeyAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataApiKeyAuthenticationOptions.cs new file mode 100644 index 000000000000..f0a14f528a7c --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataApiKeyAuthenticationOptions.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// The authentication options for Azure OpenAI On Your Data when using an API key. + public partial class OnYourDataApiKeyAuthenticationOptions : OnYourDataAuthenticationOptions + { + /// Initializes a new instance of . + /// The API key to use for authentication. + /// is null. + public OnYourDataApiKeyAuthenticationOptions(string key) + { + Argument.AssertNotNull(key, nameof(key)); + + Type = OnYourDataAuthenticationType.ApiKey; + Key = key; + } + + /// Initializes a new instance of . + /// The authentication type. + /// Keeps track of any properties unknown to the library. + /// The API key to use for authentication. + internal OnYourDataApiKeyAuthenticationOptions(OnYourDataAuthenticationType type, IDictionary serializedAdditionalRawData, string key) : base(type, serializedAdditionalRawData) + { + Key = key; + } + + /// Initializes a new instance of for deserialization. + internal OnYourDataApiKeyAuthenticationOptions() + { + } + + /// The API key to use for authentication. + public string Key { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataAuthenticationOptions.Serialization.cs new file mode 100644 index 000000000000..12d36c52d08d --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataAuthenticationOptions.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + [PersistableModelProxy(typeof(UnknownOnYourDataAuthenticationOptions))] + public partial class OnYourDataAuthenticationOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataAuthenticationOptions)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OnYourDataAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataAuthenticationOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOnYourDataAuthenticationOptions(document.RootElement, options); + } + + internal static OnYourDataAuthenticationOptions DeserializeOnYourDataAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "access_token": return OnYourDataAccessTokenAuthenticationOptions.DeserializeOnYourDataAccessTokenAuthenticationOptions(element, options); + case "api_key": return OnYourDataApiKeyAuthenticationOptions.DeserializeOnYourDataApiKeyAuthenticationOptions(element, options); + case "connection_string": return OnYourDataConnectionStringAuthenticationOptions.DeserializeOnYourDataConnectionStringAuthenticationOptions(element, options); + case "encoded_api_key": return OnYourDataEncodedApiKeyAuthenticationOptions.DeserializeOnYourDataEncodedApiKeyAuthenticationOptions(element, options); + case "key_and_key_id": return OnYourDataKeyAndKeyIdAuthenticationOptions.DeserializeOnYourDataKeyAndKeyIdAuthenticationOptions(element, options); + case "system_assigned_managed_identity": return OnYourDataSystemAssignedManagedIdentityAuthenticationOptions.DeserializeOnYourDataSystemAssignedManagedIdentityAuthenticationOptions(element, options); + case "user_assigned_managed_identity": return OnYourDataUserAssignedManagedIdentityAuthenticationOptions.DeserializeOnYourDataUserAssignedManagedIdentityAuthenticationOptions(element, options); + case "username_and_password": return OnYourDataUsernameAndPasswordAuthenticationOptions.DeserializeOnYourDataUsernameAndPasswordAuthenticationOptions(element, options); + } + } + return UnknownOnYourDataAuthenticationOptions.DeserializeUnknownOnYourDataAuthenticationOptions(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OnYourDataAuthenticationOptions)} does not support writing '{options.Format}' format."); + } + } + + OnYourDataAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOnYourDataAuthenticationOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OnYourDataAuthenticationOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static OnYourDataAuthenticationOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOnYourDataAuthenticationOptions(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/openai/Azure.AI.OpenAI/src/Generated/OnYourDataAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataAuthenticationOptions.cs new file mode 100644 index 000000000000..e507e2c7c801 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataAuthenticationOptions.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// + /// The authentication options for Azure OpenAI On Your Data. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , and . + /// + public abstract partial class OnYourDataAuthenticationOptions + { + /// + /// 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; + + /// Initializes a new instance of . + protected OnYourDataAuthenticationOptions() + { + } + + /// Initializes a new instance of . + /// The authentication type. + /// Keeps track of any properties unknown to the library. + internal OnYourDataAuthenticationOptions(OnYourDataAuthenticationType type, IDictionary serializedAdditionalRawData) + { + Type = type; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The authentication type. + internal OnYourDataAuthenticationType Type { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataAuthenticationType.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataAuthenticationType.cs new file mode 100644 index 000000000000..3505399d9f9d --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataAuthenticationType.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// The authentication types supported with Azure OpenAI On Your Data. + internal readonly partial struct OnYourDataAuthenticationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OnYourDataAuthenticationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ApiKeyValue = "api_key"; + private const string ConnectionStringValue = "connection_string"; + private const string KeyAndKeyIdValue = "key_and_key_id"; + private const string EncodedApiKeyValue = "encoded_api_key"; + private const string AccessTokenValue = "access_token"; + private const string SystemAssignedManagedIdentityValue = "system_assigned_managed_identity"; + private const string UserAssignedManagedIdentityValue = "user_assigned_managed_identity"; + private const string UsernameAndPasswordValue = "username_and_password"; + + /// Authentication via API key. + public static OnYourDataAuthenticationType ApiKey { get; } = new OnYourDataAuthenticationType(ApiKeyValue); + /// Authentication via connection string. + public static OnYourDataAuthenticationType ConnectionString { get; } = new OnYourDataAuthenticationType(ConnectionStringValue); + /// Authentication via key and key ID pair. + public static OnYourDataAuthenticationType KeyAndKeyId { get; } = new OnYourDataAuthenticationType(KeyAndKeyIdValue); + /// Authentication via encoded API key. + public static OnYourDataAuthenticationType EncodedApiKey { get; } = new OnYourDataAuthenticationType(EncodedApiKeyValue); + /// Authentication via access token. + public static OnYourDataAuthenticationType AccessToken { get; } = new OnYourDataAuthenticationType(AccessTokenValue); + /// Authentication via system-assigned managed identity. + public static OnYourDataAuthenticationType SystemAssignedManagedIdentity { get; } = new OnYourDataAuthenticationType(SystemAssignedManagedIdentityValue); + /// Authentication via user-assigned managed identity. + public static OnYourDataAuthenticationType UserAssignedManagedIdentity { get; } = new OnYourDataAuthenticationType(UserAssignedManagedIdentityValue); + /// Authentication via username and password. + public static OnYourDataAuthenticationType UsernameAndPassword { get; } = new OnYourDataAuthenticationType(UsernameAndPasswordValue); + /// Determines if two values are the same. + public static bool operator ==(OnYourDataAuthenticationType left, OnYourDataAuthenticationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OnYourDataAuthenticationType left, OnYourDataAuthenticationType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OnYourDataAuthenticationType(string value) => new OnYourDataAuthenticationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OnYourDataAuthenticationType other && Equals(other); + /// + public bool Equals(OnYourDataAuthenticationType 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/openai/Azure.AI.OpenAI/src/Generated/OnYourDataConnectionStringAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataConnectionStringAuthenticationOptions.Serialization.cs new file mode 100644 index 000000000000..03059e450a69 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataConnectionStringAuthenticationOptions.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class OnYourDataConnectionStringAuthenticationOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataConnectionStringAuthenticationOptions)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("connection_string"u8); + writer.WriteStringValue(ConnectionString); + } + + OnYourDataConnectionStringAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataConnectionStringAuthenticationOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOnYourDataConnectionStringAuthenticationOptions(document.RootElement, options); + } + + internal static OnYourDataConnectionStringAuthenticationOptions DeserializeOnYourDataConnectionStringAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string connectionString = default; + OnYourDataAuthenticationType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("connection_string"u8)) + { + connectionString = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new OnYourDataAuthenticationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OnYourDataConnectionStringAuthenticationOptions(type, serializedAdditionalRawData, connectionString); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OnYourDataConnectionStringAuthenticationOptions)} does not support writing '{options.Format}' format."); + } + } + + OnYourDataConnectionStringAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOnYourDataConnectionStringAuthenticationOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OnYourDataConnectionStringAuthenticationOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new OnYourDataConnectionStringAuthenticationOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOnYourDataConnectionStringAuthenticationOptions(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/openai/Azure.AI.OpenAI/src/Generated/OnYourDataConnectionStringAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataConnectionStringAuthenticationOptions.cs new file mode 100644 index 000000000000..a3a007891075 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataConnectionStringAuthenticationOptions.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// The authentication options for Azure OpenAI On Your Data when using a connection string. + public partial class OnYourDataConnectionStringAuthenticationOptions : OnYourDataAuthenticationOptions + { + /// Initializes a new instance of . + /// The connection string to use for authentication. + /// is null. + public OnYourDataConnectionStringAuthenticationOptions(string connectionString) + { + Argument.AssertNotNull(connectionString, nameof(connectionString)); + + Type = OnYourDataAuthenticationType.ConnectionString; + ConnectionString = connectionString; + } + + /// Initializes a new instance of . + /// The authentication type. + /// Keeps track of any properties unknown to the library. + /// The connection string to use for authentication. + internal OnYourDataConnectionStringAuthenticationOptions(OnYourDataAuthenticationType type, IDictionary serializedAdditionalRawData, string connectionString) : base(type, serializedAdditionalRawData) + { + ConnectionString = connectionString; + } + + /// Initializes a new instance of for deserialization. + internal OnYourDataConnectionStringAuthenticationOptions() + { + } + + /// The connection string to use for authentication. + public string ConnectionString { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataContextProperty.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataContextProperty.cs new file mode 100644 index 000000000000..741585547c4a --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataContextProperty.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// The context property. + public readonly partial struct OnYourDataContextProperty : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OnYourDataContextProperty(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CitationsValue = "citations"; + private const string IntentValue = "intent"; + private const string AllRetrievedDocumentsValue = "all_retrieved_documents"; + + /// The `citations` property. + public static OnYourDataContextProperty Citations { get; } = new OnYourDataContextProperty(CitationsValue); + /// The `intent` property. + public static OnYourDataContextProperty Intent { get; } = new OnYourDataContextProperty(IntentValue); + /// The `all_retrieved_documents` property. + public static OnYourDataContextProperty AllRetrievedDocuments { get; } = new OnYourDataContextProperty(AllRetrievedDocumentsValue); + /// Determines if two values are the same. + public static bool operator ==(OnYourDataContextProperty left, OnYourDataContextProperty right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OnYourDataContextProperty left, OnYourDataContextProperty right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OnYourDataContextProperty(string value) => new OnYourDataContextProperty(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OnYourDataContextProperty other && Equals(other); + /// + public bool Equals(OnYourDataContextProperty 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/openai/Azure.AI.OpenAI/src/Generated/OnYourDataDeploymentNameVectorizationSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataDeploymentNameVectorizationSource.Serialization.cs new file mode 100644 index 000000000000..4fb1c22e39f0 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataDeploymentNameVectorizationSource.Serialization.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class OnYourDataDeploymentNameVectorizationSource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataDeploymentNameVectorizationSource)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("deployment_name"u8); + writer.WriteStringValue(DeploymentName); + if (Optional.IsDefined(Dimensions)) + { + writer.WritePropertyName("dimensions"u8); + writer.WriteNumberValue(Dimensions.Value); + } + } + + OnYourDataDeploymentNameVectorizationSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataDeploymentNameVectorizationSource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOnYourDataDeploymentNameVectorizationSource(document.RootElement, options); + } + + internal static OnYourDataDeploymentNameVectorizationSource DeserializeOnYourDataDeploymentNameVectorizationSource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string deploymentName = default; + int? dimensions = default; + OnYourDataVectorizationSourceType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("deployment_name"u8)) + { + deploymentName = property.Value.GetString(); + continue; + } + if (property.NameEquals("dimensions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dimensions = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new OnYourDataVectorizationSourceType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OnYourDataDeploymentNameVectorizationSource(type, serializedAdditionalRawData, deploymentName, dimensions); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OnYourDataDeploymentNameVectorizationSource)} does not support writing '{options.Format}' format."); + } + } + + OnYourDataDeploymentNameVectorizationSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOnYourDataDeploymentNameVectorizationSource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OnYourDataDeploymentNameVectorizationSource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new OnYourDataDeploymentNameVectorizationSource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOnYourDataDeploymentNameVectorizationSource(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/openai/Azure.AI.OpenAI/src/Generated/OnYourDataDeploymentNameVectorizationSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataDeploymentNameVectorizationSource.cs new file mode 100644 index 000000000000..1183ff66cbe4 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataDeploymentNameVectorizationSource.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// + /// The details of a a vectorization source, used by Azure OpenAI On Your Data when applying vector search, that is based + /// on an internal embeddings model deployment name in the same Azure OpenAI resource. + /// + public partial class OnYourDataDeploymentNameVectorizationSource : OnYourDataVectorizationSource + { + /// Initializes a new instance of . + /// The embedding model deployment name within the same Azure OpenAI resource. This enables you to use vector search without Azure OpenAI api-key and without Azure OpenAI public network access. + /// is null. + public OnYourDataDeploymentNameVectorizationSource(string deploymentName) + { + Argument.AssertNotNull(deploymentName, nameof(deploymentName)); + + Type = OnYourDataVectorizationSourceType.DeploymentName; + DeploymentName = deploymentName; + } + + /// Initializes a new instance of . + /// The type of vectorization source to use. + /// Keeps track of any properties unknown to the library. + /// The embedding model deployment name within the same Azure OpenAI resource. This enables you to use vector search without Azure OpenAI api-key and without Azure OpenAI public network access. + /// The number of dimensions the embeddings should have. Only supported in `text-embedding-3` and later models. + internal OnYourDataDeploymentNameVectorizationSource(OnYourDataVectorizationSourceType type, IDictionary serializedAdditionalRawData, string deploymentName, int? dimensions) : base(type, serializedAdditionalRawData) + { + DeploymentName = deploymentName; + Dimensions = dimensions; + } + + /// Initializes a new instance of for deserialization. + internal OnYourDataDeploymentNameVectorizationSource() + { + } + + /// The embedding model deployment name within the same Azure OpenAI resource. This enables you to use vector search without Azure OpenAI api-key and without Azure OpenAI public network access. + public string DeploymentName { get; } + /// The number of dimensions the embeddings should have. Only supported in `text-embedding-3` and later models. + public int? Dimensions { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataEncodedApiKeyAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataEncodedApiKeyAuthenticationOptions.Serialization.cs new file mode 100644 index 000000000000..138b466b1db6 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataEncodedApiKeyAuthenticationOptions.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class OnYourDataEncodedApiKeyAuthenticationOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataEncodedApiKeyAuthenticationOptions)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("encoded_api_key"u8); + writer.WriteStringValue(EncodedApiKey); + } + + OnYourDataEncodedApiKeyAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataEncodedApiKeyAuthenticationOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOnYourDataEncodedApiKeyAuthenticationOptions(document.RootElement, options); + } + + internal static OnYourDataEncodedApiKeyAuthenticationOptions DeserializeOnYourDataEncodedApiKeyAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string encodedApiKey = default; + OnYourDataAuthenticationType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("encoded_api_key"u8)) + { + encodedApiKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new OnYourDataAuthenticationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OnYourDataEncodedApiKeyAuthenticationOptions(type, serializedAdditionalRawData, encodedApiKey); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OnYourDataEncodedApiKeyAuthenticationOptions)} does not support writing '{options.Format}' format."); + } + } + + OnYourDataEncodedApiKeyAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOnYourDataEncodedApiKeyAuthenticationOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OnYourDataEncodedApiKeyAuthenticationOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new OnYourDataEncodedApiKeyAuthenticationOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOnYourDataEncodedApiKeyAuthenticationOptions(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/openai/Azure.AI.OpenAI/src/Generated/OnYourDataEncodedApiKeyAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataEncodedApiKeyAuthenticationOptions.cs new file mode 100644 index 000000000000..927e2e27e169 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataEncodedApiKeyAuthenticationOptions.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// The authentication options for Azure OpenAI On Your Data when using an Elasticsearch encoded API key. + public partial class OnYourDataEncodedApiKeyAuthenticationOptions : OnYourDataAuthenticationOptions + { + /// Initializes a new instance of . + /// The encoded API key to use for authentication. + /// is null. + public OnYourDataEncodedApiKeyAuthenticationOptions(string encodedApiKey) + { + Argument.AssertNotNull(encodedApiKey, nameof(encodedApiKey)); + + Type = OnYourDataAuthenticationType.EncodedApiKey; + EncodedApiKey = encodedApiKey; + } + + /// Initializes a new instance of . + /// The authentication type. + /// Keeps track of any properties unknown to the library. + /// The encoded API key to use for authentication. + internal OnYourDataEncodedApiKeyAuthenticationOptions(OnYourDataAuthenticationType type, IDictionary serializedAdditionalRawData, string encodedApiKey) : base(type, serializedAdditionalRawData) + { + EncodedApiKey = encodedApiKey; + } + + /// Initializes a new instance of for deserialization. + internal OnYourDataEncodedApiKeyAuthenticationOptions() + { + } + + /// The encoded API key to use for authentication. + public string EncodedApiKey { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataEndpointVectorizationSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataEndpointVectorizationSource.Serialization.cs new file mode 100644 index 000000000000..559bf813932b --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataEndpointVectorizationSource.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class OnYourDataEndpointVectorizationSource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataEndpointVectorizationSource)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("endpoint"u8); + writer.WriteStringValue(Endpoint.AbsoluteUri); + writer.WritePropertyName("authentication"u8); + writer.WriteObjectValue(Authentication, options); + } + + OnYourDataEndpointVectorizationSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataEndpointVectorizationSource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOnYourDataEndpointVectorizationSource(document.RootElement, options); + } + + internal static OnYourDataEndpointVectorizationSource DeserializeOnYourDataEndpointVectorizationSource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri endpoint = default; + OnYourDataVectorSearchAuthenticationOptions authentication = default; + OnYourDataVectorizationSourceType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("endpoint"u8)) + { + endpoint = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("authentication"u8)) + { + authentication = OnYourDataVectorSearchAuthenticationOptions.DeserializeOnYourDataVectorSearchAuthenticationOptions(property.Value, options); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new OnYourDataVectorizationSourceType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OnYourDataEndpointVectorizationSource(type, serializedAdditionalRawData, endpoint, authentication); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OnYourDataEndpointVectorizationSource)} does not support writing '{options.Format}' format."); + } + } + + OnYourDataEndpointVectorizationSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOnYourDataEndpointVectorizationSource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OnYourDataEndpointVectorizationSource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new OnYourDataEndpointVectorizationSource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOnYourDataEndpointVectorizationSource(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/openai/Azure.AI.OpenAI/src/Generated/OnYourDataEndpointVectorizationSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataEndpointVectorizationSource.cs new file mode 100644 index 000000000000..5ab4f3198354 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataEndpointVectorizationSource.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// + /// The details of a a vectorization source, used by Azure OpenAI On Your Data when applying vector search, that is based + /// on a public Azure OpenAI endpoint call for embeddings. + /// + public partial class OnYourDataEndpointVectorizationSource : OnYourDataVectorizationSource + { + /// Initializes a new instance of . + /// Specifies the resource endpoint URL from which embeddings should be retrieved. It should be in the format of https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/embeddings. The api-version query parameter is not allowed. + /// + /// Specifies the authentication options to use when retrieving embeddings from the specified endpoint. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// or is null. + public OnYourDataEndpointVectorizationSource(Uri endpoint, OnYourDataVectorSearchAuthenticationOptions authentication) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(authentication, nameof(authentication)); + + Type = OnYourDataVectorizationSourceType.Endpoint; + Endpoint = endpoint; + Authentication = authentication; + } + + /// Initializes a new instance of . + /// The type of vectorization source to use. + /// Keeps track of any properties unknown to the library. + /// Specifies the resource endpoint URL from which embeddings should be retrieved. It should be in the format of https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/embeddings. The api-version query parameter is not allowed. + /// + /// Specifies the authentication options to use when retrieving embeddings from the specified endpoint. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + internal OnYourDataEndpointVectorizationSource(OnYourDataVectorizationSourceType type, IDictionary serializedAdditionalRawData, Uri endpoint, OnYourDataVectorSearchAuthenticationOptions authentication) : base(type, serializedAdditionalRawData) + { + Endpoint = endpoint; + Authentication = authentication; + } + + /// Initializes a new instance of for deserialization. + internal OnYourDataEndpointVectorizationSource() + { + } + + /// Specifies the resource endpoint URL from which embeddings should be retrieved. It should be in the format of https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/embeddings. The api-version query parameter is not allowed. + public Uri Endpoint { get; } + /// + /// Specifies the authentication options to use when retrieving embeddings from the specified endpoint. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public OnYourDataVectorSearchAuthenticationOptions Authentication { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataIntegratedVectorizationSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataIntegratedVectorizationSource.Serialization.cs new file mode 100644 index 000000000000..2f9028279b2f --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataIntegratedVectorizationSource.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class OnYourDataIntegratedVectorizationSource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataIntegratedVectorizationSource)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + OnYourDataIntegratedVectorizationSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataIntegratedVectorizationSource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOnYourDataIntegratedVectorizationSource(document.RootElement, options); + } + + internal static OnYourDataIntegratedVectorizationSource DeserializeOnYourDataIntegratedVectorizationSource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OnYourDataVectorizationSourceType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new OnYourDataVectorizationSourceType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OnYourDataIntegratedVectorizationSource(type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OnYourDataIntegratedVectorizationSource)} does not support writing '{options.Format}' format."); + } + } + + OnYourDataIntegratedVectorizationSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOnYourDataIntegratedVectorizationSource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OnYourDataIntegratedVectorizationSource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new OnYourDataIntegratedVectorizationSource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOnYourDataIntegratedVectorizationSource(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/openai/Azure.AI.OpenAI/src/Generated/OnYourDataIntegratedVectorizationSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataIntegratedVectorizationSource.cs new file mode 100644 index 000000000000..89325cda307e --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataIntegratedVectorizationSource.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Represents the integrated vectorizer defined within the search resource. + public partial class OnYourDataIntegratedVectorizationSource : OnYourDataVectorizationSource + { + /// Initializes a new instance of . + public OnYourDataIntegratedVectorizationSource() + { + Type = OnYourDataVectorizationSourceType.Integrated; + } + + /// Initializes a new instance of . + /// The type of vectorization source to use. + /// Keeps track of any properties unknown to the library. + internal OnYourDataIntegratedVectorizationSource(OnYourDataVectorizationSourceType type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) + { + } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataKeyAndKeyIdAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataKeyAndKeyIdAuthenticationOptions.Serialization.cs new file mode 100644 index 000000000000..96ff9cb654d7 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataKeyAndKeyIdAuthenticationOptions.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class OnYourDataKeyAndKeyIdAuthenticationOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataKeyAndKeyIdAuthenticationOptions)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + writer.WritePropertyName("key_id"u8); + writer.WriteStringValue(KeyId); + } + + OnYourDataKeyAndKeyIdAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataKeyAndKeyIdAuthenticationOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOnYourDataKeyAndKeyIdAuthenticationOptions(document.RootElement, options); + } + + internal static OnYourDataKeyAndKeyIdAuthenticationOptions DeserializeOnYourDataKeyAndKeyIdAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string key = default; + string keyId = default; + OnYourDataAuthenticationType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("key"u8)) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("key_id"u8)) + { + keyId = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new OnYourDataAuthenticationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OnYourDataKeyAndKeyIdAuthenticationOptions(type, serializedAdditionalRawData, key, keyId); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OnYourDataKeyAndKeyIdAuthenticationOptions)} does not support writing '{options.Format}' format."); + } + } + + OnYourDataKeyAndKeyIdAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOnYourDataKeyAndKeyIdAuthenticationOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OnYourDataKeyAndKeyIdAuthenticationOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new OnYourDataKeyAndKeyIdAuthenticationOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOnYourDataKeyAndKeyIdAuthenticationOptions(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/openai/Azure.AI.OpenAI/src/Generated/OnYourDataKeyAndKeyIdAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataKeyAndKeyIdAuthenticationOptions.cs new file mode 100644 index 000000000000..469ac62213b4 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataKeyAndKeyIdAuthenticationOptions.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// The authentication options for Azure OpenAI On Your Data when using an Elasticsearch key and key ID pair. + public partial class OnYourDataKeyAndKeyIdAuthenticationOptions : OnYourDataAuthenticationOptions + { + /// Initializes a new instance of . + /// The key to use for authentication. + /// The key ID to use for authentication. + /// or is null. + public OnYourDataKeyAndKeyIdAuthenticationOptions(string key, string keyId) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(keyId, nameof(keyId)); + + Type = OnYourDataAuthenticationType.KeyAndKeyId; + Key = key; + KeyId = keyId; + } + + /// Initializes a new instance of . + /// The authentication type. + /// Keeps track of any properties unknown to the library. + /// The key to use for authentication. + /// The key ID to use for authentication. + internal OnYourDataKeyAndKeyIdAuthenticationOptions(OnYourDataAuthenticationType type, IDictionary serializedAdditionalRawData, string key, string keyId) : base(type, serializedAdditionalRawData) + { + Key = key; + KeyId = keyId; + } + + /// Initializes a new instance of for deserialization. + internal OnYourDataKeyAndKeyIdAuthenticationOptions() + { + } + + /// The key to use for authentication. + public string Key { get; } + /// The key ID to use for authentication. + public string KeyId { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataModelIdVectorizationSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataModelIdVectorizationSource.Serialization.cs new file mode 100644 index 000000000000..01ac9e3ec63c --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataModelIdVectorizationSource.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class OnYourDataModelIdVectorizationSource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataModelIdVectorizationSource)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("model_id"u8); + writer.WriteStringValue(ModelId); + } + + OnYourDataModelIdVectorizationSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataModelIdVectorizationSource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOnYourDataModelIdVectorizationSource(document.RootElement, options); + } + + internal static OnYourDataModelIdVectorizationSource DeserializeOnYourDataModelIdVectorizationSource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string modelId = default; + OnYourDataVectorizationSourceType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("model_id"u8)) + { + modelId = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new OnYourDataVectorizationSourceType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OnYourDataModelIdVectorizationSource(type, serializedAdditionalRawData, modelId); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OnYourDataModelIdVectorizationSource)} does not support writing '{options.Format}' format."); + } + } + + OnYourDataModelIdVectorizationSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOnYourDataModelIdVectorizationSource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OnYourDataModelIdVectorizationSource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new OnYourDataModelIdVectorizationSource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOnYourDataModelIdVectorizationSource(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/openai/Azure.AI.OpenAI/src/Generated/OnYourDataModelIdVectorizationSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataModelIdVectorizationSource.cs new file mode 100644 index 000000000000..3db079445dbc --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataModelIdVectorizationSource.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// + /// The details of a a vectorization source, used by Azure OpenAI On Your Data when applying vector search, that is based + /// on a search service model ID. Currently only supported by Elasticsearch®. + /// + public partial class OnYourDataModelIdVectorizationSource : OnYourDataVectorizationSource + { + /// Initializes a new instance of . + /// The embedding model ID build inside the search service. Currently only supported by Elasticsearch®. + /// is null. + public OnYourDataModelIdVectorizationSource(string modelId) + { + Argument.AssertNotNull(modelId, nameof(modelId)); + + Type = OnYourDataVectorizationSourceType.ModelId; + ModelId = modelId; + } + + /// Initializes a new instance of . + /// The type of vectorization source to use. + /// Keeps track of any properties unknown to the library. + /// The embedding model ID build inside the search service. Currently only supported by Elasticsearch®. + internal OnYourDataModelIdVectorizationSource(OnYourDataVectorizationSourceType type, IDictionary serializedAdditionalRawData, string modelId) : base(type, serializedAdditionalRawData) + { + ModelId = modelId; + } + + /// Initializes a new instance of for deserialization. + internal OnYourDataModelIdVectorizationSource() + { + } + + /// The embedding model ID build inside the search service. Currently only supported by Elasticsearch®. + public string ModelId { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs new file mode 100644 index 000000000000..7ba24724d382 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class OnYourDataSystemAssignedManagedIdentityAuthenticationOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataSystemAssignedManagedIdentityAuthenticationOptions)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + OnYourDataSystemAssignedManagedIdentityAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataSystemAssignedManagedIdentityAuthenticationOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOnYourDataSystemAssignedManagedIdentityAuthenticationOptions(document.RootElement, options); + } + + internal static OnYourDataSystemAssignedManagedIdentityAuthenticationOptions DeserializeOnYourDataSystemAssignedManagedIdentityAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OnYourDataAuthenticationType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new OnYourDataAuthenticationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OnYourDataSystemAssignedManagedIdentityAuthenticationOptions(type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OnYourDataSystemAssignedManagedIdentityAuthenticationOptions)} does not support writing '{options.Format}' format."); + } + } + + OnYourDataSystemAssignedManagedIdentityAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOnYourDataSystemAssignedManagedIdentityAuthenticationOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OnYourDataSystemAssignedManagedIdentityAuthenticationOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new OnYourDataSystemAssignedManagedIdentityAuthenticationOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOnYourDataSystemAssignedManagedIdentityAuthenticationOptions(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/openai/Azure.AI.OpenAI/src/Generated/OnYourDataSystemAssignedManagedIdentityAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataSystemAssignedManagedIdentityAuthenticationOptions.cs new file mode 100644 index 000000000000..734ef7b5d70c --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataSystemAssignedManagedIdentityAuthenticationOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// The authentication options for Azure OpenAI On Your Data when using a system-assigned managed identity. + public partial class OnYourDataSystemAssignedManagedIdentityAuthenticationOptions : OnYourDataAuthenticationOptions + { + /// Initializes a new instance of . + public OnYourDataSystemAssignedManagedIdentityAuthenticationOptions() + { + Type = OnYourDataAuthenticationType.SystemAssignedManagedIdentity; + } + + /// Initializes a new instance of . + /// The authentication type. + /// Keeps track of any properties unknown to the library. + internal OnYourDataSystemAssignedManagedIdentityAuthenticationOptions(OnYourDataAuthenticationType type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) + { + } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs new file mode 100644 index 000000000000..9ffa560eb3f8 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class OnYourDataUserAssignedManagedIdentityAuthenticationOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataUserAssignedManagedIdentityAuthenticationOptions)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("managed_identity_resource_id"u8); + writer.WriteStringValue(ManagedIdentityResourceId); + } + + OnYourDataUserAssignedManagedIdentityAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataUserAssignedManagedIdentityAuthenticationOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOnYourDataUserAssignedManagedIdentityAuthenticationOptions(document.RootElement, options); + } + + internal static OnYourDataUserAssignedManagedIdentityAuthenticationOptions DeserializeOnYourDataUserAssignedManagedIdentityAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string managedIdentityResourceId = default; + OnYourDataAuthenticationType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("managed_identity_resource_id"u8)) + { + managedIdentityResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new OnYourDataAuthenticationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OnYourDataUserAssignedManagedIdentityAuthenticationOptions(type, serializedAdditionalRawData, managedIdentityResourceId); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OnYourDataUserAssignedManagedIdentityAuthenticationOptions)} does not support writing '{options.Format}' format."); + } + } + + OnYourDataUserAssignedManagedIdentityAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOnYourDataUserAssignedManagedIdentityAuthenticationOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OnYourDataUserAssignedManagedIdentityAuthenticationOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new OnYourDataUserAssignedManagedIdentityAuthenticationOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOnYourDataUserAssignedManagedIdentityAuthenticationOptions(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/openai/Azure.AI.OpenAI/src/Generated/OnYourDataUserAssignedManagedIdentityAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataUserAssignedManagedIdentityAuthenticationOptions.cs new file mode 100644 index 000000000000..89ca44bf1441 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataUserAssignedManagedIdentityAuthenticationOptions.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// The authentication options for Azure OpenAI On Your Data when using a user-assigned managed identity. + public partial class OnYourDataUserAssignedManagedIdentityAuthenticationOptions : OnYourDataAuthenticationOptions + { + /// Initializes a new instance of . + /// The resource ID of the user-assigned managed identity to use for authentication. + /// is null. + public OnYourDataUserAssignedManagedIdentityAuthenticationOptions(string managedIdentityResourceId) + { + Argument.AssertNotNull(managedIdentityResourceId, nameof(managedIdentityResourceId)); + + Type = OnYourDataAuthenticationType.UserAssignedManagedIdentity; + ManagedIdentityResourceId = managedIdentityResourceId; + } + + /// Initializes a new instance of . + /// The authentication type. + /// Keeps track of any properties unknown to the library. + /// The resource ID of the user-assigned managed identity to use for authentication. + internal OnYourDataUserAssignedManagedIdentityAuthenticationOptions(OnYourDataAuthenticationType type, IDictionary serializedAdditionalRawData, string managedIdentityResourceId) : base(type, serializedAdditionalRawData) + { + ManagedIdentityResourceId = managedIdentityResourceId; + } + + /// Initializes a new instance of for deserialization. + internal OnYourDataUserAssignedManagedIdentityAuthenticationOptions() + { + } + + /// The resource ID of the user-assigned managed identity to use for authentication. + public string ManagedIdentityResourceId { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataUsernameAndPasswordAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataUsernameAndPasswordAuthenticationOptions.Serialization.cs new file mode 100644 index 000000000000..c7aac3c350b5 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataUsernameAndPasswordAuthenticationOptions.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class OnYourDataUsernameAndPasswordAuthenticationOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataUsernameAndPasswordAuthenticationOptions)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("username"u8); + writer.WriteStringValue(Username); + writer.WritePropertyName("password"u8); + writer.WriteStringValue(Password); + } + + OnYourDataUsernameAndPasswordAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataUsernameAndPasswordAuthenticationOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOnYourDataUsernameAndPasswordAuthenticationOptions(document.RootElement, options); + } + + internal static OnYourDataUsernameAndPasswordAuthenticationOptions DeserializeOnYourDataUsernameAndPasswordAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string username = default; + string password = default; + OnYourDataAuthenticationType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("username"u8)) + { + username = property.Value.GetString(); + continue; + } + if (property.NameEquals("password"u8)) + { + password = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new OnYourDataAuthenticationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OnYourDataUsernameAndPasswordAuthenticationOptions(type, serializedAdditionalRawData, username, password); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OnYourDataUsernameAndPasswordAuthenticationOptions)} does not support writing '{options.Format}' format."); + } + } + + OnYourDataUsernameAndPasswordAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOnYourDataUsernameAndPasswordAuthenticationOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OnYourDataUsernameAndPasswordAuthenticationOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new OnYourDataUsernameAndPasswordAuthenticationOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOnYourDataUsernameAndPasswordAuthenticationOptions(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/openai/Azure.AI.OpenAI/src/Generated/OnYourDataUsernameAndPasswordAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataUsernameAndPasswordAuthenticationOptions.cs new file mode 100644 index 000000000000..3b382f621f00 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataUsernameAndPasswordAuthenticationOptions.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// The authentication options for Azure OpenAI On Your Data when using a username and password. + public partial class OnYourDataUsernameAndPasswordAuthenticationOptions : OnYourDataAuthenticationOptions + { + /// Initializes a new instance of . + /// The username. + /// The password. + /// or is null. + public OnYourDataUsernameAndPasswordAuthenticationOptions(string username, string password) + { + Argument.AssertNotNull(username, nameof(username)); + Argument.AssertNotNull(password, nameof(password)); + + Type = OnYourDataAuthenticationType.UsernameAndPassword; + Username = username; + Password = password; + } + + /// Initializes a new instance of . + /// The authentication type. + /// Keeps track of any properties unknown to the library. + /// The username. + /// The password. + internal OnYourDataUsernameAndPasswordAuthenticationOptions(OnYourDataAuthenticationType type, IDictionary serializedAdditionalRawData, string username, string password) : base(type, serializedAdditionalRawData) + { + Username = username; + Password = password; + } + + /// Initializes a new instance of for deserialization. + internal OnYourDataUsernameAndPasswordAuthenticationOptions() + { + } + + /// The username. + public string Username { get; } + /// The password. + public string Password { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorSearchAccessTokenAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorSearchAccessTokenAuthenticationOptions.Serialization.cs new file mode 100644 index 000000000000..40893e3f7eaf --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorSearchAccessTokenAuthenticationOptions.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class OnYourDataVectorSearchAccessTokenAuthenticationOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataVectorSearchAccessTokenAuthenticationOptions)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("access_token"u8); + writer.WriteStringValue(AccessToken); + } + + OnYourDataVectorSearchAccessTokenAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataVectorSearchAccessTokenAuthenticationOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOnYourDataVectorSearchAccessTokenAuthenticationOptions(document.RootElement, options); + } + + internal static OnYourDataVectorSearchAccessTokenAuthenticationOptions DeserializeOnYourDataVectorSearchAccessTokenAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string accessToken = default; + OnYourDataVectorSearchAuthenticationType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("access_token"u8)) + { + accessToken = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new OnYourDataVectorSearchAuthenticationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OnYourDataVectorSearchAccessTokenAuthenticationOptions(type, serializedAdditionalRawData, accessToken); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OnYourDataVectorSearchAccessTokenAuthenticationOptions)} does not support writing '{options.Format}' format."); + } + } + + OnYourDataVectorSearchAccessTokenAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOnYourDataVectorSearchAccessTokenAuthenticationOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OnYourDataVectorSearchAccessTokenAuthenticationOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new OnYourDataVectorSearchAccessTokenAuthenticationOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOnYourDataVectorSearchAccessTokenAuthenticationOptions(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/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorSearchAccessTokenAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorSearchAccessTokenAuthenticationOptions.cs new file mode 100644 index 000000000000..9a6cc8cd23c1 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorSearchAccessTokenAuthenticationOptions.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// The authentication options for Azure OpenAI On Your Data vector search when using access token. + public partial class OnYourDataVectorSearchAccessTokenAuthenticationOptions : OnYourDataVectorSearchAuthenticationOptions + { + /// Initializes a new instance of . + /// The access token to use for authentication. + /// is null. + public OnYourDataVectorSearchAccessTokenAuthenticationOptions(string accessToken) + { + Argument.AssertNotNull(accessToken, nameof(accessToken)); + + Type = OnYourDataVectorSearchAuthenticationType.AccessToken; + AccessToken = accessToken; + } + + /// Initializes a new instance of . + /// The type of authentication to use. + /// Keeps track of any properties unknown to the library. + /// The access token to use for authentication. + internal OnYourDataVectorSearchAccessTokenAuthenticationOptions(OnYourDataVectorSearchAuthenticationType type, IDictionary serializedAdditionalRawData, string accessToken) : base(type, serializedAdditionalRawData) + { + AccessToken = accessToken; + } + + /// Initializes a new instance of for deserialization. + internal OnYourDataVectorSearchAccessTokenAuthenticationOptions() + { + } + + /// The access token to use for authentication. + public string AccessToken { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorSearchApiKeyAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorSearchApiKeyAuthenticationOptions.Serialization.cs new file mode 100644 index 000000000000..5a27462832db --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorSearchApiKeyAuthenticationOptions.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class OnYourDataVectorSearchApiKeyAuthenticationOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataVectorSearchApiKeyAuthenticationOptions)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + } + + OnYourDataVectorSearchApiKeyAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataVectorSearchApiKeyAuthenticationOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOnYourDataVectorSearchApiKeyAuthenticationOptions(document.RootElement, options); + } + + internal static OnYourDataVectorSearchApiKeyAuthenticationOptions DeserializeOnYourDataVectorSearchApiKeyAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string key = default; + OnYourDataVectorSearchAuthenticationType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("key"u8)) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new OnYourDataVectorSearchAuthenticationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OnYourDataVectorSearchApiKeyAuthenticationOptions(type, serializedAdditionalRawData, key); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OnYourDataVectorSearchApiKeyAuthenticationOptions)} does not support writing '{options.Format}' format."); + } + } + + OnYourDataVectorSearchApiKeyAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOnYourDataVectorSearchApiKeyAuthenticationOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OnYourDataVectorSearchApiKeyAuthenticationOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new OnYourDataVectorSearchApiKeyAuthenticationOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOnYourDataVectorSearchApiKeyAuthenticationOptions(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/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorSearchApiKeyAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorSearchApiKeyAuthenticationOptions.cs new file mode 100644 index 000000000000..6cb88743fc8a --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorSearchApiKeyAuthenticationOptions.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// The authentication options for Azure OpenAI On Your Data when using an API key. + public partial class OnYourDataVectorSearchApiKeyAuthenticationOptions : OnYourDataVectorSearchAuthenticationOptions + { + /// Initializes a new instance of . + /// The API key to use for authentication. + /// is null. + public OnYourDataVectorSearchApiKeyAuthenticationOptions(string key) + { + Argument.AssertNotNull(key, nameof(key)); + + Type = OnYourDataVectorSearchAuthenticationType.ApiKey; + Key = key; + } + + /// Initializes a new instance of . + /// The type of authentication to use. + /// Keeps track of any properties unknown to the library. + /// The API key to use for authentication. + internal OnYourDataVectorSearchApiKeyAuthenticationOptions(OnYourDataVectorSearchAuthenticationType type, IDictionary serializedAdditionalRawData, string key) : base(type, serializedAdditionalRawData) + { + Key = key; + } + + /// Initializes a new instance of for deserialization. + internal OnYourDataVectorSearchApiKeyAuthenticationOptions() + { + } + + /// The API key to use for authentication. + public string Key { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorSearchAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorSearchAuthenticationOptions.Serialization.cs new file mode 100644 index 000000000000..79649808e846 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorSearchAuthenticationOptions.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + [PersistableModelProxy(typeof(UnknownOnYourDataVectorSearchAuthenticationOptions))] + public partial class OnYourDataVectorSearchAuthenticationOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataVectorSearchAuthenticationOptions)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OnYourDataVectorSearchAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataVectorSearchAuthenticationOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOnYourDataVectorSearchAuthenticationOptions(document.RootElement, options); + } + + internal static OnYourDataVectorSearchAuthenticationOptions DeserializeOnYourDataVectorSearchAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "access_token": return OnYourDataVectorSearchAccessTokenAuthenticationOptions.DeserializeOnYourDataVectorSearchAccessTokenAuthenticationOptions(element, options); + case "api_key": return OnYourDataVectorSearchApiKeyAuthenticationOptions.DeserializeOnYourDataVectorSearchApiKeyAuthenticationOptions(element, options); + } + } + return UnknownOnYourDataVectorSearchAuthenticationOptions.DeserializeUnknownOnYourDataVectorSearchAuthenticationOptions(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OnYourDataVectorSearchAuthenticationOptions)} does not support writing '{options.Format}' format."); + } + } + + OnYourDataVectorSearchAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOnYourDataVectorSearchAuthenticationOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OnYourDataVectorSearchAuthenticationOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static OnYourDataVectorSearchAuthenticationOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOnYourDataVectorSearchAuthenticationOptions(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/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorSearchAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorSearchAuthenticationOptions.cs new file mode 100644 index 000000000000..077fa22c2793 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorSearchAuthenticationOptions.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// + /// The authentication options for Azure OpenAI On Your Data vector search. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public abstract partial class OnYourDataVectorSearchAuthenticationOptions + { + /// + /// 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; + + /// Initializes a new instance of . + protected OnYourDataVectorSearchAuthenticationOptions() + { + } + + /// Initializes a new instance of . + /// The type of authentication to use. + /// Keeps track of any properties unknown to the library. + internal OnYourDataVectorSearchAuthenticationOptions(OnYourDataVectorSearchAuthenticationType type, IDictionary serializedAdditionalRawData) + { + Type = type; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of authentication to use. + internal OnYourDataVectorSearchAuthenticationType Type { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorSearchAuthenticationType.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorSearchAuthenticationType.cs new file mode 100644 index 000000000000..5b91b4f56ba1 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorSearchAuthenticationType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// The authentication types supported with Azure OpenAI On Your Data vector search. + internal readonly partial struct OnYourDataVectorSearchAuthenticationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OnYourDataVectorSearchAuthenticationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ApiKeyValue = "api_key"; + private const string AccessTokenValue = "access_token"; + + /// Authentication via API key. + public static OnYourDataVectorSearchAuthenticationType ApiKey { get; } = new OnYourDataVectorSearchAuthenticationType(ApiKeyValue); + /// Authentication via access token. + public static OnYourDataVectorSearchAuthenticationType AccessToken { get; } = new OnYourDataVectorSearchAuthenticationType(AccessTokenValue); + /// Determines if two values are the same. + public static bool operator ==(OnYourDataVectorSearchAuthenticationType left, OnYourDataVectorSearchAuthenticationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OnYourDataVectorSearchAuthenticationType left, OnYourDataVectorSearchAuthenticationType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OnYourDataVectorSearchAuthenticationType(string value) => new OnYourDataVectorSearchAuthenticationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OnYourDataVectorSearchAuthenticationType other && Equals(other); + /// + public bool Equals(OnYourDataVectorSearchAuthenticationType 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/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorizationSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorizationSource.Serialization.cs new file mode 100644 index 000000000000..212f42af104e --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorizationSource.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + [PersistableModelProxy(typeof(UnknownOnYourDataVectorizationSource))] + public partial class OnYourDataVectorizationSource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataVectorizationSource)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OnYourDataVectorizationSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataVectorizationSource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOnYourDataVectorizationSource(document.RootElement, options); + } + + internal static OnYourDataVectorizationSource DeserializeOnYourDataVectorizationSource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "deployment_name": return OnYourDataDeploymentNameVectorizationSource.DeserializeOnYourDataDeploymentNameVectorizationSource(element, options); + case "endpoint": return OnYourDataEndpointVectorizationSource.DeserializeOnYourDataEndpointVectorizationSource(element, options); + case "integrated": return OnYourDataIntegratedVectorizationSource.DeserializeOnYourDataIntegratedVectorizationSource(element, options); + case "model_id": return OnYourDataModelIdVectorizationSource.DeserializeOnYourDataModelIdVectorizationSource(element, options); + } + } + return UnknownOnYourDataVectorizationSource.DeserializeUnknownOnYourDataVectorizationSource(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OnYourDataVectorizationSource)} does not support writing '{options.Format}' format."); + } + } + + OnYourDataVectorizationSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOnYourDataVectorizationSource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OnYourDataVectorizationSource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static OnYourDataVectorizationSource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOnYourDataVectorizationSource(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/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorizationSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorizationSource.cs new file mode 100644 index 000000000000..c675da983dd8 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorizationSource.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// + /// An abstract representation of a vectorization source for Azure OpenAI On Your Data with vector search. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + public abstract partial class OnYourDataVectorizationSource + { + /// + /// 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; + + /// Initializes a new instance of . + protected OnYourDataVectorizationSource() + { + } + + /// Initializes a new instance of . + /// The type of vectorization source to use. + /// Keeps track of any properties unknown to the library. + internal OnYourDataVectorizationSource(OnYourDataVectorizationSourceType type, IDictionary serializedAdditionalRawData) + { + Type = type; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of vectorization source to use. + internal OnYourDataVectorizationSourceType Type { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorizationSourceType.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorizationSourceType.cs new file mode 100644 index 000000000000..1f951716f33e --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OnYourDataVectorizationSourceType.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// + /// Represents the available sources Azure OpenAI On Your Data can use to configure vectorization of data for use with + /// vector search. + /// + internal readonly partial struct OnYourDataVectorizationSourceType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OnYourDataVectorizationSourceType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EndpointValue = "endpoint"; + private const string DeploymentNameValue = "deployment_name"; + private const string ModelIdValue = "model_id"; + private const string IntegratedValue = "integrated"; + + /// Represents vectorization performed by public service calls to an Azure OpenAI embedding model. + public static OnYourDataVectorizationSourceType Endpoint { get; } = new OnYourDataVectorizationSourceType(EndpointValue); + /// + /// Represents an Ada model deployment name to use. This model deployment must be in the same Azure OpenAI resource, but + /// On Your Data will use this model deployment via an internal call rather than a public one, which enables vector + /// search even in private networks. + /// + public static OnYourDataVectorizationSourceType DeploymentName { get; } = new OnYourDataVectorizationSourceType(DeploymentNameValue); + /// + /// Represents a specific embedding model ID as defined in the search service. + /// Currently only supported by Elasticsearch®. + /// + public static OnYourDataVectorizationSourceType ModelId { get; } = new OnYourDataVectorizationSourceType(ModelIdValue); + /// Represents the integrated vectorizer defined within the search resource. + public static OnYourDataVectorizationSourceType Integrated { get; } = new OnYourDataVectorizationSourceType(IntegratedValue); + /// Determines if two values are the same. + public static bool operator ==(OnYourDataVectorizationSourceType left, OnYourDataVectorizationSourceType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OnYourDataVectorizationSourceType left, OnYourDataVectorizationSourceType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OnYourDataVectorizationSourceType(string value) => new OnYourDataVectorizationSourceType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OnYourDataVectorizationSourceType other && Equals(other); + /// + public bool Equals(OnYourDataVectorizationSourceType 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/openai/Azure.AI.OpenAI/src/Generated/OpenAIClient.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIClient.cs new file mode 100644 index 000000000000..eb3ffa08498c --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIClient.cs @@ -0,0 +1,2867 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.AI.OpenAI +{ + // Data plane generated client. + /// The OpenAI service client. + public partial class OpenAIClient + { + private const string AuthorizationHeader = "api-key"; + private readonly AzureKeyCredential _keyCredential; + private static readonly string[] AuthorizationScopes = new string[] { "https://cognitiveservices.azure.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of OpenAIClient for mocking. + protected OpenAIClient() + { + } + + /// Initializes a new instance of OpenAIClient. + /// + /// Supported Cognitive Services endpoints (protocol and hostname, for example: + /// https://westus.api.cognitive.microsoft.com). + /// + /// A credential used to authenticate to an Azure Service. + /// or is null. + public OpenAIClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new OpenAIClientOptions()) + { + } + + /// Initializes a new instance of OpenAIClient. + /// + /// Supported Cognitive Services endpoints (protocol and hostname, for example: + /// https://westus.api.cognitive.microsoft.com). + /// + /// A credential used to authenticate to an Azure Service. + /// or is null. + public OpenAIClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new OpenAIClientOptions()) + { + } + + /// Initializes a new instance of OpenAIClient. + /// + /// Supported Cognitive Services endpoints (protocol and hostname, for example: + /// https://westus.api.cognitive.microsoft.com). + /// + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public OpenAIClient(Uri endpoint, AzureKeyCredential credential, OpenAIClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new OpenAIClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _keyCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new AzureKeyCredentialPolicy(_keyCredential, AuthorizationHeader) }, new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// Initializes a new instance of OpenAIClient. + /// + /// Supported Cognitive Services endpoints (protocol and hostname, for example: + /// https://westus.api.cognitive.microsoft.com). + /// + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public OpenAIClient(Uri endpoint, TokenCredential credential, OpenAIClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new OpenAIClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// + /// Gets transcribed text and associated metadata from provided spoken audio data. Audio will be transcribed in the + /// written language corresponding to the language it was spoken in. + /// + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// The configuration information for an audio transcription request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> GetAudioTranscriptionAsPlainTextAsync(string deploymentId, AudioTranscriptionOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(body, nameof(body)); + + using MultipartFormDataRequestContent content = body.ToMultipartRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetAudioTranscriptionAsPlainTextAsync(deploymentId, content, content.ContentType, context).ConfigureAwait(false); + return Response.FromValue(response.Content.ToString(), response); + } + + /// + /// Gets transcribed text and associated metadata from provided spoken audio data. Audio will be transcribed in the + /// written language corresponding to the language it was spoken in. + /// + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// The configuration information for an audio transcription request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response GetAudioTranscriptionAsPlainText(string deploymentId, AudioTranscriptionOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(body, nameof(body)); + + using MultipartFormDataRequestContent content = body.ToMultipartRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetAudioTranscriptionAsPlainText(deploymentId, content, content.ContentType, context); + return Response.FromValue(response.Content.ToString(), response); + } + + /// + /// [Protocol Method] Gets transcribed text and associated metadata from provided spoken audio data. Audio will be transcribed in the + /// written language corresponding to the language it was spoken in. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// The content to send as the body of the request. + /// The content type for the operation. Always multipart/form-data for this operation. Allowed values: "multipart/form-data". + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task GetAudioTranscriptionAsPlainTextAsync(string deploymentId, RequestContent content, string contentType, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.GetAudioTranscriptionAsPlainText"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAudioTranscriptionAsPlainTextRequest(deploymentId, content, contentType, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets transcribed text and associated metadata from provided spoken audio data. Audio will be transcribed in the + /// written language corresponding to the language it was spoken in. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// The content to send as the body of the request. + /// The content type for the operation. Always multipart/form-data for this operation. Allowed values: "multipart/form-data". + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response GetAudioTranscriptionAsPlainText(string deploymentId, RequestContent content, string contentType, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.GetAudioTranscriptionAsPlainText"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAudioTranscriptionAsPlainTextRequest(deploymentId, content, contentType, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets transcribed text and associated metadata from provided spoken audio data. Audio will be transcribed in the + /// written language corresponding to the language it was spoken in. + /// + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// The configuration information for an audio transcription request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> GetAudioTranscriptionAsResponseObjectAsync(string deploymentId, AudioTranscriptionOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(body, nameof(body)); + + using MultipartFormDataRequestContent content = body.ToMultipartRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetAudioTranscriptionAsResponseObjectAsync(deploymentId, content, content.ContentType, context).ConfigureAwait(false); + return Response.FromValue(AudioTranscription.FromResponse(response), response); + } + + /// + /// Gets transcribed text and associated metadata from provided spoken audio data. Audio will be transcribed in the + /// written language corresponding to the language it was spoken in. + /// + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// The configuration information for an audio transcription request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response GetAudioTranscriptionAsResponseObject(string deploymentId, AudioTranscriptionOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(body, nameof(body)); + + using MultipartFormDataRequestContent content = body.ToMultipartRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetAudioTranscriptionAsResponseObject(deploymentId, content, content.ContentType, context); + return Response.FromValue(AudioTranscription.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets transcribed text and associated metadata from provided spoken audio data. Audio will be transcribed in the + /// written language corresponding to the language it was spoken in. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// The content to send as the body of the request. + /// The content type for the operation. Always multipart/form-data for this operation. Allowed values: "multipart/form-data". + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task GetAudioTranscriptionAsResponseObjectAsync(string deploymentId, RequestContent content, string contentType, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.GetAudioTranscriptionAsResponseObject"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAudioTranscriptionAsResponseObjectRequest(deploymentId, content, contentType, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets transcribed text and associated metadata from provided spoken audio data. Audio will be transcribed in the + /// written language corresponding to the language it was spoken in. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// The content to send as the body of the request. + /// The content type for the operation. Always multipart/form-data for this operation. Allowed values: "multipart/form-data". + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response GetAudioTranscriptionAsResponseObject(string deploymentId, RequestContent content, string contentType, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.GetAudioTranscriptionAsResponseObject"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAudioTranscriptionAsResponseObjectRequest(deploymentId, content, contentType, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets English language transcribed text and associated metadata from provided spoken audio data. + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// The configuration information for an audio translation request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> GetAudioTranslationAsPlainTextAsync(string deploymentId, AudioTranslationOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(body, nameof(body)); + + using MultipartFormDataRequestContent content = body.ToMultipartRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetAudioTranslationAsPlainTextAsync(deploymentId, content, content.ContentType, context).ConfigureAwait(false); + return Response.FromValue(response.Content.ToString(), response); + } + + /// Gets English language transcribed text and associated metadata from provided spoken audio data. + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// The configuration information for an audio translation request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response GetAudioTranslationAsPlainText(string deploymentId, AudioTranslationOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(body, nameof(body)); + + using MultipartFormDataRequestContent content = body.ToMultipartRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetAudioTranslationAsPlainText(deploymentId, content, content.ContentType, context); + return Response.FromValue(response.Content.ToString(), response); + } + + /// + /// [Protocol Method] Gets English language transcribed text and associated metadata from provided spoken audio data. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// The content to send as the body of the request. + /// The content type for the operation. Always multipart/form-data for this operation. Allowed values: "multipart/form-data". + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task GetAudioTranslationAsPlainTextAsync(string deploymentId, RequestContent content, string contentType, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.GetAudioTranslationAsPlainText"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAudioTranslationAsPlainTextRequest(deploymentId, content, contentType, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets English language transcribed text and associated metadata from provided spoken audio data. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// The content to send as the body of the request. + /// The content type for the operation. Always multipart/form-data for this operation. Allowed values: "multipart/form-data". + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response GetAudioTranslationAsPlainText(string deploymentId, RequestContent content, string contentType, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.GetAudioTranslationAsPlainText"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAudioTranslationAsPlainTextRequest(deploymentId, content, contentType, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets English language transcribed text and associated metadata from provided spoken audio data. + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// The configuration information for an audio translation request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> GetAudioTranslationAsResponseObjectAsync(string deploymentId, AudioTranslationOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(body, nameof(body)); + + using MultipartFormDataRequestContent content = body.ToMultipartRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetAudioTranslationAsResponseObjectAsync(deploymentId, content, content.ContentType, context).ConfigureAwait(false); + return Response.FromValue(AudioTranslation.FromResponse(response), response); + } + + /// Gets English language transcribed text and associated metadata from provided spoken audio data. + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// The configuration information for an audio translation request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response GetAudioTranslationAsResponseObject(string deploymentId, AudioTranslationOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(body, nameof(body)); + + using MultipartFormDataRequestContent content = body.ToMultipartRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetAudioTranslationAsResponseObject(deploymentId, content, content.ContentType, context); + return Response.FromValue(AudioTranslation.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets English language transcribed text and associated metadata from provided spoken audio data. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// The content to send as the body of the request. + /// The content type for the operation. Always multipart/form-data for this operation. Allowed values: "multipart/form-data". + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task GetAudioTranslationAsResponseObjectAsync(string deploymentId, RequestContent content, string contentType, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.GetAudioTranslationAsResponseObject"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAudioTranslationAsResponseObjectRequest(deploymentId, content, contentType, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets English language transcribed text and associated metadata from provided spoken audio data. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// The content to send as the body of the request. + /// The content type for the operation. Always multipart/form-data for this operation. Allowed values: "multipart/form-data". + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response GetAudioTranslationAsResponseObject(string deploymentId, RequestContent content, string contentType, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.GetAudioTranslationAsResponseObject"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAudioTranslationAsResponseObjectRequest(deploymentId, content, contentType, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets completions for the provided input prompts. + /// Completions support a wide variety of tasks and generate text that continues from or "completes" + /// provided prompt data. + /// + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// + /// The configuration information for a completions request. + /// Completions support a wide variety of tasks and generate text that continues from or "completes" + /// provided prompt data. + /// + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> GetCompletionsAsync(string deploymentId, CompletionsOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetCompletionsAsync(deploymentId, content, context).ConfigureAwait(false); + return Response.FromValue(Completions.FromResponse(response), response); + } + + /// + /// Gets completions for the provided input prompts. + /// Completions support a wide variety of tasks and generate text that continues from or "completes" + /// provided prompt data. + /// + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// + /// The configuration information for a completions request. + /// Completions support a wide variety of tasks and generate text that continues from or "completes" + /// provided prompt data. + /// + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response GetCompletions(string deploymentId, CompletionsOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetCompletions(deploymentId, content, context); + return Response.FromValue(Completions.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets completions for the provided input prompts. + /// Completions support a wide variety of tasks and generate text that continues from or "completes" + /// provided prompt data. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task GetCompletionsAsync(string deploymentId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.GetCompletions"); + scope.Start(); + try + { + using HttpMessage message = CreateGetCompletionsRequest(deploymentId, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets completions for the provided input prompts. + /// Completions support a wide variety of tasks and generate text that continues from or "completes" + /// provided prompt data. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response GetCompletions(string deploymentId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.GetCompletions"); + scope.Start(); + try + { + using HttpMessage message = CreateGetCompletionsRequest(deploymentId, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets chat completions for the provided chat messages. + /// Completions support a wide variety of tasks and generate text that continues from or "completes" + /// provided prompt data. + /// + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// + /// The configuration information for a chat completions request. + /// Completions support a wide variety of tasks and generate text that continues from or "completes" + /// provided prompt data. + /// + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> GetChatCompletionsAsync(string deploymentId, ChatCompletionsOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetChatCompletionsAsync(deploymentId, content, context).ConfigureAwait(false); + return Response.FromValue(ChatCompletions.FromResponse(response), response); + } + + /// + /// Gets chat completions for the provided chat messages. + /// Completions support a wide variety of tasks and generate text that continues from or "completes" + /// provided prompt data. + /// + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// + /// The configuration information for a chat completions request. + /// Completions support a wide variety of tasks and generate text that continues from or "completes" + /// provided prompt data. + /// + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response GetChatCompletions(string deploymentId, ChatCompletionsOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetChatCompletions(deploymentId, content, context); + return Response.FromValue(ChatCompletions.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets chat completions for the provided chat messages. + /// Completions support a wide variety of tasks and generate text that continues from or "completes" + /// provided prompt data. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task GetChatCompletionsAsync(string deploymentId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.GetChatCompletions"); + scope.Start(); + try + { + using HttpMessage message = CreateGetChatCompletionsRequest(deploymentId, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets chat completions for the provided chat messages. + /// Completions support a wide variety of tasks and generate text that continues from or "completes" + /// provided prompt data. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response GetChatCompletions(string deploymentId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.GetChatCompletions"); + scope.Start(); + try + { + using HttpMessage message = CreateGetChatCompletionsRequest(deploymentId, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Creates an image given a prompt. + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// Represents the request data used to generate images. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> GetImageGenerationsAsync(string deploymentId, ImageGenerationOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetImageGenerationsAsync(deploymentId, content, context).ConfigureAwait(false); + return Response.FromValue(ImageGenerations.FromResponse(response), response); + } + + /// Creates an image given a prompt. + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// Represents the request data used to generate images. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response GetImageGenerations(string deploymentId, ImageGenerationOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetImageGenerations(deploymentId, content, context); + return Response.FromValue(ImageGenerations.FromResponse(response), response); + } + + /// + /// [Protocol Method] Creates an image given a prompt. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task GetImageGenerationsAsync(string deploymentId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.GetImageGenerations"); + scope.Start(); + try + { + using HttpMessage message = CreateGetImageGenerationsRequest(deploymentId, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates an image given a prompt. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response GetImageGenerations(string deploymentId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.GetImageGenerations"); + scope.Start(); + try + { + using HttpMessage message = CreateGetImageGenerationsRequest(deploymentId, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Generates text-to-speech audio from the input text. + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// A representation of the request options that control the behavior of a text-to-speech operation. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> GenerateSpeechFromTextAsync(string deploymentId, SpeechGenerationOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GenerateSpeechFromTextAsync(deploymentId, content, context).ConfigureAwait(false); + return Response.FromValue(response.Content, response); + } + + /// Generates text-to-speech audio from the input text. + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// A representation of the request options that control the behavior of a text-to-speech operation. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response GenerateSpeechFromText(string deploymentId, SpeechGenerationOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GenerateSpeechFromText(deploymentId, content, context); + return Response.FromValue(response.Content, response); + } + + /// + /// [Protocol Method] Generates text-to-speech audio from the input text. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task GenerateSpeechFromTextAsync(string deploymentId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.GenerateSpeechFromText"); + scope.Start(); + try + { + using HttpMessage message = CreateGenerateSpeechFromTextRequest(deploymentId, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Generates text-to-speech audio from the input text. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response GenerateSpeechFromText(string deploymentId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.GenerateSpeechFromText"); + scope.Start(); + try + { + using HttpMessage message = CreateGenerateSpeechFromTextRequest(deploymentId, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Return the embeddings for a given prompt. + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// + /// The configuration information for an embeddings request. + /// Embeddings measure the relatedness of text strings and are commonly used for search, clustering, + /// recommendations, and other similar scenarios. + /// + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> GetEmbeddingsAsync(string deploymentId, EmbeddingsOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetEmbeddingsAsync(deploymentId, content, context).ConfigureAwait(false); + return Response.FromValue(OpenAI.Embeddings.FromResponse(response), response); + } + + /// Return the embeddings for a given prompt. + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// + /// The configuration information for an embeddings request. + /// Embeddings measure the relatedness of text strings and are commonly used for search, clustering, + /// recommendations, and other similar scenarios. + /// + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response GetEmbeddings(string deploymentId, EmbeddingsOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetEmbeddings(deploymentId, content, context); + return Response.FromValue(OpenAI.Embeddings.FromResponse(response), response); + } + + /// + /// [Protocol Method] Return the embeddings for a given prompt. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task GetEmbeddingsAsync(string deploymentId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.GetEmbeddings"); + scope.Start(); + try + { + using HttpMessage message = CreateGetEmbeddingsRequest(deploymentId, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Return the embeddings for a given prompt. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response GetEmbeddings(string deploymentId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.GetEmbeddings"); + scope.Start(); + try + { + using HttpMessage message = CreateGetEmbeddingsRequest(deploymentId, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets a list of previously uploaded files. + /// A value that, when provided, limits list results to files matching the corresponding purpose. + /// The cancellation token to use. + public virtual async Task> GetFilesAsync(FilePurpose? purpose = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetFilesAsync(purpose?.ToString(), context).ConfigureAwait(false); + return Response.FromValue(FileListResponse.FromResponse(response), response); + } + + /// Gets a list of previously uploaded files. + /// A value that, when provided, limits list results to files matching the corresponding purpose. + /// The cancellation token to use. + public virtual Response GetFiles(FilePurpose? purpose = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetFiles(purpose?.ToString(), context); + return Response.FromValue(FileListResponse.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets a list of previously uploaded files. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// A value that, when provided, limits list results to files matching the corresponding purpose. Allowed values: "fine-tune" | "fine-tune-results" | "assistants" | "assistants_output" | "batch" | "batch_output" | "vision". + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task GetFilesAsync(string purpose, RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.GetFiles"); + scope.Start(); + try + { + using HttpMessage message = CreateGetFilesRequest(purpose, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets a list of previously uploaded files. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// A value that, when provided, limits list results to files matching the corresponding purpose. Allowed values: "fine-tune" | "fine-tune-results" | "assistants" | "assistants_output" | "batch" | "batch_output" | "vision". + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response GetFiles(string purpose, RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.GetFiles"); + scope.Start(); + try + { + using HttpMessage message = CreateGetFilesRequest(purpose, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Uploads a file for use by other operations. + /// The file data (not filename) to upload. + /// The intended purpose of the file. + /// A filename to associate with the uploaded data. + /// The cancellation token to use. + /// is null. + public virtual async Task> UploadFileAsync(Stream data, FilePurpose purpose, string filename = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + UploadFileRequest uploadFileRequest = new UploadFileRequest(data, purpose, filename, null); + using MultipartFormDataRequestContent content = uploadFileRequest.ToMultipartRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await UploadFileAsync(content, content.ContentType, context).ConfigureAwait(false); + return Response.FromValue(OpenAIFile.FromResponse(response), response); + } + + /// Uploads a file for use by other operations. + /// The file data (not filename) to upload. + /// The intended purpose of the file. + /// A filename to associate with the uploaded data. + /// The cancellation token to use. + /// is null. + public virtual Response UploadFile(Stream data, FilePurpose purpose, string filename = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + UploadFileRequest uploadFileRequest = new UploadFileRequest(data, purpose, filename, null); + using MultipartFormDataRequestContent content = uploadFileRequest.ToMultipartRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = UploadFile(content, content.ContentType, context); + return Response.FromValue(OpenAIFile.FromResponse(response), response); + } + + /// + /// [Protocol Method] Uploads a file for use by other operations. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The 'content-type' header value, always 'multipart/format-data' for this operation. Allowed values: "multipart/form-data". + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task UploadFileAsync(RequestContent content, string contentType, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.UploadFile"); + scope.Start(); + try + { + using HttpMessage message = CreateUploadFileRequest(content, contentType, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Uploads a file for use by other operations. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The 'content-type' header value, always 'multipart/format-data' for this operation. Allowed values: "multipart/form-data". + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response UploadFile(RequestContent content, string contentType, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.UploadFile"); + scope.Start(); + try + { + using HttpMessage message = CreateUploadFileRequest(content, contentType, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Delete a previously uploaded file. + /// The ID of the file to delete. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> DeleteFileAsync(string fileId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fileId, nameof(fileId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await DeleteFileAsync(fileId, context).ConfigureAwait(false); + return Response.FromValue(FileDeletionStatus.FromResponse(response), response); + } + + /// Delete a previously uploaded file. + /// The ID of the file to delete. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response DeleteFile(string fileId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fileId, nameof(fileId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = DeleteFile(fileId, context); + return Response.FromValue(FileDeletionStatus.FromResponse(response), response); + } + + /// + /// [Protocol Method] Delete a previously uploaded file. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the file to delete. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task DeleteFileAsync(string fileId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(fileId, nameof(fileId)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.DeleteFile"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteFileRequest(fileId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Delete a previously uploaded file. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the file to delete. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response DeleteFile(string fileId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(fileId, nameof(fileId)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.DeleteFile"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteFileRequest(fileId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Returns information about a specific file. Does not retrieve file content. + /// The ID of the file to retrieve. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> GetFileAsync(string fileId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fileId, nameof(fileId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetFileAsync(fileId, context).ConfigureAwait(false); + return Response.FromValue(OpenAIFile.FromResponse(response), response); + } + + /// Returns information about a specific file. Does not retrieve file content. + /// The ID of the file to retrieve. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response GetFile(string fileId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fileId, nameof(fileId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetFile(fileId, context); + return Response.FromValue(OpenAIFile.FromResponse(response), response); + } + + /// + /// [Protocol Method] Returns information about a specific file. Does not retrieve file content. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the file to retrieve. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task GetFileAsync(string fileId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(fileId, nameof(fileId)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.GetFile"); + scope.Start(); + try + { + using HttpMessage message = CreateGetFileRequest(fileId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Returns information about a specific file. Does not retrieve file content. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the file to retrieve. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response GetFile(string fileId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(fileId, nameof(fileId)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.GetFile"); + scope.Start(); + try + { + using HttpMessage message = CreateGetFileRequest(fileId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Returns information about a specific file. Does not retrieve file content. + /// The ID of the file to retrieve. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> GetFileContentAsync(string fileId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fileId, nameof(fileId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetFileContentAsync(fileId, context).ConfigureAwait(false); + return Response.FromValue(response.Content, response); + } + + /// Returns information about a specific file. Does not retrieve file content. + /// The ID of the file to retrieve. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response GetFileContent(string fileId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fileId, nameof(fileId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetFileContent(fileId, context); + return Response.FromValue(response.Content, response); + } + + /// + /// [Protocol Method] Returns information about a specific file. Does not retrieve file content. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the file to retrieve. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task GetFileContentAsync(string fileId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(fileId, nameof(fileId)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.GetFileContent"); + scope.Start(); + try + { + using HttpMessage message = CreateGetFileContentRequest(fileId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Returns information about a specific file. Does not retrieve file content. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the file to retrieve. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response GetFileContent(string fileId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(fileId, nameof(fileId)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.GetFileContent"); + scope.Start(); + try + { + using HttpMessage message = CreateGetFileContentRequest(fileId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets a list of all batches owned by the Azure OpenAI resource. + /// Identifier for the last event from the previous pagination request. + /// Number of batches to retrieve. Defaults to 20. + /// The cancellation token to use. + public virtual async Task> GetBatchesAsync(string after = null, int? limit = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetBatchesAsync(after, limit, context).ConfigureAwait(false); + return Response.FromValue(OpenAIPageableListOfBatch.FromResponse(response), response); + } + + /// Gets a list of all batches owned by the Azure OpenAI resource. + /// Identifier for the last event from the previous pagination request. + /// Number of batches to retrieve. Defaults to 20. + /// The cancellation token to use. + public virtual Response GetBatches(string after = null, int? limit = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetBatches(after, limit, context); + return Response.FromValue(OpenAIPageableListOfBatch.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets a list of all batches owned by the Azure OpenAI resource. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Identifier for the last event from the previous pagination request. + /// Number of batches to retrieve. Defaults to 20. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task GetBatchesAsync(string after, int? limit, RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.GetBatches"); + scope.Start(); + try + { + using HttpMessage message = CreateGetBatchesRequest(after, limit, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets a list of all batches owned by the Azure OpenAI resource. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Identifier for the last event from the previous pagination request. + /// Number of batches to retrieve. Defaults to 20. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response GetBatches(string after, int? limit, RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.GetBatches"); + scope.Start(); + try + { + using HttpMessage message = CreateGetBatchesRequest(after, limit, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates and executes a batch from an uploaded file of requests. + /// Response includes details of the enqueued job including job status. + /// The ID of the result file is added to the response once complete. + /// + /// The specification of the batch to create and execute. + /// The cancellation token to use. + /// is null. + public virtual async Task> CreateBatchAsync(BatchCreateRequest createBatchRequest, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(createBatchRequest, nameof(createBatchRequest)); + + using RequestContent content = createBatchRequest.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CreateBatchAsync(content, context).ConfigureAwait(false); + return Response.FromValue(OpenAI.Batch.FromResponse(response), response); + } + + /// + /// Creates and executes a batch from an uploaded file of requests. + /// Response includes details of the enqueued job including job status. + /// The ID of the result file is added to the response once complete. + /// + /// The specification of the batch to create and execute. + /// The cancellation token to use. + /// is null. + public virtual Response CreateBatch(BatchCreateRequest createBatchRequest, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(createBatchRequest, nameof(createBatchRequest)); + + using RequestContent content = createBatchRequest.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = CreateBatch(content, context); + return Response.FromValue(OpenAI.Batch.FromResponse(response), response); + } + + /// + /// [Protocol Method] Creates and executes a batch from an uploaded file of requests. + /// Response includes details of the enqueued job including job status. + /// The ID of the result file is added to the response once complete. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task CreateBatchAsync(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.CreateBatch"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateBatchRequest(content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates and executes a batch from an uploaded file of requests. + /// Response includes details of the enqueued job including job status. + /// The ID of the result file is added to the response once complete. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response CreateBatch(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.CreateBatch"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateBatchRequest(content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets details for a single batch specified by the given batchID. + /// The identifier of the batch. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> GetBatchAsync(string batchId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(batchId, nameof(batchId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetBatchAsync(batchId, context).ConfigureAwait(false); + return Response.FromValue(OpenAI.Batch.FromResponse(response), response); + } + + /// Gets details for a single batch specified by the given batchID. + /// The identifier of the batch. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response GetBatch(string batchId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(batchId, nameof(batchId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetBatch(batchId, context); + return Response.FromValue(OpenAI.Batch.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets details for a single batch specified by the given batchID. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The identifier of the batch. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task GetBatchAsync(string batchId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(batchId, nameof(batchId)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.GetBatch"); + scope.Start(); + try + { + using HttpMessage message = CreateGetBatchRequest(batchId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets details for a single batch specified by the given batchID. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The identifier of the batch. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response GetBatch(string batchId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(batchId, nameof(batchId)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.GetBatch"); + scope.Start(); + try + { + using HttpMessage message = CreateGetBatchRequest(batchId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets details for a single batch specified by the given batchID. + /// The identifier of the batch. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> CancelBatchAsync(string batchId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(batchId, nameof(batchId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CancelBatchAsync(batchId, context).ConfigureAwait(false); + return Response.FromValue(OpenAI.Batch.FromResponse(response), response); + } + + /// Gets details for a single batch specified by the given batchID. + /// The identifier of the batch. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response CancelBatch(string batchId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(batchId, nameof(batchId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = CancelBatch(batchId, context); + return Response.FromValue(OpenAI.Batch.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets details for a single batch specified by the given batchID. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The identifier of the batch. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task CancelBatchAsync(string batchId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(batchId, nameof(batchId)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.CancelBatch"); + scope.Start(); + try + { + using HttpMessage message = CreateCancelBatchRequest(batchId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets details for a single batch specified by the given batchID. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The identifier of the batch. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response CancelBatch(string batchId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(batchId, nameof(batchId)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.CancelBatch"); + scope.Start(); + try + { + using HttpMessage message = CreateCancelBatchRequest(batchId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an intermediate Upload object that you can add Parts to. Currently, an Upload can accept at most 8 GB in total and expires after an hour after you create it. + /// + /// Once you complete the Upload, we will create a File object that contains all the parts you uploaded. This File is usable in the rest of our platform as a regular File object. + /// + /// For certain purposes, the correct mime_type must be specified. Please refer to documentation for the supported MIME types for your use case. + /// + /// For guidance on the proper filename extensions for each purpose, please follow the documentation on creating a File. + /// + /// The request body for the operation options. + /// The cancellation token to use. + /// is null. + public virtual async Task> CreateUploadAsync(CreateUploadRequest requestBody, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(requestBody, nameof(requestBody)); + + using RequestContent content = requestBody.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CreateUploadAsync(content, context).ConfigureAwait(false); + return Response.FromValue(Upload.FromResponse(response), response); + } + + /// + /// Creates an intermediate Upload object that you can add Parts to. Currently, an Upload can accept at most 8 GB in total and expires after an hour after you create it. + /// + /// Once you complete the Upload, we will create a File object that contains all the parts you uploaded. This File is usable in the rest of our platform as a regular File object. + /// + /// For certain purposes, the correct mime_type must be specified. Please refer to documentation for the supported MIME types for your use case. + /// + /// For guidance on the proper filename extensions for each purpose, please follow the documentation on creating a File. + /// + /// The request body for the operation options. + /// The cancellation token to use. + /// is null. + public virtual Response CreateUpload(CreateUploadRequest requestBody, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(requestBody, nameof(requestBody)); + + using RequestContent content = requestBody.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = CreateUpload(content, context); + return Response.FromValue(Upload.FromResponse(response), response); + } + + /// + /// [Protocol Method] Creates an intermediate Upload object that you can add Parts to. Currently, an Upload can accept at most 8 GB in total and expires after an hour after you create it. + /// + /// Once you complete the Upload, we will create a File object that contains all the parts you uploaded. This File is usable in the rest of our platform as a regular File object. + /// + /// For certain purposes, the correct mime_type must be specified. Please refer to documentation for the supported MIME types for your use case. + /// + /// For guidance on the proper filename extensions for each purpose, please follow the documentation on creating a File. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task CreateUploadAsync(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.CreateUpload"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateUploadRequest(content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates an intermediate Upload object that you can add Parts to. Currently, an Upload can accept at most 8 GB in total and expires after an hour after you create it. + /// + /// Once you complete the Upload, we will create a File object that contains all the parts you uploaded. This File is usable in the rest of our platform as a regular File object. + /// + /// For certain purposes, the correct mime_type must be specified. Please refer to documentation for the supported MIME types for your use case. + /// + /// For guidance on the proper filename extensions for each purpose, please follow the documentation on creating a File. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response CreateUpload(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.CreateUpload"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateUploadRequest(content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Adds a Part to an Upload object. A Part represents a chunk of bytes from the file you are trying to upload. + /// + /// Each Part can be at most 64 MB, and you can add Parts until you hit the Upload maximum of 8 GB. + /// + /// It is possible to add multiple Parts in parallel. You can decide the intended order of the Parts when you complete the Upload. + /// + /// The ID of the upload associated with this operation. + /// The request body data payload for the operation. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> AddUploadPartAsync(string uploadId, AddUploadPartRequest requestBody, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(uploadId, nameof(uploadId)); + Argument.AssertNotNull(requestBody, nameof(requestBody)); + + using MultipartFormDataRequestContent content = requestBody.ToMultipartRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await AddUploadPartAsync(uploadId, content, content.ContentType, context).ConfigureAwait(false); + return Response.FromValue(UploadPart.FromResponse(response), response); + } + + /// + /// Adds a Part to an Upload object. A Part represents a chunk of bytes from the file you are trying to upload. + /// + /// Each Part can be at most 64 MB, and you can add Parts until you hit the Upload maximum of 8 GB. + /// + /// It is possible to add multiple Parts in parallel. You can decide the intended order of the Parts when you complete the Upload. + /// + /// The ID of the upload associated with this operation. + /// The request body data payload for the operation. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response AddUploadPart(string uploadId, AddUploadPartRequest requestBody, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(uploadId, nameof(uploadId)); + Argument.AssertNotNull(requestBody, nameof(requestBody)); + + using MultipartFormDataRequestContent content = requestBody.ToMultipartRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = AddUploadPart(uploadId, content, content.ContentType, context); + return Response.FromValue(UploadPart.FromResponse(response), response); + } + + /// + /// [Protocol Method] Adds a Part to an Upload object. A Part represents a chunk of bytes from the file you are trying to upload. + /// + /// Each Part can be at most 64 MB, and you can add Parts until you hit the Upload maximum of 8 GB. + /// + /// It is possible to add multiple Parts in parallel. You can decide the intended order of the Parts when you complete the Upload. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the upload associated with this operation. + /// The content to send as the body of the request. + /// The multipart/form-data content-type header for the operation. Allowed values: "multipart/form-data". + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task AddUploadPartAsync(string uploadId, RequestContent content, string contentType, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(uploadId, nameof(uploadId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.AddUploadPart"); + scope.Start(); + try + { + using HttpMessage message = CreateAddUploadPartRequest(uploadId, content, contentType, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Adds a Part to an Upload object. A Part represents a chunk of bytes from the file you are trying to upload. + /// + /// Each Part can be at most 64 MB, and you can add Parts until you hit the Upload maximum of 8 GB. + /// + /// It is possible to add multiple Parts in parallel. You can decide the intended order of the Parts when you complete the Upload. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the upload associated with this operation. + /// The content to send as the body of the request. + /// The multipart/form-data content-type header for the operation. Allowed values: "multipart/form-data". + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response AddUploadPart(string uploadId, RequestContent content, string contentType, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(uploadId, nameof(uploadId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.AddUploadPart"); + scope.Start(); + try + { + using HttpMessage message = CreateAddUploadPartRequest(uploadId, content, contentType, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Completes the Upload. + /// + /// Within the returned Upload object, there is a nested File object that is ready to use in the rest of the platform. + /// + /// You can specify the order of the Parts by passing in an ordered list of the Part IDs. + /// + /// The number of bytes uploaded upon completion must match the number of bytes initially specified when creating the Upload object. No Parts may be added after an Upload is completed. + /// + /// The ID of the upload associated with this operation. + /// The request body for the completion operation. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> CompleteUploadAsync(string uploadId, CompleteUploadRequest requestBody, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(uploadId, nameof(uploadId)); + Argument.AssertNotNull(requestBody, nameof(requestBody)); + + using RequestContent content = requestBody.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CompleteUploadAsync(uploadId, content, context).ConfigureAwait(false); + return Response.FromValue(Upload.FromResponse(response), response); + } + + /// + /// Completes the Upload. + /// + /// Within the returned Upload object, there is a nested File object that is ready to use in the rest of the platform. + /// + /// You can specify the order of the Parts by passing in an ordered list of the Part IDs. + /// + /// The number of bytes uploaded upon completion must match the number of bytes initially specified when creating the Upload object. No Parts may be added after an Upload is completed. + /// + /// The ID of the upload associated with this operation. + /// The request body for the completion operation. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response CompleteUpload(string uploadId, CompleteUploadRequest requestBody, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(uploadId, nameof(uploadId)); + Argument.AssertNotNull(requestBody, nameof(requestBody)); + + using RequestContent content = requestBody.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = CompleteUpload(uploadId, content, context); + return Response.FromValue(Upload.FromResponse(response), response); + } + + /// + /// [Protocol Method] Completes the Upload. + /// + /// Within the returned Upload object, there is a nested File object that is ready to use in the rest of the platform. + /// + /// You can specify the order of the Parts by passing in an ordered list of the Part IDs. + /// + /// The number of bytes uploaded upon completion must match the number of bytes initially specified when creating the Upload object. No Parts may be added after an Upload is completed. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the upload associated with this operation. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task CompleteUploadAsync(string uploadId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(uploadId, nameof(uploadId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.CompleteUpload"); + scope.Start(); + try + { + using HttpMessage message = CreateCompleteUploadRequest(uploadId, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Completes the Upload. + /// + /// Within the returned Upload object, there is a nested File object that is ready to use in the rest of the platform. + /// + /// You can specify the order of the Parts by passing in an ordered list of the Part IDs. + /// + /// The number of bytes uploaded upon completion must match the number of bytes initially specified when creating the Upload object. No Parts may be added after an Upload is completed. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the upload associated with this operation. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response CompleteUpload(string uploadId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(uploadId, nameof(uploadId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.CompleteUpload"); + scope.Start(); + try + { + using HttpMessage message = CreateCompleteUploadRequest(uploadId, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Cancels the Upload. No Parts may be added after an Upload is cancelled. + /// The ID of the upload associated with this operation. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> CancelUploadAsync(string uploadId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(uploadId, nameof(uploadId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CancelUploadAsync(uploadId, context).ConfigureAwait(false); + return Response.FromValue(Upload.FromResponse(response), response); + } + + /// Cancels the Upload. No Parts may be added after an Upload is cancelled. + /// The ID of the upload associated with this operation. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response CancelUpload(string uploadId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(uploadId, nameof(uploadId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = CancelUpload(uploadId, context); + return Response.FromValue(Upload.FromResponse(response), response); + } + + /// + /// [Protocol Method] Cancels the Upload. No Parts may be added after an Upload is cancelled. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the upload associated with this operation. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task CancelUploadAsync(string uploadId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(uploadId, nameof(uploadId)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.CancelUpload"); + scope.Start(); + try + { + using HttpMessage message = CreateCancelUploadRequest(uploadId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Cancels the Upload. No Parts may be added after an Upload is cancelled. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The ID of the upload associated with this operation. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response CancelUpload(string uploadId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(uploadId, nameof(uploadId)); + + using var scope = ClientDiagnostics.CreateScope("OpenAIClient.CancelUpload"); + scope.Start(); + try + { + using HttpMessage message = CreateCancelUploadRequest(uploadId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateGetAudioTranscriptionAsPlainTextRequest(string deploymentId, RequestContent content, string contentType, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/openai", false); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentId, true); + uri.AppendPath("/audio/transcriptions", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "text/plain"); + request.Headers.Add("Content-Type", contentType); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetAudioTranscriptionAsResponseObjectRequest(string deploymentId, RequestContent content, string contentType, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/openai", false); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentId, true); + uri.AppendPath("/audio/transcriptions", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", contentType); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetAudioTranslationAsPlainTextRequest(string deploymentId, RequestContent content, string contentType, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/openai", false); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentId, true); + uri.AppendPath("/audio/translations", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "text/plain"); + request.Headers.Add("Content-Type", contentType); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetAudioTranslationAsResponseObjectRequest(string deploymentId, RequestContent content, string contentType, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/openai", false); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentId, true); + uri.AppendPath("/audio/translations", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", contentType); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetCompletionsRequest(string deploymentId, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/openai", false); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentId, true); + uri.AppendPath("/completions", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetChatCompletionsRequest(string deploymentId, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/openai", false); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentId, true); + uri.AppendPath("/chat/completions", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetImageGenerationsRequest(string deploymentId, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/openai", false); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentId, true); + uri.AppendPath("/images/generations", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGenerateSpeechFromTextRequest(string deploymentId, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/openai", false); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentId, true); + uri.AppendPath("/audio/speech", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/octet-stream"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetEmbeddingsRequest(string deploymentId, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/openai", false); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentId, true); + uri.AppendPath("/embeddings", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetFilesRequest(string purpose, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/openai", false); + uri.AppendPath("/files", false); + if (purpose != null) + { + uri.AppendQuery("purpose", purpose, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateUploadFileRequest(RequestContent content, string contentType, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/openai", false); + uri.AppendPath("/files", false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", contentType); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteFileRequest(string fileId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/openai", false); + uri.AppendPath("/files/", false); + uri.AppendPath(fileId, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetFileRequest(string fileId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/openai", false); + uri.AppendPath("/files/", false); + uri.AppendPath(fileId, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetFileContentRequest(string fileId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/openai", false); + uri.AppendPath("/files/", false); + uri.AppendPath(fileId, true); + uri.AppendPath("/content", false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetBatchesRequest(string after, int? limit, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/openai", false); + uri.AppendPath("/batches", false); + if (after != null) + { + uri.AppendQuery("after", after, true); + } + if (limit != null) + { + uri.AppendQuery("limit", limit.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateBatchRequest(RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier201); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/openai", false); + uri.AppendPath("/batches", false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetBatchRequest(string batchId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/openai", false); + uri.AppendPath("/batches/", false); + uri.AppendPath(batchId, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCancelBatchRequest(string batchId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/openai", false); + uri.AppendPath("/batches/", false); + uri.AppendPath(batchId, true); + uri.AppendPath("/cancel", false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateUploadRequest(RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/openai", false); + uri.AppendPath("/uploads", false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateAddUploadPartRequest(string uploadId, RequestContent content, string contentType, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/openai", false); + uri.AppendPath("/uploads/", false); + uri.AppendPath(uploadId, true); + uri.AppendPath("/parts", false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", contentType); + request.Content = content; + return message; + } + + internal HttpMessage CreateCompleteUploadRequest(string uploadId, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/openai", false); + uri.AppendPath("/uploads/", false); + uri.AppendPath(uploadId, true); + uri.AppendPath("/complete", false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateCancelUploadRequest(string uploadId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/openai", false); + uri.AppendPath("/uploads/", false); + uri.AppendPath(uploadId, true); + uri.AppendPath("/cancel", false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier201; + private static ResponseClassifier ResponseClassifier201 => _responseClassifier201 ??= new StatusCodeClassifier(stackalloc ushort[] { 201 }); + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIClientOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIClientOptions.cs new file mode 100644 index 000000000000..0393a6ea403a --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIClientOptions.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + /// Client options for OpenAIClient. + public partial class OpenAIClientOptions : ClientOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2024_10_01_Preview; + + /// The version of the service to use. + public enum ServiceVersion + { + /// Service version "2022-12-01". + V2022_12_01 = 1, + /// Service version "2023-05-15". + V2023_05_15 = 2, + /// Service version "2023-06-01-preview". + V2023_06_01_Preview = 3, + /// Service version "2023-07-01-preview". + V2023_07_01_Preview = 4, + /// Service version "2024-02-01". + V2024_02_01 = 5, + /// Service version "2024-02-15-preview". + V2024_02_15_Preview = 6, + /// Service version "2024-03-01-preview". + V2024_03_01_Preview = 7, + /// Service version "2024-04-01-preview". + V2024_04_01_Preview = 8, + /// Service version "2024-05-01-preview". + V2024_05_01_Preview = 9, + /// Service version "2024-06-01". + V2024_06_01 = 10, + /// Service version "2024-07-01-preview". + V2024_07_01_Preview = 11, + /// Service version "2024-08-01-preview". + V2024_08_01_Preview = 12, + /// Service version "2024-09-01-preview". + V2024_09_01_Preview = 13, + /// Service version "2024-10-01-preview". + V2024_10_01_Preview = 14, + } + + internal string Version { get; } + + /// Initializes new instance of OpenAIClientOptions. + public OpenAIClientOptions(ServiceVersion version = LatestVersion) + { + Version = version switch + { + ServiceVersion.V2022_12_01 => "2022-12-01", + ServiceVersion.V2023_05_15 => "2023-05-15", + ServiceVersion.V2023_06_01_Preview => "2023-06-01-preview", + ServiceVersion.V2023_07_01_Preview => "2023-07-01-preview", + ServiceVersion.V2024_02_01 => "2024-02-01", + ServiceVersion.V2024_02_15_Preview => "2024-02-15-preview", + ServiceVersion.V2024_03_01_Preview => "2024-03-01-preview", + ServiceVersion.V2024_04_01_Preview => "2024-04-01-preview", + ServiceVersion.V2024_05_01_Preview => "2024-05-01-preview", + ServiceVersion.V2024_06_01 => "2024-06-01", + ServiceVersion.V2024_07_01_Preview => "2024-07-01-preview", + ServiceVersion.V2024_08_01_Preview => "2024-08-01-preview", + ServiceVersion.V2024_09_01_Preview => "2024-09-01-preview", + ServiceVersion.V2024_10_01_Preview => "2024-10-01-preview", + _ => throw new NotSupportedException() + }; + } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIFile.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIFile.Serialization.cs new file mode 100644 index 000000000000..ce98a07b9110 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIFile.Serialization.cs @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class OpenAIFile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenAIFile)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("object"u8); + writer.WriteStringValue(Object.ToString()); + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("bytes"u8); + writer.WriteNumberValue(Bytes); + writer.WritePropertyName("filename"u8); + writer.WriteStringValue(Filename); + writer.WritePropertyName("created_at"u8); + writer.WriteNumberValue(CreatedAt, "U"); + writer.WritePropertyName("purpose"u8); + writer.WriteStringValue(Purpose.ToString()); + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(StatusDetails)) + { + writer.WritePropertyName("status_details"u8); + writer.WriteStringValue(StatusDetails); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OpenAIFile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenAIFile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOpenAIFile(document.RootElement, options); + } + + internal static OpenAIFile DeserializeOpenAIFile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OpenAIFileObject @object = default; + string id = default; + int bytes = default; + string filename = default; + DateTimeOffset createdAt = default; + FilePurpose purpose = default; + FileState? status = default; + string statusDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("object"u8)) + { + @object = new OpenAIFileObject(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("bytes"u8)) + { + bytes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("filename"u8)) + { + filename = property.Value.GetString(); + continue; + } + if (property.NameEquals("created_at"u8)) + { + createdAt = DateTimeOffset.FromUnixTimeSeconds(property.Value.GetInt64()); + continue; + } + if (property.NameEquals("purpose"u8)) + { + purpose = new FilePurpose(property.Value.GetString()); + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new FileState(property.Value.GetString()); + continue; + } + if (property.NameEquals("status_details"u8)) + { + statusDetails = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OpenAIFile( + @object, + id, + bytes, + filename, + createdAt, + purpose, + status, + statusDetails, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OpenAIFile)} does not support writing '{options.Format}' format."); + } + } + + OpenAIFile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOpenAIFile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OpenAIFile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static OpenAIFile FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOpenAIFile(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/openai/Azure.AI.OpenAI/src/Generated/OpenAIFile.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIFile.cs new file mode 100644 index 000000000000..a9eddeb3b1c6 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIFile.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Represents an assistant that can call the model and use tools. + public partial class OpenAIFile + { + /// + /// 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; + + /// Initializes a new instance of . + /// The identifier, which can be referenced in API endpoints. + /// The size of the file, in bytes. + /// The name of the file. + /// The Unix timestamp, in seconds, representing when this object was created. + /// The intended purpose of a file. + /// or is null. + internal OpenAIFile(string id, int bytes, string filename, DateTimeOffset createdAt, FilePurpose purpose) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(filename, nameof(filename)); + + Id = id; + Bytes = bytes; + Filename = filename; + CreatedAt = createdAt; + Purpose = purpose; + } + + /// Initializes a new instance of . + /// The object type, which is always 'file'. + /// The identifier, which can be referenced in API endpoints. + /// The size of the file, in bytes. + /// The name of the file. + /// The Unix timestamp, in seconds, representing when this object was created. + /// The intended purpose of a file. + /// The state of the file. This field is available in Azure OpenAI only. + /// The error message with details in case processing of this file failed. This field is available in Azure OpenAI only. + /// Keeps track of any properties unknown to the library. + internal OpenAIFile(OpenAIFileObject @object, string id, int bytes, string filename, DateTimeOffset createdAt, FilePurpose purpose, FileState? status, string statusDetails, IDictionary serializedAdditionalRawData) + { + Object = @object; + Id = id; + Bytes = bytes; + Filename = filename; + CreatedAt = createdAt; + Purpose = purpose; + Status = status; + StatusDetails = statusDetails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal OpenAIFile() + { + } + + /// The object type, which is always 'file'. + public OpenAIFileObject Object { get; } = OpenAIFileObject.File; + + /// The identifier, which can be referenced in API endpoints. + public string Id { get; } + /// The size of the file, in bytes. + public int Bytes { get; } + /// The name of the file. + public string Filename { get; } + /// The Unix timestamp, in seconds, representing when this object was created. + public DateTimeOffset CreatedAt { get; } + /// The intended purpose of a file. + public FilePurpose Purpose { get; } + /// The state of the file. This field is available in Azure OpenAI only. + public FileState? Status { get; } + /// The error message with details in case processing of this file failed. This field is available in Azure OpenAI only. + public string StatusDetails { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIFileObject.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIFileObject.cs new file mode 100644 index 000000000000..8268140265ee --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIFileObject.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// The OpenAIFile_object. + public readonly partial struct OpenAIFileObject : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OpenAIFileObject(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string FileValue = "file"; + + /// file. + public static OpenAIFileObject File { get; } = new OpenAIFileObject(FileValue); + /// Determines if two values are the same. + public static bool operator ==(OpenAIFileObject left, OpenAIFileObject right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OpenAIFileObject left, OpenAIFileObject right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OpenAIFileObject(string value) => new OpenAIFileObject(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OpenAIFileObject other && Equals(other); + /// + public bool Equals(OpenAIFileObject 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/openai/Azure.AI.OpenAI/src/Generated/OpenAIPageableListOfBatch.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIPageableListOfBatch.Serialization.cs new file mode 100644 index 000000000000..0f860b8e6af0 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIPageableListOfBatch.Serialization.cs @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class OpenAIPageableListOfBatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenAIPageableListOfBatch)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("object"u8); + writer.WriteStringValue(Object.ToString()); + if (Optional.IsCollectionDefined(Data)) + { + writer.WritePropertyName("data"u8); + writer.WriteStartArray(); + foreach (var item in Data) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(FirstId)) + { + writer.WritePropertyName("first_id"u8); + writer.WriteStringValue(FirstId); + } + if (Optional.IsDefined(LastId)) + { + writer.WritePropertyName("last_id"u8); + writer.WriteStringValue(LastId); + } + if (Optional.IsDefined(HasMore)) + { + writer.WritePropertyName("has_more"u8); + writer.WriteBooleanValue(HasMore.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OpenAIPageableListOfBatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenAIPageableListOfBatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOpenAIPageableListOfBatch(document.RootElement, options); + } + + internal static OpenAIPageableListOfBatch DeserializeOpenAIPageableListOfBatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OpenAIPageableListOfBatchObject @object = default; + IReadOnlyList data = default; + string firstId = default; + string lastId = default; + bool? hasMore = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("object"u8)) + { + @object = new OpenAIPageableListOfBatchObject(property.Value.GetString()); + continue; + } + if (property.NameEquals("data"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OpenAI.Batch.DeserializeBatch(item, options)); + } + data = array; + continue; + } + if (property.NameEquals("first_id"u8)) + { + firstId = property.Value.GetString(); + continue; + } + if (property.NameEquals("last_id"u8)) + { + lastId = property.Value.GetString(); + continue; + } + if (property.NameEquals("has_more"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hasMore = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OpenAIPageableListOfBatch( + @object, + data ?? new ChangeTrackingList(), + firstId, + lastId, + hasMore, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OpenAIPageableListOfBatch)} does not support writing '{options.Format}' format."); + } + } + + OpenAIPageableListOfBatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOpenAIPageableListOfBatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OpenAIPageableListOfBatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static OpenAIPageableListOfBatch FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOpenAIPageableListOfBatch(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/openai/Azure.AI.OpenAI/src/Generated/OpenAIPageableListOfBatch.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIPageableListOfBatch.cs new file mode 100644 index 000000000000..16be6cb0109c --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIPageableListOfBatch.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// The response data for a requested list of items. + public partial class OpenAIPageableListOfBatch + { + /// + /// 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; + + /// Initializes a new instance of . + internal OpenAIPageableListOfBatch() + { + Data = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The object type, which is always list. + /// The requested list of items. + /// The first ID represented in this list. + /// The last ID represented in this list. + /// A value indicating whether there are additional values available not captured in this list. + /// Keeps track of any properties unknown to the library. + internal OpenAIPageableListOfBatch(OpenAIPageableListOfBatchObject @object, IReadOnlyList data, string firstId, string lastId, bool? hasMore, IDictionary serializedAdditionalRawData) + { + Object = @object; + Data = data; + FirstId = firstId; + LastId = lastId; + HasMore = hasMore; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The object type, which is always list. + public OpenAIPageableListOfBatchObject Object { get; } = OpenAIPageableListOfBatchObject.List; + + /// The requested list of items. + public IReadOnlyList Data { get; } + /// The first ID represented in this list. + public string FirstId { get; } + /// The last ID represented in this list. + public string LastId { get; } + /// A value indicating whether there are additional values available not captured in this list. + public bool? HasMore { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIPageableListOfBatchObject.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIPageableListOfBatchObject.cs new file mode 100644 index 000000000000..db12e107d15c --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIPageableListOfBatchObject.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// The OpenAIPageableListOfBatch_object. + public readonly partial struct OpenAIPageableListOfBatchObject : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OpenAIPageableListOfBatchObject(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ListValue = "list"; + + /// list. + public static OpenAIPageableListOfBatchObject List { get; } = new OpenAIPageableListOfBatchObject(ListValue); + /// Determines if two values are the same. + public static bool operator ==(OpenAIPageableListOfBatchObject left, OpenAIPageableListOfBatchObject right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OpenAIPageableListOfBatchObject left, OpenAIPageableListOfBatchObject right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OpenAIPageableListOfBatchObject(string value) => new OpenAIPageableListOfBatchObject(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OpenAIPageableListOfBatchObject other && Equals(other); + /// + public bool Equals(OpenAIPageableListOfBatchObject 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/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.Serialization.cs deleted file mode 100644 index ca7bb2911d1c..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI.Chat -{ - public partial class PineconeChatDataSource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PineconeChatDataSource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("parameters") != true) - { - writer.WritePropertyName("parameters"u8); - writer.WriteObjectValue(InternalParameters, options); - } - if (SerializedAdditionalRawData?.ContainsKey("type") != true) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - PineconeChatDataSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PineconeChatDataSource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePineconeChatDataSource(document.RootElement, options); - } - - internal static PineconeChatDataSource DeserializePineconeChatDataSource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - InternalPineconeChatDataSourceParameters parameters = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("parameters"u8)) - { - parameters = InternalPineconeChatDataSourceParameters.DeserializeInternalPineconeChatDataSourceParameters(property.Value, options); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new PineconeChatDataSource(type, serializedAdditionalRawData, parameters); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(PineconeChatDataSource)} does not support writing '{options.Format}' format."); - } - } - - PineconeChatDataSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializePineconeChatDataSource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(PineconeChatDataSource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new PineconeChatDataSource FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializePineconeChatDataSource(document.RootElement); - } - - /// Convert into a . - internal override BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.cs deleted file mode 100644 index 213c4559cc44..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.cs +++ /dev/null @@ -1,14 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI.Chat -{ - /// The PineconeChatDataSource. - public partial class PineconeChatDataSource : ChatDataSource - { - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatExtensionConfiguration.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatExtensionConfiguration.Serialization.cs new file mode 100644 index 000000000000..514da2b198f2 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatExtensionConfiguration.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class PineconeChatExtensionConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(PineconeChatExtensionConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("parameters"u8); + writer.WriteObjectValue(Parameters, options); + } + + PineconeChatExtensionConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PineconeChatExtensionConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePineconeChatExtensionConfiguration(document.RootElement, options); + } + + internal static PineconeChatExtensionConfiguration DeserializePineconeChatExtensionConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PineconeChatExtensionParameters parameters = default; + AzureChatExtensionType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("parameters"u8)) + { + parameters = PineconeChatExtensionParameters.DeserializePineconeChatExtensionParameters(property.Value, options); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new AzureChatExtensionType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PineconeChatExtensionConfiguration(type, serializedAdditionalRawData, parameters); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PineconeChatExtensionConfiguration)} does not support writing '{options.Format}' format."); + } + } + + PineconeChatExtensionConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePineconeChatExtensionConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PineconeChatExtensionConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new PineconeChatExtensionConfiguration FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializePineconeChatExtensionConfiguration(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/openai/Azure.AI.OpenAI/src/Generated/PineconeChatExtensionConfiguration.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatExtensionConfiguration.cs new file mode 100644 index 000000000000..047937523042 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatExtensionConfiguration.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// + /// A specific representation of configurable options for Pinecone when using it as an Azure OpenAI chat + /// extension. + /// + public partial class PineconeChatExtensionConfiguration : AzureChatExtensionConfiguration + { + /// Initializes a new instance of . + /// The parameters to use when configuring Azure OpenAI chat extensions. + /// is null. + public PineconeChatExtensionConfiguration(PineconeChatExtensionParameters parameters) + { + Argument.AssertNotNull(parameters, nameof(parameters)); + + Type = AzureChatExtensionType.Pinecone; + Parameters = parameters; + } + + /// Initializes a new instance of . + /// + /// The label for the type of an Azure chat extension. This typically corresponds to a matching Azure resource. + /// Azure chat extensions are only compatible with Azure OpenAI. + /// + /// Keeps track of any properties unknown to the library. + /// The parameters to use when configuring Azure OpenAI chat extensions. + internal PineconeChatExtensionConfiguration(AzureChatExtensionType type, IDictionary serializedAdditionalRawData, PineconeChatExtensionParameters parameters) : base(type, serializedAdditionalRawData) + { + Parameters = parameters; + } + + /// Initializes a new instance of for deserialization. + internal PineconeChatExtensionConfiguration() + { + } + + /// The parameters to use when configuring Azure OpenAI chat extensions. + public PineconeChatExtensionParameters Parameters { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatExtensionParameters.Serialization.cs similarity index 54% rename from sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.Serialization.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatExtensionParameters.Serialization.cs index 245e5f4ce33d..fb883616be0e 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatExtensionParameters.Serialization.cs @@ -1,94 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // #nullable disable using System; -using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.Core; -namespace Azure.AI.OpenAI.Chat +namespace Azure.AI.OpenAI { - internal partial class InternalPineconeChatDataSourceParameters : IJsonModel + public partial class PineconeChatExtensionParameters : IUtf8JsonSerializable, IJsonModel { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(InternalPineconeChatDataSourceParameters)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(PineconeChatExtensionParameters)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("top_n_documents") != true && Optional.IsDefined(TopNDocuments)) + if (Optional.IsDefined(DocumentCount)) { writer.WritePropertyName("top_n_documents"u8); - writer.WriteNumberValue(TopNDocuments.Value); + writer.WriteNumberValue(DocumentCount.Value); } - if (SerializedAdditionalRawData?.ContainsKey("in_scope") != true && Optional.IsDefined(InScope)) + if (Optional.IsDefined(ShouldRestrictResultScope)) { writer.WritePropertyName("in_scope"u8); - writer.WriteBooleanValue(InScope.Value); + writer.WriteBooleanValue(ShouldRestrictResultScope.Value); } - if (SerializedAdditionalRawData?.ContainsKey("strictness") != true && Optional.IsDefined(Strictness)) + if (Optional.IsDefined(Strictness)) { writer.WritePropertyName("strictness"u8); writer.WriteNumberValue(Strictness.Value); } - if (SerializedAdditionalRawData?.ContainsKey("max_search_queries") != true && Optional.IsDefined(MaxSearchQueries)) + if (Optional.IsDefined(MaxSearchQueries)) { writer.WritePropertyName("max_search_queries"u8); writer.WriteNumberValue(MaxSearchQueries.Value); } - if (SerializedAdditionalRawData?.ContainsKey("allow_partial_result") != true && Optional.IsDefined(AllowPartialResult)) + if (Optional.IsDefined(AllowPartialResult)) { writer.WritePropertyName("allow_partial_result"u8); writer.WriteBooleanValue(AllowPartialResult.Value); } - if (SerializedAdditionalRawData?.ContainsKey("include_contexts") != true && Optional.IsCollectionDefined(_internalIncludeContexts)) + if (Optional.IsCollectionDefined(IncludeContexts)) { writer.WritePropertyName("include_contexts"u8); writer.WriteStartArray(); - foreach (var item in _internalIncludeContexts) + foreach (var item in IncludeContexts) { - writer.WriteStringValue(item); + writer.WriteStringValue(item.ToString()); } writer.WriteEndArray(); } - if (SerializedAdditionalRawData?.ContainsKey("environment") != true) - { - writer.WritePropertyName("environment"u8); - writer.WriteStringValue(Environment); - } - if (SerializedAdditionalRawData?.ContainsKey("index_name") != true) - { - writer.WritePropertyName("index_name"u8); - writer.WriteStringValue(IndexName); - } - if (SerializedAdditionalRawData?.ContainsKey("authentication") != true) + if (Optional.IsDefined(Authentication)) { writer.WritePropertyName("authentication"u8); - writer.WriteObjectValue(Authentication, options); + writer.WriteObjectValue(Authentication, options); } - if (SerializedAdditionalRawData?.ContainsKey("embedding_dependency") != true) + writer.WritePropertyName("environment"u8); + writer.WriteStringValue(EnvironmentName); + writer.WritePropertyName("index_name"u8); + writer.WriteStringValue(IndexName); + writer.WritePropertyName("fields_mapping"u8); + writer.WriteObjectValue(FieldMappingOptions, options); + writer.WritePropertyName("embedding_dependency"u8); + writer.WriteObjectValue(EmbeddingDependency, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) { - writer.WritePropertyName("embedding_dependency"u8); - writer.WriteObjectValue(VectorizationSource, options); - } - if (SerializedAdditionalRawData?.ContainsKey("fields_mapping") != true) - { - writer.WritePropertyName("fields_mapping"u8); - writer.WriteObjectValue(FieldMappings, options); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _serializedAdditionalRawData) { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -100,22 +97,21 @@ void IJsonModel.Write(Utf8JsonWriter w #endif } } - writer.WriteEndObject(); } - InternalPineconeChatDataSourceParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + PineconeChatExtensionParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(InternalPineconeChatDataSourceParameters)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(PineconeChatExtensionParameters)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInternalPineconeChatDataSourceParameters(document.RootElement, options); + return DeserializePineconeChatExtensionParameters(document.RootElement, options); } - internal static InternalPineconeChatDataSourceParameters DeserializeInternalPineconeChatDataSourceParameters(JsonElement element, ModelReaderWriterOptions options = null) + internal static PineconeChatExtensionParameters DeserializePineconeChatExtensionParameters(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -128,12 +124,12 @@ internal static InternalPineconeChatDataSourceParameters DeserializeInternalPine int? strictness = default; int? maxSearchQueries = default; bool? allowPartialResult = default; - IList includeContexts = default; + IList includeContexts = default; + OnYourDataAuthenticationOptions authentication = default; string environment = default; string indexName = default; - DataSourceAuthentication authentication = default; - DataSourceVectorizer embeddingDependency = default; - DataSourceFieldMappings fieldsMapping = default; + PineconeFieldMappingOptions fieldsMapping = default; + OnYourDataVectorizationSource embeddingDependency = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -189,14 +185,23 @@ internal static InternalPineconeChatDataSourceParameters DeserializeInternalPine { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(item.GetString()); + array.Add(new OnYourDataContextProperty(item.GetString())); } includeContexts = array; continue; } + if (property.NameEquals("authentication"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authentication = OnYourDataAuthenticationOptions.DeserializeOnYourDataAuthenticationOptions(property.Value, options); + continue; + } if (property.NameEquals("environment"u8)) { environment = property.Value.GetString(); @@ -207,86 +212,82 @@ internal static InternalPineconeChatDataSourceParameters DeserializeInternalPine indexName = property.Value.GetString(); continue; } - if (property.NameEquals("authentication"u8)) + if (property.NameEquals("fields_mapping"u8)) { - authentication = DataSourceAuthentication.DeserializeDataSourceAuthentication(property.Value, options); + fieldsMapping = PineconeFieldMappingOptions.DeserializePineconeFieldMappingOptions(property.Value, options); continue; } if (property.NameEquals("embedding_dependency"u8)) { - embeddingDependency = DataSourceVectorizer.DeserializeDataSourceVectorizer(property.Value, options); - continue; - } - if (property.NameEquals("fields_mapping"u8)) - { - fieldsMapping = DataSourceFieldMappings.DeserializeDataSourceFieldMappings(property.Value, options); + embeddingDependency = OnYourDataVectorizationSource.DeserializeOnYourDataVectorizationSource(property.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new InternalPineconeChatDataSourceParameters( + return new PineconeChatExtensionParameters( topNDocuments, inScope, strictness, maxSearchQueries, allowPartialResult, - includeContexts ?? new ChangeTrackingList(), + includeContexts ?? new ChangeTrackingList(), + authentication, environment, indexName, - authentication, - embeddingDependency, fieldsMapping, + embeddingDependency, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(InternalPineconeChatDataSourceParameters)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(PineconeChatExtensionParameters)} does not support writing '{options.Format}' format."); } } - InternalPineconeChatDataSourceParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + PineconeChatExtensionParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInternalPineconeChatDataSourceParameters(document.RootElement, options); + return DeserializePineconeChatExtensionParameters(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(InternalPineconeChatDataSourceParameters)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(PineconeChatExtensionParameters)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static InternalPineconeChatDataSourceParameters FromResponse(PipelineResponse response) + /// The response to deserialize the model from. + internal static PineconeChatExtensionParameters FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalPineconeChatDataSourceParameters(document.RootElement); + return DeserializePineconeChatExtensionParameters(document.RootElement); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// Convert into a . + internal virtual RequestContent ToRequestContent() { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatExtensionParameters.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatExtensionParameters.cs new file mode 100644 index 000000000000..7f1a38f68a42 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatExtensionParameters.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Parameters for configuring Azure OpenAI Pinecone chat extensions. The supported authentication type is APIKey. + public partial class PineconeChatExtensionParameters + { + /// + /// 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; + + /// Initializes a new instance of . + /// The environment name of Pinecone. + /// The name of the Pinecone database index. + /// Customized field mapping behavior to use when interacting with the search index. + /// + /// The embedding dependency for vector search. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + /// , , or is null. + public PineconeChatExtensionParameters(string environmentName, string indexName, PineconeFieldMappingOptions fieldMappingOptions, OnYourDataVectorizationSource embeddingDependency) + { + Argument.AssertNotNull(environmentName, nameof(environmentName)); + Argument.AssertNotNull(indexName, nameof(indexName)); + Argument.AssertNotNull(fieldMappingOptions, nameof(fieldMappingOptions)); + Argument.AssertNotNull(embeddingDependency, nameof(embeddingDependency)); + + IncludeContexts = new ChangeTrackingList(); + EnvironmentName = environmentName; + IndexName = indexName; + FieldMappingOptions = fieldMappingOptions; + EmbeddingDependency = embeddingDependency; + } + + /// Initializes a new instance of . + /// The configured top number of documents to feature for the configured query. + /// Whether queries should be restricted to use of indexed data. + /// The configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but lower recall of the answer. + /// + /// The max number of rewritten queries should be send to search provider for one user message. If not specified, + /// the system will decide the number of queries to send. + /// + /// + /// If specified as true, the system will allow partial search results to be used and the request fails if all the queries fail. + /// If not specified, or specified as false, the request will fail if any search query fails. + /// + /// The included properties of the output context. If not specified, the default value is `citations` and `intent`. + /// + /// The authentication method to use when accessing the defined data source. + /// Each data source type supports a specific set of available authentication methods; please see the documentation of + /// the data source for supported mechanisms. + /// If not otherwise provided, On Your Data will attempt to use System Managed Identity (default credential) + /// authentication. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , and . + /// + /// The environment name of Pinecone. + /// The name of the Pinecone database index. + /// Customized field mapping behavior to use when interacting with the search index. + /// + /// The embedding dependency for vector search. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + /// Keeps track of any properties unknown to the library. + internal PineconeChatExtensionParameters(int? documentCount, bool? shouldRestrictResultScope, int? strictness, int? maxSearchQueries, bool? allowPartialResult, IList includeContexts, OnYourDataAuthenticationOptions authentication, string environmentName, string indexName, PineconeFieldMappingOptions fieldMappingOptions, OnYourDataVectorizationSource embeddingDependency, IDictionary serializedAdditionalRawData) + { + DocumentCount = documentCount; + ShouldRestrictResultScope = shouldRestrictResultScope; + Strictness = strictness; + MaxSearchQueries = maxSearchQueries; + AllowPartialResult = allowPartialResult; + IncludeContexts = includeContexts; + Authentication = authentication; + EnvironmentName = environmentName; + IndexName = indexName; + FieldMappingOptions = fieldMappingOptions; + EmbeddingDependency = embeddingDependency; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PineconeChatExtensionParameters() + { + } + + /// The configured top number of documents to feature for the configured query. + public int? DocumentCount { get; set; } + /// Whether queries should be restricted to use of indexed data. + public bool? ShouldRestrictResultScope { get; set; } + /// The configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but lower recall of the answer. + public int? Strictness { get; set; } + /// + /// The max number of rewritten queries should be send to search provider for one user message. If not specified, + /// the system will decide the number of queries to send. + /// + public int? MaxSearchQueries { get; set; } + /// + /// If specified as true, the system will allow partial search results to be used and the request fails if all the queries fail. + /// If not specified, or specified as false, the request will fail if any search query fails. + /// + public bool? AllowPartialResult { get; set; } + /// The included properties of the output context. If not specified, the default value is `citations` and `intent`. + public IList IncludeContexts { get; } + /// + /// The authentication method to use when accessing the defined data source. + /// Each data source type supports a specific set of available authentication methods; please see the documentation of + /// the data source for supported mechanisms. + /// If not otherwise provided, On Your Data will attempt to use System Managed Identity (default credential) + /// authentication. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , and . + /// + public OnYourDataAuthenticationOptions Authentication { get; set; } + /// The environment name of Pinecone. + public string EnvironmentName { get; } + /// The name of the Pinecone database index. + public string IndexName { get; } + /// Customized field mapping behavior to use when interacting with the search index. + public PineconeFieldMappingOptions FieldMappingOptions { get; } + /// + /// The embedding dependency for vector search. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + public OnYourDataVectorizationSource EmbeddingDependency { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeFieldMappingOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeFieldMappingOptions.Serialization.cs new file mode 100644 index 000000000000..22a55bdd70d0 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeFieldMappingOptions.Serialization.cs @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class PineconeFieldMappingOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(PineconeFieldMappingOptions)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(TitleFieldName)) + { + writer.WritePropertyName("title_field"u8); + writer.WriteStringValue(TitleFieldName); + } + if (Optional.IsDefined(UrlFieldName)) + { + writer.WritePropertyName("url_field"u8); + writer.WriteStringValue(UrlFieldName); + } + if (Optional.IsDefined(FilepathFieldName)) + { + writer.WritePropertyName("filepath_field"u8); + writer.WriteStringValue(FilepathFieldName); + } + writer.WritePropertyName("content_fields"u8); + writer.WriteStartArray(); + foreach (var item in ContentFieldNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(ContentFieldSeparator)) + { + writer.WritePropertyName("content_fields_separator"u8); + writer.WriteStringValue(ContentFieldSeparator); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PineconeFieldMappingOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PineconeFieldMappingOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePineconeFieldMappingOptions(document.RootElement, options); + } + + internal static PineconeFieldMappingOptions DeserializePineconeFieldMappingOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string titleField = default; + string urlField = default; + string filepathField = default; + IList contentFields = default; + string contentFieldsSeparator = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("title_field"u8)) + { + titleField = property.Value.GetString(); + continue; + } + if (property.NameEquals("url_field"u8)) + { + urlField = property.Value.GetString(); + continue; + } + if (property.NameEquals("filepath_field"u8)) + { + filepathField = property.Value.GetString(); + continue; + } + if (property.NameEquals("content_fields"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + contentFields = array; + continue; + } + if (property.NameEquals("content_fields_separator"u8)) + { + contentFieldsSeparator = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PineconeFieldMappingOptions( + titleField, + urlField, + filepathField, + contentFields, + contentFieldsSeparator, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PineconeFieldMappingOptions)} does not support writing '{options.Format}' format."); + } + } + + PineconeFieldMappingOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePineconeFieldMappingOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PineconeFieldMappingOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static PineconeFieldMappingOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializePineconeFieldMappingOptions(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/openai/Azure.AI.OpenAI/src/Generated/PineconeFieldMappingOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeFieldMappingOptions.cs new file mode 100644 index 000000000000..4d3d569a6533 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeFieldMappingOptions.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.OpenAI +{ + /// Optional settings to control how fields are processed when using a configured Pinecone resource. + public partial class PineconeFieldMappingOptions + { + /// + /// 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; + + /// Initializes a new instance of . + /// The names of index fields that should be treated as content. + /// is null. + public PineconeFieldMappingOptions(IEnumerable contentFieldNames) + { + Argument.AssertNotNull(contentFieldNames, nameof(contentFieldNames)); + + ContentFieldNames = contentFieldNames.ToList(); + } + + /// Initializes a new instance of . + /// The name of the index field to use as a title. + /// The name of the index field to use as a URL. + /// The name of the index field to use as a filepath. + /// The names of index fields that should be treated as content. + /// The separator pattern that content fields should use. + /// Keeps track of any properties unknown to the library. + internal PineconeFieldMappingOptions(string titleFieldName, string urlFieldName, string filepathFieldName, IList contentFieldNames, string contentFieldSeparator, IDictionary serializedAdditionalRawData) + { + TitleFieldName = titleFieldName; + UrlFieldName = urlFieldName; + FilepathFieldName = filepathFieldName; + ContentFieldNames = contentFieldNames; + ContentFieldSeparator = contentFieldSeparator; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PineconeFieldMappingOptions() + { + } + + /// The name of the index field to use as a title. + public string TitleFieldName { get; set; } + /// The name of the index field to use as a URL. + public string UrlFieldName { get; set; } + /// The name of the index field to use as a filepath. + public string FilepathFieldName { get; set; } + /// The names of index fields that should be treated as content. + public IList ContentFieldNames { get; } + /// The separator pattern that content fields should use. + public string ContentFieldSeparator { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestContentFilterResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestContentFilterResult.Serialization.cs deleted file mode 100644 index 030bb75bd3c8..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestContentFilterResult.Serialization.cs +++ /dev/null @@ -1,155 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI -{ - public partial class RequestContentFilterResult : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RequestContentFilterResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("prompt_index") != true && Optional.IsDefined(PromptIndex)) - { - writer.WritePropertyName("prompt_index"u8); - writer.WriteNumberValue(PromptIndex.Value); - } - if (SerializedAdditionalRawData?.ContainsKey("content_filter_results") != true && Optional.IsDefined(InternalResults)) - { - writer.WritePropertyName("content_filter_results"u8); - writer.WriteObjectValue(InternalResults, options); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - RequestContentFilterResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RequestContentFilterResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRequestContentFilterResult(document.RootElement, options); - } - - internal static RequestContentFilterResult DeserializeRequestContentFilterResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int? promptIndex = default; - InternalAzureContentFilterResultForPromptContentFilterResults contentFilterResults = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("prompt_index"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - promptIndex = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("content_filter_results"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - contentFilterResults = InternalAzureContentFilterResultForPromptContentFilterResults.DeserializeInternalAzureContentFilterResultForPromptContentFilterResults(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RequestContentFilterResult(promptIndex, contentFilterResults, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(RequestContentFilterResult)} does not support writing '{options.Format}' format."); - } - } - - RequestContentFilterResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRequestContentFilterResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RequestContentFilterResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static RequestContentFilterResult FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeRequestContentFilterResult(document.RootElement); - } - - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestContentFilterResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestContentFilterResult.cs deleted file mode 100644 index 74a54e0155bb..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestContentFilterResult.cs +++ /dev/null @@ -1,60 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI -{ - /// A content filter result associated with a single input prompt item into a generative AI system. - public partial class RequestContentFilterResult - { - /// - /// 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" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - internal RequestContentFilterResult() - { - } - - /// Initializes a new instance of . - /// The index of the input prompt associated with the accompanying content filter result categories. - /// The content filter category details for the result. - /// Keeps track of any properties unknown to the library. - internal RequestContentFilterResult(int? promptIndex, InternalAzureContentFilterResultForPromptContentFilterResults internalResults, IDictionary serializedAdditionalRawData) - { - PromptIndex = promptIndex; - InternalResults = internalResults; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestImageContentFilterResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestImageContentFilterResult.cs deleted file mode 100644 index e41fc322b0ee..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestImageContentFilterResult.cs +++ /dev/null @@ -1,85 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI -{ - /// A content filter result for an image generation operation's input request content. - public partial class RequestImageContentFilterResult : ResponseImageContentFilterResult - { - /// Initializes a new instance of . - /// - /// A detection result that describes user prompt injection attacks, where malicious users deliberately exploit - /// system vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content - /// generation or violations of system-imposed restrictions. - /// - /// is null. - internal RequestImageContentFilterResult(ContentFilterDetectionResult jailbreak) - { - Argument.AssertNotNull(jailbreak, nameof(jailbreak)); - - Jailbreak = jailbreak; - } - - /// Initializes a new instance of . - /// - /// A content filter category for language related to anatomical organs and genitals, romantic relationships, acts - /// portrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an - /// assault or a forced sexual violent act against one's will, prostitution, pornography, and abuse. - /// - /// - /// A content filter category for language related to physical actions intended to hurt, injure, damage, or kill - /// someone or something; describes weapons, guns and related entities, such as manufactures, associations, - /// legislation, and so on. - /// - /// - /// A content filter category that can refer to any content that attacks or uses pejorative or discriminatory - /// language with reference to a person or identity group based on certain differentiating attributes of these groups - /// including but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation, - /// religion, immigration status, ability status, personal appearance, and body size. - /// - /// - /// A content filter category that describes language related to physical actions intended to purposely hurt, injure, - /// damage one's body or kill oneself. - /// - /// Keeps track of any properties unknown to the library. - /// - /// A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the - /// content. - /// - /// A collection of binary filtering outcomes for configured custom blocklists. - /// - /// A detection result that describes user prompt injection attacks, where malicious users deliberately exploit - /// system vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content - /// generation or violations of system-imposed restrictions. - /// - internal RequestImageContentFilterResult(ContentFilterSeverityResult sexual, ContentFilterSeverityResult violence, ContentFilterSeverityResult hate, ContentFilterSeverityResult selfHarm, IDictionary serializedAdditionalRawData, ContentFilterDetectionResult profanity, ContentFilterBlocklistResult customBlocklists, ContentFilterDetectionResult jailbreak) : base(sexual, violence, hate, selfHarm, serializedAdditionalRawData) - { - Profanity = profanity; - CustomBlocklists = customBlocklists; - Jailbreak = jailbreak; - } - - /// Initializes a new instance of for deserialization. - internal RequestImageContentFilterResult() - { - } - - /// - /// A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the - /// content. - /// - public ContentFilterDetectionResult Profanity { get; } - /// A collection of binary filtering outcomes for configured custom blocklists. - public ContentFilterBlocklistResult CustomBlocklists { get; } - /// - /// A detection result that describes user prompt injection attacks, where malicious users deliberately exploit - /// system vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content - /// generation or violations of system-imposed restrictions. - /// - public ContentFilterDetectionResult Jailbreak { get; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseContentFilterResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseContentFilterResult.cs deleted file mode 100644 index be77b4567b3d..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseContentFilterResult.cs +++ /dev/null @@ -1,129 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI -{ - /// A content filter result for a single response item produced by a generative AI system. - public partial class ResponseContentFilterResult - { - /// - /// 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" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - internal ResponseContentFilterResult() - { - } - - /// Initializes a new instance of . - /// - /// A content filter category for language related to anatomical organs and genitals, romantic relationships, acts - /// portrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an - /// assault or a forced sexual violent act against one's will, prostitution, pornography, and abuse. - /// - /// - /// A content filter category that can refer to any content that attacks or uses pejorative or discriminatory - /// language with reference to a person or identity group based on certain differentiating attributes of these groups - /// including but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation, - /// religion, immigration status, ability status, personal appearance, and body size. - /// - /// - /// A content filter category for language related to physical actions intended to hurt, injure, damage, or kill - /// someone or something; describes weapons, guns and related entities, such as manufactures, associations, - /// legislation, and so on. - /// - /// - /// A content filter category that describes language related to physical actions intended to purposely hurt, injure, - /// damage one's body or kill oneself. - /// - /// - /// A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the - /// content. - /// - /// A collection of binary filtering outcomes for configured custom blocklists. - /// If present, details about an error that prevented content filtering from completing its evaluation. - /// A detection result that describes a match against text protected under copyright or other status. - /// A detection result that describes a match against licensed code or other protected source material. - /// Keeps track of any properties unknown to the library. - internal ResponseContentFilterResult(ContentFilterSeverityResult sexual, ContentFilterSeverityResult hate, ContentFilterSeverityResult violence, ContentFilterSeverityResult selfHarm, ContentFilterDetectionResult profanity, ContentFilterBlocklistResult customBlocklists, InternalAzureContentFilterResultForPromptContentFilterResultsError error, ContentFilterDetectionResult protectedMaterialText, ContentFilterProtectedMaterialResult protectedMaterialCode, IDictionary serializedAdditionalRawData) - { - Sexual = sexual; - Hate = hate; - Violence = violence; - SelfHarm = selfHarm; - Profanity = profanity; - CustomBlocklists = customBlocklists; - Error = error; - ProtectedMaterialText = protectedMaterialText; - ProtectedMaterialCode = protectedMaterialCode; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// - /// A content filter category for language related to anatomical organs and genitals, romantic relationships, acts - /// portrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an - /// assault or a forced sexual violent act against one's will, prostitution, pornography, and abuse. - /// - public ContentFilterSeverityResult Sexual { get; } - /// - /// A content filter category that can refer to any content that attacks or uses pejorative or discriminatory - /// language with reference to a person or identity group based on certain differentiating attributes of these groups - /// including but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation, - /// religion, immigration status, ability status, personal appearance, and body size. - /// - public ContentFilterSeverityResult Hate { get; } - /// - /// A content filter category for language related to physical actions intended to hurt, injure, damage, or kill - /// someone or something; describes weapons, guns and related entities, such as manufactures, associations, - /// legislation, and so on. - /// - public ContentFilterSeverityResult Violence { get; } - /// - /// A content filter category that describes language related to physical actions intended to purposely hurt, injure, - /// damage one's body or kill oneself. - /// - public ContentFilterSeverityResult SelfHarm { get; } - /// - /// A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the - /// content. - /// - public ContentFilterDetectionResult Profanity { get; } - /// A collection of binary filtering outcomes for configured custom blocklists. - public ContentFilterBlocklistResult CustomBlocklists { get; } - /// A detection result that describes a match against text protected under copyright or other status. - public ContentFilterDetectionResult ProtectedMaterialText { get; } - /// A detection result that describes a match against licensed code or other protected source material. - public ContentFilterProtectedMaterialResult ProtectedMaterialCode { get; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseImageContentFilterResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseImageContentFilterResult.Serialization.cs deleted file mode 100644 index ea977b08966e..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseImageContentFilterResult.Serialization.cs +++ /dev/null @@ -1,185 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI -{ - public partial class ResponseImageContentFilterResult : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ResponseImageContentFilterResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("sexual") != true && Optional.IsDefined(Sexual)) - { - writer.WritePropertyName("sexual"u8); - writer.WriteObjectValue(Sexual, options); - } - if (SerializedAdditionalRawData?.ContainsKey("violence") != true && Optional.IsDefined(Violence)) - { - writer.WritePropertyName("violence"u8); - writer.WriteObjectValue(Violence, options); - } - if (SerializedAdditionalRawData?.ContainsKey("hate") != true && Optional.IsDefined(Hate)) - { - writer.WritePropertyName("hate"u8); - writer.WriteObjectValue(Hate, options); - } - if (SerializedAdditionalRawData?.ContainsKey("self_harm") != true && Optional.IsDefined(SelfHarm)) - { - writer.WritePropertyName("self_harm"u8); - writer.WriteObjectValue(SelfHarm, options); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ResponseImageContentFilterResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ResponseImageContentFilterResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeResponseImageContentFilterResult(document.RootElement, options); - } - - internal static ResponseImageContentFilterResult DeserializeResponseImageContentFilterResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ContentFilterSeverityResult sexual = default; - ContentFilterSeverityResult violence = default; - ContentFilterSeverityResult hate = default; - ContentFilterSeverityResult selfHarm = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("sexual"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - sexual = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); - continue; - } - if (property.NameEquals("violence"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - violence = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); - continue; - } - if (property.NameEquals("hate"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - hate = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); - continue; - } - if (property.NameEquals("self_harm"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - selfHarm = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ResponseImageContentFilterResult(sexual, violence, hate, selfHarm, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ResponseImageContentFilterResult)} does not support writing '{options.Format}' format."); - } - } - - ResponseImageContentFilterResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeResponseImageContentFilterResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ResponseImageContentFilterResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static ResponseImageContentFilterResult FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeResponseImageContentFilterResult(document.RootElement); - } - - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseImageContentFilterResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseImageContentFilterResult.cs deleted file mode 100644 index 2a5b21055925..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseImageContentFilterResult.cs +++ /dev/null @@ -1,105 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI -{ - /// A content filter result for an image generation operation's output response content. - public partial class ResponseImageContentFilterResult - { - /// - /// 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" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - internal ResponseImageContentFilterResult() - { - } - - /// Initializes a new instance of . - /// - /// A content filter category for language related to anatomical organs and genitals, romantic relationships, acts - /// portrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an - /// assault or a forced sexual violent act against one's will, prostitution, pornography, and abuse. - /// - /// - /// A content filter category for language related to physical actions intended to hurt, injure, damage, or kill - /// someone or something; describes weapons, guns and related entities, such as manufactures, associations, - /// legislation, and so on. - /// - /// - /// A content filter category that can refer to any content that attacks or uses pejorative or discriminatory - /// language with reference to a person or identity group based on certain differentiating attributes of these groups - /// including but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation, - /// religion, immigration status, ability status, personal appearance, and body size. - /// - /// - /// A content filter category that describes language related to physical actions intended to purposely hurt, injure, - /// damage one's body or kill oneself. - /// - /// Keeps track of any properties unknown to the library. - internal ResponseImageContentFilterResult(ContentFilterSeverityResult sexual, ContentFilterSeverityResult violence, ContentFilterSeverityResult hate, ContentFilterSeverityResult selfHarm, IDictionary serializedAdditionalRawData) - { - Sexual = sexual; - Violence = violence; - Hate = hate; - SelfHarm = selfHarm; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// - /// A content filter category for language related to anatomical organs and genitals, romantic relationships, acts - /// portrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an - /// assault or a forced sexual violent act against one's will, prostitution, pornography, and abuse. - /// - public ContentFilterSeverityResult Sexual { get; } - /// - /// A content filter category for language related to physical actions intended to hurt, injure, damage, or kill - /// someone or something; describes weapons, guns and related entities, such as manufactures, associations, - /// legislation, and so on. - /// - public ContentFilterSeverityResult Violence { get; } - /// - /// A content filter category that can refer to any content that attacks or uses pejorative or discriminatory - /// language with reference to a person or identity group based on certain differentiating attributes of these groups - /// including but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation, - /// religion, immigration status, ability status, personal appearance, and body size. - /// - public ContentFilterSeverityResult Hate { get; } - /// - /// A content filter category that describes language related to physical actions intended to purposely hurt, injure, - /// damage one's body or kill oneself. - /// - public ContentFilterSeverityResult SelfHarm { get; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/SpeechGenerationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/SpeechGenerationOptions.Serialization.cs new file mode 100644 index 000000000000..a5145545c54d --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/SpeechGenerationOptions.Serialization.cs @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class SpeechGenerationOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(SpeechGenerationOptions)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("input"u8); + writer.WriteStringValue(Input); + writer.WritePropertyName("voice"u8); + writer.WriteStringValue(Voice.ToString()); + if (Optional.IsDefined(ResponseFormat)) + { + writer.WritePropertyName("response_format"u8); + writer.WriteStringValue(ResponseFormat.Value.ToString()); + } + if (Optional.IsDefined(Speed)) + { + writer.WritePropertyName("speed"u8); + writer.WriteNumberValue(Speed.Value); + } + if (Optional.IsDefined(DeploymentName)) + { + writer.WritePropertyName("model"u8); + writer.WriteStringValue(DeploymentName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SpeechGenerationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SpeechGenerationOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSpeechGenerationOptions(document.RootElement, options); + } + + internal static SpeechGenerationOptions DeserializeSpeechGenerationOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string input = default; + SpeechVoice voice = default; + SpeechGenerationResponseFormat? responseFormat = default; + float? speed = default; + string model = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("input"u8)) + { + input = property.Value.GetString(); + continue; + } + if (property.NameEquals("voice"u8)) + { + voice = new SpeechVoice(property.Value.GetString()); + continue; + } + if (property.NameEquals("response_format"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + responseFormat = new SpeechGenerationResponseFormat(property.Value.GetString()); + continue; + } + if (property.NameEquals("speed"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + speed = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("model"u8)) + { + model = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SpeechGenerationOptions( + input, + voice, + responseFormat, + speed, + model, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SpeechGenerationOptions)} does not support writing '{options.Format}' format."); + } + } + + SpeechGenerationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSpeechGenerationOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SpeechGenerationOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SpeechGenerationOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSpeechGenerationOptions(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/openai/Azure.AI.OpenAI/src/Generated/SpeechGenerationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/SpeechGenerationOptions.cs new file mode 100644 index 000000000000..21f6b6fd2888 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/SpeechGenerationOptions.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// A representation of the request options that control the behavior of a text-to-speech operation. + public partial class SpeechGenerationOptions + { + /// + /// 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; + + /// Initializes a new instance of . + /// The text to generate audio for. The maximum length is 4096 characters. + /// The voice to use for text-to-speech. + /// is null. + public SpeechGenerationOptions(string input, SpeechVoice voice) + { + Argument.AssertNotNull(input, nameof(input)); + + Input = input; + Voice = voice; + } + + /// Initializes a new instance of . + /// The text to generate audio for. The maximum length is 4096 characters. + /// The voice to use for text-to-speech. + /// The audio output format for the spoken text. By default, the MP3 format will be used. + /// The speed of speech for generated audio. Values are valid in the range from 0.25 to 4.0, with 1.0 the default and higher values corresponding to faster speech. + /// The model to use for this text-to-speech request. + /// Keeps track of any properties unknown to the library. + internal SpeechGenerationOptions(string input, SpeechVoice voice, SpeechGenerationResponseFormat? responseFormat, float? speed, string deploymentName, IDictionary serializedAdditionalRawData) + { + Input = input; + Voice = voice; + ResponseFormat = responseFormat; + Speed = speed; + DeploymentName = deploymentName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SpeechGenerationOptions() + { + } + + /// The text to generate audio for. The maximum length is 4096 characters. + public string Input { get; } + /// The voice to use for text-to-speech. + public SpeechVoice Voice { get; } + /// The audio output format for the spoken text. By default, the MP3 format will be used. + public SpeechGenerationResponseFormat? ResponseFormat { get; set; } + /// The speed of speech for generated audio. Values are valid in the range from 0.25 to 4.0, with 1.0 the default and higher values corresponding to faster speech. + public float? Speed { get; set; } + /// The model to use for this text-to-speech request. + public string DeploymentName { get; set; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/SpeechGenerationResponseFormat.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/SpeechGenerationResponseFormat.cs new file mode 100644 index 000000000000..e2af864d093b --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/SpeechGenerationResponseFormat.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// The supported audio output formats for text-to-speech. + public readonly partial struct SpeechGenerationResponseFormat : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SpeechGenerationResponseFormat(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string Mp3Value = "mp3"; + private const string OpusValue = "opus"; + private const string AacValue = "aac"; + private const string FlacValue = "flac"; + private const string WavValue = "wav"; + private const string PcmValue = "pcm"; + + /// Use MP3 as the audio output format. MP3 is the default, general-purpose format. + public static SpeechGenerationResponseFormat Mp3 { get; } = new SpeechGenerationResponseFormat(Mp3Value); + /// Use Opus as the audio output format. Opus is optimized for internet streaming and low latency. + public static SpeechGenerationResponseFormat Opus { get; } = new SpeechGenerationResponseFormat(OpusValue); + /// Use AAC as the audio output format. AAC is optimized for digital audio compression and is preferred by YouTube, Android, and iOS. + public static SpeechGenerationResponseFormat Aac { get; } = new SpeechGenerationResponseFormat(AacValue); + /// Use FLAC as the audio output format. FLAC is a fully lossless format optimized for maximum quality at the expense of size. + public static SpeechGenerationResponseFormat Flac { get; } = new SpeechGenerationResponseFormat(FlacValue); + /// Use uncompressed WAV as the audio output format, suitable for low-latency applications to avoid decoding overhead. + public static SpeechGenerationResponseFormat Wav { get; } = new SpeechGenerationResponseFormat(WavValue); + /// Use uncompressed PCM as the audio output format, which is similar to WAV but contains raw samples in 24kHz (16-bit signed, low-endian), without the header. + public static SpeechGenerationResponseFormat Pcm { get; } = new SpeechGenerationResponseFormat(PcmValue); + /// Determines if two values are the same. + public static bool operator ==(SpeechGenerationResponseFormat left, SpeechGenerationResponseFormat right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SpeechGenerationResponseFormat left, SpeechGenerationResponseFormat right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SpeechGenerationResponseFormat(string value) => new SpeechGenerationResponseFormat(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SpeechGenerationResponseFormat other && Equals(other); + /// + public bool Equals(SpeechGenerationResponseFormat 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/openai/Azure.AI.OpenAI/src/Generated/SpeechVoice.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/SpeechVoice.cs new file mode 100644 index 000000000000..a4b9c07a167f --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/SpeechVoice.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// The available voices for text-to-speech. + public readonly partial struct SpeechVoice : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SpeechVoice(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AlloyValue = "alloy"; + private const string EchoValue = "echo"; + private const string FableValue = "fable"; + private const string OnyxValue = "onyx"; + private const string NovaValue = "nova"; + private const string ShimmerValue = "shimmer"; + + /// The Alloy voice. + public static SpeechVoice Alloy { get; } = new SpeechVoice(AlloyValue); + /// The Echo voice. + public static SpeechVoice Echo { get; } = new SpeechVoice(EchoValue); + /// The Fable voice. + public static SpeechVoice Fable { get; } = new SpeechVoice(FableValue); + /// The Onyx voice. + public static SpeechVoice Onyx { get; } = new SpeechVoice(OnyxValue); + /// The Nova voice. + public static SpeechVoice Nova { get; } = new SpeechVoice(NovaValue); + /// The Shimmer voice. + public static SpeechVoice Shimmer { get; } = new SpeechVoice(ShimmerValue); + /// Determines if two values are the same. + public static bool operator ==(SpeechVoice left, SpeechVoice right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SpeechVoice left, SpeechVoice right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SpeechVoice(string value) => new SpeechVoice(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SpeechVoice other && Equals(other); + /// + public bool Equals(SpeechVoice 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/MediaJobOutputFinishedEventData.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownAzureChatExtensionConfiguration.Serialization.cs similarity index 53% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputFinishedEventData.Serialization.cs rename to sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownAzureChatExtensionConfiguration.Serialization.cs index 129a88fa4d80..341f72a8756b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputFinishedEventData.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownAzureChatExtensionConfiguration.Serialization.cs @@ -11,13 +11,13 @@ using System.Text.Json; using Azure.Core; -namespace Azure.Messaging.EventGrid.SystemEvents +namespace Azure.AI.OpenAI { - public partial class MediaJobOutputFinishedEventData : IUtf8JsonSerializable, IJsonModel + internal partial class UnknownAzureChatExtensionConfiguration : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,28 +28,28 @@ 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobOutputFinishedEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(AzureChatExtensionConfiguration)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); } - MediaJobOutputFinishedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AzureChatExtensionConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MediaJobOutputFinishedEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(AzureChatExtensionConfiguration)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMediaJobOutputFinishedEventData(document.RootElement, options); + return DeserializeAzureChatExtensionConfiguration(document.RootElement, options); } - internal static MediaJobOutputFinishedEventData DeserializeMediaJobOutputFinishedEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static UnknownAzureChatExtensionConfiguration DeserializeUnknownAzureChatExtensionConfiguration(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -57,31 +57,14 @@ internal static MediaJobOutputFinishedEventData DeserializeMediaJobOutputFinishe { return null; } - MediaJobState previousState = default; - MediaJobOutput output = default; - IReadOnlyDictionary jobCorrelationData = default; + AzureChatExtensionType type = "Unknown"; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("previousState"u8)) + if (property.NameEquals("type"u8)) { - previousState = new MediaJobState(property.Value.GetString()); - continue; - } - if (property.NameEquals("output"u8)) - { - output = MediaJobOutput.DeserializeMediaJobOutput(property.Value, options); - continue; - } - if (property.NameEquals("jobCorrelationData"u8)) - { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - jobCorrelationData = dictionary; + type = new AzureChatExtensionType(property.Value.GetString()); continue; } if (options.Format != "W") @@ -90,53 +73,53 @@ internal static MediaJobOutputFinishedEventData DeserializeMediaJobOutputFinishe } } serializedAdditionalRawData = rawDataDictionary; - return new MediaJobOutputFinishedEventData(previousState, output, jobCorrelationData, serializedAdditionalRawData); + return new UnknownAzureChatExtensionConfiguration(type, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MediaJobOutputFinishedEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(AzureChatExtensionConfiguration)} does not support writing '{options.Format}' format."); } } - MediaJobOutputFinishedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + AzureChatExtensionConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMediaJobOutputFinishedEventData(document.RootElement, options); + return DeserializeAzureChatExtensionConfiguration(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MediaJobOutputFinishedEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(AzureChatExtensionConfiguration)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new MediaJobOutputFinishedEventData FromResponse(Response response) + internal static new UnknownAzureChatExtensionConfiguration FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeMediaJobOutputFinishedEventData(document.RootElement); + return DeserializeUnknownAzureChatExtensionConfiguration(document.RootElement); } /// Convert into a . internal override RequestContent ToRequestContent() { var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); return content; } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownAzureChatExtensionConfiguration.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownAzureChatExtensionConfiguration.cs new file mode 100644 index 000000000000..c9f09702aa3a --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownAzureChatExtensionConfiguration.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Unknown version of AzureChatExtensionConfiguration. + internal partial class UnknownAzureChatExtensionConfiguration : AzureChatExtensionConfiguration + { + /// Initializes a new instance of . + /// + /// The label for the type of an Azure chat extension. This typically corresponds to a matching Azure resource. + /// Azure chat extensions are only compatible with Azure OpenAI. + /// + /// Keeps track of any properties unknown to the library. + internal UnknownAzureChatExtensionConfiguration(AzureChatExtensionType type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownAzureChatExtensionConfiguration() + { + } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsNamedToolSelection.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsNamedToolSelection.Serialization.cs new file mode 100644 index 000000000000..697f2ee1418e --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsNamedToolSelection.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + internal partial class UnknownChatCompletionsNamedToolSelection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsNamedToolSelection)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ChatCompletionsNamedToolSelection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsNamedToolSelection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatCompletionsNamedToolSelection(document.RootElement, options); + } + + internal static UnknownChatCompletionsNamedToolSelection DeserializeUnknownChatCompletionsNamedToolSelection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string type = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownChatCompletionsNamedToolSelection(type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatCompletionsNamedToolSelection)} does not support writing '{options.Format}' format."); + } + } + + ChatCompletionsNamedToolSelection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatCompletionsNamedToolSelection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatCompletionsNamedToolSelection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownChatCompletionsNamedToolSelection FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownChatCompletionsNamedToolSelection(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/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsNamedToolSelection.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsNamedToolSelection.cs new file mode 100644 index 000000000000..f3a885278854 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsNamedToolSelection.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Unknown version of ChatCompletionsNamedToolSelection. + internal partial class UnknownChatCompletionsNamedToolSelection : ChatCompletionsNamedToolSelection + { + /// Initializes a new instance of . + /// The object type. + /// Keeps track of any properties unknown to the library. + internal UnknownChatCompletionsNamedToolSelection(string type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownChatCompletionsNamedToolSelection() + { + } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsResponseFormat.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsResponseFormat.Serialization.cs new file mode 100644 index 000000000000..f6e256e35bb8 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsResponseFormat.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + internal partial class UnknownChatCompletionsResponseFormat : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsResponseFormat)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ChatCompletionsResponseFormat IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsResponseFormat)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatCompletionsResponseFormat(document.RootElement, options); + } + + internal static UnknownChatCompletionsResponseFormat DeserializeUnknownChatCompletionsResponseFormat(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string type = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownChatCompletionsResponseFormat(type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatCompletionsResponseFormat)} does not support writing '{options.Format}' format."); + } + } + + ChatCompletionsResponseFormat IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatCompletionsResponseFormat(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatCompletionsResponseFormat)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownChatCompletionsResponseFormat FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownChatCompletionsResponseFormat(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/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsResponseFormat.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsResponseFormat.cs new file mode 100644 index 000000000000..1b7ad649a682 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsResponseFormat.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Unknown version of ChatCompletionsResponseFormat. + internal partial class UnknownChatCompletionsResponseFormat : ChatCompletionsResponseFormat + { + /// Initializes a new instance of . + /// The discriminated type for the response format. + /// Keeps track of any properties unknown to the library. + internal UnknownChatCompletionsResponseFormat(string type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownChatCompletionsResponseFormat() + { + } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsToolCall.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsToolCall.Serialization.cs new file mode 100644 index 000000000000..49d273b61d07 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsToolCall.Serialization.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + internal partial class UnknownChatCompletionsToolCall : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsToolCall)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ChatCompletionsToolCall IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsToolCall)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatCompletionsToolCall(document.RootElement, options); + } + + internal static UnknownChatCompletionsToolCall DeserializeUnknownChatCompletionsToolCall(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string type = "Unknown"; + string id = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownChatCompletionsToolCall(type, id, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatCompletionsToolCall)} does not support writing '{options.Format}' format."); + } + } + + ChatCompletionsToolCall IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatCompletionsToolCall(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatCompletionsToolCall)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownChatCompletionsToolCall FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownChatCompletionsToolCall(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/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsToolCall.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsToolCall.cs new file mode 100644 index 000000000000..88be20fa0524 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsToolCall.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Unknown version of ChatCompletionsToolCall. + internal partial class UnknownChatCompletionsToolCall : ChatCompletionsToolCall + { + /// Initializes a new instance of . + /// The object type. + /// The ID of the tool call. + /// Keeps track of any properties unknown to the library. + internal UnknownChatCompletionsToolCall(string type, string id, IDictionary serializedAdditionalRawData) : base(type, id, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownChatCompletionsToolCall() + { + } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsToolDefinition.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsToolDefinition.Serialization.cs new file mode 100644 index 000000000000..7ad8bdfbb8bf --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsToolDefinition.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + internal partial class UnknownChatCompletionsToolDefinition : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsToolDefinition)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ChatCompletionsToolDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatCompletionsToolDefinition)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatCompletionsToolDefinition(document.RootElement, options); + } + + internal static UnknownChatCompletionsToolDefinition DeserializeUnknownChatCompletionsToolDefinition(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string type = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownChatCompletionsToolDefinition(type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatCompletionsToolDefinition)} does not support writing '{options.Format}' format."); + } + } + + ChatCompletionsToolDefinition IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatCompletionsToolDefinition(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatCompletionsToolDefinition)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownChatCompletionsToolDefinition FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownChatCompletionsToolDefinition(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/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsToolDefinition.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsToolDefinition.cs new file mode 100644 index 000000000000..5b671919dd47 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatCompletionsToolDefinition.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Unknown version of ChatCompletionsToolDefinition. + internal partial class UnknownChatCompletionsToolDefinition : ChatCompletionsToolDefinition + { + /// Initializes a new instance of . + /// The object type. + /// Keeps track of any properties unknown to the library. + internal UnknownChatCompletionsToolDefinition(string type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownChatCompletionsToolDefinition() + { + } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatMessageContentItem.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatMessageContentItem.Serialization.cs new file mode 100644 index 000000000000..1c52a7d540e9 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatMessageContentItem.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + internal partial class UnknownChatMessageContentItem : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatMessageContentItem)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ChatMessageContentItem IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatMessageContentItem)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatMessageContentItem(document.RootElement, options); + } + + internal static UnknownChatMessageContentItem DeserializeUnknownChatMessageContentItem(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string type = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownChatMessageContentItem(type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatMessageContentItem)} does not support writing '{options.Format}' format."); + } + } + + ChatMessageContentItem IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatMessageContentItem(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatMessageContentItem)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownChatMessageContentItem FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownChatMessageContentItem(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/openai/Azure.AI.OpenAI/src/Generated/UnknownChatMessageContentItem.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatMessageContentItem.cs new file mode 100644 index 000000000000..7407e7520c34 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatMessageContentItem.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Unknown version of ChatMessageContentItem. + internal partial class UnknownChatMessageContentItem : ChatMessageContentItem + { + /// Initializes a new instance of . + /// The discriminated object type. + /// Keeps track of any properties unknown to the library. + internal UnknownChatMessageContentItem(string type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownChatMessageContentItem() + { + } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatRequestMessage.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatRequestMessage.Serialization.cs new file mode 100644 index 000000000000..08c1f077bca2 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatRequestMessage.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + internal partial class UnknownChatRequestMessage : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatRequestMessage)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ChatRequestMessage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ChatRequestMessage)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeChatRequestMessage(document.RootElement, options); + } + + internal static UnknownChatRequestMessage DeserializeUnknownChatRequestMessage(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ChatRole role = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("role"u8)) + { + role = new ChatRole(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownChatRequestMessage(role, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ChatRequestMessage)} does not support writing '{options.Format}' format."); + } + } + + ChatRequestMessage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeChatRequestMessage(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ChatRequestMessage)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownChatRequestMessage FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownChatRequestMessage(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/openai/Azure.AI.OpenAI/src/Generated/UnknownChatRequestMessage.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatRequestMessage.cs new file mode 100644 index 000000000000..16ce3943613b --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownChatRequestMessage.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Unknown version of ChatRequestMessage. + internal partial class UnknownChatRequestMessage : ChatRequestMessage + { + /// Initializes a new instance of . + /// The chat role associated with this message. + /// Keeps track of any properties unknown to the library. + internal UnknownChatRequestMessage(ChatRole role, IDictionary serializedAdditionalRawData) : base(role, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownChatRequestMessage() + { + } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownOnYourDataAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownOnYourDataAuthenticationOptions.Serialization.cs new file mode 100644 index 000000000000..1d318bd01c5a --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownOnYourDataAuthenticationOptions.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + internal partial class UnknownOnYourDataAuthenticationOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataAuthenticationOptions)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + OnYourDataAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataAuthenticationOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOnYourDataAuthenticationOptions(document.RootElement, options); + } + + internal static UnknownOnYourDataAuthenticationOptions DeserializeUnknownOnYourDataAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OnYourDataAuthenticationType type = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new OnYourDataAuthenticationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownOnYourDataAuthenticationOptions(type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OnYourDataAuthenticationOptions)} does not support writing '{options.Format}' format."); + } + } + + OnYourDataAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOnYourDataAuthenticationOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OnYourDataAuthenticationOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownOnYourDataAuthenticationOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownOnYourDataAuthenticationOptions(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/openai/Azure.AI.OpenAI/src/Generated/UnknownOnYourDataAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownOnYourDataAuthenticationOptions.cs new file mode 100644 index 000000000000..3d47c4f32f51 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownOnYourDataAuthenticationOptions.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Unknown version of OnYourDataAuthenticationOptions. + internal partial class UnknownOnYourDataAuthenticationOptions : OnYourDataAuthenticationOptions + { + /// Initializes a new instance of . + /// The authentication type. + /// Keeps track of any properties unknown to the library. + internal UnknownOnYourDataAuthenticationOptions(OnYourDataAuthenticationType type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownOnYourDataAuthenticationOptions() + { + } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownOnYourDataVectorSearchAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownOnYourDataVectorSearchAuthenticationOptions.Serialization.cs new file mode 100644 index 000000000000..c031418ef880 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownOnYourDataVectorSearchAuthenticationOptions.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + internal partial class UnknownOnYourDataVectorSearchAuthenticationOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataVectorSearchAuthenticationOptions)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + OnYourDataVectorSearchAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataVectorSearchAuthenticationOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOnYourDataVectorSearchAuthenticationOptions(document.RootElement, options); + } + + internal static UnknownOnYourDataVectorSearchAuthenticationOptions DeserializeUnknownOnYourDataVectorSearchAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OnYourDataVectorSearchAuthenticationType type = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new OnYourDataVectorSearchAuthenticationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownOnYourDataVectorSearchAuthenticationOptions(type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OnYourDataVectorSearchAuthenticationOptions)} does not support writing '{options.Format}' format."); + } + } + + OnYourDataVectorSearchAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOnYourDataVectorSearchAuthenticationOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OnYourDataVectorSearchAuthenticationOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownOnYourDataVectorSearchAuthenticationOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownOnYourDataVectorSearchAuthenticationOptions(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/openai/Azure.AI.OpenAI/src/Generated/UnknownOnYourDataVectorSearchAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownOnYourDataVectorSearchAuthenticationOptions.cs new file mode 100644 index 000000000000..13d87a07efb2 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownOnYourDataVectorSearchAuthenticationOptions.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Unknown version of OnYourDataVectorSearchAuthenticationOptions. + internal partial class UnknownOnYourDataVectorSearchAuthenticationOptions : OnYourDataVectorSearchAuthenticationOptions + { + /// Initializes a new instance of . + /// The type of authentication to use. + /// Keeps track of any properties unknown to the library. + internal UnknownOnYourDataVectorSearchAuthenticationOptions(OnYourDataVectorSearchAuthenticationType type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownOnYourDataVectorSearchAuthenticationOptions() + { + } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownOnYourDataVectorizationSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownOnYourDataVectorizationSource.Serialization.cs new file mode 100644 index 000000000000..2b6417300881 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownOnYourDataVectorizationSource.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + internal partial class UnknownOnYourDataVectorizationSource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataVectorizationSource)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + OnYourDataVectorizationSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnYourDataVectorizationSource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOnYourDataVectorizationSource(document.RootElement, options); + } + + internal static UnknownOnYourDataVectorizationSource DeserializeUnknownOnYourDataVectorizationSource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OnYourDataVectorizationSourceType type = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new OnYourDataVectorizationSourceType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownOnYourDataVectorizationSource(type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OnYourDataVectorizationSource)} does not support writing '{options.Format}' format."); + } + } + + OnYourDataVectorizationSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOnYourDataVectorizationSource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OnYourDataVectorizationSource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownOnYourDataVectorizationSource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownOnYourDataVectorizationSource(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/openai/Azure.AI.OpenAI/src/Generated/UnknownOnYourDataVectorizationSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownOnYourDataVectorizationSource.cs new file mode 100644 index 000000000000..2bf5702ab3fd --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/UnknownOnYourDataVectorizationSource.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// Unknown version of OnYourDataVectorizationSource. + internal partial class UnknownOnYourDataVectorizationSource : OnYourDataVectorizationSource + { + /// Initializes a new instance of . + /// The type of vectorization source to use. + /// Keeps track of any properties unknown to the library. + internal UnknownOnYourDataVectorizationSource(OnYourDataVectorizationSourceType type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownOnYourDataVectorizationSource() + { + } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/Upload.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Upload.Serialization.cs new file mode 100644 index 000000000000..2c7d9dff6cb0 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/Upload.Serialization.cs @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class Upload : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(Upload)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("created_at"u8); + writer.WriteNumberValue(CreatedAt, "U"); + writer.WritePropertyName("filename"u8); + writer.WriteStringValue(Filename); + writer.WritePropertyName("bytes"u8); + writer.WriteNumberValue(Bytes); + writer.WritePropertyName("purpose"u8); + writer.WriteStringValue(Purpose.ToString()); + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + writer.WritePropertyName("expires_at"u8); + writer.WriteNumberValue(ExpiresAt, "U"); + if (Optional.IsDefined(Object)) + { + writer.WritePropertyName("object"u8); + writer.WriteStringValue(Object.Value.ToString()); + } + if (Optional.IsDefined(File)) + { + if (File != null) + { + writer.WritePropertyName("file"u8); + writer.WriteObjectValue(File, options); + } + else + { + writer.WriteNull("file"); + } + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + Upload IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Upload)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUpload(document.RootElement, options); + } + + internal static Upload DeserializeUpload(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + DateTimeOffset createdAt = default; + string filename = default; + long bytes = default; + UploadPurpose purpose = default; + UploadStatus status = default; + DateTimeOffset expiresAt = default; + UploadObject? @object = default; + OpenAIFile file = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("created_at"u8)) + { + createdAt = DateTimeOffset.FromUnixTimeSeconds(property.Value.GetInt64()); + continue; + } + if (property.NameEquals("filename"u8)) + { + filename = property.Value.GetString(); + continue; + } + if (property.NameEquals("bytes"u8)) + { + bytes = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("purpose"u8)) + { + purpose = new UploadPurpose(property.Value.GetString()); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new UploadStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("expires_at"u8)) + { + expiresAt = DateTimeOffset.FromUnixTimeSeconds(property.Value.GetInt64()); + continue; + } + if (property.NameEquals("object"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + @object = new UploadObject(property.Value.GetString()); + continue; + } + if (property.NameEquals("file"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + file = null; + continue; + } + file = OpenAIFile.DeserializeOpenAIFile(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Upload( + id, + createdAt, + filename, + bytes, + purpose, + status, + expiresAt, + @object, + file, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(Upload)} does not support writing '{options.Format}' format."); + } + } + + Upload IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeUpload(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Upload)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static Upload FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUpload(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/openai/Azure.AI.OpenAI/src/Generated/Upload.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Upload.cs new file mode 100644 index 000000000000..ac29382c966a --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/Upload.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// The Upload object can accept byte chunks in the form of Parts. + public partial class Upload + { + /// + /// 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; + + /// Initializes a new instance of . + /// The Upload unique identifier, which can be referenced in API endpoints. + /// The Unix timestamp (in seconds) for when the Upload was created. + /// The name of the file to be uploaded. + /// The intended number of bytes to be uploaded. + /// The intended purpose of the file. + /// The status of the Upload. + /// The Unix timestamp (in seconds) for when the Upload was created. + /// or is null. + internal Upload(string id, DateTimeOffset createdAt, string filename, long bytes, UploadPurpose purpose, UploadStatus status, DateTimeOffset expiresAt) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(filename, nameof(filename)); + + Id = id; + CreatedAt = createdAt; + Filename = filename; + Bytes = bytes; + Purpose = purpose; + Status = status; + ExpiresAt = expiresAt; + } + + /// Initializes a new instance of . + /// The Upload unique identifier, which can be referenced in API endpoints. + /// The Unix timestamp (in seconds) for when the Upload was created. + /// The name of the file to be uploaded. + /// The intended number of bytes to be uploaded. + /// The intended purpose of the file. + /// The status of the Upload. + /// The Unix timestamp (in seconds) for when the Upload was created. + /// The object type, which is always "upload". + /// The ready File object after the Upload is completed. + /// Keeps track of any properties unknown to the library. + internal Upload(string id, DateTimeOffset createdAt, string filename, long bytes, UploadPurpose purpose, UploadStatus status, DateTimeOffset expiresAt, UploadObject? @object, OpenAIFile file, IDictionary serializedAdditionalRawData) + { + Id = id; + CreatedAt = createdAt; + Filename = filename; + Bytes = bytes; + Purpose = purpose; + Status = status; + ExpiresAt = expiresAt; + Object = @object; + File = file; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal Upload() + { + } + + /// The Upload unique identifier, which can be referenced in API endpoints. + public string Id { get; } + /// The Unix timestamp (in seconds) for when the Upload was created. + public DateTimeOffset CreatedAt { get; } + /// The name of the file to be uploaded. + public string Filename { get; } + /// The intended number of bytes to be uploaded. + public long Bytes { get; } + /// The intended purpose of the file. + public UploadPurpose Purpose { get; } + /// The status of the Upload. + public UploadStatus Status { get; } + /// The Unix timestamp (in seconds) for when the Upload was created. + public DateTimeOffset ExpiresAt { get; } + /// The object type, which is always "upload". + public UploadObject? Object { get; } + /// The ready File object after the Upload is completed. + public OpenAIFile File { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/UploadFileRequest.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/UploadFileRequest.Serialization.cs new file mode 100644 index 000000000000..218932d9d761 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/UploadFileRequest.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + internal partial class UploadFileRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(UploadFileRequest)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("file"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(global::System.BinaryData.FromStream(Data)); +#else + using (JsonDocument document = JsonDocument.Parse(BinaryData.FromStream(Data))) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + writer.WritePropertyName("purpose"u8); + writer.WriteStringValue(Purpose.ToString()); + if (Optional.IsDefined(Filename)) + { + writer.WritePropertyName("filename"u8); + writer.WriteStringValue(Filename); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UploadFileRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UploadFileRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUploadFileRequest(document.RootElement, options); + } + + internal static UploadFileRequest DeserializeUploadFileRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Stream file = default; + FilePurpose purpose = default; + string filename = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("file"u8)) + { + file = BinaryData.FromString(property.Value.GetRawText()).ToStream(); + continue; + } + if (property.NameEquals("purpose"u8)) + { + purpose = new FilePurpose(property.Value.GetString()); + continue; + } + if (property.NameEquals("filename"u8)) + { + filename = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UploadFileRequest(file, purpose, filename, serializedAdditionalRawData); + } + + private BinaryData SerializeMultipart(ModelReaderWriterOptions options) + { + using MultipartFormDataRequestContent content = ToMultipartRequestContent(); + using MemoryStream stream = new MemoryStream(); + content.WriteTo(stream); + if (stream.Position > int.MaxValue) + { + return BinaryData.FromStream(stream); + } + else + { + return new BinaryData(stream.GetBuffer().AsMemory(0, (int)stream.Position)); + } + } + + internal virtual MultipartFormDataRequestContent ToMultipartRequestContent() + { + MultipartFormDataRequestContent content = new MultipartFormDataRequestContent(); + content.Add(Data, "file", "file", "application/octet-stream"); + content.Add(Purpose.ToString(), "purpose"); + if (Optional.IsDefined(Filename)) + { + content.Add(Filename, "filename"); + } + return content; + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "MFD": + return SerializeMultipart(options); + default: + throw new FormatException($"The model {nameof(UploadFileRequest)} does not support writing '{options.Format}' format."); + } + } + + UploadFileRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeUploadFileRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UploadFileRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "MFD"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static UploadFileRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUploadFileRequest(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/openai/Azure.AI.OpenAI/src/Generated/UploadFileRequest.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/UploadFileRequest.cs new file mode 100644 index 000000000000..a39f8a840ef4 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/UploadFileRequest.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Azure.AI.OpenAI +{ + /// The UploadFileRequest. + internal partial class UploadFileRequest + { + /// + /// 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; + + /// Initializes a new instance of . + /// The file data (not filename) to upload. + /// The intended purpose of the file. + /// is null. + internal UploadFileRequest(Stream data, FilePurpose purpose) + { + Argument.AssertNotNull(data, nameof(data)); + + Data = data; + Purpose = purpose; + } + + /// Initializes a new instance of . + /// The file data (not filename) to upload. + /// The intended purpose of the file. + /// A filename to associate with the uploaded data. + /// Keeps track of any properties unknown to the library. + internal UploadFileRequest(Stream data, FilePurpose purpose, string filename, IDictionary serializedAdditionalRawData) + { + Data = data; + Purpose = purpose; + Filename = filename; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UploadFileRequest() + { + } + + /// The file data (not filename) to upload. + public Stream Data { get; } + /// The intended purpose of the file. + public FilePurpose Purpose { get; } + /// A filename to associate with the uploaded data. + public string Filename { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/UploadObject.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/UploadObject.cs new file mode 100644 index 000000000000..649a57ce5a4c --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/UploadObject.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// The Upload_object. + public readonly partial struct UploadObject : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public UploadObject(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UploadValue = "upload"; + + /// upload. + public static UploadObject Upload { get; } = new UploadObject(UploadValue); + /// Determines if two values are the same. + public static bool operator ==(UploadObject left, UploadObject right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(UploadObject left, UploadObject right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator UploadObject(string value) => new UploadObject(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is UploadObject other && Equals(other); + /// + public bool Equals(UploadObject 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/openai/Azure.AI.OpenAI/src/Generated/UploadPart.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/UploadPart.Serialization.cs new file mode 100644 index 000000000000..941fa0d47669 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/UploadPart.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.OpenAI +{ + public partial class UploadPart : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(UploadPart)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("created_at"u8); + writer.WriteNumberValue(CreatedAt, "U"); + writer.WritePropertyName("upload_id"u8); + writer.WriteStringValue(UploadId); + writer.WritePropertyName("object"u8); + writer.WriteStringValue(Object.ToString()); + if (Optional.IsDefined(AzureBlockId)) + { + writer.WritePropertyName("azure_block_id"u8); + writer.WriteStringValue(AzureBlockId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UploadPart IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UploadPart)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUploadPart(document.RootElement, options); + } + + internal static UploadPart DeserializeUploadPart(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + DateTimeOffset createdAt = default; + string uploadId = default; + UploadPartObject @object = default; + string azureBlockId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("created_at"u8)) + { + createdAt = DateTimeOffset.FromUnixTimeSeconds(property.Value.GetInt64()); + continue; + } + if (property.NameEquals("upload_id"u8)) + { + uploadId = property.Value.GetString(); + continue; + } + if (property.NameEquals("object"u8)) + { + @object = new UploadPartObject(property.Value.GetString()); + continue; + } + if (property.NameEquals("azure_block_id"u8)) + { + azureBlockId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UploadPart( + id, + createdAt, + uploadId, + @object, + azureBlockId, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(UploadPart)} does not support writing '{options.Format}' format."); + } + } + + UploadPart IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeUploadPart(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UploadPart)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static UploadPart FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUploadPart(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/openai/Azure.AI.OpenAI/src/Generated/UploadPart.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/UploadPart.cs new file mode 100644 index 000000000000..2706e3f8f9cc --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/UploadPart.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.OpenAI +{ + /// The upload Part represents a chunk of bytes we can add to an Upload object. + public partial class UploadPart + { + /// + /// 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; + + /// Initializes a new instance of . + /// The upload Part unique identifier, which can be referenced in API endpoints. + /// The Unix timestamp (in seconds) for when the Part was created. + /// The ID of the Upload object that this Part was added to. + /// or is null. + internal UploadPart(string id, DateTimeOffset createdAt, string uploadId) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(uploadId, nameof(uploadId)); + + Id = id; + CreatedAt = createdAt; + UploadId = uploadId; + } + + /// Initializes a new instance of . + /// The upload Part unique identifier, which can be referenced in API endpoints. + /// The Unix timestamp (in seconds) for when the Part was created. + /// The ID of the Upload object that this Part was added to. + /// The object type, which is always `upload.part`. + /// Azure only field. + /// Keeps track of any properties unknown to the library. + internal UploadPart(string id, DateTimeOffset createdAt, string uploadId, UploadPartObject @object, string azureBlockId, IDictionary serializedAdditionalRawData) + { + Id = id; + CreatedAt = createdAt; + UploadId = uploadId; + Object = @object; + AzureBlockId = azureBlockId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UploadPart() + { + } + + /// The upload Part unique identifier, which can be referenced in API endpoints. + public string Id { get; } + /// The Unix timestamp (in seconds) for when the Part was created. + public DateTimeOffset CreatedAt { get; } + /// The ID of the Upload object that this Part was added to. + public string UploadId { get; } + /// The object type, which is always `upload.part`. + public UploadPartObject Object { get; } = UploadPartObject.UploadPart; + + /// Azure only field. + public string AzureBlockId { get; } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/UploadPartObject.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/UploadPartObject.cs new file mode 100644 index 000000000000..d161f3e609de --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/UploadPartObject.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// The UploadPart_object. + public readonly partial struct UploadPartObject : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public UploadPartObject(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UploadPartValue = "upload.part"; + + /// upload.part. + public static UploadPartObject UploadPart { get; } = new UploadPartObject(UploadPartValue); + /// Determines if two values are the same. + public static bool operator ==(UploadPartObject left, UploadPartObject right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(UploadPartObject left, UploadPartObject right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator UploadPartObject(string value) => new UploadPartObject(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is UploadPartObject other && Equals(other); + /// + public bool Equals(UploadPartObject 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/openai/Azure.AI.OpenAI/src/Generated/UploadPurpose.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/UploadPurpose.cs new file mode 100644 index 000000000000..69f7e4ccfb6b --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/UploadPurpose.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// The UploadPurpose. + public readonly partial struct UploadPurpose : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public UploadPurpose(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string BatchValue = "batch"; + private const string BatchOutputValue = "batch_output"; + private const string FineTuneValue = "fine-tune"; + private const string FineTuneResultsValue = "fine-tune-results"; + private const string AssistantsValue = "assistants"; + private const string AssistantsOutputValue = "assistants_output"; + private const string VisionValue = "vision"; + + /// batch. + public static UploadPurpose Batch { get; } = new UploadPurpose(BatchValue); + /// batch_output. + public static UploadPurpose BatchOutput { get; } = new UploadPurpose(BatchOutputValue); + /// fine-tune. + public static UploadPurpose FineTune { get; } = new UploadPurpose(FineTuneValue); + /// fine-tune-results. + public static UploadPurpose FineTuneResults { get; } = new UploadPurpose(FineTuneResultsValue); + /// assistants. + public static UploadPurpose Assistants { get; } = new UploadPurpose(AssistantsValue); + /// assistants_output. + public static UploadPurpose AssistantsOutput { get; } = new UploadPurpose(AssistantsOutputValue); + /// vision. + public static UploadPurpose Vision { get; } = new UploadPurpose(VisionValue); + /// Determines if two values are the same. + public static bool operator ==(UploadPurpose left, UploadPurpose right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(UploadPurpose left, UploadPurpose right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator UploadPurpose(string value) => new UploadPurpose(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is UploadPurpose other && Equals(other); + /// + public bool Equals(UploadPurpose 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/openai/Azure.AI.OpenAI/src/Generated/UploadStatus.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/UploadStatus.cs new file mode 100644 index 000000000000..bdb03110818d --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/UploadStatus.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI +{ + /// The UploadStatus. + public readonly partial struct UploadStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public UploadStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PendingValue = "pending"; + private const string CompletedValue = "completed"; + private const string CancelledValue = "cancelled"; + private const string ExpiredValue = "expired"; + + /// pending. + public static UploadStatus Pending { get; } = new UploadStatus(PendingValue); + /// completed. + public static UploadStatus Completed { get; } = new UploadStatus(CompletedValue); + /// cancelled. + public static UploadStatus Cancelled { get; } = new UploadStatus(CancelledValue); + /// expired. + public static UploadStatus Expired { get; } = new UploadStatus(ExpiredValue); + /// Determines if two values are the same. + public static bool operator ==(UploadStatus left, UploadStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(UploadStatus left, UploadStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator UploadStatus(string value) => new UploadStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is UploadStatus other && Equals(other); + /// + public bool Equals(UploadStatus 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/openai/Azure.AI.OpenAI/tsp-location.yaml b/sdk/openai/Azure.AI.OpenAI/tsp-location.yaml new file mode 100644 index 000000000000..c5ce066bb4c6 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/cognitiveservices/OpenAI.Inference +commit: 7c52cf4d9a41dd06846b099946e8b85a9504cf1e +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/openenergyplatform/ci.mgmt.yml b/sdk/openenergyplatform/ci.mgmt.yml index 1ab74128b4db..c24e485f4948 100644 --- a/sdk/openenergyplatform/ci.mgmt.yml +++ b/sdk/openenergyplatform/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/openenergyplatform/ci.mgmt.yml - sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/openenergyplatform/ci.mgmt.yml + - sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/openenergyplatform/ci.mgmt.yml + - sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/openenergyplatform/ci.mgmt.yml + - sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/openenergyplatform/ci.mgmt.yml + - sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/openenergyplatform/ci.mgmt.yml + - sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/openenergyplatform/ci.mgmt.yml + - sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/openenergyplatform/ci.mgmt.yml + - sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/openenergyplatform/ci.mgmt.yml + - sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/openenergyplatform/ci.mgmt.yml + - sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/ + extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/operationalinsights/ci.mgmt.yml b/sdk/operationalinsights/ci.mgmt.yml index d4c3b61dac40..91394eb83dda 100644 --- a/sdk/operationalinsights/ci.mgmt.yml +++ b/sdk/operationalinsights/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/operationalinsights/ci.mgmt.yml - sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/operationalinsights/ci.mgmt.yml + - sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/operationalinsights/ci.mgmt.yml + - sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/operationalinsights/ci.mgmt.yml + - sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/operationalinsights/ci.mgmt.yml + - sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/operationalinsights/ci.mgmt.yml + - sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/operationalinsights/ci.mgmt.yml + - sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/operationalinsights/ci.mgmt.yml + - sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/operationalinsights/ci.mgmt.yml + - sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/operationalinsights/ci.mgmt.yml + - sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/oracle/ci.mgmt.yml b/sdk/oracle/ci.mgmt.yml index ccbd7c096ecf..721f2d8f2638 100644 --- a/sdk/oracle/ci.mgmt.yml +++ b/sdk/oracle/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/oracle/ci.mgmt.yml - sdk/oracle/Azure.ResourceManager.OracleDatabase/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/oracle/ci.mgmt.yml + - sdk/oracle/Azure.ResourceManager.OracleDatabase/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/oracle/ci.mgmt.yml + - sdk/oracle/Azure.ResourceManager.OracleDatabase/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/oracle/ci.mgmt.yml + - sdk/oracle/Azure.ResourceManager.OracleDatabase/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/oracle/ci.mgmt.yml + - sdk/oracle/Azure.ResourceManager.OracleDatabase/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/oracle/ci.mgmt.yml + - sdk/oracle/Azure.ResourceManager.OracleDatabase/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/oracle/ci.mgmt.yml + - sdk/oracle/Azure.ResourceManager.OracleDatabase/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/oracle/ci.mgmt.yml + - sdk/oracle/Azure.ResourceManager.OracleDatabase/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/oracle/ci.mgmt.yml + - sdk/oracle/Azure.ResourceManager.OracleDatabase/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/oracle/ci.mgmt.yml + - sdk/oracle/Azure.ResourceManager.OracleDatabase/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/orbital/ci.mgmt.yml b/sdk/orbital/ci.mgmt.yml index 701576d2fa62..7be9c7467e1f 100644 --- a/sdk/orbital/ci.mgmt.yml +++ b/sdk/orbital/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/orbital/ci.mgmt.yml - sdk/orbital/Azure.ResourceManager.Orbital/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/orbital/ci.mgmt.yml + - sdk/orbital/Azure.ResourceManager.Orbital/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/orbital/ci.mgmt.yml + - sdk/orbital/Azure.ResourceManager.Orbital/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/orbital/ci.mgmt.yml + - sdk/orbital/Azure.ResourceManager.Orbital/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/orbital/ci.mgmt.yml + - sdk/orbital/Azure.ResourceManager.Orbital/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/orbital/ci.mgmt.yml + - sdk/orbital/Azure.ResourceManager.Orbital/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/orbital/ci.mgmt.yml + - sdk/orbital/Azure.ResourceManager.Orbital/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/orbital/ci.mgmt.yml + - sdk/orbital/Azure.ResourceManager.Orbital/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/orbital/ci.mgmt.yml + - sdk/orbital/Azure.ResourceManager.Orbital/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/orbital/ci.mgmt.yml + - sdk/orbital/Azure.ResourceManager.Orbital/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/paloaltonetworks.ngfw/ci.mgmt.yml b/sdk/paloaltonetworks.ngfw/ci.mgmt.yml index 77dca48de9ef..7b81c4cbb427 100644 --- a/sdk/paloaltonetworks.ngfw/ci.mgmt.yml +++ b/sdk/paloaltonetworks.ngfw/ci.mgmt.yml @@ -1,4 +1,5 @@ trigger: none + pr: branches: include: @@ -11,6 +12,114 @@ pr: - sdk/paloaltonetworks.ngfw/ci.mgmt.yml - sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/paloaltonetworks.ngfw/ci.mgmt.yml + - sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/paloaltonetworks.ngfw/ci.mgmt.yml + - sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/paloaltonetworks.ngfw/ci.mgmt.yml + - sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/paloaltonetworks.ngfw/ci.mgmt.yml + - sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/paloaltonetworks.ngfw/ci.mgmt.yml + - sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/paloaltonetworks.ngfw/ci.mgmt.yml + - sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/paloaltonetworks.ngfw/ci.mgmt.yml + - sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/paloaltonetworks.ngfw/ci.mgmt.yml + - sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/paloaltonetworks.ngfw/ci.mgmt.yml + - sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/peering/ci.mgmt.yml b/sdk/peering/ci.mgmt.yml index 4d3d67e73949..9276082c17f8 100644 --- a/sdk/peering/ci.mgmt.yml +++ b/sdk/peering/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/peering/ci.mgmt.yml - sdk/peering/Azure.ResourceManager.Peering/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/peering/ci.mgmt.yml + - sdk/peering/Azure.ResourceManager.Peering/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/peering/ci.mgmt.yml + - sdk/peering/Azure.ResourceManager.Peering/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/peering/ci.mgmt.yml + - sdk/peering/Azure.ResourceManager.Peering/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/peering/ci.mgmt.yml + - sdk/peering/Azure.ResourceManager.Peering/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/peering/ci.mgmt.yml + - sdk/peering/Azure.ResourceManager.Peering/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/peering/ci.mgmt.yml + - sdk/peering/Azure.ResourceManager.Peering/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/peering/ci.mgmt.yml + - sdk/peering/Azure.ResourceManager.Peering/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/peering/ci.mgmt.yml + - sdk/peering/Azure.ResourceManager.Peering/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/peering/ci.mgmt.yml + - sdk/peering/Azure.ResourceManager.Peering/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/Azure.Developer.MicrosoftPlaywrightTesting.sln b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/Azure.Developer.MicrosoftPlaywrightTesting.sln new file mode 100644 index 000000000000..f0b95cc94a15 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/Azure.Developer.MicrosoftPlaywrightTesting.sln @@ -0,0 +1,56 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{ECC730C1-4AEA-420C-916A-66B19B79E4DC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Developer.MicrosoftPlaywrightTesting", "src\Azure.Developer.MicrosoftPlaywrightTesting.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Developer.MicrosoftPlaywrightTesting.Tests", "tests\Azure.Developer.MicrosoftPlaywrightTesting.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/CHANGELOG.md b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes \ No newline at end of file diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/Directory.Build.props b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/README.md b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/README.md new file mode 100644 index 000000000000..ba9958c97bb7 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/README.md @@ -0,0 +1,107 @@ +# Azure.Developer.MicrosoftPlaywrightTesting client library for .NET + +Azure.Developer.MicrosoftPlaywrightTesting is a managed service that helps developers get secret simply and securely. + +Use the client library for to: + +* [Get secret](https://docs.microsoft.com/azure) + +[Source code][source_root] | [Package (NuGet)][package] | [API reference documentation][reference_docs] | [Product documentation][azconfig_docs] | [Samples][source_samples] + + [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src) | [Package (NuGet)](https://www.nuget.org/packages) | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://docs.microsoft.com/azure) + +## Getting started + +This section should include everything a developer needs to do to install and create their first client connection *very quickly*. + +### Install the package + +First, provide instruction for obtaining and installing the package or library. This section might include only a single line of code, like `dotnet add package package-name`, but should enable a developer to successfully install the package from NuGet, npm, or even cloning a GitHub repository. + +Install the client library for .NET with [NuGet](https://www.nuget.org/ ): + +```dotnetcli +dotnet add package Azure.Developer.MicrosoftPlaywrightTesting --prerelease +``` + +### Prerequisites + +Include a section after the install command that details any requirements that must be satisfied before a developer can [authenticate](#authenticate-the-client) and test all of the snippets in the [Examples](#examples) section. For example, for Cosmos DB: + +> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Cosmos DB account](https://docs.microsoft.com/azure/cosmos-db/account-overview) (SQL API). In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://docs.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. It is also possible to compile with the .NET Core SDK 2.1.x using a language version of `preview`. + +### Authenticate the client + +If your library requires authentication for use, such as for Azure services, include instructions and example code needed for initializing and authenticating. + +For example, include details on obtaining an account key and endpoint URI, setting environment variables for each, and initializing the client object. + +### Service API versions + +The client library targets the latest service API version by default. A client instance accepts an optional service API version parameter from its options to specify which API version service to communicate. + +#### Select a service API version + +You have the flexibility to explicitly select a supported service API version when instantiating a client by configuring its associated options. This ensures that the client can communicate with services using the specified API version. + +For example, + +```C# Snippet:CreateClientForSpecificApiVersion +Uri endpoint = new Uri(""); +DefaultAzureCredential credential = new DefaultAzureCredential(); +ClientOptions options = new ClientOptions(ClientOptions.ServiceVersion.) +var client = new Client(endpoint, credential, options); +``` + +When selecting an API version, it's important to verify that there are no breaking changes compared to the latest API version. If there are significant differences, API calls may fail due to incompatibility. + +Always ensure that the chosen API version is fully supported and operational for your specific use case and that it aligns with the service's versioning policy. + +## Key concepts + +The *Key concepts* section should describe the functionality of the main classes. Point out the most important and useful classes in the package (with links to their reference pages) and explain how those classes work together. Feel free to use bulleted lists, tables, code blocks, or even diagrams for clarity. + +Include the *Thread safety* and *Additional concepts* sections below at the end of your *Key concepts* section. You may remove or add links depending on what your library makes use of: + +### Thread safety + +We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads. + +### Additional concepts + +[Client options](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) | +[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) | +[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) | +[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) | +[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) | +[Mocking](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#mocking) | +[Client lifetime](https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/) + + +## Examples + +You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/samples). + +## Troubleshooting + +Describe common errors and exceptions, how to "unpack" them if necessary, and include guidance for graceful handling and recovery. + +Provide information to help developers avoid throttling or other service-enforced errors they might encounter. For example, provide guidance and examples for using retry or connection policies in the API. + +If the package or a related package supports it, include tips for logging or enabling instrumentation to help them debug their code. + +## Next steps + +* Provide a link to additional code examples, ideally to those sitting alongside the README in the package's `/samples` directory. +* If appropriate, point users to other packages that might be useful. +* If you think there's a good chance that developers might stumble across your package in error (because they're searching for specific functionality and mistakenly think the package provides that functionality), point them to the packages they might be looking for. + +## Contributing + +This is a template, but your SDK readme should include details on how to contribute code to the repo/package. + + +[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/README.png) \ No newline at end of file diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Azure.Developer.MicrosoftPlaywrightTesting.csproj b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Azure.Developer.MicrosoftPlaywrightTesting.csproj new file mode 100644 index 000000000000..4a68b892e00d --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Azure.Developer.MicrosoftPlaywrightTesting.csproj @@ -0,0 +1,19 @@ + + + This is the Azure.Developer.MicrosoftPlaywrightTesting client library for developing .NET applications with rich experience. + Azure SDK Code Generation Azure.Developer.MicrosoftPlaywrightTesting for Azure Data Plane + 1.0.0-beta.1 + Azure.Developer.MicrosoftPlaywrightTesting + $(RequiredTargetFrameworks) + true + + + + + + + + + + + diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccessToken.Serialization.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccessToken.Serialization.cs new file mode 100644 index 000000000000..2916dd2e3f66 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccessToken.Serialization.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + public partial class AccessToken : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccessToken)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (options.Format != "W" && Optional.IsDefined(JwtToken)) + { + writer.WritePropertyName("jwtToken"u8); + writer.WriteStringValue(JwtToken); + } + if (options.Format != "W") + { + writer.WritePropertyName("createdAt"u8); + writer.WriteStringValue(CreatedAt, "O"); + } + writer.WritePropertyName("expiryAt"u8); + writer.WriteStringValue(ExpiryAt, "O"); + if (options.Format != "W") + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AccessToken IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccessToken)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAccessToken(document.RootElement, options); + } + + internal static AccessToken DeserializeAccessToken(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Guid id = default; + string name = default; + string jwtToken = default; + DateTimeOffset createdAt = default; + DateTimeOffset expiryAt = default; + AccessTokenState state = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("jwtToken"u8)) + { + jwtToken = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdAt"u8)) + { + createdAt = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("expiryAt"u8)) + { + expiryAt = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("state"u8)) + { + state = new AccessTokenState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AccessToken( + id, + name, + jwtToken, + createdAt, + expiryAt, + state, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AccessToken)} does not support writing '{options.Format}' format."); + } + } + + AccessToken IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAccessToken(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AccessToken)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AccessToken FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAccessToken(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/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccessToken.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccessToken.cs new file mode 100644 index 000000000000..f681c953a689 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccessToken.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// Model of an access-token linked to an account. + public partial class AccessToken + { + /// + /// 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; + + /// Initializes a new instance of . + /// The access-token name. + /// The access-token expiryAt utcDateTime. + /// is null. + public AccessToken(string name, DateTimeOffset expiryAt) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + ExpiryAt = expiryAt; + } + + /// Initializes a new instance of . + /// The access-token id. + /// The access-token name. + /// The access-token value in JWT format. + /// The access-token createdAt utcDateTime. + /// The access-token expiryAt utcDateTime. + /// The access-token state - Active | Expired. + /// Keeps track of any properties unknown to the library. + internal AccessToken(Guid id, string name, string jwtToken, DateTimeOffset createdAt, DateTimeOffset expiryAt, AccessTokenState state, IDictionary serializedAdditionalRawData) + { + Id = id; + Name = name; + JwtToken = jwtToken; + CreatedAt = createdAt; + ExpiryAt = expiryAt; + State = state; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AccessToken() + { + } + + /// The access-token id. + public Guid Id { get; } + /// The access-token name. + public string Name { get; set; } + /// The access-token value in JWT format. + public string JwtToken { get; } + /// The access-token createdAt utcDateTime. + public DateTimeOffset CreatedAt { get; } + /// The access-token expiryAt utcDateTime. + public DateTimeOffset ExpiryAt { get; set; } + /// The access-token state - Active | Expired. + public AccessTokenState State { get; } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccessTokenState.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccessTokenState.cs new file mode 100644 index 000000000000..f321e8733180 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccessTokenState.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// The access-token state. + public readonly partial struct AccessTokenState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AccessTokenState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ActiveValue = "Active"; + private const string ExpiredValue = "Expired"; + + /// The access-token is Active. + public static AccessTokenState Active { get; } = new AccessTokenState(ActiveValue); + /// The access-token is Expired. + public static AccessTokenState Expired { get; } = new AccessTokenState(ExpiredValue); + /// Determines if two values are the same. + public static bool operator ==(AccessTokenState left, AccessTokenState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AccessTokenState left, AccessTokenState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AccessTokenState(string value) => new AccessTokenState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AccessTokenState other && Equals(other); + /// + public bool Equals(AccessTokenState 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/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccessTokens.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccessTokens.cs new file mode 100644 index 000000000000..141567fa8cc8 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccessTokens.cs @@ -0,0 +1,562 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + // Data plane generated sub-client. + /// The AccessTokens sub-client. + public partial class AccessTokens + { + private static readonly string[] AuthorizationScopes = new string[] { "https://playwright.microsoft.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of AccessTokens for mocking. + protected AccessTokens() + { + } + + /// Initializes a new instance of AccessTokens. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The token credential to copy. + /// + /// Supported Azure Playwright Service API Endpoints (protocol and hostname, for example: + /// https://{region}.api.playwright.microsoft.com). + /// + /// The API version to use for this operation. + internal AccessTokens(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + /// Creates an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID. + /// The account id. + /// The access-token id. + /// The resource instance. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> CreateOrReplaceAsync(string accountId, Guid accessTokenId, AccessToken resource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + Argument.AssertNotNull(resource, nameof(resource)); + + using RequestContent content = resource.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CreateOrReplaceAsync(accountId, accessTokenId, content, context).ConfigureAwait(false); + return Response.FromValue(AccessToken.FromResponse(response), response); + } + + /// Creates an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID. + /// The account id. + /// The access-token id. + /// The resource instance. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response CreateOrReplace(string accountId, Guid accessTokenId, AccessToken resource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + Argument.AssertNotNull(resource, nameof(resource)); + + using RequestContent content = resource.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = CreateOrReplace(accountId, accessTokenId, content, context); + return Response.FromValue(AccessToken.FromResponse(response), response); + } + + /// + /// [Protocol Method] Creates an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The account id. + /// The access-token id. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CreateOrReplaceAsync(string accountId, Guid accessTokenId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("AccessTokens.CreateOrReplace"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrReplaceRequest(accountId, accessTokenId, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The account id. + /// The access-token id. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response CreateOrReplace(string accountId, Guid accessTokenId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("AccessTokens.CreateOrReplace"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrReplaceRequest(accountId, accessTokenId, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID. + /// The account id. + /// The access-token id. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetAccessTokenAsync(string accountId, Guid accessTokenId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetAccessTokenAsync(accountId, accessTokenId, context).ConfigureAwait(false); + return Response.FromValue(AccessToken.FromResponse(response), response); + } + + /// Gets an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID. + /// The account id. + /// The access-token id. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetAccessToken(string accountId, Guid accessTokenId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetAccessToken(accountId, accessTokenId, context); + return Response.FromValue(AccessToken.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The account id. + /// The access-token id. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetAccessTokenAsync(string accountId, Guid accessTokenId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + using var scope = ClientDiagnostics.CreateScope("AccessTokens.GetAccessToken"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAccessTokenRequest(accountId, accessTokenId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The account id. + /// The access-token id. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetAccessToken(string accountId, Guid accessTokenId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + using var scope = ClientDiagnostics.CreateScope("AccessTokens.GetAccessToken"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAccessTokenRequest(accountId, accessTokenId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The account id. + /// The access-token id. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DeleteAsync(string accountId, Guid accessTokenId, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + using var scope = ClientDiagnostics.CreateScope("AccessTokens.Delete"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteRequest(accountId, accessTokenId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The account id. + /// The access-token id. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Delete(string accountId, Guid accessTokenId, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + using var scope = ClientDiagnostics.CreateScope("AccessTokens.Delete"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteRequest(accountId, accessTokenId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Lists access-tokens for the given account id. It can use OData query params like $select, $filter, $orderby, $top and $skip. The default page size is 10. Use nextLink in response to fetch more objects in the list. Authorization required is Bearer JWT Access token provided by EntraID. + /// The account id. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual AsyncPageable GetAccessTokensAsync(string accountId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAccessTokensRequest(accountId, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAccessTokensNextPageRequest(nextLink, accountId, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => AccessToken.DeserializeAccessToken(e), ClientDiagnostics, _pipeline, "AccessTokens.GetAccessTokens", "value", "nextLink", context); + } + + /// Lists access-tokens for the given account id. It can use OData query params like $select, $filter, $orderby, $top and $skip. The default page size is 10. Use nextLink in response to fetch more objects in the list. Authorization required is Bearer JWT Access token provided by EntraID. + /// The account id. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Pageable GetAccessTokens(string accountId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAccessTokensRequest(accountId, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAccessTokensNextPageRequest(nextLink, accountId, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => AccessToken.DeserializeAccessToken(e), ClientDiagnostics, _pipeline, "AccessTokens.GetAccessTokens", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists access-tokens for the given account id. It can use OData query params like $select, $filter, $orderby, $top and $skip. The default page size is 10. Use nextLink in response to fetch more objects in the list. Authorization required is Bearer JWT Access token provided by EntraID. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The account id. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetAccessTokensAsync(string accountId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAccessTokensRequest(accountId, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAccessTokensNextPageRequest(nextLink, accountId, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AccessTokens.GetAccessTokens", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists access-tokens for the given account id. It can use OData query params like $select, $filter, $orderby, $top and $skip. The default page size is 10. Use nextLink in response to fetch more objects in the list. Authorization required is Bearer JWT Access token provided by EntraID. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The account id. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetAccessTokens(string accountId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAccessTokensRequest(accountId, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAccessTokensNextPageRequest(nextLink, accountId, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AccessTokens.GetAccessTokens", "value", "nextLink", context); + } + + internal HttpMessage CreateCreateOrReplaceRequest(string accountId, Guid accessTokenId, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200201); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountId, true); + uri.AppendPath("/access-tokens/", false); + uri.AppendPath(accessTokenId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetAccessTokenRequest(string accountId, Guid accessTokenId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountId, true); + uri.AppendPath("/access-tokens/", false); + uri.AppendPath(accessTokenId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateDeleteRequest(string accountId, Guid accessTokenId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountId, true); + uri.AppendPath("/access-tokens/", false); + uri.AppendPath(accessTokenId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetAccessTokensRequest(string accountId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountId, true); + uri.AppendPath("/access-tokens", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetAccessTokensNextPageRequest(string nextLink, string accountId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200201; + private static ResponseClassifier ResponseClassifier200201 => _responseClassifier200201 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 201 }); + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier204; + private static ResponseClassifier ResponseClassifier204 => _responseClassifier204 ??= new StatusCodeClassifier(stackalloc ushort[] { 204 }); + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Account.Serialization.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Account.Serialization.cs new file mode 100644 index 000000000000..cc2c94d0ee3d --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Account.Serialization.cs @@ -0,0 +1,295 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + public partial class Account : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(Account)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("resourceId"u8); + writer.WriteStringValue(ResourceId); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.ToString()); + } + if (options.Format != "W") + { + writer.WritePropertyName("subscriptionId"u8); + writer.WriteStringValue(SubscriptionId); + } + if (options.Format != "W") + { + writer.WritePropertyName("subscriptionState"u8); + writer.WriteStringValue(SubscriptionState.ToString()); + } + if (options.Format != "W") + { + writer.WritePropertyName("tenantId"u8); + writer.WriteStringValue(TenantId); + } + if (options.Format != "W") + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + } + if (options.Format != "W" && Optional.IsDefined(RegionalAffinity)) + { + writer.WritePropertyName("regionalAffinity"u8); + writer.WriteStringValue(RegionalAffinity.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ScalableExecution)) + { + writer.WritePropertyName("scalableExecution"u8); + writer.WriteStringValue(ScalableExecution.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Reporting)) + { + writer.WritePropertyName("reporting"u8); + writer.WriteStringValue(Reporting.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(LocalAuth)) + { + writer.WritePropertyName("localAuth"u8); + writer.WriteStringValue(LocalAuth.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + Account IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Account)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAccount(document.RootElement, options); + } + + internal static Account DeserializeAccount(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string resourceId = default; + string name = default; + AccountState state = default; + Guid subscriptionId = default; + SubscriptionState subscriptionState = default; + Guid tenantId = default; + string location = default; + EnablementStatus? regionalAffinity = default; + EnablementStatus? scalableExecution = default; + EnablementStatus? reporting = default; + EnablementStatus? localAuth = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceId"u8)) + { + resourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("state"u8)) + { + state = new AccountState(property.Value.GetString()); + continue; + } + if (property.NameEquals("subscriptionId"u8)) + { + subscriptionId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("subscriptionState"u8)) + { + subscriptionState = new SubscriptionState(property.Value.GetString()); + continue; + } + if (property.NameEquals("tenantId"u8)) + { + tenantId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("regionalAffinity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + regionalAffinity = new EnablementStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("scalableExecution"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scalableExecution = new EnablementStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("reporting"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + reporting = new EnablementStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("localAuth"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localAuth = new EnablementStatus(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Account( + id, + resourceId, + name, + state, + subscriptionId, + subscriptionState, + tenantId, + location, + regionalAffinity, + scalableExecution, + reporting, + localAuth, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(Account)} does not support writing '{options.Format}' format."); + } + } + + Account IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAccount(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Account)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static Account FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAccount(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/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Account.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Account.cs new file mode 100644 index 000000000000..be4afd6848bb --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Account.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// An account is a parent resource for most of the other service resources. It's directly mapped to an Azure resource. + public partial class Account + { + /// + /// 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; + + /// Initializes a new instance of . + internal Account() + { + } + + /// Initializes a new instance of . + /// The account id. + /// The fully-qualified Azure resource id for the account. + /// The account name. + /// The state of account - Active | Inactive. + /// The Azure subscription id for the account. + /// The Azure subscription state - Registered | Unregistered | Warned | Suspended | Deleted. + /// The Azure tenant id of the account. + /// The account resource location in Azure, for eg. eastus, southeastasia. + /// This property sets the connection region for Playwright client workers to cloud-hosted browsers. If enabled, workers connect to browsers in the closest Azure region, ensuring lower latency. If disabled, workers connect to browsers in the Azure region in which the workspace was initially created. + /// When enabled, Playwright client workers can connect to cloud-hosted browsers. This can increase the number of parallel workers for a test run, significantly minimizing test completion durations. + /// When enabled, this feature allows the workspace to upload and display test results, including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting. + /// When enabled, this feature allows the workspace to use local auth (through service access token) for executing operations. + /// Keeps track of any properties unknown to the library. + internal Account(string id, string resourceId, string name, AccountState state, Guid subscriptionId, SubscriptionState subscriptionState, Guid tenantId, string location, EnablementStatus? regionalAffinity, EnablementStatus? scalableExecution, EnablementStatus? reporting, EnablementStatus? localAuth, IDictionary serializedAdditionalRawData) + { + Id = id; + ResourceId = resourceId; + Name = name; + State = state; + SubscriptionId = subscriptionId; + SubscriptionState = subscriptionState; + TenantId = tenantId; + Location = location; + RegionalAffinity = regionalAffinity; + ScalableExecution = scalableExecution; + Reporting = reporting; + LocalAuth = localAuth; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The account id. + public string Id { get; } + /// The fully-qualified Azure resource id for the account. + public string ResourceId { get; } + /// The account name. + public string Name { get; } + /// The state of account - Active | Inactive. + public AccountState State { get; } + /// The Azure subscription id for the account. + public Guid SubscriptionId { get; } + /// The Azure subscription state - Registered | Unregistered | Warned | Suspended | Deleted. + public SubscriptionState SubscriptionState { get; } + /// The Azure tenant id of the account. + public Guid TenantId { get; } + /// The account resource location in Azure, for eg. eastus, southeastasia. + public string Location { get; } + /// This property sets the connection region for Playwright client workers to cloud-hosted browsers. If enabled, workers connect to browsers in the closest Azure region, ensuring lower latency. If disabled, workers connect to browsers in the Azure region in which the workspace was initially created. + public EnablementStatus? RegionalAffinity { get; } + /// When enabled, Playwright client workers can connect to cloud-hosted browsers. This can increase the number of parallel workers for a test run, significantly minimizing test completion durations. + public EnablementStatus? ScalableExecution { get; } + /// When enabled, this feature allows the workspace to upload and display test results, including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting. + public EnablementStatus? Reporting { get; } + /// When enabled, this feature allows the workspace to use local auth (through service access token) for executing operations. + public EnablementStatus? LocalAuth { get; } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccountState.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccountState.cs new file mode 100644 index 000000000000..bac66ed7f0e2 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccountState.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// The account state. + public readonly partial struct AccountState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AccountState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ActiveValue = "Active"; + private const string InactiveValue = "Inactive"; + + /// The account is Active. + public static AccountState Active { get; } = new AccountState(ActiveValue); + /// The account is Inactive. + public static AccountState Inactive { get; } = new AccountState(InactiveValue); + /// Determines if two values are the same. + public static bool operator ==(AccountState left, AccountState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AccountState left, AccountState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AccountState(string value) => new AccountState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AccountState other && Equals(other); + /// + public bool Equals(AccountState 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/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Accounts.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Accounts.cs new file mode 100644 index 000000000000..c7773ce95649 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Accounts.cs @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + // Data plane generated sub-client. + /// The Accounts sub-client. + public partial class Accounts + { + private static readonly string[] AuthorizationScopes = new string[] { "https://playwright.microsoft.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of Accounts for mocking. + protected Accounts() + { + } + + /// Initializes a new instance of Accounts. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The token credential to copy. + /// + /// Supported Azure Playwright Service API Endpoints (protocol and hostname, for example: + /// https://{region}.api.playwright.microsoft.com). + /// + /// The API version to use for this operation. + internal Accounts(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + /// Get details of the Azure resource mapped to an account for the given account id. Authorization required is Bearer JWT Access token provided by EntraID. + /// The account id. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetAccountAsync(string accountId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetAccountAsync(accountId, context).ConfigureAwait(false); + return Response.FromValue(Account.FromResponse(response), response); + } + + /// Get details of the Azure resource mapped to an account for the given account id. Authorization required is Bearer JWT Access token provided by EntraID. + /// The account id. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetAccount(string accountId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetAccount(accountId, context); + return Response.FromValue(Account.FromResponse(response), response); + } + + /// + /// [Protocol Method] Get details of the Azure resource mapped to an account for the given account id. Authorization required is Bearer JWT Access token provided by EntraID. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The account id. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetAccountAsync(string accountId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.GetAccount"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAccountRequest(accountId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Get details of the Azure resource mapped to an account for the given account id. Authorization required is Bearer JWT Access token provided by EntraID. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The account id. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetAccount(string accountId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.GetAccount"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAccountRequest(accountId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets remote browsers corresponding to given account id and redirects the client for running Playwright tests. Authorization required is Bearer JWT Access token provided by EntraID or Microsoft Playwright Testing Service. + /// The account id. + /// The run id provided by client for corresponding remote test run. + /// The os provided by client for remote test runs. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task GetBrowsersAsync(string accountId, string runId = null, OS? os = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetBrowsersAsync(accountId, runId, os?.ToString(), context).ConfigureAwait(false); + return response; + } + + /// Gets remote browsers corresponding to given account id and redirects the client for running Playwright tests. Authorization required is Bearer JWT Access token provided by EntraID or Microsoft Playwright Testing Service. + /// The account id. + /// The run id provided by client for corresponding remote test run. + /// The os provided by client for remote test runs. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetBrowsers(string accountId, string runId = null, OS? os = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetBrowsers(accountId, runId, os?.ToString(), context); + return response; + } + + /// + /// [Protocol Method] Gets remote browsers corresponding to given account id and redirects the client for running Playwright tests. Authorization required is Bearer JWT Access token provided by EntraID or Microsoft Playwright Testing Service. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The account id. + /// The run id provided by client for corresponding remote test run. + /// The os provided by client for remote test runs. Allowed values: "Linux" | "Windows". + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetBrowsersAsync(string accountId, string runId, string os, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.GetBrowsers"); + scope.Start(); + try + { + using HttpMessage message = CreateGetBrowsersRequest(accountId, runId, os, context); + RedirectPolicy.SetAllowAutoRedirect(message, true); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets remote browsers corresponding to given account id and redirects the client for running Playwright tests. Authorization required is Bearer JWT Access token provided by EntraID or Microsoft Playwright Testing Service. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The account id. + /// The run id provided by client for corresponding remote test run. + /// The os provided by client for remote test runs. Allowed values: "Linux" | "Windows". + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetBrowsers(string accountId, string runId, string os, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.GetBrowsers"); + scope.Start(); + try + { + using HttpMessage message = CreateGetBrowsersRequest(accountId, runId, os, context); + RedirectPolicy.SetAllowAutoRedirect(message, true); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateGetAccountRequest(string accountId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetBrowsersRequest(string accountId, string runId, string os, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier302); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountId, true); + uri.AppendPath("/browsers", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (runId != null) + { + uri.AppendQuery("runId", runId, true); + } + if (os != null) + { + uri.AppendQuery("os", os, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier302; + private static ResponseClassifier ResponseClassifier302 => _responseClassifier302 ??= new StatusCodeClassifier(stackalloc ushort[] { 302 }); + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AuthManagerClient.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AuthManagerClient.cs new file mode 100644 index 000000000000..aeae0a5f3275 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AuthManagerClient.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + // Data plane generated client. + /// The AuthManager service client. + public partial class AuthManagerClient + { + private static readonly string[] AuthorizationScopes = new string[] { "https://playwright.microsoft.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of AuthManagerClient for mocking. + protected AuthManagerClient() + { + } + + /// Initializes a new instance of AuthManagerClient. + /// + /// Supported Azure Playwright Service API Endpoints (protocol and hostname, for example: + /// https://{region}.api.playwright.microsoft.com). + /// + /// A credential used to authenticate to an Azure Service. + /// or is null. + public AuthManagerClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new AuthManagerClientOptions()) + { + } + + /// Initializes a new instance of AuthManagerClient. + /// + /// Supported Azure Playwright Service API Endpoints (protocol and hostname, for example: + /// https://{region}.api.playwright.microsoft.com). + /// + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public AuthManagerClient(Uri endpoint, TokenCredential credential, AuthManagerClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new AuthManagerClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _endpoint = endpoint; + } + + /// Initializes a new instance of AccessTokens. + /// The API version to use for this operation. + /// is null. + public virtual AccessTokens GetAccessTokensClient(string apiVersion = "2024-12-01") + { + Argument.AssertNotNull(apiVersion, nameof(apiVersion)); + + return new AccessTokens(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, apiVersion); + } + + /// Initializes a new instance of Accounts. + /// The API version to use for this operation. + /// is null. + public virtual Accounts GetAccountsClient(string apiVersion = "2024-12-01") + { + Argument.AssertNotNull(apiVersion, nameof(apiVersion)); + + return new Accounts(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, apiVersion); + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AuthManagerClientOptions.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AuthManagerClientOptions.cs new file mode 100644 index 000000000000..99fd673ddfd4 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AuthManagerClientOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// Client options for AuthManagerClient. + public partial class AuthManagerClientOptions : ClientOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2024_12_01; + + /// The version of the service to use. + public enum ServiceVersion + { + /// Service version "2024-12-01". + V2024_12_01 = 1, + } + + internal string Version { get; } + + /// Initializes new instance of AuthManagerClientOptions. + public AuthManagerClientOptions(ServiceVersion version = LatestVersion) + { + Version = version switch + { + ServiceVersion.V2024_12_01 => "2024-12-01", + _ => throw new NotSupportedException() + }; + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/DeveloperMicrosoftPlaywrightTestingClientBuilderExtensions.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/DeveloperMicrosoftPlaywrightTestingClientBuilderExtensions.cs new file mode 100644 index 000000000000..364126f7a80c --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/DeveloperMicrosoftPlaywrightTestingClientBuilderExtensions.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core.Extensions; +using Azure.Developer.MicrosoftPlaywrightTesting; + +namespace Microsoft.Extensions.Azure +{ + /// Extension methods to add to client builder. + public static partial class DeveloperMicrosoftPlaywrightTestingClientBuilderExtensions + { + /// Registers a instance. + /// The builder to register with. + /// + /// Supported Azure Playwright Service API Endpoints (protocol and hostname, for example: + /// https://{region}.api.playwright.microsoft.com). + /// + public static IAzureClientBuilder AddAuthManagerClient(this TBuilder builder, Uri endpoint) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new AuthManagerClient(endpoint, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddAuthManagerClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/DeveloperMicrosoftPlaywrightTestingModelFactory.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/DeveloperMicrosoftPlaywrightTestingModelFactory.cs new file mode 100644 index 000000000000..91a05b3a7100 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/DeveloperMicrosoftPlaywrightTestingModelFactory.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// Model factory for models. + public static partial class DeveloperMicrosoftPlaywrightTestingModelFactory + { + /// Initializes a new instance of . + /// The account id. + /// The fully-qualified Azure resource id for the account. + /// The account name. + /// The state of account - Active | Inactive. + /// The Azure subscription id for the account. + /// The Azure subscription state - Registered | Unregistered | Warned | Suspended | Deleted. + /// The Azure tenant id of the account. + /// The account resource location in Azure, for eg. eastus, southeastasia. + /// This property sets the connection region for Playwright client workers to cloud-hosted browsers. If enabled, workers connect to browsers in the closest Azure region, ensuring lower latency. If disabled, workers connect to browsers in the Azure region in which the workspace was initially created. + /// When enabled, Playwright client workers can connect to cloud-hosted browsers. This can increase the number of parallel workers for a test run, significantly minimizing test completion durations. + /// When enabled, this feature allows the workspace to upload and display test results, including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting. + /// When enabled, this feature allows the workspace to use local auth (through service access token) for executing operations. + /// A new instance for mocking. + public static Account Account(string id = null, string resourceId = null, string name = null, AccountState state = default, Guid subscriptionId = default, SubscriptionState subscriptionState = default, Guid tenantId = default, string location = null, EnablementStatus? regionalAffinity = null, EnablementStatus? scalableExecution = null, EnablementStatus? reporting = null, EnablementStatus? localAuth = null) + { + return new Account( + id, + resourceId, + name, + state, + subscriptionId, + subscriptionState, + tenantId, + location, + regionalAffinity, + scalableExecution, + reporting, + localAuth, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The access-token id. + /// The access-token name. + /// The access-token value in JWT format. + /// The access-token createdAt utcDateTime. + /// The access-token expiryAt utcDateTime. + /// The access-token state - Active | Expired. + /// A new instance for mocking. + public static AccessToken AccessToken(Guid id = default, string name = null, string jwtToken = null, DateTimeOffset createdAt = default, DateTimeOffset expiryAt = default, AccessTokenState state = default) + { + return new AccessToken( + id, + name, + jwtToken, + createdAt, + expiryAt, + state, + serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Docs/AccessTokens.xml b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Docs/AccessTokens.xml new file mode 100644 index 000000000000..fe737d05e5e0 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Docs/AccessTokens.xml @@ -0,0 +1,225 @@ + + + + + +This sample shows how to call CreateOrReplaceAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +AccessTokens client = new AuthManagerClient(endpoint, credential).GetAccessTokensClient(apiVersion: "2024-12-01"); + +AccessToken resource = new AccessToken("sampleAccessToken", DateTimeOffset.Parse("2022-09-28T12:32:33Z")); +Response response = await client.CreateOrReplaceAsync("sampleAccountId_00000000-0000-0000-0000-000000000000", Guid.Parse("00000000-0000-0000-0000-000000000000"), resource); +]]> + + + +This sample shows how to call CreateOrReplace. +"); +TokenCredential credential = new DefaultAzureCredential(); +AccessTokens client = new AuthManagerClient(endpoint, credential).GetAccessTokensClient(apiVersion: "2024-12-01"); + +AccessToken resource = new AccessToken("sampleAccessToken", DateTimeOffset.Parse("2022-09-28T12:32:33Z")); +Response response = client.CreateOrReplace("sampleAccountId_00000000-0000-0000-0000-000000000000", Guid.Parse("00000000-0000-0000-0000-000000000000"), resource); +]]> + + + +This sample shows how to call CreateOrReplaceAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +AccessTokens client = new AuthManagerClient(endpoint, credential).GetAccessTokensClient(apiVersion: "2024-12-01"); + +using RequestContent content = RequestContent.Create(new +{ + id = "00000000-0000-0000-0000-000000000000", + name = "sampleAccessToken", + expiryAt = "2022-09-28T12:32:33Z", +}); +Response response = await client.CreateOrReplaceAsync("sampleAccountId_00000000-0000-0000-0000-000000000000", Guid.Parse("00000000-0000-0000-0000-000000000000"), content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("createdAt").ToString()); +Console.WriteLine(result.GetProperty("expiryAt").ToString()); +Console.WriteLine(result.GetProperty("state").ToString()); +]]> + + + +This sample shows how to call CreateOrReplace and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +AccessTokens client = new AuthManagerClient(endpoint, credential).GetAccessTokensClient(apiVersion: "2024-12-01"); + +using RequestContent content = RequestContent.Create(new +{ + id = "00000000-0000-0000-0000-000000000000", + name = "sampleAccessToken", + expiryAt = "2022-09-28T12:32:33Z", +}); +Response response = client.CreateOrReplace("sampleAccountId_00000000-0000-0000-0000-000000000000", Guid.Parse("00000000-0000-0000-0000-000000000000"), content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("createdAt").ToString()); +Console.WriteLine(result.GetProperty("expiryAt").ToString()); +Console.WriteLine(result.GetProperty("state").ToString()); +]]> + + + +This sample shows how to call GetAccessTokenAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +AccessTokens client = new AuthManagerClient(endpoint, credential).GetAccessTokensClient(apiVersion: "2024-12-01"); + +Response response = await client.GetAccessTokenAsync("sampleAccountId_00000000-0000-0000-0000-000000000000", Guid.Parse("00000000-0000-0000-0000-000000000000")); +]]> + + + +This sample shows how to call GetAccessToken. +"); +TokenCredential credential = new DefaultAzureCredential(); +AccessTokens client = new AuthManagerClient(endpoint, credential).GetAccessTokensClient(apiVersion: "2024-12-01"); + +Response response = client.GetAccessToken("sampleAccountId_00000000-0000-0000-0000-000000000000", Guid.Parse("00000000-0000-0000-0000-000000000000")); +]]> + + + +This sample shows how to call GetAccessTokenAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +AccessTokens client = new AuthManagerClient(endpoint, credential).GetAccessTokensClient(apiVersion: "2024-12-01"); + +Response response = await client.GetAccessTokenAsync("sampleAccountId_00000000-0000-0000-0000-000000000000", Guid.Parse("00000000-0000-0000-0000-000000000000"), null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("createdAt").ToString()); +Console.WriteLine(result.GetProperty("expiryAt").ToString()); +Console.WriteLine(result.GetProperty("state").ToString()); +]]> + + + +This sample shows how to call GetAccessToken and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +AccessTokens client = new AuthManagerClient(endpoint, credential).GetAccessTokensClient(apiVersion: "2024-12-01"); + +Response response = client.GetAccessToken("sampleAccountId_00000000-0000-0000-0000-000000000000", Guid.Parse("00000000-0000-0000-0000-000000000000"), null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("createdAt").ToString()); +Console.WriteLine(result.GetProperty("expiryAt").ToString()); +Console.WriteLine(result.GetProperty("state").ToString()); +]]> + + + +This sample shows how to call DeleteAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +AccessTokens client = new AuthManagerClient(endpoint, credential).GetAccessTokensClient(apiVersion: "2024-12-01"); + +Response response = await client.DeleteAsync("sampleAccountId_00000000-0000-0000-0000-000000000000", Guid.Parse("00000000-0000-0000-0000-000000000000")); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call Delete. +"); +TokenCredential credential = new DefaultAzureCredential(); +AccessTokens client = new AuthManagerClient(endpoint, credential).GetAccessTokensClient(apiVersion: "2024-12-01"); + +Response response = client.Delete("sampleAccountId_00000000-0000-0000-0000-000000000000", Guid.Parse("00000000-0000-0000-0000-000000000000")); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call GetAccessTokensAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +AccessTokens client = new AuthManagerClient(endpoint, credential).GetAccessTokensClient(apiVersion: "2024-12-01"); + +await foreach (AccessToken item in client.GetAccessTokensAsync("sampleAccountId_00000000-0000-0000-0000-000000000000")) +{ +} +]]> + + + +This sample shows how to call GetAccessTokens. +"); +TokenCredential credential = new DefaultAzureCredential(); +AccessTokens client = new AuthManagerClient(endpoint, credential).GetAccessTokensClient(apiVersion: "2024-12-01"); + +foreach (AccessToken item in client.GetAccessTokens("sampleAccountId_00000000-0000-0000-0000-000000000000")) +{ +} +]]> + + + +This sample shows how to call GetAccessTokensAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +AccessTokens client = new AuthManagerClient(endpoint, credential).GetAccessTokensClient(apiVersion: "2024-12-01"); + +await foreach (BinaryData item in client.GetAccessTokensAsync("sampleAccountId_00000000-0000-0000-0000-000000000000", null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("expiryAt").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); +} +]]> + + + +This sample shows how to call GetAccessTokens and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +AccessTokens client = new AuthManagerClient(endpoint, credential).GetAccessTokensClient(apiVersion: "2024-12-01"); + +foreach (BinaryData item in client.GetAccessTokens("sampleAccountId_00000000-0000-0000-0000-000000000000", null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("expiryAt").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); +} +]]> + + + \ No newline at end of file diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Docs/Accounts.xml b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Docs/Accounts.xml new file mode 100644 index 000000000000..62ebdf2b75ee --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Docs/Accounts.xml @@ -0,0 +1,117 @@ + + + + + +This sample shows how to call GetAccountAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new AuthManagerClient(endpoint, credential).GetAccountsClient(apiVersion: "2024-12-01"); + +Response response = await client.GetAccountAsync("sampleAccountId_00000000-0000-0000-0000-000000000000"); +]]> + + + +This sample shows how to call GetAccount. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new AuthManagerClient(endpoint, credential).GetAccountsClient(apiVersion: "2024-12-01"); + +Response response = client.GetAccount("sampleAccountId_00000000-0000-0000-0000-000000000000"); +]]> + + + +This sample shows how to call GetAccountAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new AuthManagerClient(endpoint, credential).GetAccountsClient(apiVersion: "2024-12-01"); + +Response response = await client.GetAccountAsync("sampleAccountId_00000000-0000-0000-0000-000000000000", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("subscriptionId").ToString()); +Console.WriteLine(result.GetProperty("subscriptionState").ToString()); +Console.WriteLine(result.GetProperty("tenantId").ToString()); +Console.WriteLine(result.GetProperty("location").ToString()); +]]> + + + +This sample shows how to call GetAccount and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new AuthManagerClient(endpoint, credential).GetAccountsClient(apiVersion: "2024-12-01"); + +Response response = client.GetAccount("sampleAccountId_00000000-0000-0000-0000-000000000000", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("subscriptionId").ToString()); +Console.WriteLine(result.GetProperty("subscriptionState").ToString()); +Console.WriteLine(result.GetProperty("tenantId").ToString()); +Console.WriteLine(result.GetProperty("location").ToString()); +]]> + + + +This sample shows how to call GetBrowsersAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new AuthManagerClient(endpoint, credential).GetAccountsClient(apiVersion: "2024-12-01"); + +Response response = await client.GetBrowsersAsync("sampleAccountId_00000000-0000-0000-0000-000000000000"); +]]> + + + +This sample shows how to call GetBrowsers. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new AuthManagerClient(endpoint, credential).GetAccountsClient(apiVersion: "2024-12-01"); + +Response response = client.GetBrowsers("sampleAccountId_00000000-0000-0000-0000-000000000000"); +]]> + + + +This sample shows how to call GetBrowsersAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new AuthManagerClient(endpoint, credential).GetAccountsClient(apiVersion: "2024-12-01"); + +Response response = await client.GetBrowsersAsync("sampleAccountId_00000000-0000-0000-0000-000000000000", null, "Linux", null); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call GetBrowsers. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new AuthManagerClient(endpoint, credential).GetAccountsClient(apiVersion: "2024-12-01"); + +Response response = client.GetBrowsers("sampleAccountId_00000000-0000-0000-0000-000000000000", null, "Linux", null); + +Console.WriteLine(response.Status); +]]> + + + \ No newline at end of file diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/EnablementStatus.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/EnablementStatus.cs new file mode 100644 index 000000000000..98e5aab7d42d --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/EnablementStatus.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// The enablement status of a feature. + public readonly partial struct EnablementStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public EnablementStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// The feature is Enabled. + public static EnablementStatus Enabled { get; } = new EnablementStatus(EnabledValue); + /// The feature is Disabled. + public static EnablementStatus Disabled { get; } = new EnablementStatus(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(EnablementStatus left, EnablementStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EnablementStatus left, EnablementStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator EnablementStatus(string value) => new EnablementStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EnablementStatus other && Equals(other); + /// + public bool Equals(EnablementStatus 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/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/Argument.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..751c33a54e9a --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + 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/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..f1d970892926 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/ChangeTrackingList.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..19167552757e --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..8eea5e0eb9ac --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + internal static class ModelSerializationExtensions + { + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var 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(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + 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"); + } + + public static string GetRequiredString(this JsonElement element) + { + var 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}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + 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/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/Optional.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..aeefc5cf26a9 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..56ddcc549b34 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// 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.Developer.MicrosoftPlaywrightTesting +{ + 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/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/OS.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/OS.cs new file mode 100644 index 000000000000..e9fcbb0f87a8 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/OS.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// The os to configure for remote test runs. + public readonly partial struct OS : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OS(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LinuxValue = "Linux"; + private const string WindowsValue = "Windows"; + + /// Linux OS. + public static OS Linux { get; } = new OS(LinuxValue); + /// Windows OS. + public static OS Windows { get; } = new OS(WindowsValue); + /// Determines if two values are the same. + public static bool operator ==(OS left, OS right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OS left, OS right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OS(string value) => new OS(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OS other && Equals(other); + /// + public bool Equals(OS 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/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/SubscriptionState.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/SubscriptionState.cs new file mode 100644 index 000000000000..d3fb25818b1a --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/SubscriptionState.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// The Azure subscription state. + public readonly partial struct SubscriptionState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SubscriptionState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RegisteredValue = "Registered"; + private const string WarnedValue = "Warned"; + private const string SuspendedValue = "Suspended"; + private const string DeletedValue = "Deleted"; + private const string UnregisteredValue = "Unregistered"; + + /// The subscription state is Registered. + public static SubscriptionState Registered { get; } = new SubscriptionState(RegisteredValue); + /// The subscription state is Warned. + public static SubscriptionState Warned { get; } = new SubscriptionState(WarnedValue); + /// The subscription state is Suspended. + public static SubscriptionState Suspended { get; } = new SubscriptionState(SuspendedValue); + /// The subscription state is Deleted. + public static SubscriptionState Deleted { get; } = new SubscriptionState(DeletedValue); + /// The subscription state is Unregistered. + public static SubscriptionState Unregistered { get; } = new SubscriptionState(UnregisteredValue); + /// Determines if two values are the same. + public static bool operator ==(SubscriptionState left, SubscriptionState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SubscriptionState left, SubscriptionState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SubscriptionState(string value) => new SubscriptionState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SubscriptionState other && Equals(other); + /// + public bool Equals(SubscriptionState 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/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Properties/AssemblyInfo.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..145709b2db91 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.Developer.MicrosoftPlaywrightTesting.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.Template")] diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tests/Azure.Developer.MicrosoftPlaywrightTesting.Tests.csproj b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tests/Azure.Developer.MicrosoftPlaywrightTesting.Tests.csproj new file mode 100644 index 000000000000..f3becb133be8 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tests/Azure.Developer.MicrosoftPlaywrightTesting.Tests.csproj @@ -0,0 +1,20 @@ + + + $(RequiredTargetFrameworks) + + $(NoWarn);CS1591 + + + + + + + + + + + + + + + diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tests/Generated/Samples/Samples_AccessTokens.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tests/Generated/Samples/Samples_AccessTokens.cs new file mode 100644 index 000000000000..4a11c551742b --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tests/Generated/Samples/Samples_AccessTokens.cs @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Developer.MicrosoftPlaywrightTesting.Samples +{ + public partial class Samples_AccessTokens + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccessToken_CreateOrReplace_AccessTokensCreateOrReplace() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + AccessTokens client = new AuthManagerClient(endpoint, credential).GetAccessTokensClient(apiVersion: "2024-12-01"); + + using RequestContent content = RequestContent.Create(new + { + id = "00000000-0000-0000-0000-000000000000", + name = "sampleAccessToken", + expiryAt = "2022-09-28T12:32:33Z", + }); + Response response = client.CreateOrReplace("sampleAccountId_00000000-0000-0000-0000-000000000000", Guid.Parse("00000000-0000-0000-0000-000000000000"), content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("expiryAt").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccessToken_CreateOrReplace_AccessTokensCreateOrReplace_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + AccessTokens client = new AuthManagerClient(endpoint, credential).GetAccessTokensClient(apiVersion: "2024-12-01"); + + using RequestContent content = RequestContent.Create(new + { + id = "00000000-0000-0000-0000-000000000000", + name = "sampleAccessToken", + expiryAt = "2022-09-28T12:32:33Z", + }); + Response response = await client.CreateOrReplaceAsync("sampleAccountId_00000000-0000-0000-0000-000000000000", Guid.Parse("00000000-0000-0000-0000-000000000000"), content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("expiryAt").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccessToken_CreateOrReplace_AccessTokensCreateOrReplace_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + AccessTokens client = new AuthManagerClient(endpoint, credential).GetAccessTokensClient(apiVersion: "2024-12-01"); + + AccessToken resource = new AccessToken("sampleAccessToken", DateTimeOffset.Parse("2022-09-28T12:32:33Z")); + Response response = client.CreateOrReplace("sampleAccountId_00000000-0000-0000-0000-000000000000", Guid.Parse("00000000-0000-0000-0000-000000000000"), resource); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccessToken_CreateOrReplace_AccessTokensCreateOrReplace_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + AccessTokens client = new AuthManagerClient(endpoint, credential).GetAccessTokensClient(apiVersion: "2024-12-01"); + + AccessToken resource = new AccessToken("sampleAccessToken", DateTimeOffset.Parse("2022-09-28T12:32:33Z")); + Response response = await client.CreateOrReplaceAsync("sampleAccountId_00000000-0000-0000-0000-000000000000", Guid.Parse("00000000-0000-0000-0000-000000000000"), resource); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccessToken_GetAccessToken_AccessTokensGet() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + AccessTokens client = new AuthManagerClient(endpoint, credential).GetAccessTokensClient(apiVersion: "2024-12-01"); + + Response response = client.GetAccessToken("sampleAccountId_00000000-0000-0000-0000-000000000000", Guid.Parse("00000000-0000-0000-0000-000000000000"), null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("expiryAt").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccessToken_GetAccessToken_AccessTokensGet_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + AccessTokens client = new AuthManagerClient(endpoint, credential).GetAccessTokensClient(apiVersion: "2024-12-01"); + + Response response = await client.GetAccessTokenAsync("sampleAccountId_00000000-0000-0000-0000-000000000000", Guid.Parse("00000000-0000-0000-0000-000000000000"), null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("expiryAt").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccessToken_GetAccessToken_AccessTokensGet_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + AccessTokens client = new AuthManagerClient(endpoint, credential).GetAccessTokensClient(apiVersion: "2024-12-01"); + + Response response = client.GetAccessToken("sampleAccountId_00000000-0000-0000-0000-000000000000", Guid.Parse("00000000-0000-0000-0000-000000000000")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccessToken_GetAccessToken_AccessTokensGet_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + AccessTokens client = new AuthManagerClient(endpoint, credential).GetAccessTokensClient(apiVersion: "2024-12-01"); + + Response response = await client.GetAccessTokenAsync("sampleAccountId_00000000-0000-0000-0000-000000000000", Guid.Parse("00000000-0000-0000-0000-000000000000")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccessToken_Delete_AccessTokensDelete() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + AccessTokens client = new AuthManagerClient(endpoint, credential).GetAccessTokensClient(apiVersion: "2024-12-01"); + + Response response = client.Delete("sampleAccountId_00000000-0000-0000-0000-000000000000", Guid.Parse("00000000-0000-0000-0000-000000000000")); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccessToken_Delete_AccessTokensDelete_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + AccessTokens client = new AuthManagerClient(endpoint, credential).GetAccessTokensClient(apiVersion: "2024-12-01"); + + Response response = await client.DeleteAsync("sampleAccountId_00000000-0000-0000-0000-000000000000", Guid.Parse("00000000-0000-0000-0000-000000000000")); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccessToken_GetAccessTokens_AccessTokensList() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + AccessTokens client = new AuthManagerClient(endpoint, credential).GetAccessTokensClient(apiVersion: "2024-12-01"); + + foreach (BinaryData item in client.GetAccessTokens("sampleAccountId_00000000-0000-0000-0000-000000000000", null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("expiryAt").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccessToken_GetAccessTokens_AccessTokensList_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + AccessTokens client = new AuthManagerClient(endpoint, credential).GetAccessTokensClient(apiVersion: "2024-12-01"); + + await foreach (BinaryData item in client.GetAccessTokensAsync("sampleAccountId_00000000-0000-0000-0000-000000000000", null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("expiryAt").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccessToken_GetAccessTokens_AccessTokensList_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + AccessTokens client = new AuthManagerClient(endpoint, credential).GetAccessTokensClient(apiVersion: "2024-12-01"); + + foreach (AccessToken item in client.GetAccessTokens("sampleAccountId_00000000-0000-0000-0000-000000000000")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccessToken_GetAccessTokens_AccessTokensList_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + AccessTokens client = new AuthManagerClient(endpoint, credential).GetAccessTokensClient(apiVersion: "2024-12-01"); + + await foreach (AccessToken item in client.GetAccessTokensAsync("sampleAccountId_00000000-0000-0000-0000-000000000000")) + { + } + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tests/Generated/Samples/Samples_Accounts.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tests/Generated/Samples/Samples_Accounts.cs new file mode 100644 index 000000000000..774f29c21146 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tests/Generated/Samples/Samples_Accounts.cs @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Developer.MicrosoftPlaywrightTesting.Samples +{ + public partial class Samples_Accounts + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Account_GetAccount_AccountsGet() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new AuthManagerClient(endpoint, credential).GetAccountsClient(apiVersion: "2024-12-01"); + + Response response = client.GetAccount("sampleAccountId_00000000-0000-0000-0000-000000000000", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("subscriptionId").ToString()); + Console.WriteLine(result.GetProperty("subscriptionState").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("location").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Account_GetAccount_AccountsGet_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new AuthManagerClient(endpoint, credential).GetAccountsClient(apiVersion: "2024-12-01"); + + Response response = await client.GetAccountAsync("sampleAccountId_00000000-0000-0000-0000-000000000000", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("subscriptionId").ToString()); + Console.WriteLine(result.GetProperty("subscriptionState").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("location").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Account_GetAccount_AccountsGet_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new AuthManagerClient(endpoint, credential).GetAccountsClient(apiVersion: "2024-12-01"); + + Response response = client.GetAccount("sampleAccountId_00000000-0000-0000-0000-000000000000"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Account_GetAccount_AccountsGet_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new AuthManagerClient(endpoint, credential).GetAccountsClient(apiVersion: "2024-12-01"); + + Response response = await client.GetAccountAsync("sampleAccountId_00000000-0000-0000-0000-000000000000"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_GetBrowsers_AccountsGetBrowsers() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new AuthManagerClient(endpoint, credential).GetAccountsClient(apiVersion: "2024-12-01"); + + Response response = client.GetBrowsers("sampleAccountId_00000000-0000-0000-0000-000000000000", null, "Linux", null); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_GetBrowsers_AccountsGetBrowsers_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new AuthManagerClient(endpoint, credential).GetAccountsClient(apiVersion: "2024-12-01"); + + Response response = await client.GetBrowsersAsync("sampleAccountId_00000000-0000-0000-0000-000000000000", null, "Linux", null); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_GetBrowsers_AccountsGetBrowsers_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new AuthManagerClient(endpoint, credential).GetAccountsClient(apiVersion: "2024-12-01"); + + Response response = client.GetBrowsers("sampleAccountId_00000000-0000-0000-0000-000000000000"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_GetBrowsers_AccountsGetBrowsers_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new AuthManagerClient(endpoint, credential).GetAccountsClient(apiVersion: "2024-12-01"); + + Response response = await client.GetBrowsersAsync("sampleAccountId_00000000-0000-0000-0000-000000000000"); + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tsp-location.yaml b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tsp-location.yaml new file mode 100644 index 000000000000..83f83e9ea233 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tsp-location.yaml @@ -0,0 +1,5 @@ +directory: specification/playwrighttesting/PlaywrightTesting.AuthManager +commit: 7c52cf4d9a41dd06846b099946e8b85a9504cf1e +repo: Azure/azure-rest-api-specs +additionalDirectories: +- specification/playwrighttesting/PlaywrightTesting.Shared diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/Configuration.json b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/Configuration.json new file mode 100644 index 000000000000..aa258a8c76eb --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/Configuration.json @@ -0,0 +1,12 @@ +{ + "output-folder": ".", + "namespace": "Azure.ResourceManager.PlaywrightTesting", + "library-name": "Azure.ResourceManager.PlaywrightTesting", + "flavor": "azure", + "use-model-reader-writer": true, + "shared-source-folders": [ + "../../TempTypeSpecFiles/node_modules/@autorest/csharp/Generator.Shared", + "../../TempTypeSpecFiles/node_modules/@autorest/csharp/Azure.Core.Shared" + ], + "azure-arm": true +} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/tsp-location.yaml b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/tsp-location.yaml index bfaa02c7b55e..a0e615d7e47a 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/tsp-location.yaml +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/tsp-location.yaml @@ -1,3 +1,4 @@ -directory: specification/playwrighttesting -commit: c39acac0b3b7ceeee03b594a7b49c9bad6b8e9f2 +directory: specification/playwrighttesting/PlaywrightTesting.Management +commit: 7c52cf4d9a41dd06846b099946e8b85a9504cf1e repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/tspCodeModel.json b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/tspCodeModel.json new file mode 100644 index 000000000000..001444041c89 --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/tspCodeModel.json @@ -0,0 +1,7107 @@ +{ + "$id": "1", + "Name": "Microsoft.AzurePlaywrightService", + "ApiVersions": [ + "2024-12-01" + ], + "Enums": [ + { + "$id": "2", + "kind": "enum", + "name": "PlaywrightTestingQuotaNames", + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.QuotaNames", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "ScalableExecution", + "value": "ScalableExecution", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "The quota details for scalable execution feature. When enabled, Playwright client workers can connect to cloud-hosted browsers. This can increase the number of parallel workers for a test run, significantly minimizing test completion durations.", + "decorators": [] + }, + { + "$id": "6", + "kind": "enumvalue", + "name": "Reporting", + "value": "Reporting", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "The quota details for reporting feature. When enabled, Playwright client will be able to upload and display test results, including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting.", + "decorators": [] + } + ], + "doc": "The enum for quota name.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "8", + "kind": "enum", + "name": "PlaywrightTestingProvisioningState", + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.ProvisioningState", + "valueType": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "10", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$id": "11", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "8" + }, + "doc": "Resource has been created.", + "decorators": [] + }, + { + "$id": "12", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "8" + }, + "doc": "Resource creation failed.", + "decorators": [] + }, + { + "$id": "14", + "kind": "enumvalue", + "name": "Canceled", + "value": "Canceled", + "valueType": { + "$id": "15", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "8" + }, + "doc": "Resource creation was canceled.", + "decorators": [] + }, + { + "$id": "16", + "kind": "enumvalue", + "name": "Creating", + "value": "Creating", + "valueType": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "8" + }, + "doc": "Creation in progress..", + "decorators": [] + }, + { + "$id": "18", + "kind": "enumvalue", + "name": "Deleting", + "value": "Deleting", + "valueType": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "8" + }, + "doc": "Deletion in progress..", + "decorators": [] + }, + { + "$id": "20", + "kind": "enumvalue", + "name": "Accepted", + "value": "Accepted", + "valueType": { + "$id": "21", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "8" + }, + "doc": "Change accepted for processing..", + "decorators": [] + } + ], + "doc": "The status of the current operation.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "22", + "kind": "enum", + "name": "createdByType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.createdByType", + "valueType": { + "$id": "23", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "24", + "kind": "enumvalue", + "name": "User", + "value": "User", + "valueType": { + "$id": "25", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "22" + }, + "doc": "The entity was created by a user.", + "decorators": [] + }, + { + "$id": "26", + "kind": "enumvalue", + "name": "Application", + "value": "Application", + "valueType": { + "$id": "27", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "22" + }, + "doc": "The entity was created by an application.", + "decorators": [] + }, + { + "$id": "28", + "kind": "enumvalue", + "name": "ManagedIdentity", + "value": "ManagedIdentity", + "valueType": { + "$id": "29", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "22" + }, + "doc": "The entity was created by a managed identity.", + "decorators": [] + }, + { + "$id": "30", + "kind": "enumvalue", + "name": "Key", + "value": "Key", + "valueType": { + "$id": "31", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "22" + }, + "doc": "The entity was created by a key.", + "decorators": [] + } + ], + "doc": "The kind of entity that created the resource.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "32", + "kind": "enum", + "name": "PlaywrightTestingFreeTrialState", + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.FreeTrialState", + "valueType": { + "$id": "33", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "34", + "kind": "enumvalue", + "name": "Active", + "value": "Active", + "valueType": { + "$id": "35", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "32" + }, + "doc": "The free-trial is Active.", + "decorators": [] + }, + { + "$id": "36", + "kind": "enumvalue", + "name": "Expired", + "value": "Expired", + "valueType": { + "$id": "37", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "32" + }, + "doc": "The free-trial is Expired.", + "decorators": [] + }, + { + "$id": "38", + "kind": "enumvalue", + "name": "NotEligible", + "value": "NotEligible", + "valueType": { + "$id": "39", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "32" + }, + "doc": "The free-trial is Not Eligible.", + "decorators": [] + }, + { + "$id": "40", + "kind": "enumvalue", + "name": "NotRegistered", + "value": "NotRegistered", + "valueType": { + "$id": "41", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "32" + }, + "doc": "The free-trial is Not Registered.", + "decorators": [] + } + ], + "doc": "The free-trial state.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "42", + "kind": "enum", + "name": "PlaywrightTestingOfferingType", + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.OfferingType", + "valueType": { + "$id": "43", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "44", + "kind": "enumvalue", + "name": "NotApplicable", + "value": "NotApplicable", + "valueType": { + "$id": "45", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "42" + }, + "doc": "The offeringType is NotApplicable.", + "decorators": [] + }, + { + "$id": "46", + "kind": "enumvalue", + "name": "PrivatePreview", + "value": "PrivatePreview", + "valueType": { + "$id": "47", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "42" + }, + "doc": "The offeringType is PrivatePreview.", + "decorators": [] + }, + { + "$id": "48", + "kind": "enumvalue", + "name": "PublicPreview", + "value": "PublicPreview", + "valueType": { + "$id": "49", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "42" + }, + "doc": "The offeringType is PublicPreview.", + "decorators": [] + }, + { + "$id": "50", + "kind": "enumvalue", + "name": "GeneralAvailability", + "value": "GeneralAvailability", + "valueType": { + "$id": "51", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "42" + }, + "doc": "The offeringType is GeneralAvailability.", + "decorators": [] + } + ], + "doc": "Offering type state.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "52", + "kind": "enum", + "name": "PlaywrightTestingEnablementStatus", + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.EnablementStatus", + "valueType": { + "$id": "53", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "54", + "kind": "enumvalue", + "name": "Enabled", + "value": "Enabled", + "valueType": { + "$id": "55", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "52" + }, + "doc": "The feature is Enabled.", + "decorators": [] + }, + { + "$id": "56", + "kind": "enumvalue", + "name": "Disabled", + "value": "Disabled", + "valueType": { + "$id": "57", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "52" + }, + "doc": "The feature is Disabled.", + "decorators": [] + } + ], + "doc": "The enablement status of a feature.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "58", + "kind": "enum", + "name": "ResourceProvisioningState", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceProvisioningState", + "valueType": { + "$id": "59", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "60", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$id": "61", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "58" + }, + "doc": "Resource has been created.", + "decorators": [] + }, + { + "$id": "62", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$id": "63", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "58" + }, + "doc": "Resource creation failed.", + "decorators": [] + }, + { + "$id": "64", + "kind": "enumvalue", + "name": "Canceled", + "value": "Canceled", + "valueType": { + "$id": "65", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "58" + }, + "doc": "Resource creation was canceled.", + "decorators": [] + } + ], + "doc": "The provisioning state of a resource type.", + "isFixed": false, + "isFlags": false, + "usage": "LroPolling", + "decorators": [] + }, + { + "$id": "66", + "kind": "enum", + "name": "PlaywrightTestingNameUnavailableReason", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.CheckNameAvailabilityReason", + "valueType": { + "$id": "67", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "68", + "kind": "enumvalue", + "name": "Invalid", + "value": "Invalid", + "valueType": { + "$id": "69", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "doc": "Name is invalid.", + "decorators": [] + }, + { + "$id": "70", + "kind": "enumvalue", + "name": "AlreadyExists", + "value": "AlreadyExists", + "valueType": { + "$id": "71", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "doc": "Name already exists.", + "decorators": [] + } + ], + "doc": "Possible reasons for a name not being available.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "72", + "kind": "enum", + "name": "Origin", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Origin", + "valueType": { + "$id": "73", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "74", + "kind": "enumvalue", + "name": "user", + "value": "user", + "valueType": { + "$id": "75", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "72" + }, + "doc": "Indicates the operation is initiated by a user.", + "decorators": [] + }, + { + "$id": "76", + "kind": "enumvalue", + "name": "system", + "value": "system", + "valueType": { + "$id": "77", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "72" + }, + "doc": "Indicates the operation is initiated by a system.", + "decorators": [] + }, + { + "$id": "78", + "kind": "enumvalue", + "name": "user,system", + "value": "user,system", + "valueType": { + "$id": "79", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "72" + }, + "doc": "Indicates the operation is initiated by a user or system.", + "decorators": [] + } + ], + "doc": "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\"", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "80", + "kind": "enum", + "name": "ActionType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ActionType", + "valueType": { + "$id": "81", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "82", + "kind": "enumvalue", + "name": "Internal", + "value": "Internal", + "valueType": { + "$id": "83", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "80" + }, + "doc": "Actions are for internal-only APIs.", + "decorators": [] + } + ], + "doc": "Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "84", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.Versions", + "valueType": { + "$id": "85", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "86", + "kind": "enumvalue", + "name": "2024-12-01", + "value": "2024-12-01", + "valueType": { + "$id": "87", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "84" + }, + "doc": "2024-12-01 version", + "decorators": [] + } + ], + "doc": "Microsoft.AzurePlaywrightService Management API Versions.", + "isFixed": true, + "isFlags": false, + "usage": "ApiVersionEnum", + "decorators": [] + } + ], + "Models": [ + { + "$id": "88", + "kind": "model", + "name": "PlaywrightTestingAccountQuotas", + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.AccountQuota", + "usage": "Output,Json", + "doc": "A quota resource for a Playwright service account.", + "decorators": [], + "baseModel": { + "$id": "89", + "kind": "model", + "name": "ProxyResource", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ProxyResource", + "usage": "Output,Json", + "doc": "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location", + "decorators": [], + "baseModel": { + "$id": "90", + "kind": "model", + "name": "Resource", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Common fields that are returned in the response for all Azure Resource Manager resources", + "decorators": [], + "properties": [ + { + "$id": "91", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}", + "type": { + "$id": "92", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "93", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.id" + }, + { + "$id": "94", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the resource", + "type": { + "$id": "95", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.name" + }, + { + "$id": "96", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\"", + "type": { + "$id": "97", + "kind": "string", + "name": "armResourceType", + "crossLanguageDefinitionId": "Azure.Core.armResourceType", + "baseType": { + "$id": "98", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.type" + }, + { + "$id": "99", + "kind": "property", + "name": "systemData", + "serializedName": "systemData", + "doc": "Azure Resource Manager metadata containing createdBy and modifiedBy information.", + "type": { + "$id": "100", + "kind": "model", + "name": "SystemData", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData", + "usage": "Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Metadata pertaining to creation and last modification of the resource.", + "decorators": [], + "properties": [ + { + "$id": "101", + "kind": "property", + "name": "createdBy", + "serializedName": "createdBy", + "doc": "The identity that created the resource.", + "type": { + "$id": "102", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdBy" + }, + { + "$id": "103", + "kind": "property", + "name": "createdByType", + "serializedName": "createdByType", + "doc": "The type of identity that created the resource.", + "type": { + "$ref": "22" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdByType" + }, + { + "$id": "104", + "kind": "property", + "name": "createdAt", + "serializedName": "createdAt", + "doc": "The timestamp of resource creation (UTC).", + "type": { + "$id": "105", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "106", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdAt" + }, + { + "$id": "107", + "kind": "property", + "name": "lastModifiedBy", + "serializedName": "lastModifiedBy", + "doc": "The identity that last modified the resource.", + "type": { + "$id": "108", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedBy" + }, + { + "$id": "109", + "kind": "property", + "name": "lastModifiedByType", + "serializedName": "lastModifiedByType", + "doc": "The type of identity that last modified the resource.", + "type": { + "$ref": "22" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedByType" + }, + { + "$id": "110", + "kind": "property", + "name": "lastModifiedAt", + "serializedName": "lastModifiedAt", + "doc": "The timestamp of resource last modification (UTC)", + "type": { + "$id": "111", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "112", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedAt" + } + ] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.systemData" + } + ] + }, + "properties": [] + }, + "properties": [ + { + "$id": "113", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "114", + "kind": "model", + "name": "PlaywrightTestingAccountQuotaProperties", + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.AccountQuotaProperties", + "usage": "Output,Json", + "doc": "The Playwright service account quota resource properties.", + "decorators": [], + "properties": [ + { + "$id": "115", + "kind": "property", + "name": "freeTrial", + "serializedName": "freeTrial", + "doc": "The Playwright service account quota resource free-trial properties.", + "type": { + "$id": "116", + "kind": "model", + "name": "PlaywrightTestingAccountFreeTrialProperties", + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.AccountFreeTrialProperties", + "usage": "Output,Json", + "doc": "The Playwright service account quota resource free-trial properties.", + "decorators": [], + "properties": [ + { + "$id": "117", + "kind": "property", + "name": "createdAt", + "serializedName": "createdAt", + "doc": "The free-trial createdAt utcDateTime.", + "type": { + "$id": "118", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "119", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.AccountFreeTrialProperties.createdAt" + }, + { + "$id": "120", + "kind": "property", + "name": "expiryAt", + "serializedName": "expiryAt", + "doc": "The free-trial expiryAt utcDateTime.", + "type": { + "$id": "121", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "122", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.AccountFreeTrialProperties.expiryAt" + }, + { + "$id": "123", + "kind": "property", + "name": "allocatedValue", + "serializedName": "allocatedValue", + "doc": "The free-trial allocated limit value eg. allocated free minutes.", + "type": { + "$id": "124", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.AccountFreeTrialProperties.allocatedValue" + }, + { + "$id": "125", + "kind": "property", + "name": "usedValue", + "serializedName": "usedValue", + "doc": "The free-trial used value eg. used free minutes.", + "type": { + "$id": "126", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.AccountFreeTrialProperties.usedValue" + }, + { + "$id": "127", + "kind": "property", + "name": "percentageUsed", + "serializedName": "percentageUsed", + "doc": "The free-trial percentage used.", + "type": { + "$id": "128", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.AccountFreeTrialProperties.percentageUsed" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.AccountQuotaProperties.freeTrial" + }, + { + "$id": "129", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The status of the last operation.", + "type": { + "$ref": "8" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.AccountQuotaProperties.provisioningState" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.AccountQuota.properties" + } + ] + }, + { + "$ref": "114" + }, + { + "$ref": "116" + }, + { + "$ref": "89" + }, + { + "$ref": "90" + }, + { + "$ref": "100" + }, + { + "$id": "130", + "kind": "model", + "name": "ErrorResponse", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "usage": "Error,Json,Exception", + "doc": "Common error response for all Azure Resource Manager APIs to return error details for failed operations.", + "decorators": [], + "properties": [ + { + "$id": "131", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "The error object.", + "type": { + "$id": "132", + "kind": "model", + "name": "ErrorDetail", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "usage": "Json,Exception,LroPolling", + "doc": "The error detail.", + "decorators": [], + "properties": [ + { + "$id": "133", + "kind": "property", + "name": "code", + "serializedName": "code", + "doc": "The error code.", + "type": { + "$id": "134", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.code" + }, + { + "$id": "135", + "kind": "property", + "name": "message", + "serializedName": "message", + "doc": "The error message.", + "type": { + "$id": "136", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.message" + }, + { + "$id": "137", + "kind": "property", + "name": "target", + "serializedName": "target", + "doc": "The error target.", + "type": { + "$id": "138", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.target" + }, + { + "$id": "139", + "kind": "property", + "name": "details", + "serializedName": "details", + "doc": "The error details.", + "type": { + "$id": "140", + "kind": "array", + "name": "ArrayErrorDetail", + "valueType": { + "$ref": "132" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.details" + }, + { + "$id": "141", + "kind": "property", + "name": "additionalInfo", + "serializedName": "additionalInfo", + "doc": "The error additional info.", + "type": { + "$id": "142", + "kind": "array", + "name": "ArrayErrorAdditionalInfo", + "valueType": { + "$id": "143", + "kind": "model", + "name": "ErrorAdditionalInfo", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "usage": "Json,Exception,LroPolling", + "doc": "The resource management error additional info.", + "decorators": [], + "properties": [ + { + "$id": "144", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The additional info type.", + "type": { + "$id": "145", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.type" + }, + { + "$id": "146", + "kind": "property", + "name": "info", + "serializedName": "info", + "doc": "The additional info.", + "type": { + "$id": "147", + "kind": "model", + "name": "ErrorAdditionalInfoInfo", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.info.anonymous", + "usage": "Json,Exception,LroPolling", + "decorators": [], + "properties": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.info" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.additionalInfo" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse.error" + } + ] + }, + { + "$ref": "132" + }, + { + "$ref": "143" + }, + { + "$ref": "147" + }, + { + "$id": "148", + "kind": "model", + "name": "AccountQuotaListResult", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a AccountQuota list operation.", + "decorators": [], + "properties": [ + { + "$id": "149", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The AccountQuota items on this page", + "type": { + "$id": "150", + "kind": "array", + "name": "ArrayAccountQuota", + "valueType": { + "$ref": "88" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value" + }, + { + "$id": "151", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "152", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "153", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink" + } + ] + }, + { + "$id": "154", + "kind": "model", + "name": "PlaywrightTestingQuotas", + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.Quota", + "usage": "Output,Json", + "doc": "A subscription quota resource.", + "decorators": [], + "baseModel": { + "$ref": "89" + }, + "properties": [ + { + "$id": "155", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "156", + "kind": "model", + "name": "PlaywrightTestingQuotaProperties", + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.QuotaProperties", + "usage": "Output,Json", + "doc": "The subscription quota resource properties.", + "decorators": [], + "properties": [ + { + "$id": "157", + "kind": "property", + "name": "freeTrial", + "serializedName": "freeTrial", + "doc": "The subscription quota resource free-trial properties.", + "type": { + "$id": "158", + "kind": "model", + "name": "PlaywrightTestingFreeTrialProperties", + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.FreeTrialProperties", + "usage": "Output,Json", + "doc": "The subscription quota resource free-trial properties.", + "decorators": [], + "properties": [ + { + "$id": "159", + "kind": "property", + "name": "accountId", + "serializedName": "accountId", + "doc": "The Playwright service account id.", + "type": { + "$id": "160", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.FreeTrialProperties.accountId" + }, + { + "$id": "161", + "kind": "property", + "name": "state", + "serializedName": "state", + "doc": "The free-trial state.", + "type": { + "$ref": "32" + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.FreeTrialProperties.state" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.QuotaProperties.freeTrial" + }, + { + "$id": "162", + "kind": "property", + "name": "offeringType", + "serializedName": "offeringType", + "doc": "Indicates the offering type for the subscription.", + "type": { + "$ref": "42" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.QuotaProperties.offeringType" + }, + { + "$id": "163", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The status of the last operation.", + "type": { + "$ref": "8" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.QuotaProperties.provisioningState" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.Quota.properties" + } + ] + }, + { + "$ref": "156" + }, + { + "$ref": "158" + }, + { + "$id": "164", + "kind": "model", + "name": "QuotaListResult", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a Quota list operation.", + "decorators": [], + "properties": [ + { + "$id": "165", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The Quota items on this page", + "type": { + "$id": "166", + "kind": "array", + "name": "ArrayQuota", + "valueType": { + "$ref": "154" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value" + }, + { + "$id": "167", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "168", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "169", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink" + } + ] + }, + { + "$id": "170", + "kind": "model", + "name": "PlaywrightTestingAccount", + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.Account", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "A Playwright service account resource.", + "decorators": [], + "baseModel": { + "$id": "171", + "kind": "model", + "name": "TrackedResource", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'", + "decorators": [], + "baseModel": { + "$ref": "90" + }, + "properties": [ + { + "$id": "172", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "173", + "kind": "dict", + "keyType": { + "$id": "174", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "175", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource.tags" + }, + { + "$id": "176", + "kind": "property", + "name": "location", + "serializedName": "location", + "doc": "The geo-location where the resource lives", + "type": { + "$id": "177", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource.location" + } + ] + }, + "properties": [ + { + "$id": "178", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "179", + "kind": "model", + "name": "PlaywrightTestingAccountProperties", + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.AccountProperties", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Account resource properties.", + "decorators": [], + "properties": [ + { + "$id": "180", + "kind": "property", + "name": "dashboardUri", + "serializedName": "dashboardUri", + "doc": "The Playwright testing dashboard URI for the account resource.", + "type": { + "$id": "181", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.AccountProperties.dashboardUri" + }, + { + "$id": "182", + "kind": "property", + "name": "regionalAffinity", + "serializedName": "regionalAffinity", + "doc": "This property sets the connection region for Playwright client workers to cloud-hosted browsers. If enabled, workers connect to browsers in the closest Azure region, ensuring lower latency. If disabled, workers connect to browsers in the Azure region in which the workspace was initially created.", + "type": { + "$ref": "52" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.AccountProperties.regionalAffinity" + }, + { + "$id": "183", + "kind": "property", + "name": "scalableExecution", + "serializedName": "scalableExecution", + "doc": "When enabled, Playwright client workers can connect to cloud-hosted browsers. This can increase the number of parallel workers for a test run, significantly minimizing test completion durations.", + "type": { + "$ref": "52" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.AccountProperties.scalableExecution" + }, + { + "$id": "184", + "kind": "property", + "name": "reporting", + "serializedName": "reporting", + "doc": "When enabled, this feature allows the workspace to upload and display test results, including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting.", + "type": { + "$ref": "52" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.AccountProperties.reporting" + }, + { + "$id": "185", + "kind": "property", + "name": "localAuth", + "serializedName": "localAuth", + "doc": "When enabled, this feature allows the workspace to use local auth (through service access token) for executing operations.", + "type": { + "$ref": "52" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.AccountProperties.localAuth" + }, + { + "$id": "186", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The status of the last operation.", + "type": { + "$ref": "8" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.AccountProperties.provisioningState" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.Account.properties" + } + ] + }, + { + "$ref": "179" + }, + { + "$ref": "171" + }, + { + "$id": "187", + "kind": "model", + "name": "AccountUpdate", + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "usage": "Input,Json", + "doc": "The type used for update operations of the Account.", + "decorators": [], + "properties": [ + { + "$id": "188", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "189", + "kind": "dict", + "keyType": { + "$id": "190", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "191", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel.tags" + }, + { + "$id": "192", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "193", + "kind": "model", + "name": "AccountUpdateProperties", + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", + "usage": "Input,Json", + "doc": "The updatable properties of the Account.", + "decorators": [], + "properties": [ + { + "$id": "194", + "kind": "property", + "name": "regionalAffinity", + "serializedName": "regionalAffinity", + "doc": "This property sets the connection region for Playwright client workers to cloud-hosted browsers. If enabled, workers connect to browsers in the closest Azure region, ensuring lower latency. If disabled, workers connect to browsers in the Azure region in which the workspace was initially created.", + "type": { + "$ref": "52" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties.regionalAffinity" + }, + { + "$id": "195", + "kind": "property", + "name": "scalableExecution", + "serializedName": "scalableExecution", + "doc": "When enabled, Playwright client workers can connect to cloud-hosted browsers. This can increase the number of parallel workers for a test run, significantly minimizing test completion durations.", + "type": { + "$ref": "52" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties.scalableExecution" + }, + { + "$id": "196", + "kind": "property", + "name": "reporting", + "serializedName": "reporting", + "doc": "When enabled, this feature allows the workspace to upload and display test results, including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting.", + "type": { + "$ref": "52" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties.reporting" + }, + { + "$id": "197", + "kind": "property", + "name": "localAuth", + "serializedName": "localAuth", + "doc": "When enabled, this feature allows the workspace to use local auth (through service access token) for executing operations.", + "type": { + "$ref": "52" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties.localAuth" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel.properties" + } + ] + }, + { + "$ref": "193" + }, + { + "$id": "198", + "kind": "model", + "name": "ArmOperationStatusResourceProvisioningState", + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus", + "usage": "LroPolling", + "doc": "Standard Azure Resource Manager operation status response", + "decorators": [], + "properties": [ + { + "$id": "199", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The operation status", + "type": { + "$ref": "58" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.status" + }, + { + "$id": "200", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the operationStatus resource", + "type": { + "$id": "201", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.name" + }, + { + "$id": "202", + "kind": "property", + "name": "startTime", + "serializedName": "startTime", + "doc": "Operation start time", + "type": { + "$id": "203", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "204", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.startTime" + }, + { + "$id": "205", + "kind": "property", + "name": "endTime", + "serializedName": "endTime", + "doc": "Operation complete time", + "type": { + "$id": "206", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "207", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.endTime" + }, + { + "$id": "208", + "kind": "property", + "name": "percentComplete", + "serializedName": "percentComplete", + "doc": "The progress made toward completing the operation", + "type": { + "$id": "209", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.percentComplete" + }, + { + "$id": "210", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "Errors that occurred if the operation ended with Canceled or Failed status", + "type": { + "$ref": "132" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.error" + } + ] + }, + { + "$id": "211", + "kind": "model", + "name": "AccountListResult", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a Account list operation.", + "decorators": [], + "properties": [ + { + "$id": "212", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The Account items on this page", + "type": { + "$id": "213", + "kind": "array", + "name": "ArrayAccount", + "valueType": { + "$ref": "170" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value" + }, + { + "$id": "214", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "215", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "216", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink" + } + ] + }, + { + "$id": "217", + "kind": "model", + "name": "PlaywrightTestingNameAvailabilityRequest", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.CheckNameAvailabilityRequest", + "usage": "Input,Json", + "doc": "The check availability request body.", + "decorators": [], + "properties": [ + { + "$id": "218", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the resource for which availability needs to be checked.", + "type": { + "$id": "219", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.CheckNameAvailabilityRequest.name" + }, + { + "$id": "220", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The resource type.", + "type": { + "$id": "221", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.CheckNameAvailabilityRequest.type" + } + ] + }, + { + "$id": "222", + "kind": "model", + "name": "PlaywrightTestingNameAvailabilityResult", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.CheckNameAvailabilityResponse", + "usage": "Output,Json", + "doc": "The check availability result.", + "decorators": [], + "properties": [ + { + "$id": "223", + "kind": "property", + "name": "IsNameAvailable", + "serializedName": "nameAvailable", + "doc": "Indicates if the resource name is available.", + "type": { + "$id": "224", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.CheckNameAvailabilityResponse.nameAvailable" + }, + { + "$id": "225", + "kind": "property", + "name": "reason", + "serializedName": "reason", + "doc": "The reason why the given name is not available.", + "type": { + "$ref": "66" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.CheckNameAvailabilityResponse.reason" + }, + { + "$id": "226", + "kind": "property", + "name": "message", + "serializedName": "message", + "doc": "Detailed reason why the given name is not available.", + "type": { + "$id": "227", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.CheckNameAvailabilityResponse.message" + } + ] + }, + { + "$id": "228", + "kind": "model", + "name": "OperationListResult", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult", + "usage": "Output,Json", + "doc": "A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.", + "decorators": [], + "properties": [ + { + "$id": "229", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The Operation items on this page", + "type": { + "$id": "230", + "kind": "array", + "name": "ArrayOperation", + "valueType": { + "$id": "231", + "kind": "model", + "name": "Operation", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation", + "usage": "Output,Json", + "doc": "Details of a REST API operation, returned from the Resource Provider Operations API", + "decorators": [], + "properties": [ + { + "$id": "232", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the operation, as per Resource-Based Access Control (RBAC). Examples: \"Microsoft.Compute/virtualMachines/write\", \"Microsoft.Compute/virtualMachines/capture/action\"", + "type": { + "$id": "233", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.name" + }, + { + "$id": "234", + "kind": "property", + "name": "isDataAction", + "serializedName": "isDataAction", + "doc": "Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for Azure Resource Manager/control-plane operations.", + "type": { + "$id": "235", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.isDataAction" + }, + { + "$id": "236", + "kind": "property", + "name": "display", + "serializedName": "display", + "doc": "Localized display information for this particular operation.", + "type": { + "$id": "237", + "kind": "model", + "name": "OperationDisplay", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "usage": "Output,Json", + "doc": "Localized display information for and operation.", + "decorators": [], + "properties": [ + { + "$id": "238", + "kind": "property", + "name": "provider", + "serializedName": "provider", + "doc": "The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring Insights\" or \"Microsoft Compute\".", + "type": { + "$id": "239", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.provider" + }, + { + "$id": "240", + "kind": "property", + "name": "resource", + "serializedName": "resource", + "doc": "The localized friendly name of the resource type related to this operation. E.g. \"Virtual Machines\" or \"Job Schedule Collections\".", + "type": { + "$id": "241", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.resource" + }, + { + "$id": "242", + "kind": "property", + "name": "operation", + "serializedName": "operation", + "doc": "The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create or Update Virtual Machine\", \"Restart Virtual Machine\".", + "type": { + "$id": "243", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.operation" + }, + { + "$id": "244", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "The short, localized friendly description of the operation; suitable for tool tips and detailed views.", + "type": { + "$id": "245", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.description" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.display" + }, + { + "$id": "246", + "kind": "property", + "name": "origin", + "serializedName": "origin", + "doc": "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\"", + "type": { + "$ref": "72" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.origin" + }, + { + "$id": "247", + "kind": "property", + "name": "actionType", + "serializedName": "actionType", + "doc": "Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs.", + "type": { + "$ref": "80" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.actionType" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult.value" + }, + { + "$id": "248", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "249", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "250", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult.nextLink" + } + ] + }, + { + "$ref": "231" + }, + { + "$ref": "237" + } + ], + "Clients": [ + { + "$id": "251", + "Name": "AzurePlaywrightServiceClient", + "Doc": "Microsoft.AzurePlaywrightService Resource Provider Management API.", + "Operations": [], + "Protocol": { + "$id": "252" + }, + "Parameters": [ + { + "$id": "253", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "254", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "255", + "Type": { + "$id": "256", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "257", + "Name": "Operations", + "Operations": [ + { + "$id": "258", + "Name": "list", + "ResourceName": "Operations", + "Doc": "List the operations for the provider", + "Accessibility": "public", + "Parameters": [ + { + "$id": "259", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "260", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "261", + "Type": { + "$id": "262", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-12-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "263", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "264", + "kind": "constant", + "valueType": { + "$id": "265", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "266", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "228" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/providers/Microsoft.AzurePlaywrightService/operations", + "BufferResponse": true, + "Paging": { + "$id": "267", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Azure.ResourceManager.Operations.list", + "Decorators": [], + "Examples": [ + { + "$id": "268", + "kind": "http", + "name": "Operations_List", + "description": "Operations_List", + "filePath": "2024-12-01/Operations_List.json", + "parameters": [ + { + "$id": "269", + "parameter": { + "$ref": "259" + }, + "value": { + "$id": "270", + "kind": "string", + "type": { + "$ref": "260" + }, + "value": "2024-12-01" + } + } + ], + "responses": [ + { + "$id": "271", + "response": { + "$ref": "266" + }, + "statusCode": 200, + "bodyValue": { + "$id": "272", + "kind": "model", + "type": { + "$ref": "228" + }, + "value": { + "$id": "273", + "value": { + "$id": "274", + "kind": "array", + "type": { + "$ref": "230" + }, + "value": [ + { + "$id": "275", + "kind": "model", + "type": { + "$ref": "231" + }, + "value": { + "$id": "276", + "name": { + "$id": "277", + "kind": "string", + "type": { + "$ref": "233" + }, + "value": "Microsoft.AzurePlaywrightService/accounts/Write" + }, + "isDataAction": { + "$id": "278", + "kind": "boolean", + "type": { + "$ref": "235" + }, + "value": false + }, + "display": { + "$id": "279", + "kind": "model", + "type": { + "$ref": "237" + }, + "value": { + "$id": "280", + "provider": { + "$id": "281", + "kind": "string", + "type": { + "$ref": "239" + }, + "value": "Microsoft.AzurePlaywrightService" + }, + "resource": { + "$id": "282", + "kind": "string", + "type": { + "$ref": "241" + }, + "value": "accounts" + }, + "operation": { + "$id": "283", + "kind": "string", + "type": { + "$ref": "243" + }, + "value": "Creates or updates the PlaywrightAccounts" + }, + "description": { + "$id": "284", + "kind": "string", + "type": { + "$ref": "245" + }, + "value": "Set PlaywrightAccounts" + } + } + } + } + }, + { + "$id": "285", + "kind": "model", + "type": { + "$ref": "231" + }, + "value": { + "$id": "286", + "name": { + "$id": "287", + "kind": "string", + "type": { + "$ref": "233" + }, + "value": "Microsoft.AzurePlaywrightService/accounts/Delete" + }, + "isDataAction": { + "$id": "288", + "kind": "boolean", + "type": { + "$ref": "235" + }, + "value": false + }, + "display": { + "$id": "289", + "kind": "model", + "type": { + "$ref": "237" + }, + "value": { + "$id": "290", + "provider": { + "$id": "291", + "kind": "string", + "type": { + "$ref": "239" + }, + "value": "Microsoft.AzurePlaywrightService" + }, + "resource": { + "$id": "292", + "kind": "string", + "type": { + "$ref": "241" + }, + "value": "accounts" + }, + "operation": { + "$id": "293", + "kind": "string", + "type": { + "$ref": "243" + }, + "value": "Deletes the PlaywrightAccounts" + }, + "description": { + "$id": "294", + "kind": "string", + "type": { + "$ref": "245" + }, + "value": "Delete PlaywrightAccounts" + } + } + } + } + }, + { + "$id": "295", + "kind": "model", + "type": { + "$ref": "231" + }, + "value": { + "$id": "296", + "name": { + "$id": "297", + "kind": "string", + "type": { + "$ref": "233" + }, + "value": "Microsoft.AzurePlaywrightService/accounts/Read" + }, + "isDataAction": { + "$id": "298", + "kind": "boolean", + "type": { + "$ref": "235" + }, + "value": false + }, + "display": { + "$id": "299", + "kind": "model", + "type": { + "$ref": "237" + }, + "value": { + "$id": "300", + "provider": { + "$id": "301", + "kind": "string", + "type": { + "$ref": "239" + }, + "value": "Microsoft.AzurePlaywrightService" + }, + "resource": { + "$id": "302", + "kind": "string", + "type": { + "$ref": "241" + }, + "value": "accounts" + }, + "operation": { + "$id": "303", + "kind": "string", + "type": { + "$ref": "243" + }, + "value": "Reads the PlaywrightAccounts" + }, + "description": { + "$id": "304", + "kind": "string", + "type": { + "$ref": "245" + }, + "value": "Read PlaywrightAccounts" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "305", + "kind": "string", + "type": { + "$ref": "249" + }, + "value": "http://nextlink.contoso.com" + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "306" + }, + "Parent": "AzurePlaywrightServiceClient", + "Parameters": [ + { + "$id": "307", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "308", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "309", + "Type": { + "$id": "310", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "311", + "Name": "Accounts", + "Operations": [ + { + "$id": "312", + "Name": "get", + "ResourceName": "Account", + "Doc": "Get a Account", + "Accessibility": "public", + "Parameters": [ + { + "$id": "313", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "314", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "315", + "Type": { + "$id": "316", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-12-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "317", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "318", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "319", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "320", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "321", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "322", + "Name": "accountName", + "NameInRequest": "accountName", + "Doc": "Name of account.", + "Type": { + "$id": "323", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "324", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "325", + "kind": "constant", + "valueType": { + "$id": "326", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "327", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "170" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Azure.ResourceManager.Accounts.get", + "Decorators": [] + }, + { + "$id": "328", + "Name": "createOrUpdate", + "ResourceName": "Account", + "Doc": "Create a Account", + "Accessibility": "public", + "Parameters": [ + { + "$id": "329", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "330", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "331", + "Type": { + "$id": "332", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-12-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "333", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "334", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "335", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "336", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "337", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "338", + "Name": "accountName", + "NameInRequest": "accountName", + "Doc": "Name of account.", + "Type": { + "$id": "339", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "340", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "341", + "kind": "constant", + "valueType": { + "$id": "342", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "343", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "344", + "kind": "constant", + "valueType": { + "$id": "345", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "346", + "Name": "resource", + "NameInRequest": "resource", + "Doc": "Resource create parameters.", + "Type": { + "$ref": "170" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "347", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "170" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + }, + { + "$id": "348", + "StatusCodes": [ + 201 + ], + "BodyType": { + "$ref": "170" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "349", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "350", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "351", + "FinalStateVia": 0, + "FinalResponse": { + "$id": "352", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "170" + }, + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.Accounts.createOrUpdate", + "Decorators": [ + { + "$id": "353", + "name": "Azure.Core.@useFinalStateVia", + "arguments": { + "$id": "354", + "finalState": "azure-async-operation" + } + } + ], + "Examples": [ + { + "$id": "355", + "kind": "http", + "name": "Accounts_CreateOrUpdate", + "description": "Accounts_CreateOrUpdate", + "filePath": "2024-12-01/Accounts_CreateOrUpdate.json", + "parameters": [ + { + "$id": "356", + "parameter": { + "$ref": "329" + }, + "value": { + "$id": "357", + "kind": "string", + "type": { + "$ref": "330" + }, + "value": "2024-12-01" + } + }, + { + "$id": "358", + "parameter": { + "$ref": "333" + }, + "value": { + "$id": "359", + "kind": "string", + "type": { + "$ref": "334" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + }, + { + "$id": "360", + "parameter": { + "$ref": "336" + }, + "value": { + "$id": "361", + "kind": "string", + "type": { + "$ref": "337" + }, + "value": "dummyrg" + } + }, + { + "$id": "362", + "parameter": { + "$ref": "338" + }, + "value": { + "$id": "363", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "myPlaywrightAccount" + } + }, + { + "$id": "364", + "parameter": { + "$ref": "346" + }, + "value": { + "$id": "365", + "kind": "model", + "type": { + "$ref": "170" + }, + "value": { + "$id": "366", + "location": { + "$id": "367", + "kind": "string", + "type": { + "$ref": "177" + }, + "value": "westus" + }, + "tags": { + "$id": "368", + "kind": "dict", + "type": { + "$ref": "173" + }, + "value": { + "$id": "369", + "Team": { + "$id": "370", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "Dev Exp" + } + } + }, + "properties": { + "$id": "371", + "kind": "model", + "type": { + "$ref": "179" + }, + "value": { + "$id": "372", + "regionalAffinity": { + "$id": "373", + "kind": "string", + "type": { + "$ref": "52" + }, + "value": "Enabled" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "374", + "response": { + "$ref": "347" + }, + "statusCode": 200, + "bodyValue": { + "$id": "375", + "kind": "model", + "type": { + "$ref": "170" + }, + "value": { + "$id": "376", + "location": { + "$id": "377", + "kind": "string", + "type": { + "$ref": "177" + }, + "value": "westus" + }, + "properties": { + "$id": "378", + "kind": "model", + "type": { + "$ref": "179" + }, + "value": { + "$id": "379", + "dashboardUri": { + "$id": "380", + "kind": "string", + "type": { + "$ref": "181" + }, + "value": "https://dashboard.00000000-0000-0000-0000-000000000000.domain.com" + }, + "provisioningState": { + "$id": "381", + "kind": "string", + "type": { + "$ref": "8" + }, + "value": "Succeeded" + }, + "regionalAffinity": { + "$id": "382", + "kind": "string", + "type": { + "$ref": "52" + }, + "value": "Enabled" + }, + "scalableExecution": { + "$id": "383", + "kind": "string", + "type": { + "$ref": "52" + }, + "value": "Enabled" + }, + "reporting": { + "$id": "384", + "kind": "string", + "type": { + "$ref": "52" + }, + "value": "Enabled" + }, + "localAuth": { + "$id": "385", + "kind": "string", + "type": { + "$ref": "52" + }, + "value": "Enabled" + } + } + }, + "id": { + "$id": "386", + "kind": "string", + "type": { + "$ref": "92" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.AzurePlaywrightService/accounts/myPlaywrightAccount" + }, + "name": { + "$id": "387", + "kind": "string", + "type": { + "$id": "388", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "myPlaywrightAccount" + }, + "type": { + "$id": "389", + "kind": "string", + "type": { + "$ref": "97" + }, + "value": "Microsoft.AzurePlaywrightService/accounts" + }, + "tags": { + "$id": "390", + "kind": "dict", + "type": { + "$ref": "173" + }, + "value": { + "$id": "391", + "Team": { + "$id": "392", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "Dev Exp" + } + } + }, + "systemData": { + "$id": "393", + "kind": "model", + "type": { + "$ref": "100" + }, + "value": { + "$id": "394", + "createdBy": { + "$id": "395", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "userId1001" + }, + "createdByType": { + "$id": "396", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "User" + }, + "createdAt": { + "$id": "397", + "kind": "string", + "type": { + "$ref": "105" + }, + "value": "2021-09-28T12:32:33Z" + }, + "lastModifiedBy": { + "$id": "398", + "kind": "string", + "type": { + "$ref": "108" + }, + "value": "userId1001" + }, + "lastModifiedByType": { + "$id": "399", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "400", + "kind": "string", + "type": { + "$ref": "111" + }, + "value": "2021-09-28T12:32:33Z" + } + } + } + } + } + }, + { + "$id": "401", + "response": { + "$ref": "348" + }, + "statusCode": 201, + "bodyValue": { + "$id": "402", + "kind": "model", + "type": { + "$ref": "170" + }, + "value": { + "$id": "403", + "location": { + "$id": "404", + "kind": "string", + "type": { + "$ref": "177" + }, + "value": "westus" + }, + "properties": { + "$id": "405", + "kind": "model", + "type": { + "$ref": "179" + }, + "value": { + "$id": "406", + "dashboardUri": { + "$id": "407", + "kind": "string", + "type": { + "$ref": "181" + }, + "value": "https://dashboard.00000000-0000-0000-0000-000000000000.domain.com" + }, + "provisioningState": { + "$id": "408", + "kind": "string", + "type": { + "$ref": "8" + }, + "value": "Succeeded" + }, + "regionalAffinity": { + "$id": "409", + "kind": "string", + "type": { + "$ref": "52" + }, + "value": "Enabled" + }, + "scalableExecution": { + "$id": "410", + "kind": "string", + "type": { + "$ref": "52" + }, + "value": "Enabled" + }, + "reporting": { + "$id": "411", + "kind": "string", + "type": { + "$ref": "52" + }, + "value": "Enabled" + }, + "localAuth": { + "$id": "412", + "kind": "string", + "type": { + "$ref": "52" + }, + "value": "Enabled" + } + } + }, + "id": { + "$id": "413", + "kind": "string", + "type": { + "$ref": "92" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.AzurePlaywrightService/accounts/myPlaywrightAccount" + }, + "name": { + "$id": "414", + "kind": "string", + "type": { + "$ref": "388" + }, + "value": "myPlaywrightAccount" + }, + "type": { + "$id": "415", + "kind": "string", + "type": { + "$ref": "97" + }, + "value": "Microsoft.AzurePlaywrightService/accounts" + }, + "tags": { + "$id": "416", + "kind": "dict", + "type": { + "$ref": "173" + }, + "value": { + "$id": "417", + "Team": { + "$id": "418", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "Dev Exp" + } + } + }, + "systemData": { + "$id": "419", + "kind": "model", + "type": { + "$ref": "100" + }, + "value": { + "$id": "420", + "createdBy": { + "$id": "421", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "userId1001" + }, + "createdByType": { + "$id": "422", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "User" + }, + "createdAt": { + "$id": "423", + "kind": "string", + "type": { + "$ref": "105" + }, + "value": "2021-09-28T12:32:33Z" + }, + "lastModifiedBy": { + "$id": "424", + "kind": "string", + "type": { + "$ref": "108" + }, + "value": "userId1001" + }, + "lastModifiedByType": { + "$id": "425", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "426", + "kind": "string", + "type": { + "$ref": "111" + }, + "value": "2021-09-28T12:32:33Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "427", + "Name": "update", + "ResourceName": "Account", + "Doc": "Update a Account", + "Accessibility": "public", + "Parameters": [ + { + "$id": "428", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "429", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "430", + "Type": { + "$id": "431", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-12-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "432", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "433", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "434", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "435", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "436", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "437", + "Name": "accountName", + "NameInRequest": "accountName", + "Doc": "Name of account.", + "Type": { + "$id": "438", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "439", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "440", + "kind": "constant", + "valueType": { + "$id": "441", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "442", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "443", + "kind": "constant", + "valueType": { + "$id": "444", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "445", + "Name": "properties", + "NameInRequest": "properties", + "Doc": "The resource properties to be updated.", + "Type": { + "$ref": "187" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "446", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "170" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.Accounts.update", + "Decorators": [], + "Examples": [ + { + "$id": "447", + "kind": "http", + "name": "Accounts_Update", + "description": "Accounts_Update", + "filePath": "2024-12-01/Accounts_Update.json", + "parameters": [ + { + "$id": "448", + "parameter": { + "$ref": "428" + }, + "value": { + "$id": "449", + "kind": "string", + "type": { + "$ref": "429" + }, + "value": "2024-12-01" + } + }, + { + "$id": "450", + "parameter": { + "$ref": "432" + }, + "value": { + "$id": "451", + "kind": "string", + "type": { + "$ref": "433" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + }, + { + "$id": "452", + "parameter": { + "$ref": "435" + }, + "value": { + "$id": "453", + "kind": "string", + "type": { + "$ref": "436" + }, + "value": "dummyrg" + } + }, + { + "$id": "454", + "parameter": { + "$ref": "437" + }, + "value": { + "$id": "455", + "kind": "string", + "type": { + "$ref": "438" + }, + "value": "myPlaywrightAccount" + } + }, + { + "$id": "456", + "parameter": { + "$ref": "445" + }, + "value": { + "$id": "457", + "kind": "model", + "type": { + "$ref": "187" + }, + "value": { + "$id": "458", + "tags": { + "$id": "459", + "kind": "dict", + "type": { + "$ref": "189" + }, + "value": { + "$id": "460", + "Team": { + "$id": "461", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "Dev Exp" + }, + "Division": { + "$id": "462", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "LT" + } + } + }, + "properties": { + "$id": "463", + "kind": "model", + "type": { + "$ref": "193" + }, + "value": { + "$id": "464", + "regionalAffinity": { + "$id": "465", + "kind": "string", + "type": { + "$ref": "52" + }, + "value": "Enabled" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "466", + "response": { + "$ref": "446" + }, + "statusCode": 200, + "bodyValue": { + "$id": "467", + "kind": "model", + "type": { + "$ref": "170" + }, + "value": { + "$id": "468", + "location": { + "$id": "469", + "kind": "string", + "type": { + "$ref": "177" + }, + "value": "westus" + }, + "properties": { + "$id": "470", + "kind": "model", + "type": { + "$ref": "179" + }, + "value": { + "$id": "471", + "dashboardUri": { + "$id": "472", + "kind": "string", + "type": { + "$ref": "181" + }, + "value": "https://dashboard.00000000-0000-0000-0000-000000000000.domain.com" + }, + "provisioningState": { + "$id": "473", + "kind": "string", + "type": { + "$ref": "8" + }, + "value": "Succeeded" + }, + "regionalAffinity": { + "$id": "474", + "kind": "string", + "type": { + "$ref": "52" + }, + "value": "Enabled" + }, + "scalableExecution": { + "$id": "475", + "kind": "string", + "type": { + "$ref": "52" + }, + "value": "Enabled" + }, + "reporting": { + "$id": "476", + "kind": "string", + "type": { + "$ref": "52" + }, + "value": "Enabled" + }, + "localAuth": { + "$id": "477", + "kind": "string", + "type": { + "$ref": "52" + }, + "value": "Enabled" + } + } + }, + "id": { + "$id": "478", + "kind": "string", + "type": { + "$ref": "92" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.AzurePlaywrightService/accounts/myPlaywrightAccount" + }, + "name": { + "$id": "479", + "kind": "string", + "type": { + "$ref": "388" + }, + "value": "myPlaywrightAccount" + }, + "type": { + "$id": "480", + "kind": "string", + "type": { + "$ref": "97" + }, + "value": "Microsoft.AzurePlaywrightService/accounts" + }, + "tags": { + "$id": "481", + "kind": "dict", + "type": { + "$ref": "173" + }, + "value": { + "$id": "482", + "Team": { + "$id": "483", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "Dev Exp" + } + } + }, + "systemData": { + "$id": "484", + "kind": "model", + "type": { + "$ref": "100" + }, + "value": { + "$id": "485", + "createdBy": { + "$id": "486", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "userId1001" + }, + "createdByType": { + "$id": "487", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "User" + }, + "createdAt": { + "$id": "488", + "kind": "string", + "type": { + "$ref": "105" + }, + "value": "2021-09-28T12:32:33Z" + }, + "lastModifiedBy": { + "$id": "489", + "kind": "string", + "type": { + "$ref": "108" + }, + "value": "userId1001" + }, + "lastModifiedByType": { + "$id": "490", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "491", + "kind": "string", + "type": { + "$ref": "111" + }, + "value": "2021-09-28T12:32:33Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "492", + "Name": "delete", + "ResourceName": "Account", + "Doc": "Delete a Account", + "Accessibility": "public", + "Parameters": [ + { + "$id": "493", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "494", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "495", + "Type": { + "$id": "496", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-12-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "497", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "498", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "499", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "500", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "501", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "502", + "Name": "accountName", + "NameInRequest": "accountName", + "Doc": "Name of account.", + "Type": { + "$id": "503", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "504", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "505", + "kind": "constant", + "valueType": { + "$id": "506", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "507", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "508", + "Name": "location", + "NameInResponse": "Location", + "Doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "Type": { + "$id": "509", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "510", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "511", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false + }, + { + "$id": "512", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "DELETE", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}", + "BufferResponse": true, + "LongRunning": { + "$id": "513", + "FinalStateVia": 1, + "FinalResponse": { + "$id": "514", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.Accounts.delete", + "Decorators": [], + "Examples": [ + { + "$id": "515", + "kind": "http", + "name": "Accounts_Delete", + "description": "Accounts_Delete", + "filePath": "2024-12-01/Accounts_Delete.json", + "parameters": [ + { + "$id": "516", + "parameter": { + "$ref": "493" + }, + "value": { + "$id": "517", + "kind": "string", + "type": { + "$ref": "494" + }, + "value": "2024-12-01" + } + }, + { + "$id": "518", + "parameter": { + "$ref": "497" + }, + "value": { + "$id": "519", + "kind": "string", + "type": { + "$ref": "498" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + }, + { + "$id": "520", + "parameter": { + "$ref": "500" + }, + "value": { + "$id": "521", + "kind": "string", + "type": { + "$ref": "501" + }, + "value": "dummyrg" + } + }, + { + "$id": "522", + "parameter": { + "$ref": "502" + }, + "value": { + "$id": "523", + "kind": "string", + "type": { + "$ref": "503" + }, + "value": "myPlaywrightAccount" + } + } + ], + "responses": [ + { + "$id": "524", + "response": { + "$ref": "507" + }, + "statusCode": 202 + }, + { + "$id": "525", + "response": { + "$ref": "512" + }, + "statusCode": 204 + } + ] + } + ] + }, + { + "$id": "526", + "Name": "listByResourceGroup", + "ResourceName": "Account", + "Doc": "List Account resources by resource group", + "Accessibility": "public", + "Parameters": [ + { + "$id": "527", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "528", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "529", + "Type": { + "$id": "530", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-12-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "531", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "532", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "533", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "534", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "535", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "536", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "537", + "kind": "constant", + "valueType": { + "$id": "538", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "539", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "211" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts", + "BufferResponse": true, + "Paging": { + "$id": "540", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Azure.ResourceManager.Accounts.listByResourceGroup", + "Decorators": [] + }, + { + "$id": "541", + "Name": "listBySubscription", + "ResourceName": "Account", + "Doc": "List Account resources by subscription ID", + "Accessibility": "public", + "Parameters": [ + { + "$id": "542", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "543", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "544", + "Type": { + "$id": "545", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-12-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "546", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "547", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "548", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "549", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "550", + "kind": "constant", + "valueType": { + "$id": "551", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "552", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "211" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/accounts", + "BufferResponse": true, + "Paging": { + "$id": "553", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Azure.ResourceManager.Accounts.listBySubscription", + "Decorators": [] + }, + { + "$id": "554", + "Name": "CheckPlaywrightTestingNameAvailability", + "ResourceName": "Accounts", + "Doc": "Adds check global name availability operation, normally used if a resource name must be globally unique.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "555", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "556", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "557", + "Type": { + "$id": "558", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-12-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "559", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "560", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "561", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "562", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "563", + "kind": "constant", + "valueType": { + "$id": "564", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "565", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "566", + "kind": "constant", + "valueType": { + "$id": "567", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "568", + "Name": "body", + "NameInRequest": "body", + "Doc": "The CheckAvailability request", + "Type": { + "$ref": "217" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "569", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "222" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/checkNameAvailability", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.Accounts.checkNameAvailability", + "Decorators": [], + "Examples": [ + { + "$id": "570", + "kind": "http", + "name": "Accounts_CheckNameAvailability", + "description": "Accounts_CheckNameAvailability", + "filePath": "2024-12-01/Accounts_CheckNameAvailability.json", + "parameters": [ + { + "$id": "571", + "parameter": { + "$ref": "555" + }, + "value": { + "$id": "572", + "kind": "string", + "type": { + "$ref": "556" + }, + "value": "2024-12-01" + } + }, + { + "$id": "573", + "parameter": { + "$ref": "559" + }, + "value": { + "$id": "574", + "kind": "string", + "type": { + "$ref": "560" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + }, + { + "$id": "575", + "parameter": { + "$ref": "568" + }, + "value": { + "$id": "576", + "kind": "model", + "type": { + "$ref": "217" + }, + "value": { + "$id": "577", + "name": { + "$id": "578", + "kind": "string", + "type": { + "$ref": "219" + }, + "value": "dummyName" + }, + "type": { + "$id": "579", + "kind": "string", + "type": { + "$ref": "221" + }, + "value": "Microsoft.AzurePlaywrightService/Accounts" + } + } + } + } + ], + "responses": [ + { + "$id": "580", + "response": { + "$ref": "569" + }, + "statusCode": 200, + "bodyValue": { + "$id": "581", + "kind": "model", + "type": { + "$ref": "222" + }, + "value": { + "$id": "582", + "nameAvailable": { + "$id": "583", + "kind": "boolean", + "type": { + "$ref": "224" + }, + "value": true + }, + "message": { + "$id": "584", + "kind": "string", + "type": { + "$ref": "227" + }, + "value": "Test message." + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "585" + }, + "Parent": "AzurePlaywrightServiceClient", + "Parameters": [ + { + "$id": "586", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "587", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "588", + "Type": { + "$id": "589", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "590", + "Name": "Quotas", + "Operations": [ + { + "$id": "591", + "Name": "get", + "ResourceName": "Quota", + "Doc": "Get subscription quota by name.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "592", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "593", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "594", + "Type": { + "$id": "595", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-12-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "596", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "597", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "598", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "599", + "Name": "location", + "NameInRequest": "location", + "Doc": "The location of quota in ARM Normalized format like eastus, southeastasia etc.", + "Type": { + "$id": "600", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "601", + "Name": "quotaName", + "NameInRequest": "quotaName", + "Doc": "The quota name.", + "Type": { + "$ref": "2" + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "602", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "603", + "kind": "constant", + "valueType": { + "$id": "604", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "605", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "154" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{quotaName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.Quotas.get", + "Decorators": [], + "Examples": [ + { + "$id": "606", + "kind": "http", + "name": "Quotas_Get", + "description": "Quotas_Get", + "filePath": "2024-12-01/Quotas_Get.json", + "parameters": [ + { + "$id": "607", + "parameter": { + "$ref": "592" + }, + "value": { + "$id": "608", + "kind": "string", + "type": { + "$ref": "593" + }, + "value": "2024-12-01" + } + }, + { + "$id": "609", + "parameter": { + "$ref": "596" + }, + "value": { + "$id": "610", + "kind": "string", + "type": { + "$ref": "597" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + }, + { + "$id": "611", + "parameter": { + "$ref": "599" + }, + "value": { + "$id": "612", + "kind": "string", + "type": { + "$ref": "600" + }, + "value": "eastus" + } + }, + { + "$id": "613", + "parameter": { + "$ref": "601" + }, + "value": { + "$id": "614", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "ScalableExecution" + } + } + ], + "responses": [ + { + "$id": "615", + "response": { + "$ref": "605" + }, + "statusCode": 200, + "bodyValue": { + "$id": "616", + "kind": "model", + "type": { + "$ref": "154" + }, + "value": { + "$id": "617", + "id": { + "$id": "618", + "kind": "string", + "type": { + "$ref": "92" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzurePlaywrightService/locations/eastus/quotas/ScalableExecution" + }, + "name": { + "$id": "619", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "ScalableExecution" + }, + "type": { + "$id": "620", + "kind": "string", + "type": { + "$ref": "97" + }, + "value": "Microsoft.AzurePlaywrightService/Locations/Quotas" + }, + "properties": { + "$id": "621", + "kind": "model", + "type": { + "$ref": "156" + }, + "value": { + "$id": "622", + "freeTrial": { + "$id": "623", + "kind": "model", + "type": { + "$ref": "158" + }, + "value": { + "$id": "624", + "accountId": { + "$id": "625", + "kind": "string", + "type": { + "$ref": "160" + }, + "value": "3fa85f64-5717-4562-b3fc-2c963f66afa6" + }, + "state": { + "$id": "626", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "Active" + } + } + }, + "offeringType": { + "$id": "627", + "kind": "string", + "type": { + "$ref": "42" + }, + "value": "NotApplicable" + }, + "provisioningState": { + "$id": "628", + "kind": "string", + "type": { + "$ref": "8" + }, + "value": "Succeeded" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "629", + "Name": "listBySubscription", + "ResourceName": "Quota", + "Doc": "List quotas for a given subscription Id.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "630", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "631", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "632", + "Type": { + "$id": "633", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-12-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "634", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "635", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "636", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "637", + "Name": "location", + "NameInRequest": "location", + "Doc": "The location of quota in ARM Normalized format like eastus, southeastasia etc.", + "Type": { + "$id": "638", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "639", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "640", + "kind": "constant", + "valueType": { + "$id": "641", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "642", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "164" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas", + "BufferResponse": true, + "Paging": { + "$id": "643", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.Quotas.listBySubscription", + "Decorators": [], + "Examples": [ + { + "$id": "644", + "kind": "http", + "name": "Quotas_ListBySubscription", + "description": "Quotas_ListBySubscription", + "filePath": "2024-12-01/Quotas_ListBySubscription.json", + "parameters": [ + { + "$id": "645", + "parameter": { + "$ref": "630" + }, + "value": { + "$id": "646", + "kind": "string", + "type": { + "$ref": "631" + }, + "value": "2024-12-01" + } + }, + { + "$id": "647", + "parameter": { + "$ref": "634" + }, + "value": { + "$id": "648", + "kind": "string", + "type": { + "$ref": "635" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + }, + { + "$id": "649", + "parameter": { + "$ref": "637" + }, + "value": { + "$id": "650", + "kind": "string", + "type": { + "$ref": "638" + }, + "value": "eastus" + } + } + ], + "responses": [ + { + "$id": "651", + "response": { + "$ref": "642" + }, + "statusCode": 200, + "bodyValue": { + "$id": "652", + "kind": "model", + "type": { + "$ref": "164" + }, + "value": { + "$id": "653", + "value": { + "$id": "654", + "kind": "array", + "type": { + "$ref": "166" + }, + "value": [ + { + "$id": "655", + "kind": "model", + "type": { + "$ref": "154" + }, + "value": { + "$id": "656", + "properties": { + "$id": "657", + "kind": "model", + "type": { + "$ref": "156" + }, + "value": { + "$id": "658", + "freeTrial": { + "$id": "659", + "kind": "model", + "type": { + "$ref": "158" + }, + "value": { + "$id": "660", + "accountId": { + "$id": "661", + "kind": "string", + "type": { + "$ref": "160" + }, + "value": "3fa85f64-5717-4562-b3fc-2c963f66afa6" + }, + "state": { + "$id": "662", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "Active" + } + } + }, + "offeringType": { + "$id": "663", + "kind": "string", + "type": { + "$ref": "42" + }, + "value": "NotApplicable" + }, + "provisioningState": { + "$id": "664", + "kind": "string", + "type": { + "$ref": "8" + }, + "value": "Succeeded" + } + } + }, + "id": { + "$id": "665", + "kind": "string", + "type": { + "$ref": "92" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzurePlaywrightService/locations/eastus/quotas/ScalableExecution" + }, + "name": { + "$id": "666", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "ScalableExecution" + }, + "type": { + "$id": "667", + "kind": "string", + "type": { + "$ref": "97" + }, + "value": "Microsoft.AzurePlaywrightService/Locations/Quotas" + } + } + }, + { + "$id": "668", + "kind": "model", + "type": { + "$ref": "154" + }, + "value": { + "$id": "669", + "properties": { + "$id": "670", + "kind": "model", + "type": { + "$ref": "156" + }, + "value": { + "$id": "671", + "freeTrial": { + "$id": "672", + "kind": "model", + "type": { + "$ref": "158" + }, + "value": { + "$id": "673", + "accountId": { + "$id": "674", + "kind": "string", + "type": { + "$ref": "160" + }, + "value": "3fa85f64-5717-4562-b3fc-2c963f66afa6" + }, + "state": { + "$id": "675", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "Active" + } + } + }, + "offeringType": { + "$id": "676", + "kind": "string", + "type": { + "$ref": "42" + }, + "value": "PrivatePreview" + }, + "provisioningState": { + "$id": "677", + "kind": "string", + "type": { + "$ref": "8" + }, + "value": "Succeeded" + } + } + }, + "id": { + "$id": "678", + "kind": "string", + "type": { + "$ref": "92" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzurePlaywrightService/locations/eastus/quotas/Reporting" + }, + "name": { + "$id": "679", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Reporting" + }, + "type": { + "$id": "680", + "kind": "string", + "type": { + "$ref": "97" + }, + "value": "Microsoft.AzurePlaywrightService/Locations/Quotas" + } + } + } + ] + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "681" + }, + "Parent": "AzurePlaywrightServiceClient", + "Parameters": [ + { + "$id": "682", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "683", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "684", + "Type": { + "$id": "685", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "686", + "Name": "AccountQuotas", + "Operations": [ + { + "$id": "687", + "Name": "get", + "ResourceName": "AccountQuota", + "Doc": "Get quota by name for an account.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "688", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "689", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "690", + "Type": { + "$id": "691", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-12-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "692", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "693", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "694", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "695", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "696", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "697", + "Name": "accountName", + "NameInRequest": "accountName", + "Doc": "Name of account.", + "Type": { + "$id": "698", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "699", + "Name": "quotaName", + "NameInRequest": "quotaName", + "Doc": "The Playwright service account quota name.", + "Type": { + "$ref": "2" + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "700", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "701", + "kind": "constant", + "valueType": { + "$id": "702", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "703", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "88" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}/quotas/{quotaName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.AccountQuotas.get", + "Decorators": [], + "Examples": [ + { + "$id": "704", + "kind": "http", + "name": "AccountQuotas_Get", + "description": "AccountQuotas_Get", + "filePath": "2024-12-01/AccountQuotas_Get.json", + "parameters": [ + { + "$id": "705", + "parameter": { + "$ref": "688" + }, + "value": { + "$id": "706", + "kind": "string", + "type": { + "$ref": "689" + }, + "value": "2024-12-01" + } + }, + { + "$id": "707", + "parameter": { + "$ref": "692" + }, + "value": { + "$id": "708", + "kind": "string", + "type": { + "$ref": "693" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + }, + { + "$id": "709", + "parameter": { + "$ref": "695" + }, + "value": { + "$id": "710", + "kind": "string", + "type": { + "$ref": "696" + }, + "value": "dummyrg" + } + }, + { + "$id": "711", + "parameter": { + "$ref": "697" + }, + "value": { + "$id": "712", + "kind": "string", + "type": { + "$ref": "698" + }, + "value": "myPlaywrightAccount" + } + }, + { + "$id": "713", + "parameter": { + "$ref": "699" + }, + "value": { + "$id": "714", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "ScalableExecution" + } + } + ], + "responses": [ + { + "$id": "715", + "response": { + "$ref": "703" + }, + "statusCode": 200, + "bodyValue": { + "$id": "716", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "717", + "id": { + "$id": "718", + "kind": "string", + "type": { + "$ref": "92" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.AzurePlaywrightService/accounts/myPlaywrightAccount/quotas/ScalableExecution" + }, + "name": { + "$id": "719", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "ScalableExecution" + }, + "type": { + "$id": "720", + "kind": "string", + "type": { + "$ref": "97" + }, + "value": "Microsoft.AzurePlaywrightService/Accounts/Quotas" + }, + "properties": { + "$id": "721", + "kind": "model", + "type": { + "$ref": "114" + }, + "value": { + "$id": "722", + "freeTrial": { + "$id": "723", + "kind": "model", + "type": { + "$ref": "116" + }, + "value": { + "$id": "724", + "createdAt": { + "$id": "725", + "kind": "string", + "type": { + "$ref": "118" + }, + "value": "2023-08-31T10:19:36.081Z" + }, + "expiryAt": { + "$id": "726", + "kind": "string", + "type": { + "$ref": "121" + }, + "value": "2023-08-31T10:19:36.081Z" + }, + "allocatedValue": { + "$id": "727", + "kind": "number", + "type": { + "$ref": "124" + }, + "value": 0 + }, + "usedValue": { + "$id": "728", + "kind": "number", + "type": { + "$ref": "126" + }, + "value": 0 + }, + "percentageUsed": { + "$id": "729", + "kind": "number", + "type": { + "$ref": "128" + }, + "value": 100 + } + } + }, + "provisioningState": { + "$id": "730", + "kind": "string", + "type": { + "$ref": "8" + }, + "value": "Succeeded" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "731", + "Name": "listByAccount", + "ResourceName": "AccountQuota", + "Doc": "List quotas for a given account.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "732", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "733", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "734", + "Type": { + "$id": "735", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-12-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "736", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "737", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "738", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "739", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "740", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "741", + "Name": "accountName", + "NameInRequest": "accountName", + "Doc": "Name of account.", + "Type": { + "$id": "742", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "743", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "744", + "kind": "constant", + "valueType": { + "$id": "745", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "746", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "148" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}/quotas", + "BufferResponse": true, + "Paging": { + "$id": "747", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.AzurePlaywrightService.AccountQuotas.listByAccount", + "Decorators": [], + "Examples": [ + { + "$id": "748", + "kind": "http", + "name": "AccountQuotas_ListByAccount", + "description": "AccountQuotas_ListByAccount", + "filePath": "2024-12-01/AccountQuotas_ListByAccount.json", + "parameters": [ + { + "$id": "749", + "parameter": { + "$ref": "732" + }, + "value": { + "$id": "750", + "kind": "string", + "type": { + "$ref": "733" + }, + "value": "2024-12-01" + } + }, + { + "$id": "751", + "parameter": { + "$ref": "736" + }, + "value": { + "$id": "752", + "kind": "string", + "type": { + "$ref": "737" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + }, + { + "$id": "753", + "parameter": { + "$ref": "739" + }, + "value": { + "$id": "754", + "kind": "string", + "type": { + "$ref": "740" + }, + "value": "dummyrg" + } + }, + { + "$id": "755", + "parameter": { + "$ref": "741" + }, + "value": { + "$id": "756", + "kind": "string", + "type": { + "$ref": "742" + }, + "value": "myPlaywrightAccount" + } + } + ], + "responses": [ + { + "$id": "757", + "response": { + "$ref": "746" + }, + "statusCode": 200, + "bodyValue": { + "$id": "758", + "kind": "model", + "type": { + "$ref": "148" + }, + "value": { + "$id": "759", + "value": { + "$id": "760", + "kind": "array", + "type": { + "$ref": "150" + }, + "value": [ + { + "$id": "761", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "762", + "id": { + "$id": "763", + "kind": "string", + "type": { + "$ref": "92" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.AzurePlaywrightService/accounts/myPlaywrightAccount/quotas/ScalableExecution" + }, + "name": { + "$id": "764", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "ScalableExecution" + }, + "type": { + "$id": "765", + "kind": "string", + "type": { + "$ref": "97" + }, + "value": "Microsoft.AzurePlaywrightService/Accounts/Quotas" + }, + "properties": { + "$id": "766", + "kind": "model", + "type": { + "$ref": "114" + }, + "value": { + "$id": "767", + "freeTrial": { + "$id": "768", + "kind": "model", + "type": { + "$ref": "116" + }, + "value": { + "$id": "769", + "createdAt": { + "$id": "770", + "kind": "string", + "type": { + "$ref": "118" + }, + "value": "2023-08-31T10:19:36.081Z" + }, + "expiryAt": { + "$id": "771", + "kind": "string", + "type": { + "$ref": "121" + }, + "value": "2023-08-31T10:19:36.081Z" + }, + "allocatedValue": { + "$id": "772", + "kind": "number", + "type": { + "$ref": "124" + }, + "value": 0 + }, + "usedValue": { + "$id": "773", + "kind": "number", + "type": { + "$ref": "126" + }, + "value": 0 + }, + "percentageUsed": { + "$id": "774", + "kind": "number", + "type": { + "$ref": "128" + }, + "value": 100 + } + } + }, + "provisioningState": { + "$id": "775", + "kind": "string", + "type": { + "$ref": "8" + }, + "value": "Succeeded" + } + } + } + } + }, + { + "$id": "776", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "777", + "id": { + "$id": "778", + "kind": "string", + "type": { + "$ref": "92" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.AzurePlaywrightService/accounts/myPlaywrightAccount/quotas/Reporting" + }, + "name": { + "$id": "779", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Reporting" + }, + "type": { + "$id": "780", + "kind": "string", + "type": { + "$ref": "97" + }, + "value": "Microsoft.AzurePlaywrightService/Accounts/Quotas" + }, + "properties": { + "$id": "781", + "kind": "model", + "type": { + "$ref": "114" + }, + "value": { + "$id": "782", + "freeTrial": { + "$id": "783", + "kind": "model", + "type": { + "$ref": "116" + }, + "value": { + "$id": "784", + "createdAt": { + "$id": "785", + "kind": "string", + "type": { + "$ref": "118" + }, + "value": "2023-08-31T10:19:36.081Z" + }, + "expiryAt": { + "$id": "786", + "kind": "string", + "type": { + "$ref": "121" + }, + "value": "2023-08-31T10:19:36.081Z" + }, + "allocatedValue": { + "$id": "787", + "kind": "number", + "type": { + "$ref": "124" + }, + "value": 0 + }, + "usedValue": { + "$id": "788", + "kind": "number", + "type": { + "$ref": "126" + }, + "value": 0 + }, + "percentageUsed": { + "$id": "789", + "kind": "number", + "type": { + "$ref": "128" + }, + "value": 100 + } + } + }, + "provisioningState": { + "$id": "790", + "kind": "string", + "type": { + "$ref": "8" + }, + "value": "Succeeded" + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "791" + }, + "Parent": "AzurePlaywrightServiceClient", + "Parameters": [ + { + "$id": "792", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "793", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "794", + "Type": { + "$id": "795", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + } + ], + "Auth": { + "$id": "796", + "OAuth2": { + "$id": "797", + "Scopes": [ + "user_impersonation" + ] + } + } +} diff --git a/sdk/playwrighttesting/ci.mgmt.yml b/sdk/playwrighttesting/ci.mgmt.yml index 79addf69162c..f48dcc479ece 100644 --- a/sdk/playwrighttesting/ci.mgmt.yml +++ b/sdk/playwrighttesting/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/playwrighttesting/ci.mgmt.yml - sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/playwrighttesting/ci.mgmt.yml + - sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/playwrighttesting/ci.mgmt.yml + - sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/playwrighttesting/ci.mgmt.yml + - sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/playwrighttesting/ci.mgmt.yml + - sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/playwrighttesting/ci.mgmt.yml + - sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/playwrighttesting/ci.mgmt.yml + - sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/playwrighttesting/ci.mgmt.yml + - sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/playwrighttesting/ci.mgmt.yml + - sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/playwrighttesting/ci.mgmt.yml + - sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/policyinsights/ci.mgmt.yml b/sdk/policyinsights/ci.mgmt.yml index 56fa5c3ead85..4402dcbf9dc7 100644 --- a/sdk/policyinsights/ci.mgmt.yml +++ b/sdk/policyinsights/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/policyinsights/ci.mgmt.yml - sdk/policyinsights/Azure.ResourceManager.PolicyInsights/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/policyinsights/ci.mgmt.yml + - sdk/policyinsights/Azure.ResourceManager.PolicyInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/policyinsights/ci.mgmt.yml + - sdk/policyinsights/Azure.ResourceManager.PolicyInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/policyinsights/ci.mgmt.yml + - sdk/policyinsights/Azure.ResourceManager.PolicyInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/policyinsights/ci.mgmt.yml + - sdk/policyinsights/Azure.ResourceManager.PolicyInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/policyinsights/ci.mgmt.yml + - sdk/policyinsights/Azure.ResourceManager.PolicyInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/policyinsights/ci.mgmt.yml + - sdk/policyinsights/Azure.ResourceManager.PolicyInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/policyinsights/ci.mgmt.yml + - sdk/policyinsights/Azure.ResourceManager.PolicyInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/policyinsights/ci.mgmt.yml + - sdk/policyinsights/Azure.ResourceManager.PolicyInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/policyinsights/ci.mgmt.yml + - sdk/policyinsights/Azure.ResourceManager.PolicyInsights/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/postgresql/ci.mgmt.yml b/sdk/postgresql/ci.mgmt.yml index 77dbaed301ba..0f94ac9fcfd3 100644 --- a/sdk/postgresql/ci.mgmt.yml +++ b/sdk/postgresql/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/postgresql/ci.mgmt.yml - sdk/postgresql/Azure.ResourceManager.PostgreSql/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/postgresql/ci.mgmt.yml + - sdk/postgresql/Azure.ResourceManager.PostgreSql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/postgresql/ci.mgmt.yml + - sdk/postgresql/Azure.ResourceManager.PostgreSql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/postgresql/ci.mgmt.yml + - sdk/postgresql/Azure.ResourceManager.PostgreSql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/postgresql/ci.mgmt.yml + - sdk/postgresql/Azure.ResourceManager.PostgreSql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/postgresql/ci.mgmt.yml + - sdk/postgresql/Azure.ResourceManager.PostgreSql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/postgresql/ci.mgmt.yml + - sdk/postgresql/Azure.ResourceManager.PostgreSql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/postgresql/ci.mgmt.yml + - sdk/postgresql/Azure.ResourceManager.PostgreSql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/postgresql/ci.mgmt.yml + - sdk/postgresql/Azure.ResourceManager.PostgreSql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/postgresql/ci.mgmt.yml + - sdk/postgresql/Azure.ResourceManager.PostgreSql/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/powerbidedicated/ci.mgmt.yml b/sdk/powerbidedicated/ci.mgmt.yml index 414f2b8ef0a9..61abd75a7345 100644 --- a/sdk/powerbidedicated/ci.mgmt.yml +++ b/sdk/powerbidedicated/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/powerbidedicated/ci.mgmt.yml - sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/powerbidedicated/ci.mgmt.yml + - sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/powerbidedicated/ci.mgmt.yml + - sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/powerbidedicated/ci.mgmt.yml + - sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/powerbidedicated/ci.mgmt.yml + - sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/powerbidedicated/ci.mgmt.yml + - sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/powerbidedicated/ci.mgmt.yml + - sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/powerbidedicated/ci.mgmt.yml + - sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/powerbidedicated/ci.mgmt.yml + - sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/powerbidedicated/ci.mgmt.yml + - sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/privatedns/ci.mgmt.yml b/sdk/privatedns/ci.mgmt.yml index 86401f2f9675..ee1fd567f8d2 100644 --- a/sdk/privatedns/ci.mgmt.yml +++ b/sdk/privatedns/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/privatedns/ci.mgmt.yml - sdk/privatedns/Azure.ResourceManager.PrivateDns/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/privatedns/ci.mgmt.yml + - sdk/privatedns/Azure.ResourceManager.PrivateDns/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/privatedns/ci.mgmt.yml + - sdk/privatedns/Azure.ResourceManager.PrivateDns/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/privatedns/ci.mgmt.yml + - sdk/privatedns/Azure.ResourceManager.PrivateDns/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/privatedns/ci.mgmt.yml + - sdk/privatedns/Azure.ResourceManager.PrivateDns/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/privatedns/ci.mgmt.yml + - sdk/privatedns/Azure.ResourceManager.PrivateDns/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/privatedns/ci.mgmt.yml + - sdk/privatedns/Azure.ResourceManager.PrivateDns/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/privatedns/ci.mgmt.yml + - sdk/privatedns/Azure.ResourceManager.PrivateDns/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/privatedns/ci.mgmt.yml + - sdk/privatedns/Azure.ResourceManager.PrivateDns/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/privatedns/ci.mgmt.yml + - sdk/privatedns/Azure.ResourceManager.PrivateDns/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/providerhub/ci.mgmt.yml b/sdk/providerhub/ci.mgmt.yml index 2c7f6ca61d3f..fe9602713d27 100644 --- a/sdk/providerhub/ci.mgmt.yml +++ b/sdk/providerhub/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/providerhub/ci.mgmt.yml - sdk/providerhub/Azure.ResourceManager.ProviderHub/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/providerhub/ci.mgmt.yml + - sdk/providerhub/Azure.ResourceManager.ProviderHub/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/providerhub/ci.mgmt.yml + - sdk/providerhub/Azure.ResourceManager.ProviderHub/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/providerhub/ci.mgmt.yml + - sdk/providerhub/Azure.ResourceManager.ProviderHub/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/providerhub/ci.mgmt.yml + - sdk/providerhub/Azure.ResourceManager.ProviderHub/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/providerhub/ci.mgmt.yml + - sdk/providerhub/Azure.ResourceManager.ProviderHub/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/providerhub/ci.mgmt.yml + - sdk/providerhub/Azure.ResourceManager.ProviderHub/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/providerhub/ci.mgmt.yml + - sdk/providerhub/Azure.ResourceManager.ProviderHub/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/providerhub/ci.mgmt.yml + - sdk/providerhub/Azure.ResourceManager.ProviderHub/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/providerhub/ci.mgmt.yml + - sdk/providerhub/Azure.ResourceManager.ProviderHub/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/purview/ci.mgmt.yml b/sdk/purview/ci.mgmt.yml index 226718ca583c..c46c6deb1925 100644 --- a/sdk/purview/ci.mgmt.yml +++ b/sdk/purview/ci.mgmt.yml @@ -1,5 +1,6 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -12,6 +13,114 @@ pr: - sdk/purview/ci.mgmt.yml - sdk/purview/Azure.ResourceManager.Purview/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/purview/ci.mgmt.yml + - sdk/purview/Azure.ResourceManager.Purview/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/purview/ci.mgmt.yml + - sdk/purview/Azure.ResourceManager.Purview/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/purview/ci.mgmt.yml + - sdk/purview/Azure.ResourceManager.Purview/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/purview/ci.mgmt.yml + - sdk/purview/Azure.ResourceManager.Purview/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/purview/ci.mgmt.yml + - sdk/purview/Azure.ResourceManager.Purview/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/purview/ci.mgmt.yml + - sdk/purview/Azure.ResourceManager.Purview/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/purview/ci.mgmt.yml + - sdk/purview/Azure.ResourceManager.Purview/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/purview/ci.mgmt.yml + - sdk/purview/Azure.ResourceManager.Purview/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/purview/ci.mgmt.yml + - sdk/purview/Azure.ResourceManager.Purview/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/quantum/ci.mgmt.yml b/sdk/quantum/ci.mgmt.yml index 8562320fa7c7..dcbf906d5eef 100644 --- a/sdk/quantum/ci.mgmt.yml +++ b/sdk/quantum/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/quantum/ci.mgmt.yml - sdk/quantum/Azure.ResourceManager.Quantum/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/quantum/ci.mgmt.yml + - sdk/quantum/Azure.ResourceManager.Quantum/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/quantum/ci.mgmt.yml + - sdk/quantum/Azure.ResourceManager.Quantum/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/quantum/ci.mgmt.yml + - sdk/quantum/Azure.ResourceManager.Quantum/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/quantum/ci.mgmt.yml + - sdk/quantum/Azure.ResourceManager.Quantum/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/quantum/ci.mgmt.yml + - sdk/quantum/Azure.ResourceManager.Quantum/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/quantum/ci.mgmt.yml + - sdk/quantum/Azure.ResourceManager.Quantum/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/quantum/ci.mgmt.yml + - sdk/quantum/Azure.ResourceManager.Quantum/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/quantum/ci.mgmt.yml + - sdk/quantum/Azure.ResourceManager.Quantum/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/quantum/ci.mgmt.yml + - sdk/quantum/Azure.ResourceManager.Quantum/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/qumulo/ci.mgmt.yml b/sdk/qumulo/ci.mgmt.yml index e89c4bea0e70..a704dbd0519f 100644 --- a/sdk/qumulo/ci.mgmt.yml +++ b/sdk/qumulo/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/qumulo/ci.mgmt.yml - sdk/qumulo/Azure.ResourceManager.Qumulo/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/qumulo/ci.mgmt.yml + - sdk/qumulo/Azure.ResourceManager.Qumulo/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/qumulo/ci.mgmt.yml + - sdk/qumulo/Azure.ResourceManager.Qumulo/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/qumulo/ci.mgmt.yml + - sdk/qumulo/Azure.ResourceManager.Qumulo/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/qumulo/ci.mgmt.yml + - sdk/qumulo/Azure.ResourceManager.Qumulo/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/qumulo/ci.mgmt.yml + - sdk/qumulo/Azure.ResourceManager.Qumulo/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/qumulo/ci.mgmt.yml + - sdk/qumulo/Azure.ResourceManager.Qumulo/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/qumulo/ci.mgmt.yml + - sdk/qumulo/Azure.ResourceManager.Qumulo/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/qumulo/ci.mgmt.yml + - sdk/qumulo/Azure.ResourceManager.Qumulo/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/qumulo/ci.mgmt.yml + - sdk/qumulo/Azure.ResourceManager.Qumulo/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/quota/ci.mgmt.yml b/sdk/quota/ci.mgmt.yml index f1f545ad13f1..3b5d1719064d 100644 --- a/sdk/quota/ci.mgmt.yml +++ b/sdk/quota/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/quota/ci.mgmt.yml - sdk/quota/Azure.ResourceManager.Quota/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/quota/ci.mgmt.yml + - sdk/quota/Azure.ResourceManager.Quota/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/quota/ci.mgmt.yml + - sdk/quota/Azure.ResourceManager.Quota/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/quota/ci.mgmt.yml + - sdk/quota/Azure.ResourceManager.Quota/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/quota/ci.mgmt.yml + - sdk/quota/Azure.ResourceManager.Quota/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/quota/ci.mgmt.yml + - sdk/quota/Azure.ResourceManager.Quota/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/quota/ci.mgmt.yml + - sdk/quota/Azure.ResourceManager.Quota/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/quota/ci.mgmt.yml + - sdk/quota/Azure.ResourceManager.Quota/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/quota/ci.mgmt.yml + - sdk/quota/Azure.ResourceManager.Quota/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/quota/ci.mgmt.yml + - sdk/quota/Azure.ResourceManager.Quota/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/recoveryservices-backup/ci.mgmt.yml b/sdk/recoveryservices-backup/ci.mgmt.yml index 5edfd823e3c0..10c1f75e6cee 100644 --- a/sdk/recoveryservices-backup/ci.mgmt.yml +++ b/sdk/recoveryservices-backup/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/recoveryservices-backup/ci.mgmt.yml - sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-backup/ci.mgmt.yml + - sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-backup/ci.mgmt.yml + - sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-backup/ci.mgmt.yml + - sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-backup/ci.mgmt.yml + - sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-backup/ci.mgmt.yml + - sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-backup/ci.mgmt.yml + - sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-backup/ci.mgmt.yml + - sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-backup/ci.mgmt.yml + - sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-backup/ci.mgmt.yml + - sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/recoveryservices-datareplication/ci.mgmt.yml b/sdk/recoveryservices-datareplication/ci.mgmt.yml index 2e3966d67a88..13bf78713e31 100644 --- a/sdk/recoveryservices-datareplication/ci.mgmt.yml +++ b/sdk/recoveryservices-datareplication/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/recoveryservices-datareplication/ci.mgmt.yml - sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-datareplication/ci.mgmt.yml + - sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-datareplication/ci.mgmt.yml + - sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-datareplication/ci.mgmt.yml + - sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-datareplication/ci.mgmt.yml + - sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-datareplication/ci.mgmt.yml + - sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-datareplication/ci.mgmt.yml + - sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-datareplication/ci.mgmt.yml + - sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-datareplication/ci.mgmt.yml + - sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-datareplication/ci.mgmt.yml + - sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/recoveryservices-siterecovery/ci.mgmt.yml b/sdk/recoveryservices-siterecovery/ci.mgmt.yml index bded800f3ee2..99f62fba968d 100644 --- a/sdk/recoveryservices-siterecovery/ci.mgmt.yml +++ b/sdk/recoveryservices-siterecovery/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/recoveryservices-siterecovery/ci.mgmt.yml - sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-siterecovery/ci.mgmt.yml + - sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-siterecovery/ci.mgmt.yml + - sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-siterecovery/ci.mgmt.yml + - sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-siterecovery/ci.mgmt.yml + - sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-siterecovery/ci.mgmt.yml + - sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-siterecovery/ci.mgmt.yml + - sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-siterecovery/ci.mgmt.yml + - sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-siterecovery/ci.mgmt.yml + - sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-siterecovery/ci.mgmt.yml + - sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/api/Azure.ResourceManager.RecoveryServices.net8.0.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/api/Azure.ResourceManager.RecoveryServices.net8.0.cs index 89bd33075e7e..789bc88a2141 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/api/Azure.ResourceManager.RecoveryServices.net8.0.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/api/Azure.ResourceManager.RecoveryServices.net8.0.cs @@ -61,8 +61,8 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class RecoveryServicesVaultCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected RecoveryServicesVaultCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string vaultName, Azure.ResourceManager.RecoveryServices.RecoveryServicesVaultData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string vaultName, Azure.ResourceManager.RecoveryServices.RecoveryServicesVaultData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string vaultName, Azure.ResourceManager.RecoveryServices.RecoveryServicesVaultData data, string xMsAuthorizationAuxiliary = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string vaultName, Azure.ResourceManager.RecoveryServices.RecoveryServicesVaultData data, string xMsAuthorizationAuxiliary = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Exists(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -157,8 +157,8 @@ protected RecoveryServicesVaultResource() { } Azure.ResourceManager.RecoveryServices.RecoveryServicesVaultData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesVaultPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesVaultPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesVaultPatch patch, string xMsAuthorizationAuxiliary = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesVaultPatch patch, string xMsAuthorizationAuxiliary = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.RecoveryServices.Mocking @@ -201,7 +201,9 @@ public static partial class ArmRecoveryServicesModelFactory public static Azure.ResourceManager.RecoveryServices.RecoveryServicesVaultData RecoveryServicesVaultData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesVaultProperties properties = null, Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesSku sku = null, Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.RecoveryServices.RecoveryServicesVaultExtendedInfoData RecoveryServicesVaultExtendedInfoData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string integrityKey = null, string encryptionKey = null, string encryptionKeyThumbprint = null, string algorithm = null, Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesVaultPatch RecoveryServicesVaultPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesVaultProperties properties = null, Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesSku sku = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ETag? etag = default(Azure.ETag?)) { throw null; } - public static Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesVaultProperties RecoveryServicesVaultProperties(string provisioningState = null, Azure.ResourceManager.RecoveryServices.Models.VaultUpgradeDetails upgradeDetails = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.RecoveryServices.Models.VaultPrivateEndpointState? privateEndpointStateForBackup = default(Azure.ResourceManager.RecoveryServices.Models.VaultPrivateEndpointState?), Azure.ResourceManager.RecoveryServices.Models.VaultPrivateEndpointState? privateEndpointStateForSiteRecovery = default(Azure.ResourceManager.RecoveryServices.Models.VaultPrivateEndpointState?), Azure.ResourceManager.RecoveryServices.Models.VaultPropertiesEncryption encryption = null, Azure.ResourceManager.RecoveryServices.Models.VaultPropertiesMoveDetails moveDetails = null, Azure.ResourceManager.RecoveryServices.Models.ResourceMoveState? moveState = default(Azure.ResourceManager.RecoveryServices.Models.ResourceMoveState?), Azure.ResourceManager.RecoveryServices.Models.BackupStorageVersion? backupStorageVersion = default(Azure.ResourceManager.RecoveryServices.Models.BackupStorageVersion?), Azure.ResourceManager.RecoveryServices.Models.VaultPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.RecoveryServices.Models.VaultPublicNetworkAccess?), Azure.ResourceManager.RecoveryServices.Models.VaultMonitoringSettings monitoringSettings = null, Azure.ResourceManager.RecoveryServices.Models.CrossSubscriptionRestoreState? crossSubscriptionRestoreState = default(Azure.ResourceManager.RecoveryServices.Models.CrossSubscriptionRestoreState?), Azure.ResourceManager.RecoveryServices.Models.VaultPropertiesRedundancySettings redundancySettings = null, Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesSecuritySettings securitySettings = null, Azure.ResourceManager.RecoveryServices.Models.SecureScoreLevel? secureScore = default(Azure.ResourceManager.RecoveryServices.Models.SecureScoreLevel?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesVaultProperties RecoveryServicesVaultProperties(string provisioningState, Azure.ResourceManager.RecoveryServices.Models.VaultUpgradeDetails upgradeDetails, System.Collections.Generic.IEnumerable privateEndpointConnections, Azure.ResourceManager.RecoveryServices.Models.VaultPrivateEndpointState? privateEndpointStateForBackup, Azure.ResourceManager.RecoveryServices.Models.VaultPrivateEndpointState? privateEndpointStateForSiteRecovery, Azure.ResourceManager.RecoveryServices.Models.VaultPropertiesEncryption encryption, Azure.ResourceManager.RecoveryServices.Models.VaultPropertiesMoveDetails moveDetails, Azure.ResourceManager.RecoveryServices.Models.ResourceMoveState? moveState, Azure.ResourceManager.RecoveryServices.Models.BackupStorageVersion? backupStorageVersion, Azure.ResourceManager.RecoveryServices.Models.VaultPublicNetworkAccess? publicNetworkAccess, Azure.ResourceManager.RecoveryServices.Models.VaultMonitoringSettings monitoringSettings, Azure.ResourceManager.RecoveryServices.Models.CrossSubscriptionRestoreState? crossSubscriptionRestoreState, Azure.ResourceManager.RecoveryServices.Models.VaultPropertiesRedundancySettings redundancySettings, Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesSecuritySettings securitySettings, Azure.ResourceManager.RecoveryServices.Models.SecureScoreLevel? secureScore) { throw null; } + public static Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesVaultProperties RecoveryServicesVaultProperties(string provisioningState = null, Azure.ResourceManager.RecoveryServices.Models.VaultUpgradeDetails upgradeDetails = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.RecoveryServices.Models.VaultPrivateEndpointState? privateEndpointStateForBackup = default(Azure.ResourceManager.RecoveryServices.Models.VaultPrivateEndpointState?), Azure.ResourceManager.RecoveryServices.Models.VaultPrivateEndpointState? privateEndpointStateForSiteRecovery = default(Azure.ResourceManager.RecoveryServices.Models.VaultPrivateEndpointState?), Azure.ResourceManager.RecoveryServices.Models.VaultPropertiesEncryption encryption = null, Azure.ResourceManager.RecoveryServices.Models.VaultPropertiesMoveDetails moveDetails = null, Azure.ResourceManager.RecoveryServices.Models.ResourceMoveState? moveState = default(Azure.ResourceManager.RecoveryServices.Models.ResourceMoveState?), Azure.ResourceManager.RecoveryServices.Models.BackupStorageVersion? backupStorageVersion = default(Azure.ResourceManager.RecoveryServices.Models.BackupStorageVersion?), Azure.ResourceManager.RecoveryServices.Models.VaultPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.RecoveryServices.Models.VaultPublicNetworkAccess?), Azure.ResourceManager.RecoveryServices.Models.VaultMonitoringSettings monitoringSettings = null, Azure.ResourceManager.RecoveryServices.Models.CrossSubscriptionRestoreState? crossSubscriptionRestoreState = default(Azure.ResourceManager.RecoveryServices.Models.CrossSubscriptionRestoreState?), Azure.ResourceManager.RecoveryServices.Models.VaultPropertiesRedundancySettings redundancySettings = null, Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesSecuritySettings securitySettings = null, Azure.ResourceManager.RecoveryServices.Models.SecureScoreLevel? secureScore = default(Azure.ResourceManager.RecoveryServices.Models.SecureScoreLevel?), Azure.ResourceManager.RecoveryServices.Models.BcdrSecurityLevel? bcdrSecurityLevel = default(Azure.ResourceManager.RecoveryServices.Models.BcdrSecurityLevel?), System.Collections.Generic.IEnumerable resourceGuardOperationRequests = null) { throw null; } public static Azure.ResourceManager.RecoveryServices.Models.ReplicationJobSummary ReplicationJobSummary(int? failedJobs = default(int?), int? suspendedJobs = default(int?), int? inProgressJobs = default(int?)) { throw null; } public static Azure.ResourceManager.RecoveryServices.Models.ReplicationUsage ReplicationUsage(Azure.ResourceManager.RecoveryServices.Models.VaultMonitoringSummary monitoringSummary = null, Azure.ResourceManager.RecoveryServices.Models.ReplicationJobSummary jobsSummary = null, int? protectedItemCount = default(int?), int? recoveryPlanCount = default(int?), int? registeredServersCount = default(int?), int? recoveryServicesProviderAuthType = default(int?)) { throw null; } public static Azure.ResourceManager.RecoveryServices.Models.ResourceCertificateAndAadDetails ResourceCertificateAndAadDetails(byte[] certificate = null, string friendlyName = null, string issuer = null, long? resourceId = default(long?), string subject = null, System.BinaryData thumbprint = null, System.DateTimeOffset? validStartOn = default(System.DateTimeOffset?), System.DateTimeOffset? validEndOn = default(System.DateTimeOffset?), string aadAuthority = null, System.Guid aadTenantId = default(System.Guid), string servicePrincipalClientId = null, string servicePrincipalObjectId = null, string azureManagementEndpointAudience = null, Azure.Core.ResourceIdentifier serviceResourceId = null, string aadAudience = null) { throw null; } @@ -210,11 +212,23 @@ public static partial class ArmRecoveryServicesModelFactory public static Azure.ResourceManager.RecoveryServices.Models.VaultCertificateResult VaultCertificateResult(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServices.Models.ResourceCertificateDetails properties = null) { throw null; } public static Azure.ResourceManager.RecoveryServices.Models.VaultMonitoringSummary VaultMonitoringSummary(int? unHealthyVmCount = default(int?), int? unHealthyProviderCount = default(int?), int? eventsCount = default(int?), int? deprecatedProviderCount = default(int?), int? supportedProviderCount = default(int?), int? unsupportedProviderCount = default(int?)) { throw null; } public static Azure.ResourceManager.RecoveryServices.Models.VaultPropertiesMoveDetails VaultPropertiesMoveDetails(string operationId = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? completedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier sourceResourceId = null, Azure.Core.ResourceIdentifier targetResourceId = null) { throw null; } - public static Azure.ResourceManager.RecoveryServices.Models.VaultPropertiesRedundancySettings VaultPropertiesRedundancySettings(Azure.ResourceManager.RecoveryServices.Models.StandardTierStorageRedundancy? standardTierStorageRedundancy = default(Azure.ResourceManager.RecoveryServices.Models.StandardTierStorageRedundancy?), Azure.ResourceManager.RecoveryServices.Models.CrossRegionRestore? crossRegionRestore = default(Azure.ResourceManager.RecoveryServices.Models.CrossRegionRestore?)) { throw null; } public static Azure.ResourceManager.RecoveryServices.Models.VaultUpgradeDetails VaultUpgradeDetails(string operationId = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastUpdatedOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), Azure.ResourceManager.RecoveryServices.Models.VaultUpgradeState? status = default(Azure.ResourceManager.RecoveryServices.Models.VaultUpgradeState?), string message = null, Azure.ResourceManager.RecoveryServices.Models.VaultUpgradeTriggerType? triggerType = default(Azure.ResourceManager.RecoveryServices.Models.VaultUpgradeTriggerType?), Azure.Core.ResourceIdentifier upgradedResourceId = null, Azure.Core.ResourceIdentifier previousResourceId = null) { throw null; } public static Azure.ResourceManager.RecoveryServices.Models.VaultUsage VaultUsage(Azure.ResourceManager.RecoveryServices.Models.VaultUsageUnit? unit = default(Azure.ResourceManager.RecoveryServices.Models.VaultUsageUnit?), string quotaPeriod = null, System.DateTimeOffset? nextResetOn = default(System.DateTimeOffset?), long? currentValue = default(long?), long? limit = default(long?), Azure.ResourceManager.RecoveryServices.Models.VaultUsageNameInfo name = null) { throw null; } public static Azure.ResourceManager.RecoveryServices.Models.VaultUsageNameInfo VaultUsageNameInfo(string value = null, string localizedValue = null) { throw null; } } + public partial class AzureMonitorAlertSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzureMonitorAlertSettings() { } + public Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesAlertsState? AlertsForAllFailoverIssues { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesAlertsState? AlertsForAllJobFailures { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesAlertsState? AlertsForAllReplicationIssues { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServices.Models.AzureMonitorAlertSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServices.Models.AzureMonitorAlertSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct BackupStorageVersion : System.IEquatable { @@ -234,6 +248,26 @@ public static partial class ArmRecoveryServicesModelFactory public static bool operator !=(Azure.ResourceManager.RecoveryServices.Models.BackupStorageVersion left, Azure.ResourceManager.RecoveryServices.Models.BackupStorageVersion right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct BcdrSecurityLevel : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public BcdrSecurityLevel(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServices.Models.BcdrSecurityLevel Excellent { get { throw null; } } + public static Azure.ResourceManager.RecoveryServices.Models.BcdrSecurityLevel Fair { get { throw null; } } + public static Azure.ResourceManager.RecoveryServices.Models.BcdrSecurityLevel Good { get { throw null; } } + public static Azure.ResourceManager.RecoveryServices.Models.BcdrSecurityLevel Poor { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServices.Models.BcdrSecurityLevel other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServices.Models.BcdrSecurityLevel left, Azure.ResourceManager.RecoveryServices.Models.BcdrSecurityLevel right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServices.Models.BcdrSecurityLevel (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServices.Models.BcdrSecurityLevel left, Azure.ResourceManager.RecoveryServices.Models.BcdrSecurityLevel right) { throw null; } + public override string ToString() { throw null; } + } public partial class CapabilitiesResult : Azure.ResourceManager.RecoveryServices.Models.ResourceCapabilitiesBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public CapabilitiesResult(Azure.Core.ResourceType resourceCapabilitiesBaseType) : base (default(Azure.Core.ResourceType)) { } @@ -245,6 +279,18 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ClassicAlertSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ClassicAlertSettings() { } + public Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesAlertsState? AlertsForCriticalOperations { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesAlertsState? EmailNotificationsForSiteRecovery { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServices.Models.ClassicAlertSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServices.Models.ClassicAlertSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class CmkKekIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public CmkKekIdentity() { } @@ -317,6 +363,26 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct EnhancedSecurityState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EnhancedSecurityState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServices.Models.EnhancedSecurityState AlwaysON { get { throw null; } } + public static Azure.ResourceManager.RecoveryServices.Models.EnhancedSecurityState Disabled { get { throw null; } } + public static Azure.ResourceManager.RecoveryServices.Models.EnhancedSecurityState Enabled { get { throw null; } } + public static Azure.ResourceManager.RecoveryServices.Models.EnhancedSecurityState Invalid { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServices.Models.EnhancedSecurityState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServices.Models.EnhancedSecurityState left, Azure.ResourceManager.RecoveryServices.Models.EnhancedSecurityState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServices.Models.EnhancedSecurityState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServices.Models.EnhancedSecurityState left, Azure.ResourceManager.RecoveryServices.Models.EnhancedSecurityState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ImmutabilityState : System.IEquatable { private readonly object _dummy; @@ -587,6 +653,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class RecoveryServicesSoftDeleteSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public RecoveryServicesSoftDeleteSettings() { } + public Azure.ResourceManager.RecoveryServices.Models.EnhancedSecurityState? EnhancedSecurityState { get { throw null; } set { } } public int? SoftDeleteRetentionPeriodInDays { get { throw null; } set { } } public Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesSoftDeleteState? SoftDeleteState { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -634,6 +701,7 @@ public partial class RecoveryServicesVaultProperties : System.ClientModel.Primit { public RecoveryServicesVaultProperties() { } public Azure.ResourceManager.RecoveryServices.Models.BackupStorageVersion? BackupStorageVersion { get { throw null; } } + public Azure.ResourceManager.RecoveryServices.Models.BcdrSecurityLevel? BcdrSecurityLevel { get { throw null; } } public Azure.ResourceManager.RecoveryServices.Models.CrossSubscriptionRestoreState? CrossSubscriptionRestoreState { get { throw null; } set { } } public Azure.ResourceManager.RecoveryServices.Models.VaultPropertiesEncryption Encryption { get { throw null; } set { } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -647,6 +715,7 @@ public RecoveryServicesVaultProperties() { } public string ProvisioningState { get { throw null; } } public Azure.ResourceManager.RecoveryServices.Models.VaultPublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } public Azure.ResourceManager.RecoveryServices.Models.VaultPropertiesRedundancySettings RedundancySettings { get { throw null; } set { } } + public System.Collections.Generic.IList ResourceGuardOperationRequests { get { throw null; } } public Azure.ResourceManager.RecoveryServices.Models.SecureScoreLevel? SecureScore { get { throw null; } } public Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesSecuritySettings SecuritySettings { get { throw null; } set { } } public Azure.ResourceManager.RecoveryServices.Models.VaultUpgradeDetails UpgradeDetails { get { throw null; } set { } } @@ -809,6 +878,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly int _dummyPrimitive; public StandardTierStorageRedundancy(string value) { throw null; } public static Azure.ResourceManager.RecoveryServices.Models.StandardTierStorageRedundancy GeoRedundant { get { throw null; } } + public static Azure.ResourceManager.RecoveryServices.Models.StandardTierStorageRedundancy Invalid { get { throw null; } } public static Azure.ResourceManager.RecoveryServices.Models.StandardTierStorageRedundancy LocallyRedundant { get { throw null; } } public static Azure.ResourceManager.RecoveryServices.Models.StandardTierStorageRedundancy ZoneRedundant { get { throw null; } } public bool Equals(Azure.ResourceManager.RecoveryServices.Models.StandardTierStorageRedundancy other) { throw null; } @@ -835,8 +905,8 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class VaultMonitoringSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public VaultMonitoringSettings() { } - public Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesAlertsState? AzureMonitorAlertAlertsForAllJobFailures { get { throw null; } set { } } - public Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesAlertsState? ClassicAlertAlertsForCriticalOperations { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServices.Models.AzureMonitorAlertSettings AzureMonitorAlertSettings { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServices.Models.ClassicAlertSettings ClassicAlertSettings { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.RecoveryServices.Models.VaultMonitoringSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -909,8 +979,8 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class VaultPropertiesRedundancySettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public VaultPropertiesRedundancySettings() { } - public Azure.ResourceManager.RecoveryServices.Models.CrossRegionRestore? CrossRegionRestore { get { throw null; } } - public Azure.ResourceManager.RecoveryServices.Models.StandardTierStorageRedundancy? StandardTierStorageRedundancy { get { throw null; } } + public Azure.ResourceManager.RecoveryServices.Models.CrossRegionRestore? CrossRegionRestore { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServices.Models.StandardTierStorageRedundancy? StandardTierStorageRedundancy { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.RecoveryServices.Models.VaultPropertiesRedundancySettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/api/Azure.ResourceManager.RecoveryServices.netstandard2.0.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/api/Azure.ResourceManager.RecoveryServices.netstandard2.0.cs index 89bd33075e7e..789bc88a2141 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/api/Azure.ResourceManager.RecoveryServices.netstandard2.0.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/api/Azure.ResourceManager.RecoveryServices.netstandard2.0.cs @@ -61,8 +61,8 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class RecoveryServicesVaultCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected RecoveryServicesVaultCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string vaultName, Azure.ResourceManager.RecoveryServices.RecoveryServicesVaultData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string vaultName, Azure.ResourceManager.RecoveryServices.RecoveryServicesVaultData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string vaultName, Azure.ResourceManager.RecoveryServices.RecoveryServicesVaultData data, string xMsAuthorizationAuxiliary = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string vaultName, Azure.ResourceManager.RecoveryServices.RecoveryServicesVaultData data, string xMsAuthorizationAuxiliary = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Exists(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -157,8 +157,8 @@ protected RecoveryServicesVaultResource() { } Azure.ResourceManager.RecoveryServices.RecoveryServicesVaultData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesVaultPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesVaultPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesVaultPatch patch, string xMsAuthorizationAuxiliary = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesVaultPatch patch, string xMsAuthorizationAuxiliary = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.RecoveryServices.Mocking @@ -201,7 +201,9 @@ public static partial class ArmRecoveryServicesModelFactory public static Azure.ResourceManager.RecoveryServices.RecoveryServicesVaultData RecoveryServicesVaultData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesVaultProperties properties = null, Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesSku sku = null, Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.RecoveryServices.RecoveryServicesVaultExtendedInfoData RecoveryServicesVaultExtendedInfoData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string integrityKey = null, string encryptionKey = null, string encryptionKeyThumbprint = null, string algorithm = null, Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesVaultPatch RecoveryServicesVaultPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesVaultProperties properties = null, Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesSku sku = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ETag? etag = default(Azure.ETag?)) { throw null; } - public static Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesVaultProperties RecoveryServicesVaultProperties(string provisioningState = null, Azure.ResourceManager.RecoveryServices.Models.VaultUpgradeDetails upgradeDetails = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.RecoveryServices.Models.VaultPrivateEndpointState? privateEndpointStateForBackup = default(Azure.ResourceManager.RecoveryServices.Models.VaultPrivateEndpointState?), Azure.ResourceManager.RecoveryServices.Models.VaultPrivateEndpointState? privateEndpointStateForSiteRecovery = default(Azure.ResourceManager.RecoveryServices.Models.VaultPrivateEndpointState?), Azure.ResourceManager.RecoveryServices.Models.VaultPropertiesEncryption encryption = null, Azure.ResourceManager.RecoveryServices.Models.VaultPropertiesMoveDetails moveDetails = null, Azure.ResourceManager.RecoveryServices.Models.ResourceMoveState? moveState = default(Azure.ResourceManager.RecoveryServices.Models.ResourceMoveState?), Azure.ResourceManager.RecoveryServices.Models.BackupStorageVersion? backupStorageVersion = default(Azure.ResourceManager.RecoveryServices.Models.BackupStorageVersion?), Azure.ResourceManager.RecoveryServices.Models.VaultPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.RecoveryServices.Models.VaultPublicNetworkAccess?), Azure.ResourceManager.RecoveryServices.Models.VaultMonitoringSettings monitoringSettings = null, Azure.ResourceManager.RecoveryServices.Models.CrossSubscriptionRestoreState? crossSubscriptionRestoreState = default(Azure.ResourceManager.RecoveryServices.Models.CrossSubscriptionRestoreState?), Azure.ResourceManager.RecoveryServices.Models.VaultPropertiesRedundancySettings redundancySettings = null, Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesSecuritySettings securitySettings = null, Azure.ResourceManager.RecoveryServices.Models.SecureScoreLevel? secureScore = default(Azure.ResourceManager.RecoveryServices.Models.SecureScoreLevel?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesVaultProperties RecoveryServicesVaultProperties(string provisioningState, Azure.ResourceManager.RecoveryServices.Models.VaultUpgradeDetails upgradeDetails, System.Collections.Generic.IEnumerable privateEndpointConnections, Azure.ResourceManager.RecoveryServices.Models.VaultPrivateEndpointState? privateEndpointStateForBackup, Azure.ResourceManager.RecoveryServices.Models.VaultPrivateEndpointState? privateEndpointStateForSiteRecovery, Azure.ResourceManager.RecoveryServices.Models.VaultPropertiesEncryption encryption, Azure.ResourceManager.RecoveryServices.Models.VaultPropertiesMoveDetails moveDetails, Azure.ResourceManager.RecoveryServices.Models.ResourceMoveState? moveState, Azure.ResourceManager.RecoveryServices.Models.BackupStorageVersion? backupStorageVersion, Azure.ResourceManager.RecoveryServices.Models.VaultPublicNetworkAccess? publicNetworkAccess, Azure.ResourceManager.RecoveryServices.Models.VaultMonitoringSettings monitoringSettings, Azure.ResourceManager.RecoveryServices.Models.CrossSubscriptionRestoreState? crossSubscriptionRestoreState, Azure.ResourceManager.RecoveryServices.Models.VaultPropertiesRedundancySettings redundancySettings, Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesSecuritySettings securitySettings, Azure.ResourceManager.RecoveryServices.Models.SecureScoreLevel? secureScore) { throw null; } + public static Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesVaultProperties RecoveryServicesVaultProperties(string provisioningState = null, Azure.ResourceManager.RecoveryServices.Models.VaultUpgradeDetails upgradeDetails = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.RecoveryServices.Models.VaultPrivateEndpointState? privateEndpointStateForBackup = default(Azure.ResourceManager.RecoveryServices.Models.VaultPrivateEndpointState?), Azure.ResourceManager.RecoveryServices.Models.VaultPrivateEndpointState? privateEndpointStateForSiteRecovery = default(Azure.ResourceManager.RecoveryServices.Models.VaultPrivateEndpointState?), Azure.ResourceManager.RecoveryServices.Models.VaultPropertiesEncryption encryption = null, Azure.ResourceManager.RecoveryServices.Models.VaultPropertiesMoveDetails moveDetails = null, Azure.ResourceManager.RecoveryServices.Models.ResourceMoveState? moveState = default(Azure.ResourceManager.RecoveryServices.Models.ResourceMoveState?), Azure.ResourceManager.RecoveryServices.Models.BackupStorageVersion? backupStorageVersion = default(Azure.ResourceManager.RecoveryServices.Models.BackupStorageVersion?), Azure.ResourceManager.RecoveryServices.Models.VaultPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.RecoveryServices.Models.VaultPublicNetworkAccess?), Azure.ResourceManager.RecoveryServices.Models.VaultMonitoringSettings monitoringSettings = null, Azure.ResourceManager.RecoveryServices.Models.CrossSubscriptionRestoreState? crossSubscriptionRestoreState = default(Azure.ResourceManager.RecoveryServices.Models.CrossSubscriptionRestoreState?), Azure.ResourceManager.RecoveryServices.Models.VaultPropertiesRedundancySettings redundancySettings = null, Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesSecuritySettings securitySettings = null, Azure.ResourceManager.RecoveryServices.Models.SecureScoreLevel? secureScore = default(Azure.ResourceManager.RecoveryServices.Models.SecureScoreLevel?), Azure.ResourceManager.RecoveryServices.Models.BcdrSecurityLevel? bcdrSecurityLevel = default(Azure.ResourceManager.RecoveryServices.Models.BcdrSecurityLevel?), System.Collections.Generic.IEnumerable resourceGuardOperationRequests = null) { throw null; } public static Azure.ResourceManager.RecoveryServices.Models.ReplicationJobSummary ReplicationJobSummary(int? failedJobs = default(int?), int? suspendedJobs = default(int?), int? inProgressJobs = default(int?)) { throw null; } public static Azure.ResourceManager.RecoveryServices.Models.ReplicationUsage ReplicationUsage(Azure.ResourceManager.RecoveryServices.Models.VaultMonitoringSummary monitoringSummary = null, Azure.ResourceManager.RecoveryServices.Models.ReplicationJobSummary jobsSummary = null, int? protectedItemCount = default(int?), int? recoveryPlanCount = default(int?), int? registeredServersCount = default(int?), int? recoveryServicesProviderAuthType = default(int?)) { throw null; } public static Azure.ResourceManager.RecoveryServices.Models.ResourceCertificateAndAadDetails ResourceCertificateAndAadDetails(byte[] certificate = null, string friendlyName = null, string issuer = null, long? resourceId = default(long?), string subject = null, System.BinaryData thumbprint = null, System.DateTimeOffset? validStartOn = default(System.DateTimeOffset?), System.DateTimeOffset? validEndOn = default(System.DateTimeOffset?), string aadAuthority = null, System.Guid aadTenantId = default(System.Guid), string servicePrincipalClientId = null, string servicePrincipalObjectId = null, string azureManagementEndpointAudience = null, Azure.Core.ResourceIdentifier serviceResourceId = null, string aadAudience = null) { throw null; } @@ -210,11 +212,23 @@ public static partial class ArmRecoveryServicesModelFactory public static Azure.ResourceManager.RecoveryServices.Models.VaultCertificateResult VaultCertificateResult(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServices.Models.ResourceCertificateDetails properties = null) { throw null; } public static Azure.ResourceManager.RecoveryServices.Models.VaultMonitoringSummary VaultMonitoringSummary(int? unHealthyVmCount = default(int?), int? unHealthyProviderCount = default(int?), int? eventsCount = default(int?), int? deprecatedProviderCount = default(int?), int? supportedProviderCount = default(int?), int? unsupportedProviderCount = default(int?)) { throw null; } public static Azure.ResourceManager.RecoveryServices.Models.VaultPropertiesMoveDetails VaultPropertiesMoveDetails(string operationId = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? completedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier sourceResourceId = null, Azure.Core.ResourceIdentifier targetResourceId = null) { throw null; } - public static Azure.ResourceManager.RecoveryServices.Models.VaultPropertiesRedundancySettings VaultPropertiesRedundancySettings(Azure.ResourceManager.RecoveryServices.Models.StandardTierStorageRedundancy? standardTierStorageRedundancy = default(Azure.ResourceManager.RecoveryServices.Models.StandardTierStorageRedundancy?), Azure.ResourceManager.RecoveryServices.Models.CrossRegionRestore? crossRegionRestore = default(Azure.ResourceManager.RecoveryServices.Models.CrossRegionRestore?)) { throw null; } public static Azure.ResourceManager.RecoveryServices.Models.VaultUpgradeDetails VaultUpgradeDetails(string operationId = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastUpdatedOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), Azure.ResourceManager.RecoveryServices.Models.VaultUpgradeState? status = default(Azure.ResourceManager.RecoveryServices.Models.VaultUpgradeState?), string message = null, Azure.ResourceManager.RecoveryServices.Models.VaultUpgradeTriggerType? triggerType = default(Azure.ResourceManager.RecoveryServices.Models.VaultUpgradeTriggerType?), Azure.Core.ResourceIdentifier upgradedResourceId = null, Azure.Core.ResourceIdentifier previousResourceId = null) { throw null; } public static Azure.ResourceManager.RecoveryServices.Models.VaultUsage VaultUsage(Azure.ResourceManager.RecoveryServices.Models.VaultUsageUnit? unit = default(Azure.ResourceManager.RecoveryServices.Models.VaultUsageUnit?), string quotaPeriod = null, System.DateTimeOffset? nextResetOn = default(System.DateTimeOffset?), long? currentValue = default(long?), long? limit = default(long?), Azure.ResourceManager.RecoveryServices.Models.VaultUsageNameInfo name = null) { throw null; } public static Azure.ResourceManager.RecoveryServices.Models.VaultUsageNameInfo VaultUsageNameInfo(string value = null, string localizedValue = null) { throw null; } } + public partial class AzureMonitorAlertSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzureMonitorAlertSettings() { } + public Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesAlertsState? AlertsForAllFailoverIssues { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesAlertsState? AlertsForAllJobFailures { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesAlertsState? AlertsForAllReplicationIssues { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServices.Models.AzureMonitorAlertSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServices.Models.AzureMonitorAlertSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct BackupStorageVersion : System.IEquatable { @@ -234,6 +248,26 @@ public static partial class ArmRecoveryServicesModelFactory public static bool operator !=(Azure.ResourceManager.RecoveryServices.Models.BackupStorageVersion left, Azure.ResourceManager.RecoveryServices.Models.BackupStorageVersion right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct BcdrSecurityLevel : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public BcdrSecurityLevel(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServices.Models.BcdrSecurityLevel Excellent { get { throw null; } } + public static Azure.ResourceManager.RecoveryServices.Models.BcdrSecurityLevel Fair { get { throw null; } } + public static Azure.ResourceManager.RecoveryServices.Models.BcdrSecurityLevel Good { get { throw null; } } + public static Azure.ResourceManager.RecoveryServices.Models.BcdrSecurityLevel Poor { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServices.Models.BcdrSecurityLevel other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServices.Models.BcdrSecurityLevel left, Azure.ResourceManager.RecoveryServices.Models.BcdrSecurityLevel right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServices.Models.BcdrSecurityLevel (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServices.Models.BcdrSecurityLevel left, Azure.ResourceManager.RecoveryServices.Models.BcdrSecurityLevel right) { throw null; } + public override string ToString() { throw null; } + } public partial class CapabilitiesResult : Azure.ResourceManager.RecoveryServices.Models.ResourceCapabilitiesBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public CapabilitiesResult(Azure.Core.ResourceType resourceCapabilitiesBaseType) : base (default(Azure.Core.ResourceType)) { } @@ -245,6 +279,18 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ClassicAlertSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ClassicAlertSettings() { } + public Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesAlertsState? AlertsForCriticalOperations { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesAlertsState? EmailNotificationsForSiteRecovery { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServices.Models.ClassicAlertSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServices.Models.ClassicAlertSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class CmkKekIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public CmkKekIdentity() { } @@ -317,6 +363,26 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct EnhancedSecurityState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EnhancedSecurityState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServices.Models.EnhancedSecurityState AlwaysON { get { throw null; } } + public static Azure.ResourceManager.RecoveryServices.Models.EnhancedSecurityState Disabled { get { throw null; } } + public static Azure.ResourceManager.RecoveryServices.Models.EnhancedSecurityState Enabled { get { throw null; } } + public static Azure.ResourceManager.RecoveryServices.Models.EnhancedSecurityState Invalid { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServices.Models.EnhancedSecurityState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServices.Models.EnhancedSecurityState left, Azure.ResourceManager.RecoveryServices.Models.EnhancedSecurityState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServices.Models.EnhancedSecurityState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServices.Models.EnhancedSecurityState left, Azure.ResourceManager.RecoveryServices.Models.EnhancedSecurityState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ImmutabilityState : System.IEquatable { private readonly object _dummy; @@ -587,6 +653,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class RecoveryServicesSoftDeleteSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public RecoveryServicesSoftDeleteSettings() { } + public Azure.ResourceManager.RecoveryServices.Models.EnhancedSecurityState? EnhancedSecurityState { get { throw null; } set { } } public int? SoftDeleteRetentionPeriodInDays { get { throw null; } set { } } public Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesSoftDeleteState? SoftDeleteState { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -634,6 +701,7 @@ public partial class RecoveryServicesVaultProperties : System.ClientModel.Primit { public RecoveryServicesVaultProperties() { } public Azure.ResourceManager.RecoveryServices.Models.BackupStorageVersion? BackupStorageVersion { get { throw null; } } + public Azure.ResourceManager.RecoveryServices.Models.BcdrSecurityLevel? BcdrSecurityLevel { get { throw null; } } public Azure.ResourceManager.RecoveryServices.Models.CrossSubscriptionRestoreState? CrossSubscriptionRestoreState { get { throw null; } set { } } public Azure.ResourceManager.RecoveryServices.Models.VaultPropertiesEncryption Encryption { get { throw null; } set { } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -647,6 +715,7 @@ public RecoveryServicesVaultProperties() { } public string ProvisioningState { get { throw null; } } public Azure.ResourceManager.RecoveryServices.Models.VaultPublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } public Azure.ResourceManager.RecoveryServices.Models.VaultPropertiesRedundancySettings RedundancySettings { get { throw null; } set { } } + public System.Collections.Generic.IList ResourceGuardOperationRequests { get { throw null; } } public Azure.ResourceManager.RecoveryServices.Models.SecureScoreLevel? SecureScore { get { throw null; } } public Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesSecuritySettings SecuritySettings { get { throw null; } set { } } public Azure.ResourceManager.RecoveryServices.Models.VaultUpgradeDetails UpgradeDetails { get { throw null; } set { } } @@ -809,6 +878,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly int _dummyPrimitive; public StandardTierStorageRedundancy(string value) { throw null; } public static Azure.ResourceManager.RecoveryServices.Models.StandardTierStorageRedundancy GeoRedundant { get { throw null; } } + public static Azure.ResourceManager.RecoveryServices.Models.StandardTierStorageRedundancy Invalid { get { throw null; } } public static Azure.ResourceManager.RecoveryServices.Models.StandardTierStorageRedundancy LocallyRedundant { get { throw null; } } public static Azure.ResourceManager.RecoveryServices.Models.StandardTierStorageRedundancy ZoneRedundant { get { throw null; } } public bool Equals(Azure.ResourceManager.RecoveryServices.Models.StandardTierStorageRedundancy other) { throw null; } @@ -835,8 +905,8 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class VaultMonitoringSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public VaultMonitoringSettings() { } - public Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesAlertsState? AzureMonitorAlertAlertsForAllJobFailures { get { throw null; } set { } } - public Azure.ResourceManager.RecoveryServices.Models.RecoveryServicesAlertsState? ClassicAlertAlertsForCriticalOperations { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServices.Models.AzureMonitorAlertSettings AzureMonitorAlertSettings { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServices.Models.ClassicAlertSettings ClassicAlertSettings { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.RecoveryServices.Models.VaultMonitoringSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -909,8 +979,8 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class VaultPropertiesRedundancySettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public VaultPropertiesRedundancySettings() { } - public Azure.ResourceManager.RecoveryServices.Models.CrossRegionRestore? CrossRegionRestore { get { throw null; } } - public Azure.ResourceManager.RecoveryServices.Models.StandardTierStorageRedundancy? StandardTierStorageRedundancy { get { throw null; } } + public Azure.ResourceManager.RecoveryServices.Models.CrossRegionRestore? CrossRegionRestore { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServices.Models.StandardTierStorageRedundancy? StandardTierStorageRedundancy { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.RecoveryServices.Models.VaultPropertiesRedundancySettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/samples/Generated/Samples/Sample_RecoveryServicesPrivateLinkResource.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/samples/Generated/Samples/Sample_RecoveryServicesPrivateLinkResource.cs index 37f579b03251..e32090006e7d 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/samples/Generated/Samples/Sample_RecoveryServicesPrivateLinkResource.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/samples/Generated/Samples/Sample_RecoveryServicesPrivateLinkResource.cs @@ -19,7 +19,7 @@ public partial class Sample_RecoveryServicesPrivateLinkResource [Ignore("Only validating compilation of examples")] public async Task Get_GetPrivateLinkResource() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/GetPrivateLinkResources.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/GetPrivateLinkResources.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/samples/Generated/Samples/Sample_RecoveryServicesPrivateLinkResourceCollection.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/samples/Generated/Samples/Sample_RecoveryServicesPrivateLinkResourceCollection.cs index 6770e4278bb4..0ccdece5cb05 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/samples/Generated/Samples/Sample_RecoveryServicesPrivateLinkResourceCollection.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/samples/Generated/Samples/Sample_RecoveryServicesPrivateLinkResourceCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_RecoveryServicesPrivateLinkResourceCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetPrivateLinkResource() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/GetPrivateLinkResources.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/GetPrivateLinkResources.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_GetPrivateLinkResource() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListPrivateLinkResources() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/ListPrivateLinkResources.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/ListPrivateLinkResources.json // this example is just showing the usage of "PrivateLinkResources_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task GetAll_ListPrivateLinkResources() [Ignore("Only validating compilation of examples")] public async Task Exists_GetPrivateLinkResource() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/GetPrivateLinkResources.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/GetPrivateLinkResources.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -119,7 +119,7 @@ public async Task Exists_GetPrivateLinkResource() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetPrivateLinkResource() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/GetPrivateLinkResources.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/GetPrivateLinkResources.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/samples/Generated/Samples/Sample_RecoveryServicesVaultCollection.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/samples/Generated/Samples/Sample_RecoveryServicesVaultCollection.cs index acefbe01c0c5..2e01be3f20d8 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/samples/Generated/Samples/Sample_RecoveryServicesVaultCollection.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/samples/Generated/Samples/Sample_RecoveryServicesVaultCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_RecoveryServicesVaultCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateRecoveryServicesVault() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PUTVault.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/PUTVault.json // this example is just showing the usage of "Vaults_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -65,7 +65,7 @@ public async Task CreateOrUpdate_CreateOrUpdateRecoveryServicesVault() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateVaultWithMonitoringSetting() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PUTVault_WithMonitoringSettings.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/PUTVault_WithMonitoringSettings.json // this example is just showing the usage of "Vaults_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,8 +93,65 @@ public async Task CreateOrUpdate_CreateOrUpdateVaultWithMonitoringSetting() PublicNetworkAccess = VaultPublicNetworkAccess.Enabled, MonitoringSettings = new VaultMonitoringSettings { - AzureMonitorAlertAlertsForAllJobFailures = RecoveryServicesAlertsState.Enabled, - ClassicAlertAlertsForCriticalOperations = RecoveryServicesAlertsState.Disabled, + AzureMonitorAlertSettings = new AzureMonitorAlertSettings + { + AlertsForAllJobFailures = RecoveryServicesAlertsState.Enabled, + AlertsForAllReplicationIssues = RecoveryServicesAlertsState.Enabled, + AlertsForAllFailoverIssues = RecoveryServicesAlertsState.Disabled, + }, + ClassicAlertSettings = new ClassicAlertSettings + { + AlertsForCriticalOperations = RecoveryServicesAlertsState.Disabled, + EmailNotificationsForSiteRecovery = RecoveryServicesAlertsState.Enabled, + }, + }, + }, + Sku = new RecoveryServicesSku(RecoveryServicesSkuName.Standard), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, vaultName, data); + RecoveryServicesVaultResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RecoveryServicesVaultData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateVaultWithRedundancySetting() + { + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/PUTVault_WithRedundancySettings.json + // this example is just showing the usage of "Vaults_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "77777777-b0c6-47a2-b37c-d8e65a629c18"; + string resourceGroupName = "Default-RecoveryServices-ResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this RecoveryServicesVaultResource + RecoveryServicesVaultCollection collection = resourceGroupResource.GetRecoveryServicesVaults(); + + // invoke the operation + string vaultName = "swaggerExample"; + RecoveryServicesVaultData data = new RecoveryServicesVaultData(new AzureLocation("West US")) + { + Identity = new ManagedServiceIdentity("SystemAssigned"), + Properties = new RecoveryServicesVaultProperties + { + PublicNetworkAccess = VaultPublicNetworkAccess.Enabled, + RedundancySettings = new VaultPropertiesRedundancySettings + { + StandardTierStorageRedundancy = StandardTierStorageRedundancy.GeoRedundant, + CrossRegionRestore = CrossRegionRestore.Enabled, }, }, Sku = new RecoveryServicesSku(RecoveryServicesSkuName.Standard), @@ -109,11 +166,70 @@ public async Task CreateOrUpdate_CreateOrUpdateVaultWithMonitoringSetting() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateVaultPerformingCriticalOperationWithMUA() + { + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/PUTVault_ResourceGuardEnabled.json + // this example is just showing the usage of "Vaults_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "77777777-b0c6-47a2-b37c-d8e65a629c18"; + string resourceGroupName = "Default-RecoveryServices-ResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this RecoveryServicesVaultResource + RecoveryServicesVaultCollection collection = resourceGroupResource.GetRecoveryServicesVaults(); + + // invoke the operation + string vaultName = "swaggerExample"; + RecoveryServicesVaultData data = new RecoveryServicesVaultData(new AzureLocation("West US")) + { + Identity = new ManagedServiceIdentity("UserAssigned") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi")] = new UserAssignedIdentity() +}, + }, + Properties = new RecoveryServicesVaultProperties + { + Encryption = new VaultPropertiesEncryption + { + KeyUri = new Uri("https://cmk2xkv.vault.azure.net/keys/Key1/0767b348bb1a4c07baa6c4ec0055d2b3"), + KekIdentity = new CmkKekIdentity + { + UserAssignedIdentity = new ResourceIdentifier("/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi"), + }, + InfrastructureEncryption = InfrastructureEncryptionState.Enabled, + }, + PublicNetworkAccess = VaultPublicNetworkAccess.Enabled, + ResourceGuardOperationRequests = { "/subscriptions/38304e13-357e-405e-9e9a-220351dcce8c/resourcegroups/ankurResourceGuard1/providers/Microsoft.DataProtection/resourceGuards/ResourceGuard38-1/modifyEncryptionSettings/default" }, + }, + Sku = new RecoveryServicesSku(RecoveryServicesSkuName.Standard), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, vaultName, data); + RecoveryServicesVaultResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RecoveryServicesVaultData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateVaultWithCustomerManagedKeys() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PUTVault_WithCMK.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/PUTVault_WithCMK.json // this example is just showing the usage of "Vaults_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -171,7 +287,7 @@ public async Task CreateOrUpdate_CreateOrUpdateVaultWithCustomerManagedKeys() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateVaultWithUserAssignedIdentity() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PUTVault_WithUserAssignedIdentity.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/PUTVault_WithUserAssignedIdentity.json // this example is just showing the usage of "Vaults_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -220,7 +336,7 @@ public async Task CreateOrUpdate_CreateOrUpdateVaultWithUserAssignedIdentity() [Ignore("Only validating compilation of examples")] public async Task Get_GetRecoveryServicesResource() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/GETVault.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/GETVault.json // this example is just showing the usage of "Vaults_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -253,7 +369,7 @@ public async Task Get_GetRecoveryServicesResource() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListOfRecoveryServicesResourcesInResourceGroup() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/ListResources.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/ListResources.json // this example is just showing the usage of "Vaults_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -288,7 +404,7 @@ public async Task GetAll_ListOfRecoveryServicesResourcesInResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_GetRecoveryServicesResource() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/GETVault.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/GETVault.json // this example is just showing the usage of "Vaults_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -317,7 +433,7 @@ public async Task Exists_GetRecoveryServicesResource() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetRecoveryServicesResource() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/GETVault.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/GETVault.json // this example is just showing the usage of "Vaults_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/samples/Generated/Samples/Sample_RecoveryServicesVaultExtendedInfoResource.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/samples/Generated/Samples/Sample_RecoveryServicesVaultExtendedInfoResource.cs index 6d6045c535c2..c1024f1432ee 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/samples/Generated/Samples/Sample_RecoveryServicesVaultExtendedInfoResource.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/samples/Generated/Samples/Sample_RecoveryServicesVaultExtendedInfoResource.cs @@ -19,7 +19,7 @@ public partial class Sample_RecoveryServicesVaultExtendedInfoResource [Ignore("Only validating compilation of examples")] public async Task Get_GetExtendedInfoOfResource() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/GETVaultExtendedInfo.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/GETVaultExtendedInfo.json // this example is just showing the usage of "VaultExtendedInfo_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +49,7 @@ public async Task Get_GetExtendedInfoOfResource() [Ignore("Only validating compilation of examples")] public async Task Update_PATCHExtendedInfoOfResource() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/UpdateVaultExtendedInfo.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/UpdateVaultExtendedInfo.json // this example is just showing the usage of "VaultExtendedInfo_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Update_PATCHExtendedInfoOfResource() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PutExtendedInfoOfResource() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/UpdateVaultExtendedInfo.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/UpdateVaultExtendedInfo.json // this example is just showing the usage of "VaultExtendedInfo_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/samples/Generated/Samples/Sample_RecoveryServicesVaultResource.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/samples/Generated/Samples/Sample_RecoveryServicesVaultResource.cs index fae92e65dca7..f8c98d419649 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/samples/Generated/Samples/Sample_RecoveryServicesVaultResource.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/samples/Generated/Samples/Sample_RecoveryServicesVaultResource.cs @@ -22,7 +22,7 @@ public partial class Sample_RecoveryServicesVaultResource [Ignore("Only validating compilation of examples")] public async Task Get_GetRecoveryServicesResource() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/GETVault.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/GETVault.json // this example is just showing the usage of "Vaults_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_GetRecoveryServicesResource() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteRecoveryServicesVault() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/DeleteVault.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/DeleteVault.json // this example is just showing the usage of "Vaults_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_DeleteRecoveryServicesVault() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateResource() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PATCHVault.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/PATCHVault.json // this example is just showing the usage of "Vaults_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -116,7 +116,7 @@ public async Task Update_UpdateResource() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateResourceWithCustomerManagedKeys() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PATCHVault_WithCMK.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/PATCHVault_WithCMK.json // this example is just showing the usage of "Vaults_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -173,7 +173,7 @@ public async Task Update_UpdateResourceWithCustomerManagedKeys() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateResourceWithCustomerManagedKeys2() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PatchVault_WithCMK2.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/PatchVault_WithCMK2.json // this example is just showing the usage of "Vaults_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -222,7 +222,7 @@ public async Task Update_UpdateResourceWithCustomerManagedKeys2() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateResourceWithCustomerManagedKeys3() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PATCHVault_WithCMK3.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/PATCHVault_WithCMK3.json // this example is just showing the usage of "Vaults_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -274,7 +274,7 @@ public async Task Update_UpdateResourceWithCustomerManagedKeys3() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateResourceWithUserAssignedIdentity() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PATCHVault_WithUserAssignedIdentity.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/PATCHVault_WithUserAssignedIdentity.json // this example is just showing the usage of "Vaults_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -319,7 +319,7 @@ public async Task Update_UpdateResourceWithUserAssignedIdentity() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateVaultWithMonitoringSetting() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PATCHVault_WithMonitoringSettings.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/PATCHVault_WithMonitoringSettings.json // this example is just showing the usage of "Vaults_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -342,8 +342,17 @@ public async Task Update_UpdateVaultWithMonitoringSetting() { MonitoringSettings = new VaultMonitoringSettings { - AzureMonitorAlertAlertsForAllJobFailures = RecoveryServicesAlertsState.Enabled, - ClassicAlertAlertsForCriticalOperations = RecoveryServicesAlertsState.Disabled, + AzureMonitorAlertSettings = new AzureMonitorAlertSettings + { + AlertsForAllJobFailures = RecoveryServicesAlertsState.Enabled, + AlertsForAllReplicationIssues = RecoveryServicesAlertsState.Enabled, + AlertsForAllFailoverIssues = RecoveryServicesAlertsState.Disabled, + }, + ClassicAlertSettings = new ClassicAlertSettings + { + AlertsForCriticalOperations = RecoveryServicesAlertsState.Disabled, + EmailNotificationsForSiteRecovery = RecoveryServicesAlertsState.Enabled, + }, }, }, Tags = @@ -361,11 +370,53 @@ public async Task Update_UpdateVaultWithMonitoringSetting() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdateVaultWithRedundancySetting() + { + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/PATCHVault_WithRedundancySettings.json + // this example is just showing the usage of "Vaults_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RecoveryServicesVaultResource created on azure + // for more information of creating RecoveryServicesVaultResource, please refer to the document of RecoveryServicesVaultResource + string subscriptionId = "77777777-b0c6-47a2-b37c-d8e65a629c18"; + string resourceGroupName = "HelloWorld"; + string vaultName = "swaggerExample"; + ResourceIdentifier recoveryServicesVaultResourceId = RecoveryServicesVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + RecoveryServicesVaultResource recoveryServicesVault = client.GetRecoveryServicesVaultResource(recoveryServicesVaultResourceId); + + // invoke the operation + RecoveryServicesVaultPatch patch = new RecoveryServicesVaultPatch(default) + { + Properties = new RecoveryServicesVaultProperties + { + RedundancySettings = new VaultPropertiesRedundancySettings + { + StandardTierStorageRedundancy = StandardTierStorageRedundancy.GeoRedundant, + CrossRegionRestore = CrossRegionRestore.Enabled, + }, + }, + }; + ArmOperation lro = await recoveryServicesVault.UpdateAsync(WaitUntil.Completed, patch); + RecoveryServicesVaultResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RecoveryServicesVaultData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task CreateVaultCertificate_DownloadVaultCredentialFile() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PUTVaultCred.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/PUTVaultCred.json // this example is just showing the usage of "VaultCertificates_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -400,7 +451,7 @@ public async Task CreateVaultCertificate_DownloadVaultCredentialFile() [Ignore("Only validating compilation of examples")] public async Task DeleteRegisteredIdentity_DeleteRegisteredIdentity() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/DeleteRegisteredIdentities.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/DeleteRegisteredIdentities.json // this example is just showing the usage of "RegisteredIdentities_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -427,7 +478,7 @@ public async Task DeleteRegisteredIdentity_DeleteRegisteredIdentity() [Ignore("Only validating compilation of examples")] public async Task GetReplicationUsages_GetsReplicationUsagesOfVault() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/ListReplicationUsages.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/ListReplicationUsages.json // this example is just showing the usage of "ReplicationUsages_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -456,7 +507,7 @@ public async Task GetReplicationUsages_GetsReplicationUsagesOfVault() [Ignore("Only validating compilation of examples")] public async Task GetUsagesByVaults_GetsVaultUsages() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/ListUsages.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/ListUsages.json // this example is just showing the usage of "Usages_ListByVaults" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs index 3dde81e4ac29..73cfd51b5df0 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs @@ -21,7 +21,7 @@ public partial class Sample_ResourceGroupResourceExtensions [Ignore("Only validating compilation of examples")] public async Task CheckRecoveryServicesNameAvailability_AvailabilityStatusOfResourceNameWhenNoResourceWithSameNameTypeAndSubscriptionExistsNorHasBeenDeletedWithinLast24Hours() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/CheckNameAvailability_Available.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/CheckNameAvailability_Available.json // this example is just showing the usage of "RecoveryServices_CheckNameAvailability" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task CheckRecoveryServicesNameAvailability_AvailabilityStatusOfReso [Ignore("Only validating compilation of examples")] public async Task CheckRecoveryServicesNameAvailability_AvailabilityStatusOfResourceNameWhenResourceWithSameNameTypeAndSubscriptionExists() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/CheckNameAvailability_NotAvailable.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/CheckNameAvailability_NotAvailable.json // this example is just showing the usage of "RecoveryServices_CheckNameAvailability" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 4dab5fd95b4c..59799af17d6a 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -21,7 +21,7 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task GetRecoveryServiceCapabilities_CapabilitiesForMicrosoftRecoveryServicesVaults() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/Capabilities.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/Capabilities.json // this example is just showing the usage of "RecoveryServices_Capabilities" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task GetRecoveryServiceCapabilities_CapabilitiesForMicrosoftRecover [Ignore("Only validating compilation of examples")] public async Task GetRecoveryServicesVaults_ListOfRecoveryServicesResourcesInSubscriptionId() { - // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/ListBySubscriptionIds.json + // Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-10-01/examples/ListBySubscriptionIds.json // this example is just showing the usage of "Vaults_ListBySubscriptionId" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/ArmRecoveryServicesModelFactory.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/ArmRecoveryServicesModelFactory.cs index 91a06a44fd7c..ba3073083a70 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/ArmRecoveryServicesModelFactory.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/ArmRecoveryServicesModelFactory.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using Azure.Core; using Azure.ResourceManager.Models; @@ -195,10 +196,13 @@ public static RecoveryServicesVaultData RecoveryServicesVaultData(ResourceIdenti /// The redundancy Settings of a Vault. /// Security Settings of the vault. /// Secure Score of Recovery Services Vault. + /// Security levels of Recovery Services Vault for business continuity and disaster recovery. + /// ResourceGuardOperationRequests on which LAC check will be performed. /// A new instance for mocking. - public static RecoveryServicesVaultProperties RecoveryServicesVaultProperties(string provisioningState = null, VaultUpgradeDetails upgradeDetails = null, IEnumerable privateEndpointConnections = null, VaultPrivateEndpointState? privateEndpointStateForBackup = null, VaultPrivateEndpointState? privateEndpointStateForSiteRecovery = null, VaultPropertiesEncryption encryption = null, VaultPropertiesMoveDetails moveDetails = null, ResourceMoveState? moveState = null, BackupStorageVersion? backupStorageVersion = null, VaultPublicNetworkAccess? publicNetworkAccess = null, VaultMonitoringSettings monitoringSettings = null, CrossSubscriptionRestoreState? crossSubscriptionRestoreState = null, VaultPropertiesRedundancySettings redundancySettings = null, RecoveryServicesSecuritySettings securitySettings = null, SecureScoreLevel? secureScore = null) + public static RecoveryServicesVaultProperties RecoveryServicesVaultProperties(string provisioningState = null, VaultUpgradeDetails upgradeDetails = null, IEnumerable privateEndpointConnections = null, VaultPrivateEndpointState? privateEndpointStateForBackup = null, VaultPrivateEndpointState? privateEndpointStateForSiteRecovery = null, VaultPropertiesEncryption encryption = null, VaultPropertiesMoveDetails moveDetails = null, ResourceMoveState? moveState = null, BackupStorageVersion? backupStorageVersion = null, VaultPublicNetworkAccess? publicNetworkAccess = null, VaultMonitoringSettings monitoringSettings = null, CrossSubscriptionRestoreState? crossSubscriptionRestoreState = null, VaultPropertiesRedundancySettings redundancySettings = null, RecoveryServicesSecuritySettings securitySettings = null, SecureScoreLevel? secureScore = null, BcdrSecurityLevel? bcdrSecurityLevel = null, IEnumerable resourceGuardOperationRequests = null) { privateEndpointConnections ??= new List(); + resourceGuardOperationRequests ??= new List(); return new RecoveryServicesVaultProperties( provisioningState, @@ -216,6 +220,8 @@ public static RecoveryServicesVaultProperties RecoveryServicesVaultProperties(st redundancySettings, securitySettings, secureScore, + bcdrSecurityLevel, + resourceGuardOperationRequests?.ToList(), serializedAdditionalRawData: null); } @@ -306,15 +312,6 @@ public static VaultPropertiesMoveDetails VaultPropertiesMoveDetails(string opera serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The storage redundancy setting of a vault. - /// Flag to show if Cross Region Restore is enabled on the Vault or not. - /// A new instance for mocking. - public static VaultPropertiesRedundancySettings VaultPropertiesRedundancySettings(StandardTierStorageRedundancy? standardTierStorageRedundancy = null, CrossRegionRestore? crossRegionRestore = null) - { - return new VaultPropertiesRedundancySettings(standardTierStorageRedundancy, crossRegionRestore, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// Immutability Settings of a vault. /// Soft delete Settings of a vault. @@ -479,5 +476,28 @@ public static ResourceCertificateAndAcsDetails ResourceCertificateAndAcsDetails( globalAcsHostName, globalAcsRPRealm); } + + /// Initializes a new instance of . + /// Provisioning State. + /// Details for upgrading vault. + /// List of private endpoint connection. + /// Private endpoint state for backup. + /// Private endpoint state for site recovery. + /// Customer Managed Key details of the resource. + /// The details of the latest move operation performed on the Azure Resource. + /// The State of the Resource after the move operation. + /// Backup storage version. + /// property to enable or disable resource provider inbound network traffic from public clients. + /// Monitoring Settings of the vault. + /// Restore Settings of the vault. + /// The redundancy Settings of a Vault. + /// Security Settings of the vault. + /// Secure Score of Recovery Services Vault. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static RecoveryServicesVaultProperties RecoveryServicesVaultProperties(string provisioningState, VaultUpgradeDetails upgradeDetails, IEnumerable privateEndpointConnections, VaultPrivateEndpointState? privateEndpointStateForBackup, VaultPrivateEndpointState? privateEndpointStateForSiteRecovery, VaultPropertiesEncryption encryption, VaultPropertiesMoveDetails moveDetails, ResourceMoveState? moveState, BackupStorageVersion? backupStorageVersion, VaultPublicNetworkAccess? publicNetworkAccess, VaultMonitoringSettings monitoringSettings, CrossSubscriptionRestoreState? crossSubscriptionRestoreState, VaultPropertiesRedundancySettings redundancySettings, RecoveryServicesSecuritySettings securitySettings, SecureScoreLevel? secureScore) + { + return RecoveryServicesVaultProperties(provisioningState: provisioningState, upgradeDetails: upgradeDetails, privateEndpointConnections: privateEndpointConnections, privateEndpointStateForBackup: privateEndpointStateForBackup, privateEndpointStateForSiteRecovery: privateEndpointStateForSiteRecovery, encryption: encryption, moveDetails: moveDetails, moveState: moveState, backupStorageVersion: backupStorageVersion, publicNetworkAccess: publicNetworkAccess, monitoringSettings: monitoringSettings, crossSubscriptionRestoreState: crossSubscriptionRestoreState, redundancySettings: redundancySettings, securitySettings: securitySettings, secureScore: secureScore, bcdrSecurityLevel: default, resourceGuardOperationRequests: default); + } } } diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/MockableRecoveryServicesResourceGroupResource.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/MockableRecoveryServicesResourceGroupResource.cs index 9bd1b4e91b46..202da0482c5b 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/MockableRecoveryServicesResourceGroupResource.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/MockableRecoveryServicesResourceGroupResource.cs @@ -61,7 +61,7 @@ public virtual RecoveryServicesVaultCollection GetRecoveryServicesVaults() /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -92,7 +92,7 @@ public virtual async Task> GetRecoverySe /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -125,7 +125,7 @@ public virtual Response GetRecoveryServicesVault( /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// @@ -166,7 +166,7 @@ public virtual async Task> Chec /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/MockableRecoveryServicesSubscriptionResource.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/MockableRecoveryServicesSubscriptionResource.cs index d74731a80b8d..9a589938487c 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/MockableRecoveryServicesSubscriptionResource.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/MockableRecoveryServicesSubscriptionResource.cs @@ -59,7 +59,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// @@ -98,7 +98,7 @@ public virtual async Task> GetRecoveryServiceCapabi /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// @@ -137,7 +137,7 @@ public virtual Response GetRecoveryServiceCapabilities(Azure /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -167,7 +167,7 @@ public virtual AsyncPageable GetRecoveryServicesV /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/RecoveryServicesExtensions.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/RecoveryServicesExtensions.cs index f902eb0e141d..9aa9635ddbd4 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/RecoveryServicesExtensions.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/RecoveryServicesExtensions.cs @@ -120,7 +120,7 @@ public static RecoveryServicesVaultCollection GetRecoveryServicesVaults(this Res /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -158,7 +158,7 @@ public static async Task> GetRecoverySer /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -198,7 +198,7 @@ public static Response GetRecoveryServicesVault(t /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// @@ -233,7 +233,7 @@ public static async Task> Check /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// @@ -266,7 +266,7 @@ public static Response CheckRecoveryServ /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// @@ -299,7 +299,7 @@ public static async Task> GetRecoveryServiceCapabil /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// @@ -332,7 +332,7 @@ public static Response GetRecoveryServiceCapabilities(this S /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -368,7 +368,7 @@ public static AsyncPageable GetRecoveryServicesVa /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/AzureMonitorAlertSettings.Serialization.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/AzureMonitorAlertSettings.Serialization.cs index 895ef9f0a355..135db289a013 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/AzureMonitorAlertSettings.Serialization.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/AzureMonitorAlertSettings.Serialization.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.RecoveryServices.Models { - internal partial class AzureMonitorAlertSettings : IUtf8JsonSerializable, IJsonModel + public partial class AzureMonitorAlertSettings : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -39,6 +39,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("alertsForAllJobFailures"u8); writer.WriteStringValue(AlertsForAllJobFailures.Value.ToString()); } + if (Optional.IsDefined(AlertsForAllReplicationIssues)) + { + writer.WritePropertyName("alertsForAllReplicationIssues"u8); + writer.WriteStringValue(AlertsForAllReplicationIssues.Value.ToString()); + } + if (Optional.IsDefined(AlertsForAllFailoverIssues)) + { + writer.WritePropertyName("alertsForAllFailoverIssues"u8); + writer.WriteStringValue(AlertsForAllFailoverIssues.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -77,6 +87,8 @@ internal static AzureMonitorAlertSettings DeserializeAzureMonitorAlertSettings(J return null; } RecoveryServicesAlertsState? alertsForAllJobFailures = default; + RecoveryServicesAlertsState? alertsForAllReplicationIssues = default; + RecoveryServicesAlertsState? alertsForAllFailoverIssues = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -90,13 +102,31 @@ internal static AzureMonitorAlertSettings DeserializeAzureMonitorAlertSettings(J alertsForAllJobFailures = new RecoveryServicesAlertsState(property.Value.GetString()); continue; } + if (property.NameEquals("alertsForAllReplicationIssues"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + alertsForAllReplicationIssues = new RecoveryServicesAlertsState(property.Value.GetString()); + continue; + } + if (property.NameEquals("alertsForAllFailoverIssues"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + alertsForAllFailoverIssues = new RecoveryServicesAlertsState(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new AzureMonitorAlertSettings(alertsForAllJobFailures, serializedAdditionalRawData); + return new AzureMonitorAlertSettings(alertsForAllJobFailures, alertsForAllReplicationIssues, alertsForAllFailoverIssues, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/AzureMonitorAlertSettings.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/AzureMonitorAlertSettings.cs index 8836144bb7f9..075339d9ffa5 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/AzureMonitorAlertSettings.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/AzureMonitorAlertSettings.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.RecoveryServices.Models { /// Settings for Azure Monitor based alerts. - internal partial class AzureMonitorAlertSettings + public partial class AzureMonitorAlertSettings { /// /// Keeps track of any properties unknown to the library. @@ -52,14 +52,22 @@ public AzureMonitorAlertSettings() /// Initializes a new instance of . /// + /// + /// /// Keeps track of any properties unknown to the library. - internal AzureMonitorAlertSettings(RecoveryServicesAlertsState? alertsForAllJobFailures, IDictionary serializedAdditionalRawData) + internal AzureMonitorAlertSettings(RecoveryServicesAlertsState? alertsForAllJobFailures, RecoveryServicesAlertsState? alertsForAllReplicationIssues, RecoveryServicesAlertsState? alertsForAllFailoverIssues, IDictionary serializedAdditionalRawData) { AlertsForAllJobFailures = alertsForAllJobFailures; + AlertsForAllReplicationIssues = alertsForAllReplicationIssues; + AlertsForAllFailoverIssues = alertsForAllFailoverIssues; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Gets or sets the alerts for all job failures. public RecoveryServicesAlertsState? AlertsForAllJobFailures { get; set; } + /// Gets or sets the alerts for all replication issues. + public RecoveryServicesAlertsState? AlertsForAllReplicationIssues { get; set; } + /// Gets or sets the alerts for all failover issues. + public RecoveryServicesAlertsState? AlertsForAllFailoverIssues { get; set; } } } diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/BcdrSecurityLevel.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/BcdrSecurityLevel.cs new file mode 100644 index 000000000000..e678c9b2b590 --- /dev/null +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/BcdrSecurityLevel.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServices.Models +{ + /// Security levels of Recovery Services Vault for business continuity and disaster recovery. + public readonly partial struct BcdrSecurityLevel : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BcdrSecurityLevel(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PoorValue = "Poor"; + private const string FairValue = "Fair"; + private const string GoodValue = "Good"; + private const string ExcellentValue = "Excellent"; + + /// Poor. + public static BcdrSecurityLevel Poor { get; } = new BcdrSecurityLevel(PoorValue); + /// Fair. + public static BcdrSecurityLevel Fair { get; } = new BcdrSecurityLevel(FairValue); + /// Good. + public static BcdrSecurityLevel Good { get; } = new BcdrSecurityLevel(GoodValue); + /// Excellent. + public static BcdrSecurityLevel Excellent { get; } = new BcdrSecurityLevel(ExcellentValue); + /// Determines if two values are the same. + public static bool operator ==(BcdrSecurityLevel left, BcdrSecurityLevel right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BcdrSecurityLevel left, BcdrSecurityLevel right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BcdrSecurityLevel(string value) => new BcdrSecurityLevel(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BcdrSecurityLevel other && Equals(other); + /// + public bool Equals(BcdrSecurityLevel 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/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/ClassicAlertSettings.Serialization.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/ClassicAlertSettings.Serialization.cs index 07562ed165e8..adf1c1e5978b 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/ClassicAlertSettings.Serialization.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/ClassicAlertSettings.Serialization.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.RecoveryServices.Models { - internal partial class ClassicAlertSettings : IUtf8JsonSerializable, IJsonModel + public partial class ClassicAlertSettings : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -39,6 +39,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("alertsForCriticalOperations"u8); writer.WriteStringValue(AlertsForCriticalOperations.Value.ToString()); } + if (Optional.IsDefined(EmailNotificationsForSiteRecovery)) + { + writer.WritePropertyName("emailNotificationsForSiteRecovery"u8); + writer.WriteStringValue(EmailNotificationsForSiteRecovery.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -77,6 +82,7 @@ internal static ClassicAlertSettings DeserializeClassicAlertSettings(JsonElement return null; } RecoveryServicesAlertsState? alertsForCriticalOperations = default; + RecoveryServicesAlertsState? emailNotificationsForSiteRecovery = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -90,13 +96,22 @@ internal static ClassicAlertSettings DeserializeClassicAlertSettings(JsonElement alertsForCriticalOperations = new RecoveryServicesAlertsState(property.Value.GetString()); continue; } + if (property.NameEquals("emailNotificationsForSiteRecovery"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + emailNotificationsForSiteRecovery = new RecoveryServicesAlertsState(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new ClassicAlertSettings(alertsForCriticalOperations, serializedAdditionalRawData); + return new ClassicAlertSettings(alertsForCriticalOperations, emailNotificationsForSiteRecovery, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/ClassicAlertSettings.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/ClassicAlertSettings.cs index 2d713aac20eb..2c54ef315429 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/ClassicAlertSettings.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/ClassicAlertSettings.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.RecoveryServices.Models { /// Settings for classic alerts. - internal partial class ClassicAlertSettings + public partial class ClassicAlertSettings { /// /// Keeps track of any properties unknown to the library. @@ -52,14 +52,18 @@ public ClassicAlertSettings() /// Initializes a new instance of . /// + /// /// Keeps track of any properties unknown to the library. - internal ClassicAlertSettings(RecoveryServicesAlertsState? alertsForCriticalOperations, IDictionary serializedAdditionalRawData) + internal ClassicAlertSettings(RecoveryServicesAlertsState? alertsForCriticalOperations, RecoveryServicesAlertsState? emailNotificationsForSiteRecovery, IDictionary serializedAdditionalRawData) { AlertsForCriticalOperations = alertsForCriticalOperations; + EmailNotificationsForSiteRecovery = emailNotificationsForSiteRecovery; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Gets or sets the alerts for critical operations. public RecoveryServicesAlertsState? AlertsForCriticalOperations { get; set; } + /// Gets or sets the email notifications for site recovery. + public RecoveryServicesAlertsState? EmailNotificationsForSiteRecovery { get; set; } } } diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/EnhancedSecurityState.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/EnhancedSecurityState.cs new file mode 100644 index 000000000000..ef48f811cdb1 --- /dev/null +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/EnhancedSecurityState.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServices.Models +{ + /// The EnhancedSecurityState. + public readonly partial struct EnhancedSecurityState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public EnhancedSecurityState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InvalidValue = "Invalid"; + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + private const string AlwaysONValue = "AlwaysON"; + + /// Invalid. + public static EnhancedSecurityState Invalid { get; } = new EnhancedSecurityState(InvalidValue); + /// Enabled. + public static EnhancedSecurityState Enabled { get; } = new EnhancedSecurityState(EnabledValue); + /// Disabled. + public static EnhancedSecurityState Disabled { get; } = new EnhancedSecurityState(DisabledValue); + /// AlwaysON. + public static EnhancedSecurityState AlwaysON { get; } = new EnhancedSecurityState(AlwaysONValue); + /// Determines if two values are the same. + public static bool operator ==(EnhancedSecurityState left, EnhancedSecurityState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EnhancedSecurityState left, EnhancedSecurityState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator EnhancedSecurityState(string value) => new EnhancedSecurityState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EnhancedSecurityState other && Equals(other); + /// + public bool Equals(EnhancedSecurityState 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/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/RecoveryServicesSoftDeleteSettings.Serialization.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/RecoveryServicesSoftDeleteSettings.Serialization.cs index b84a8dbec8fe..769284c61812 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/RecoveryServicesSoftDeleteSettings.Serialization.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/RecoveryServicesSoftDeleteSettings.Serialization.cs @@ -44,6 +44,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("softDeleteRetentionPeriodInDays"u8); writer.WriteNumberValue(SoftDeleteRetentionPeriodInDays.Value); } + if (Optional.IsDefined(EnhancedSecurityState)) + { + writer.WritePropertyName("enhancedSecurityState"u8); + writer.WriteStringValue(EnhancedSecurityState.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -83,6 +88,7 @@ internal static RecoveryServicesSoftDeleteSettings DeserializeRecoveryServicesSo } RecoveryServicesSoftDeleteState? softDeleteState = default; int? softDeleteRetentionPeriodInDays = default; + EnhancedSecurityState? enhancedSecurityState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -105,13 +111,22 @@ internal static RecoveryServicesSoftDeleteSettings DeserializeRecoveryServicesSo softDeleteRetentionPeriodInDays = property.Value.GetInt32(); continue; } + if (property.NameEquals("enhancedSecurityState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enhancedSecurityState = new EnhancedSecurityState(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new RecoveryServicesSoftDeleteSettings(softDeleteState, softDeleteRetentionPeriodInDays, serializedAdditionalRawData); + return new RecoveryServicesSoftDeleteSettings(softDeleteState, softDeleteRetentionPeriodInDays, enhancedSecurityState, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/RecoveryServicesSoftDeleteSettings.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/RecoveryServicesSoftDeleteSettings.cs index 5bebaf46dc0d..02d47c4f555a 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/RecoveryServicesSoftDeleteSettings.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/RecoveryServicesSoftDeleteSettings.cs @@ -53,11 +53,13 @@ public RecoveryServicesSoftDeleteSettings() /// Initializes a new instance of . /// /// Soft delete retention period in days. + /// /// Keeps track of any properties unknown to the library. - internal RecoveryServicesSoftDeleteSettings(RecoveryServicesSoftDeleteState? softDeleteState, int? softDeleteRetentionPeriodInDays, IDictionary serializedAdditionalRawData) + internal RecoveryServicesSoftDeleteSettings(RecoveryServicesSoftDeleteState? softDeleteState, int? softDeleteRetentionPeriodInDays, EnhancedSecurityState? enhancedSecurityState, IDictionary serializedAdditionalRawData) { SoftDeleteState = softDeleteState; SoftDeleteRetentionPeriodInDays = softDeleteRetentionPeriodInDays; + EnhancedSecurityState = enhancedSecurityState; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -65,5 +67,7 @@ internal RecoveryServicesSoftDeleteSettings(RecoveryServicesSoftDeleteState? sof public RecoveryServicesSoftDeleteState? SoftDeleteState { get; set; } /// Soft delete retention period in days. public int? SoftDeleteRetentionPeriodInDays { get; set; } + /// Gets or sets the enhanced security state. + public EnhancedSecurityState? EnhancedSecurityState { get; set; } } } diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/RecoveryServicesVaultProperties.Serialization.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/RecoveryServicesVaultProperties.Serialization.cs index aaf16cdca0ab..7cadf5448720 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/RecoveryServicesVaultProperties.Serialization.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/RecoveryServicesVaultProperties.Serialization.cs @@ -114,6 +114,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("secureScore"u8); writer.WriteStringValue(SecureScore.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(BcdrSecurityLevel)) + { + writer.WritePropertyName("bcdrSecurityLevel"u8); + writer.WriteStringValue(BcdrSecurityLevel.Value.ToString()); + } + if (Optional.IsCollectionDefined(ResourceGuardOperationRequests)) + { + writer.WritePropertyName("resourceGuardOperationRequests"u8); + writer.WriteStartArray(); + foreach (var item in ResourceGuardOperationRequests) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -166,6 +181,8 @@ internal static RecoveryServicesVaultProperties DeserializeRecoveryServicesVault VaultPropertiesRedundancySettings redundancySettings = default; RecoveryServicesSecuritySettings securitySettings = default; SecureScoreLevel? secureScore = default; + BcdrSecurityLevel? bcdrSecurityLevel = default; + IList resourceGuardOperationRequests = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -306,6 +323,29 @@ internal static RecoveryServicesVaultProperties DeserializeRecoveryServicesVault secureScore = new SecureScoreLevel(property.Value.GetString()); continue; } + if (property.NameEquals("bcdrSecurityLevel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bcdrSecurityLevel = new BcdrSecurityLevel(property.Value.GetString()); + continue; + } + if (property.NameEquals("resourceGuardOperationRequests"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + resourceGuardOperationRequests = array; + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -328,6 +368,8 @@ internal static RecoveryServicesVaultProperties DeserializeRecoveryServicesVault redundancySettings, securitySettings, secureScore, + bcdrSecurityLevel, + resourceGuardOperationRequests ?? new ChangeTrackingList(), serializedAdditionalRawData); } diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/RecoveryServicesVaultProperties.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/RecoveryServicesVaultProperties.cs index 28e1980bdf1c..941a082b3202 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/RecoveryServicesVaultProperties.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/RecoveryServicesVaultProperties.cs @@ -49,6 +49,7 @@ public partial class RecoveryServicesVaultProperties public RecoveryServicesVaultProperties() { PrivateEndpointConnections = new ChangeTrackingList(); + ResourceGuardOperationRequests = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -67,8 +68,10 @@ public RecoveryServicesVaultProperties() /// The redundancy Settings of a Vault. /// Security Settings of the vault. /// Secure Score of Recovery Services Vault. + /// Security levels of Recovery Services Vault for business continuity and disaster recovery. + /// ResourceGuardOperationRequests on which LAC check will be performed. /// Keeps track of any properties unknown to the library. - internal RecoveryServicesVaultProperties(string provisioningState, VaultUpgradeDetails upgradeDetails, IReadOnlyList privateEndpointConnections, VaultPrivateEndpointState? privateEndpointStateForBackup, VaultPrivateEndpointState? privateEndpointStateForSiteRecovery, VaultPropertiesEncryption encryption, VaultPropertiesMoveDetails moveDetails, ResourceMoveState? moveState, BackupStorageVersion? backupStorageVersion, VaultPublicNetworkAccess? publicNetworkAccess, VaultMonitoringSettings monitoringSettings, RestoreSettings restoreSettings, VaultPropertiesRedundancySettings redundancySettings, RecoveryServicesSecuritySettings securitySettings, SecureScoreLevel? secureScore, IDictionary serializedAdditionalRawData) + internal RecoveryServicesVaultProperties(string provisioningState, VaultUpgradeDetails upgradeDetails, IReadOnlyList privateEndpointConnections, VaultPrivateEndpointState? privateEndpointStateForBackup, VaultPrivateEndpointState? privateEndpointStateForSiteRecovery, VaultPropertiesEncryption encryption, VaultPropertiesMoveDetails moveDetails, ResourceMoveState? moveState, BackupStorageVersion? backupStorageVersion, VaultPublicNetworkAccess? publicNetworkAccess, VaultMonitoringSettings monitoringSettings, RestoreSettings restoreSettings, VaultPropertiesRedundancySettings redundancySettings, RecoveryServicesSecuritySettings securitySettings, SecureScoreLevel? secureScore, BcdrSecurityLevel? bcdrSecurityLevel, IList resourceGuardOperationRequests, IDictionary serializedAdditionalRawData) { ProvisioningState = provisioningState; UpgradeDetails = upgradeDetails; @@ -85,6 +88,8 @@ internal RecoveryServicesVaultProperties(string provisioningState, VaultUpgradeD RedundancySettings = redundancySettings; SecuritySettings = securitySettings; SecureScore = secureScore; + BcdrSecurityLevel = bcdrSecurityLevel; + ResourceGuardOperationRequests = resourceGuardOperationRequests; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -130,5 +135,9 @@ public CrossSubscriptionRestoreState? CrossSubscriptionRestoreState public RecoveryServicesSecuritySettings SecuritySettings { get; set; } /// Secure Score of Recovery Services Vault. public SecureScoreLevel? SecureScore { get; } + /// Security levels of Recovery Services Vault for business continuity and disaster recovery. + public BcdrSecurityLevel? BcdrSecurityLevel { get; } + /// ResourceGuardOperationRequests on which LAC check will be performed. + public IList ResourceGuardOperationRequests { get; } } } diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/StandardTierStorageRedundancy.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/StandardTierStorageRedundancy.cs index 9e09a5431f6d..47869f9ea0f2 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/StandardTierStorageRedundancy.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/StandardTierStorageRedundancy.cs @@ -22,10 +22,13 @@ public StandardTierStorageRedundancy(string value) _value = value ?? throw new ArgumentNullException(nameof(value)); } + private const string InvalidValue = "Invalid"; private const string LocallyRedundantValue = "LocallyRedundant"; private const string GeoRedundantValue = "GeoRedundant"; private const string ZoneRedundantValue = "ZoneRedundant"; + /// Invalid. + public static StandardTierStorageRedundancy Invalid { get; } = new StandardTierStorageRedundancy(InvalidValue); /// LocallyRedundant. public static StandardTierStorageRedundancy LocallyRedundant { get; } = new StandardTierStorageRedundancy(LocallyRedundantValue); /// GeoRedundant. diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/VaultMonitoringSettings.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/VaultMonitoringSettings.cs index 7135ee342ae1..48dc1c73fc68 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/VaultMonitoringSettings.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/VaultMonitoringSettings.cs @@ -62,31 +62,8 @@ internal VaultMonitoringSettings(AzureMonitorAlertSettings azureMonitorAlertSett } /// Settings for Azure Monitor based alerts. - internal AzureMonitorAlertSettings AzureMonitorAlertSettings { get; set; } - /// Gets or sets the azure monitor alert alerts for all job failures. - public RecoveryServicesAlertsState? AzureMonitorAlertAlertsForAllJobFailures - { - get => AzureMonitorAlertSettings is null ? default : AzureMonitorAlertSettings.AlertsForAllJobFailures; - set - { - if (AzureMonitorAlertSettings is null) - AzureMonitorAlertSettings = new AzureMonitorAlertSettings(); - AzureMonitorAlertSettings.AlertsForAllJobFailures = value; - } - } - + public AzureMonitorAlertSettings AzureMonitorAlertSettings { get; set; } /// Settings for classic alerts. - internal ClassicAlertSettings ClassicAlertSettings { get; set; } - /// Gets or sets the classic alert alerts for critical operations. - public RecoveryServicesAlertsState? ClassicAlertAlertsForCriticalOperations - { - get => ClassicAlertSettings is null ? default : ClassicAlertSettings.AlertsForCriticalOperations; - set - { - if (ClassicAlertSettings is null) - ClassicAlertSettings = new ClassicAlertSettings(); - ClassicAlertSettings.AlertsForCriticalOperations = value; - } - } + public ClassicAlertSettings ClassicAlertSettings { get; set; } } } diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/VaultPropertiesRedundancySettings.Serialization.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/VaultPropertiesRedundancySettings.Serialization.cs index 5ba5dc230b62..6b69f47c122f 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/VaultPropertiesRedundancySettings.Serialization.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/VaultPropertiesRedundancySettings.Serialization.cs @@ -34,12 +34,12 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(VaultPropertiesRedundancySettings)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsDefined(StandardTierStorageRedundancy)) + if (Optional.IsDefined(StandardTierStorageRedundancy)) { writer.WritePropertyName("standardTierStorageRedundancy"u8); writer.WriteStringValue(StandardTierStorageRedundancy.Value.ToString()); } - if (options.Format != "W" && Optional.IsDefined(CrossRegionRestore)) + if (Optional.IsDefined(CrossRegionRestore)) { writer.WritePropertyName("crossRegionRestore"u8); writer.WriteStringValue(CrossRegionRestore.Value.ToString()); diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/VaultPropertiesRedundancySettings.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/VaultPropertiesRedundancySettings.cs index 6667f670678e..3bbec3562c9f 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/VaultPropertiesRedundancySettings.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Models/VaultPropertiesRedundancySettings.cs @@ -62,8 +62,8 @@ internal VaultPropertiesRedundancySettings(StandardTierStorageRedundancy? standa } /// The storage redundancy setting of a vault. - public StandardTierStorageRedundancy? StandardTierStorageRedundancy { get; } + public StandardTierStorageRedundancy? StandardTierStorageRedundancy { get; set; } /// Flag to show if Cross Region Restore is enabled on the Vault or not. - public CrossRegionRestore? CrossRegionRestore { get; } + public CrossRegionRestore? CrossRegionRestore { get; set; } } } diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RecoveryServicesPrivateLinkResource.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RecoveryServicesPrivateLinkResource.cs index 98043878d1f0..a25d1d14c684 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RecoveryServicesPrivateLinkResource.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RecoveryServicesPrivateLinkResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RecoveryServicesPrivateLinkResourceCollection.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RecoveryServicesPrivateLinkResourceCollection.cs index 1054c239dab1..41196c1b6091 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RecoveryServicesPrivateLinkResourceCollection.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RecoveryServicesPrivateLinkResourceCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string privateL /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual AsyncPageable GetAllAsync(Ca /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual Pageable GetAll(Cancellation /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -257,7 +257,7 @@ public virtual async Task> ExistsAsync(string privateLinkResource /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -300,7 +300,7 @@ public virtual Response Exists(string privateLinkResourceName, Cancellatio /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -345,7 +345,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RecoveryServicesVaultCollection.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RecoveryServicesVaultCollection.cs index ea0ecb0cba49..b98091055c2a 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RecoveryServicesVaultCollection.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RecoveryServicesVaultCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -76,10 +76,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The name of the recovery services vault. /// Recovery Services Vault to be created. + /// The to use. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string vaultName, RecoveryServicesVaultData data, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string vaultName, RecoveryServicesVaultData data, string xMsAuthorizationAuxiliary = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); Argument.AssertNotNull(data, nameof(data)); @@ -88,8 +89,8 @@ public virtual async Task> CreateOrU scope.Start(); try { - var response = await _recoveryServicesVaultVaultsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, vaultName, data, cancellationToken).ConfigureAwait(false); - var operation = new RecoveryServicesArmOperation(new RecoveryServicesVaultOperationSource(Client), _recoveryServicesVaultVaultsClientDiagnostics, Pipeline, _recoveryServicesVaultVaultsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, vaultName, data).Request, response, OperationFinalStateVia.Location); + var response = await _recoveryServicesVaultVaultsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, vaultName, data, xMsAuthorizationAuxiliary, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesArmOperation(new RecoveryServicesVaultOperationSource(Client), _recoveryServicesVaultVaultsClientDiagnostics, Pipeline, _recoveryServicesVaultVaultsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, vaultName, data, xMsAuthorizationAuxiliary).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -114,7 +115,7 @@ public virtual async Task> CreateOrU /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -125,10 +126,11 @@ public virtual async Task> CreateOrU /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The name of the recovery services vault. /// Recovery Services Vault to be created. + /// The to use. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string vaultName, RecoveryServicesVaultData data, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string vaultName, RecoveryServicesVaultData data, string xMsAuthorizationAuxiliary = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); Argument.AssertNotNull(data, nameof(data)); @@ -137,8 +139,8 @@ public virtual ArmOperation CreateOrUpdate(WaitUn scope.Start(); try { - var response = _recoveryServicesVaultVaultsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, vaultName, data, cancellationToken); - var operation = new RecoveryServicesArmOperation(new RecoveryServicesVaultOperationSource(Client), _recoveryServicesVaultVaultsClientDiagnostics, Pipeline, _recoveryServicesVaultVaultsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, vaultName, data).Request, response, OperationFinalStateVia.Location); + var response = _recoveryServicesVaultVaultsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, vaultName, data, xMsAuthorizationAuxiliary, cancellationToken); + var operation = new RecoveryServicesArmOperation(new RecoveryServicesVaultOperationSource(Client), _recoveryServicesVaultVaultsClientDiagnostics, Pipeline, _recoveryServicesVaultVaultsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, vaultName, data, xMsAuthorizationAuxiliary).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -163,7 +165,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUn /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -208,7 +210,7 @@ public virtual async Task> GetAsync(stri /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -253,7 +255,7 @@ public virtual Response Get(string vaultName, Can /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -283,7 +285,7 @@ public virtual AsyncPageable GetAllAsync(Cancella /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -313,7 +315,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -356,7 +358,7 @@ public virtual async Task> ExistsAsync(string vaultName, Cancella /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -399,7 +401,7 @@ public virtual Response Exists(string vaultName, CancellationToken cancell /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -444,7 +446,7 @@ public virtual async Task> GetIf /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RecoveryServicesVaultExtendedInfoResource.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RecoveryServicesVaultExtendedInfoResource.cs index 851d15948c3b..933d74134d50 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RecoveryServicesVaultExtendedInfoResource.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RecoveryServicesVaultExtendedInfoResource.cs @@ -100,7 +100,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -140,7 +140,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -180,7 +180,7 @@ public virtual Response Get(Cancellat /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -222,7 +222,7 @@ public virtual async Task> U /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -264,7 +264,7 @@ public virtual Response Update(Recove /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RecoveryServicesVaultResource.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RecoveryServicesVaultResource.cs index 2c30a9851df8..f6f2a52164e4 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RecoveryServicesVaultResource.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RecoveryServicesVaultResource.cs @@ -127,7 +127,7 @@ public virtual RecoveryServicesPrivateLinkResourceCollection GetRecoveryServices /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -158,7 +158,7 @@ public virtual async Task> GetReco /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -196,7 +196,7 @@ public virtual RecoveryServicesVaultExtendedInfoResource GetRecoveryServicesVaul /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -236,7 +236,7 @@ public virtual async Task> GetAsync(Canc /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -276,7 +276,7 @@ public virtual Response Get(CancellationToken can /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -293,9 +293,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell try { var response = await _recoveryServicesVaultVaultsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var uri = _recoveryServicesVaultVaultsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new RecoveryServicesArmOperation(response, rehydrationToken); + var operation = new RecoveryServicesArmOperation(_recoveryServicesVaultVaultsClientDiagnostics, Pipeline, _recoveryServicesVaultVaultsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -320,7 +318,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -337,9 +335,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel try { var response = _recoveryServicesVaultVaultsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var uri = _recoveryServicesVaultVaultsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new RecoveryServicesArmOperation(response, rehydrationToken); + var operation = new RecoveryServicesArmOperation(_recoveryServicesVaultVaultsClientDiagnostics, Pipeline, _recoveryServicesVaultVaultsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -364,7 +360,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -374,9 +370,10 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// Recovery Services Vault to be created. + /// The to use. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, RecoveryServicesVaultPatch patch, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, RecoveryServicesVaultPatch patch, string xMsAuthorizationAuxiliary = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); @@ -384,8 +381,8 @@ public virtual async Task> UpdateAsy scope.Start(); try { - var response = await _recoveryServicesVaultVaultsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new RecoveryServicesArmOperation(new RecoveryServicesVaultOperationSource(Client), _recoveryServicesVaultVaultsClientDiagnostics, Pipeline, _recoveryServicesVaultVaultsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = await _recoveryServicesVaultVaultsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, xMsAuthorizationAuxiliary, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesArmOperation(new RecoveryServicesVaultOperationSource(Client), _recoveryServicesVaultVaultsClientDiagnostics, Pipeline, _recoveryServicesVaultVaultsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, xMsAuthorizationAuxiliary).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -410,7 +407,7 @@ public virtual async Task> UpdateAsy /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -420,9 +417,10 @@ public virtual async Task> UpdateAsy /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// Recovery Services Vault to be created. + /// The to use. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, RecoveryServicesVaultPatch patch, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, RecoveryServicesVaultPatch patch, string xMsAuthorizationAuxiliary = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); @@ -430,8 +428,8 @@ public virtual ArmOperation Update(WaitUntil wait scope.Start(); try { - var response = _recoveryServicesVaultVaultsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); - var operation = new RecoveryServicesArmOperation(new RecoveryServicesVaultOperationSource(Client), _recoveryServicesVaultVaultsClientDiagnostics, Pipeline, _recoveryServicesVaultVaultsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = _recoveryServicesVaultVaultsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, xMsAuthorizationAuxiliary, cancellationToken); + var operation = new RecoveryServicesArmOperation(new RecoveryServicesVaultOperationSource(Client), _recoveryServicesVaultVaultsClientDiagnostics, Pipeline, _recoveryServicesVaultVaultsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, xMsAuthorizationAuxiliary).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -456,7 +454,7 @@ public virtual ArmOperation Update(WaitUntil wait /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// @@ -497,7 +495,7 @@ public virtual async Task> CreateVaultCertifica /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// @@ -538,7 +536,7 @@ public virtual Response CreateVaultCertificate(string ce /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// @@ -577,7 +575,7 @@ public virtual async Task DeleteRegisteredIdentityAsync(string identit /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// @@ -616,7 +614,7 @@ public virtual Response DeleteRegisteredIdentity(string identityName, Cancellati /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// @@ -641,7 +639,7 @@ public virtual AsyncPageable GetReplicationUsagesAsync(Cancell /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// @@ -666,7 +664,7 @@ public virtual Pageable GetReplicationUsages(CancellationToken /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// @@ -691,7 +689,7 @@ public virtual AsyncPageable GetUsagesByVaultsAsync(CancellationToke /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// @@ -716,7 +714,7 @@ public virtual Pageable GetUsagesByVaults(CancellationToken cancella /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -778,7 +776,7 @@ public virtual async Task> AddTagAsync(s /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -840,7 +838,7 @@ public virtual Response AddTag(string key, string /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -897,7 +895,7 @@ public virtual async Task> SetTagsAsync( /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -954,7 +952,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource @@ -1014,7 +1012,7 @@ public virtual async Task> RemoveTagAsyn /// /// /// Default Api Version - /// 2023-04-01 + /// 2024-10-01 /// /// /// Resource diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs index b6313684c407..31e82b98fc23 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -32,7 +32,7 @@ public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-04-01"; + _apiVersion = apiVersion ?? "2024-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/RecoveryServicesRestOperations.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/RecoveryServicesRestOperations.cs index 4433c9ae4e43..bee08dec582c 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/RecoveryServicesRestOperations.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/RecoveryServicesRestOperations.cs @@ -32,7 +32,7 @@ public RecoveryServicesRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-04-01"; + _apiVersion = apiVersion ?? "2024-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/RegisteredIdentitiesRestOperations.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/RegisteredIdentitiesRestOperations.cs index 30a1b9711d82..812175e4934b 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/RegisteredIdentitiesRestOperations.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/RegisteredIdentitiesRestOperations.cs @@ -30,7 +30,7 @@ public RegisteredIdentitiesRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-04-01"; + _apiVersion = apiVersion ?? "2024-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/ReplicationUsagesRestOperations.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/ReplicationUsagesRestOperations.cs index 80e462516406..2ea1bec90a9e 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/ReplicationUsagesRestOperations.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/ReplicationUsagesRestOperations.cs @@ -32,7 +32,7 @@ public ReplicationUsagesRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-04-01"; + _apiVersion = apiVersion ?? "2024-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/UsagesRestOperations.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/UsagesRestOperations.cs index 0873a0be9d83..5d5fb9a2f78b 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/UsagesRestOperations.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/UsagesRestOperations.cs @@ -32,7 +32,7 @@ public UsagesRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-04-01"; + _apiVersion = apiVersion ?? "2024-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/VaultCertificatesRestOperations.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/VaultCertificatesRestOperations.cs index a1642e559386..1f077ba38fd3 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/VaultCertificatesRestOperations.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/VaultCertificatesRestOperations.cs @@ -32,7 +32,7 @@ public VaultCertificatesRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-04-01"; + _apiVersion = apiVersion ?? "2024-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/VaultExtendedInfoRestOperations.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/VaultExtendedInfoRestOperations.cs index 9be3b71d81e9..a7bdf550d76e 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/VaultExtendedInfoRestOperations.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/VaultExtendedInfoRestOperations.cs @@ -31,7 +31,7 @@ public VaultExtendedInfoRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-04-01"; + _apiVersion = apiVersion ?? "2024-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/VaultsRestOperations.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/VaultsRestOperations.cs index 2bf9e3f54d17..bf7be056f6d2 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/VaultsRestOperations.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RestOperations/VaultsRestOperations.cs @@ -32,7 +32,7 @@ public VaultsRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-04-01"; + _apiVersion = apiVersion ?? "2024-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -296,7 +296,7 @@ public Response Get(string subscriptionId, string res } } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, RecoveryServicesVaultData data) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, RecoveryServicesVaultData data, string xMsAuthorizationAuxiliary) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -310,7 +310,7 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string vaultName, RecoveryServicesVaultData data) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string vaultName, RecoveryServicesVaultData data, string xMsAuthorizationAuxiliary) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -325,6 +325,10 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r uri.AppendPath(vaultName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; + if (xMsAuthorizationAuxiliary != null) + { + request.Headers.Add("x-ms-authorization-auxiliary", xMsAuthorizationAuxiliary); + } request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); @@ -339,17 +343,18 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r /// The name of the resource group. The name is case insensitive. /// The name of the recovery services vault. /// Recovery Services Vault to be created. + /// The to use. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string vaultName, RecoveryServicesVaultData data, CancellationToken cancellationToken = default) + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string vaultName, RecoveryServicesVaultData data, string xMsAuthorizationAuxiliary = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, vaultName, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, vaultName, data, xMsAuthorizationAuxiliary); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -366,17 +371,18 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re /// The name of the resource group. The name is case insensitive. /// The name of the recovery services vault. /// Recovery Services Vault to be created. + /// The to use. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string vaultName, RecoveryServicesVaultData data, CancellationToken cancellationToken = default) + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string vaultName, RecoveryServicesVaultData data, string xMsAuthorizationAuxiliary = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, vaultName, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, vaultName, data, xMsAuthorizationAuxiliary); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -439,7 +445,8 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: + case 202: + case 204: return message.Response; default: throw new RequestFailedException(message.Response); @@ -463,14 +470,15 @@ public Response Delete(string subscriptionId, string resourceGroupName, string v _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: + case 202: + case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, RecoveryServicesVaultPatch patch) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, RecoveryServicesVaultPatch patch, string xMsAuthorizationAuxiliary) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -484,7 +492,7 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string vaultName, RecoveryServicesVaultPatch patch) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string vaultName, RecoveryServicesVaultPatch patch, string xMsAuthorizationAuxiliary) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -499,6 +507,10 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendPath(vaultName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; + if (xMsAuthorizationAuxiliary != null) + { + request.Headers.Add("x-ms-authorization-auxiliary", xMsAuthorizationAuxiliary); + } request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); @@ -513,17 +525,18 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG /// The name of the resource group. The name is case insensitive. /// The name of the recovery services vault. /// Recovery Services Vault to be created. + /// The to use. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string vaultName, RecoveryServicesVaultPatch patch, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string vaultName, RecoveryServicesVaultPatch patch, string xMsAuthorizationAuxiliary = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, vaultName, patch); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, vaultName, patch, xMsAuthorizationAuxiliary); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -540,17 +553,18 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr /// The name of the resource group. The name is case insensitive. /// The name of the recovery services vault. /// Recovery Services Vault to be created. + /// The to use. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string vaultName, RecoveryServicesVaultPatch patch, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string vaultName, RecoveryServicesVaultPatch patch, string xMsAuthorizationAuxiliary = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, vaultName, patch); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, vaultName, patch, xMsAuthorizationAuxiliary); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/autorest.md b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/autorest.md index 8b8c4508a66a..5e4e5b9caa67 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/autorest.md +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: RecoveryServices namespace: Azure.ResourceManager.RecoveryServices -require: https://github.com/Azure/azure-rest-api-specs/blob/95c0363e4cae8756c6a33b58add67776db427bbc/specification/recoveryservices/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/recoveryservices/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: diff --git a/sdk/recoveryservices/ci.mgmt.yml b/sdk/recoveryservices/ci.mgmt.yml index 0e7e6985f21c..59e5af3132ed 100644 --- a/sdk/recoveryservices/ci.mgmt.yml +++ b/sdk/recoveryservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/recoveryservices/ci.mgmt.yml - sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices/ci.mgmt.yml + - sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices/ci.mgmt.yml + - sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices/ci.mgmt.yml + - sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices/ci.mgmt.yml + - sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices/ci.mgmt.yml + - sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices/ci.mgmt.yml + - sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices/ci.mgmt.yml + - sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices/ci.mgmt.yml + - sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices/ci.mgmt.yml + - sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/redis/ci.mgmt.yml b/sdk/redis/ci.mgmt.yml index 9e6845322580..8f1c31d22469 100644 --- a/sdk/redis/ci.mgmt.yml +++ b/sdk/redis/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/redis/ci.mgmt.yml - sdk/redis/Azure.ResourceManager.Redis/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/redis/ci.mgmt.yml + - sdk/redis/Azure.ResourceManager.Redis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/redis/ci.mgmt.yml + - sdk/redis/Azure.ResourceManager.Redis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/redis/ci.mgmt.yml + - sdk/redis/Azure.ResourceManager.Redis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/redis/ci.mgmt.yml + - sdk/redis/Azure.ResourceManager.Redis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/redis/ci.mgmt.yml + - sdk/redis/Azure.ResourceManager.Redis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/redis/ci.mgmt.yml + - sdk/redis/Azure.ResourceManager.Redis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/redis/ci.mgmt.yml + - sdk/redis/Azure.ResourceManager.Redis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/redis/ci.mgmt.yml + - sdk/redis/Azure.ResourceManager.Redis/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/redis/ci.mgmt.yml + - sdk/redis/Azure.ResourceManager.Redis/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/api/Azure.ResourceManager.RedisEnterprise.net8.0.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/api/Azure.ResourceManager.RedisEnterprise.net8.0.cs index d0e42e163495..2942894952c3 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/api/Azure.ResourceManager.RedisEnterprise.net8.0.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/api/Azure.ResourceManager.RedisEnterprise.net8.0.cs @@ -1,54 +1,5 @@ namespace Azure.ResourceManager.RedisEnterprise { - public partial class AccessPolicyAssignmentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected AccessPolicyAssignmentCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string accessPolicyAssignmentName, Azure.ResourceManager.RedisEnterprise.AccessPolicyAssignmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string accessPolicyAssignmentName, Azure.ResourceManager.RedisEnterprise.AccessPolicyAssignmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Exists(string accessPolicyAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string accessPolicyAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string accessPolicyAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string accessPolicyAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string accessPolicyAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string accessPolicyAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class AccessPolicyAssignmentData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public AccessPolicyAssignmentData() { } - public string AccessPolicyName { get { throw null; } set { } } - public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? ProvisioningState { get { throw null; } } - public System.Guid? UserObjectId { get { throw null; } set { } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.RedisEnterprise.AccessPolicyAssignmentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.RedisEnterprise.AccessPolicyAssignmentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class AccessPolicyAssignmentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public static readonly Azure.Core.ResourceType ResourceType; - protected AccessPolicyAssignmentResource() { } - public virtual Azure.ResourceManager.RedisEnterprise.AccessPolicyAssignmentData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string clusterName, string databaseName, string accessPolicyAssignmentName) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.RedisEnterprise.AccessPolicyAssignmentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.RedisEnterprise.AccessPolicyAssignmentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RedisEnterprise.AccessPolicyAssignmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RedisEnterprise.AccessPolicyAssignmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } public partial class RedisEnterpriseClusterCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected RedisEnterpriseClusterCollection() { } @@ -70,14 +21,12 @@ public partial class RedisEnterpriseClusterData : Azure.ResourceManager.Models.T { public RedisEnterpriseClusterData(Azure.Core.AzureLocation location, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSku sku) { } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseCustomerManagedKeyEncryption CustomerManagedKeyEncryption { get { throw null; } set { } } - public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseHighAvailability? HighAvailability { get { throw null; } set { } } public string HostName { get { throw null; } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseTlsVersion? MinimumTlsVersion { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList PrivateEndpointConnections { get { throw null; } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? ProvisioningState { get { throw null; } } public string RedisVersion { get { throw null; } } - public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode? RedundancyMode { get { throw null; } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? ResourceState { get { throw null; } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSku Sku { get { throw null; } set { } } public System.Collections.Generic.IList Zones { get { throw null; } } @@ -141,17 +90,14 @@ protected RedisEnterpriseDatabaseCollection() { } public partial class RedisEnterpriseDatabaseData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public RedisEnterpriseDatabaseData() { } - public Azure.ResourceManager.RedisEnterprise.Models.AccessKeysAuthentication? AccessKeysAuthentication { get { throw null; } set { } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClientProtocol? ClientProtocol { get { throw null; } set { } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusteringPolicy? ClusteringPolicy { get { throw null; } set { } } - public Azure.ResourceManager.RedisEnterprise.Models.DeferUpgradeSetting? DeferUpgrade { get { throw null; } set { } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy? EvictionPolicy { get { throw null; } set { } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabaseGeoReplication GeoReplication { get { throw null; } set { } } public System.Collections.Generic.IList Modules { get { throw null; } } public Azure.ResourceManager.RedisEnterprise.Models.RedisPersistenceSettings Persistence { get { throw null; } set { } } public int? Port { get { throw null; } set { } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? ProvisioningState { get { throw null; } } - public string RedisVersion { get { throw null; } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? ResourceState { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.RedisEnterprise.RedisEnterpriseDatabaseData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -178,9 +124,6 @@ protected RedisEnterpriseDatabaseResource() { } public virtual Azure.ResourceManager.ArmOperation ForceUnlink(Azure.WaitUntil waitUntil, Azure.ResourceManager.RedisEnterprise.Models.ForceUnlinkRedisEnterpriseDatabaseContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task ForceUnlinkAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RedisEnterprise.Models.ForceUnlinkRedisEnterpriseDatabaseContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetAccessPolicyAssignment(string accessPolicyAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAccessPolicyAssignmentAsync(string accessPolicyAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.RedisEnterprise.AccessPolicyAssignmentCollection GetAccessPolicyAssignments() { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetKeys(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetKeysAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -195,12 +138,9 @@ protected RedisEnterpriseDatabaseResource() { } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabasePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabasePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.ArmOperation UpgradeDBRedisVersion(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task UpgradeDBRedisVersionAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public static partial class RedisEnterpriseExtensions { - public static Azure.ResourceManager.RedisEnterprise.AccessPolicyAssignmentResource GetAccessPolicyAssignmentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetRedisEnterpriseCluster(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetRedisEnterpriseClusterAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.RedisEnterprise.RedisEnterpriseClusterResource GetRedisEnterpriseClusterResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -267,7 +207,6 @@ namespace Azure.ResourceManager.RedisEnterprise.Mocking public partial class MockableRedisEnterpriseArmClient : Azure.ResourceManager.ArmResource { protected MockableRedisEnterpriseArmClient() { } - public virtual Azure.ResourceManager.RedisEnterprise.AccessPolicyAssignmentResource GetAccessPolicyAssignmentResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.RedisEnterprise.RedisEnterpriseClusterResource GetRedisEnterpriseClusterResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.RedisEnterprise.RedisEnterpriseDatabaseResource GetRedisEnterpriseDatabaseResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.RedisEnterprise.RedisEnterprisePrivateEndpointConnectionResource GetRedisEnterprisePrivateEndpointConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -290,64 +229,19 @@ protected MockableRedisEnterpriseSubscriptionResource() { } } namespace Azure.ResourceManager.RedisEnterprise.Models { - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct AccessKeysAuthentication : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public AccessKeysAuthentication(string value) { throw null; } - public static Azure.ResourceManager.RedisEnterprise.Models.AccessKeysAuthentication Disabled { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.AccessKeysAuthentication Enabled { get { throw null; } } - public bool Equals(Azure.ResourceManager.RedisEnterprise.Models.AccessKeysAuthentication other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.RedisEnterprise.Models.AccessKeysAuthentication left, Azure.ResourceManager.RedisEnterprise.Models.AccessKeysAuthentication right) { throw null; } - public static implicit operator Azure.ResourceManager.RedisEnterprise.Models.AccessKeysAuthentication (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.RedisEnterprise.Models.AccessKeysAuthentication left, Azure.ResourceManager.RedisEnterprise.Models.AccessKeysAuthentication right) { throw null; } - public override string ToString() { throw null; } - } public static partial class ArmRedisEnterpriseModelFactory { - public static Azure.ResourceManager.RedisEnterprise.AccessPolicyAssignmentData AccessPolicyAssignmentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? provisioningState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus?), string accessPolicyName = null, System.Guid? userObjectId = default(System.Guid?)) { throw null; } - public static Azure.ResourceManager.RedisEnterprise.RedisEnterpriseClusterData RedisEnterpriseClusterData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSku sku = null, System.Collections.Generic.IEnumerable zones = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseHighAvailability? highAvailability = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseHighAvailability?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseTlsVersion? minimumTlsVersion = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseTlsVersion?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseCustomerManagedKeyEncryption customerManagedKeyEncryption = null, string hostName = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? provisioningState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode? redundancyMode = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? resourceState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState?), string redisVersion = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.RedisEnterprise.RedisEnterpriseClusterData RedisEnterpriseClusterData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSku sku, System.Collections.Generic.IEnumerable zones, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseTlsVersion? minimumTlsVersion, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseCustomerManagedKeyEncryption customerManagedKeyEncryption, string hostName, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? provisioningState, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? resourceState, string redisVersion, System.Collections.Generic.IEnumerable privateEndpointConnections) { throw null; } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterPatch RedisEnterpriseClusterPatch(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSku sku = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseHighAvailability? highAvailability = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseHighAvailability?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseTlsVersion? minimumTlsVersion = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseTlsVersion?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseCustomerManagedKeyEncryption customerManagedKeyEncryption = null, string hostName = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? provisioningState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode? redundancyMode = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? resourceState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState?), string redisVersion = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterPatch RedisEnterpriseClusterPatch(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSku sku, Azure.ResourceManager.Models.ManagedServiceIdentity identity, System.Collections.Generic.IDictionary tags, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseTlsVersion? minimumTlsVersion, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseCustomerManagedKeyEncryption customerManagedKeyEncryption, string hostName, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? provisioningState, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? resourceState, string redisVersion, System.Collections.Generic.IEnumerable privateEndpointConnections) { throw null; } + public static Azure.ResourceManager.RedisEnterprise.RedisEnterpriseClusterData RedisEnterpriseClusterData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSku sku = null, System.Collections.Generic.IEnumerable zones = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseTlsVersion? minimumTlsVersion = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseTlsVersion?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseCustomerManagedKeyEncryption customerManagedKeyEncryption = null, string hostName = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? provisioningState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? resourceState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState?), string redisVersion = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null) { throw null; } + public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterPatch RedisEnterpriseClusterPatch(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSku sku = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseTlsVersion? minimumTlsVersion = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseTlsVersion?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseCustomerManagedKeyEncryption customerManagedKeyEncryption = null, string hostName = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? provisioningState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? resourceState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState?), string redisVersion = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null) { throw null; } public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDataAccessKeys RedisEnterpriseDataAccessKeys(string primaryKey = null, string secondaryKey = null) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.RedisEnterprise.RedisEnterpriseDatabaseData RedisEnterpriseDatabaseData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClientProtocol? clientProtocol, int? port, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? provisioningState, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? resourceState, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusteringPolicy? clusteringPolicy, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy? evictionPolicy, Azure.ResourceManager.RedisEnterprise.Models.RedisPersistenceSettings persistence, System.Collections.Generic.IEnumerable modules, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabaseGeoReplication geoReplication) { throw null; } - public static Azure.ResourceManager.RedisEnterprise.RedisEnterpriseDatabaseData RedisEnterpriseDatabaseData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClientProtocol? clientProtocol = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClientProtocol?), int? port = default(int?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? provisioningState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? resourceState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusteringPolicy? clusteringPolicy = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusteringPolicy?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy? evictionPolicy = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy?), Azure.ResourceManager.RedisEnterprise.Models.RedisPersistenceSettings persistence = null, System.Collections.Generic.IEnumerable modules = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabaseGeoReplication geoReplication = null, string redisVersion = null, Azure.ResourceManager.RedisEnterprise.Models.DeferUpgradeSetting? deferUpgrade = default(Azure.ResourceManager.RedisEnterprise.Models.DeferUpgradeSetting?), Azure.ResourceManager.RedisEnterprise.Models.AccessKeysAuthentication? accessKeysAuthentication = default(Azure.ResourceManager.RedisEnterprise.Models.AccessKeysAuthentication?)) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabasePatch RedisEnterpriseDatabasePatch(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClientProtocol? clientProtocol, int? port, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? provisioningState, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? resourceState, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusteringPolicy? clusteringPolicy, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy? evictionPolicy, Azure.ResourceManager.RedisEnterprise.Models.RedisPersistenceSettings persistence, System.Collections.Generic.IEnumerable modules, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabaseGeoReplication geoReplication) { throw null; } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabasePatch RedisEnterpriseDatabasePatch(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClientProtocol? clientProtocol = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClientProtocol?), int? port = default(int?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? provisioningState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? resourceState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusteringPolicy? clusteringPolicy = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusteringPolicy?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy? evictionPolicy = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy?), Azure.ResourceManager.RedisEnterprise.Models.RedisPersistenceSettings persistence = null, System.Collections.Generic.IEnumerable modules = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabaseGeoReplication geoReplication = null, string redisVersion = null, Azure.ResourceManager.RedisEnterprise.Models.DeferUpgradeSetting? deferUpgrade = default(Azure.ResourceManager.RedisEnterprise.Models.DeferUpgradeSetting?), Azure.ResourceManager.RedisEnterprise.Models.AccessKeysAuthentication? accessKeysAuthentication = default(Azure.ResourceManager.RedisEnterprise.Models.AccessKeysAuthentication?)) { throw null; } + public static Azure.ResourceManager.RedisEnterprise.RedisEnterpriseDatabaseData RedisEnterpriseDatabaseData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClientProtocol? clientProtocol = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClientProtocol?), int? port = default(int?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? provisioningState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? resourceState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusteringPolicy? clusteringPolicy = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusteringPolicy?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy? evictionPolicy = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy?), Azure.ResourceManager.RedisEnterprise.Models.RedisPersistenceSettings persistence = null, System.Collections.Generic.IEnumerable modules = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabaseGeoReplication geoReplication = null) { throw null; } + public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabasePatch RedisEnterpriseDatabasePatch(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClientProtocol? clientProtocol = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClientProtocol?), int? port = default(int?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? provisioningState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? resourceState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusteringPolicy? clusteringPolicy = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusteringPolicy?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy? evictionPolicy = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy?), Azure.ResourceManager.RedisEnterprise.Models.RedisPersistenceSettings persistence = null, System.Collections.Generic.IEnumerable modules = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabaseGeoReplication geoReplication = null) { throw null; } public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseLinkedDatabase RedisEnterpriseLinkedDatabase(Azure.Core.ResourceIdentifier id = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabaseLinkState? state = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabaseLinkState?)) { throw null; } public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseModule RedisEnterpriseModule(string name = null, string args = null, string version = null) { throw null; } public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseOperationStatus RedisEnterpriseOperationStatus(Azure.Core.ResourceIdentifier id = null, string name = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), string status = null, Azure.ResponseError error = null) { throw null; } public static Azure.ResourceManager.RedisEnterprise.RedisEnterprisePrivateEndpointConnectionData RedisEnterprisePrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterprisePrivateLinkServiceConnectionState connectionState = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterprisePrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterprisePrivateEndpointConnectionProvisioningState?)) { throw null; } public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterprisePrivateLinkResource RedisEnterprisePrivateLinkResource(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct DeferUpgradeSetting : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public DeferUpgradeSetting(string value) { throw null; } - public static Azure.ResourceManager.RedisEnterprise.Models.DeferUpgradeSetting Deferred { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.DeferUpgradeSetting NotDeferred { get { throw null; } } - public bool Equals(Azure.ResourceManager.RedisEnterprise.Models.DeferUpgradeSetting other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.RedisEnterprise.Models.DeferUpgradeSetting left, Azure.ResourceManager.RedisEnterprise.Models.DeferUpgradeSetting right) { throw null; } - public static implicit operator Azure.ResourceManager.RedisEnterprise.Models.DeferUpgradeSetting (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.RedisEnterprise.Models.DeferUpgradeSetting left, Azure.ResourceManager.RedisEnterprise.Models.DeferUpgradeSetting right) { throw null; } - public override string ToString() { throw null; } - } public partial class ExportRedisEnterpriseDatabaseContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ExportRedisEnterpriseDatabaseContent(System.Uri sasUri) { } @@ -372,9 +266,8 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer } public partial class ForceLinkContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ForceLinkContent(string groupNickname, System.Collections.Generic.IEnumerable linkedDatabases) { } - public string GroupNickname { get { throw null; } } - public System.Collections.Generic.IList LinkedDatabases { get { throw null; } } + public ForceLinkContent(Azure.ResourceManager.RedisEnterprise.Models.ForceLinkParametersGeoReplication geoReplication) { } + public Azure.ResourceManager.RedisEnterprise.Models.ForceLinkParametersGeoReplication GeoReplication { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.RedisEnterprise.Models.ForceLinkContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -382,6 +275,18 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ForceLinkParametersGeoReplication : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ForceLinkParametersGeoReplication() { } + public string GroupNickname { get { throw null; } set { } } + public System.Collections.Generic.IList LinkedDatabases { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RedisEnterprise.Models.ForceLinkParametersGeoReplication System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RedisEnterprise.Models.ForceLinkParametersGeoReplication System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ForceUnlinkRedisEnterpriseDatabaseContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ForceUnlinkRedisEnterpriseDatabaseContent(System.Collections.Generic.IEnumerable ids) { } @@ -486,14 +391,12 @@ public partial class RedisEnterpriseClusterPatch : System.ClientModel.Primitives { public RedisEnterpriseClusterPatch() { } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseCustomerManagedKeyEncryption CustomerManagedKeyEncryption { get { throw null; } set { } } - public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseHighAvailability? HighAvailability { get { throw null; } set { } } public string HostName { get { throw null; } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseTlsVersion? MinimumTlsVersion { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList PrivateEndpointConnections { get { throw null; } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? ProvisioningState { get { throw null; } } public string RedisVersion { get { throw null; } } - public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode? RedundancyMode { get { throw null; } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? ResourceState { get { throw null; } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSku Sku { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } @@ -624,17 +527,14 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class RedisEnterpriseDatabasePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public RedisEnterpriseDatabasePatch() { } - public Azure.ResourceManager.RedisEnterprise.Models.AccessKeysAuthentication? AccessKeysAuthentication { get { throw null; } set { } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClientProtocol? ClientProtocol { get { throw null; } set { } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusteringPolicy? ClusteringPolicy { get { throw null; } set { } } - public Azure.ResourceManager.RedisEnterprise.Models.DeferUpgradeSetting? DeferUpgrade { get { throw null; } set { } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy? EvictionPolicy { get { throw null; } set { } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabaseGeoReplication GeoReplication { get { throw null; } set { } } public System.Collections.Generic.IList Modules { get { throw null; } } public Azure.ResourceManager.RedisEnterprise.Models.RedisPersistenceSettings Persistence { get { throw null; } set { } } public int? Port { get { throw null; } set { } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? ProvisioningState { get { throw null; } } - public string RedisVersion { get { throw null; } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? ResourceState { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabasePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -667,24 +567,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy left, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy right) { throw null; } public override string ToString() { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct RedisEnterpriseHighAvailability : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public RedisEnterpriseHighAvailability(string value) { throw null; } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseHighAvailability Disabled { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseHighAvailability Enabled { get { throw null; } } - public bool Equals(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseHighAvailability other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseHighAvailability left, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseHighAvailability right) { throw null; } - public static implicit operator Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseHighAvailability (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseHighAvailability left, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseHighAvailability right) { throw null; } - public override string ToString() { throw null; } - } public partial class RedisEnterpriseLinkedDatabase : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public RedisEnterpriseLinkedDatabase() { } @@ -813,25 +695,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus left, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus right) { throw null; } public override string ToString() { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct RedisEnterpriseRedundancyMode : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public RedisEnterpriseRedundancyMode(string value) { throw null; } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode LR { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode None { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode ZR { get { throw null; } } - public bool Equals(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode left, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode right) { throw null; } - public static implicit operator Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode left, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode right) { throw null; } - public override string ToString() { throw null; } - } public partial class RedisEnterpriseRegenerateKeyContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public RedisEnterpriseRegenerateKeyContent(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseAccessKeyType keyType) { } @@ -861,31 +724,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly object _dummy; private readonly int _dummyPrimitive; public RedisEnterpriseSkuName(string value) { throw null; } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName BalancedB0 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName BalancedB1 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName BalancedB10 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName BalancedB100 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName BalancedB1000 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName BalancedB150 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName BalancedB20 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName BalancedB250 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName BalancedB3 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName BalancedB350 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName BalancedB5 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName BalancedB50 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName BalancedB500 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName BalancedB700 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName ComputeOptimizedX10 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName ComputeOptimizedX100 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName ComputeOptimizedX150 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName ComputeOptimizedX20 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName ComputeOptimizedX250 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName ComputeOptimizedX3 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName ComputeOptimizedX350 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName ComputeOptimizedX5 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName ComputeOptimizedX50 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName ComputeOptimizedX500 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName ComputeOptimizedX700 { get { throw null; } } public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName EnterpriseE1 { get { throw null; } } public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName EnterpriseE10 { get { throw null; } } public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName EnterpriseE100 { get { throw null; } } @@ -897,25 +735,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName EnterpriseFlashF1500 { get { throw null; } } public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName EnterpriseFlashF300 { get { throw null; } } public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName EnterpriseFlashF700 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName FlashOptimizedA1000 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName FlashOptimizedA1500 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName FlashOptimizedA2000 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName FlashOptimizedA250 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName FlashOptimizedA4500 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName FlashOptimizedA500 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName FlashOptimizedA700 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName MemoryOptimizedM10 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName MemoryOptimizedM100 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName MemoryOptimizedM1000 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName MemoryOptimizedM150 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName MemoryOptimizedM1500 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName MemoryOptimizedM20 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName MemoryOptimizedM2000 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName MemoryOptimizedM250 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName MemoryOptimizedM350 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName MemoryOptimizedM50 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName MemoryOptimizedM500 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName MemoryOptimizedM700 { get { throw null; } } public bool Equals(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/api/Azure.ResourceManager.RedisEnterprise.netstandard2.0.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/api/Azure.ResourceManager.RedisEnterprise.netstandard2.0.cs index d0e42e163495..2942894952c3 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/api/Azure.ResourceManager.RedisEnterprise.netstandard2.0.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/api/Azure.ResourceManager.RedisEnterprise.netstandard2.0.cs @@ -1,54 +1,5 @@ namespace Azure.ResourceManager.RedisEnterprise { - public partial class AccessPolicyAssignmentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected AccessPolicyAssignmentCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string accessPolicyAssignmentName, Azure.ResourceManager.RedisEnterprise.AccessPolicyAssignmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string accessPolicyAssignmentName, Azure.ResourceManager.RedisEnterprise.AccessPolicyAssignmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Exists(string accessPolicyAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string accessPolicyAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string accessPolicyAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string accessPolicyAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string accessPolicyAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string accessPolicyAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class AccessPolicyAssignmentData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public AccessPolicyAssignmentData() { } - public string AccessPolicyName { get { throw null; } set { } } - public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? ProvisioningState { get { throw null; } } - public System.Guid? UserObjectId { get { throw null; } set { } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.RedisEnterprise.AccessPolicyAssignmentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.RedisEnterprise.AccessPolicyAssignmentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class AccessPolicyAssignmentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public static readonly Azure.Core.ResourceType ResourceType; - protected AccessPolicyAssignmentResource() { } - public virtual Azure.ResourceManager.RedisEnterprise.AccessPolicyAssignmentData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string clusterName, string databaseName, string accessPolicyAssignmentName) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.RedisEnterprise.AccessPolicyAssignmentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.RedisEnterprise.AccessPolicyAssignmentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RedisEnterprise.AccessPolicyAssignmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RedisEnterprise.AccessPolicyAssignmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } public partial class RedisEnterpriseClusterCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected RedisEnterpriseClusterCollection() { } @@ -70,14 +21,12 @@ public partial class RedisEnterpriseClusterData : Azure.ResourceManager.Models.T { public RedisEnterpriseClusterData(Azure.Core.AzureLocation location, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSku sku) { } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseCustomerManagedKeyEncryption CustomerManagedKeyEncryption { get { throw null; } set { } } - public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseHighAvailability? HighAvailability { get { throw null; } set { } } public string HostName { get { throw null; } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseTlsVersion? MinimumTlsVersion { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList PrivateEndpointConnections { get { throw null; } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? ProvisioningState { get { throw null; } } public string RedisVersion { get { throw null; } } - public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode? RedundancyMode { get { throw null; } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? ResourceState { get { throw null; } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSku Sku { get { throw null; } set { } } public System.Collections.Generic.IList Zones { get { throw null; } } @@ -141,17 +90,14 @@ protected RedisEnterpriseDatabaseCollection() { } public partial class RedisEnterpriseDatabaseData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public RedisEnterpriseDatabaseData() { } - public Azure.ResourceManager.RedisEnterprise.Models.AccessKeysAuthentication? AccessKeysAuthentication { get { throw null; } set { } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClientProtocol? ClientProtocol { get { throw null; } set { } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusteringPolicy? ClusteringPolicy { get { throw null; } set { } } - public Azure.ResourceManager.RedisEnterprise.Models.DeferUpgradeSetting? DeferUpgrade { get { throw null; } set { } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy? EvictionPolicy { get { throw null; } set { } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabaseGeoReplication GeoReplication { get { throw null; } set { } } public System.Collections.Generic.IList Modules { get { throw null; } } public Azure.ResourceManager.RedisEnterprise.Models.RedisPersistenceSettings Persistence { get { throw null; } set { } } public int? Port { get { throw null; } set { } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? ProvisioningState { get { throw null; } } - public string RedisVersion { get { throw null; } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? ResourceState { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.RedisEnterprise.RedisEnterpriseDatabaseData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -178,9 +124,6 @@ protected RedisEnterpriseDatabaseResource() { } public virtual Azure.ResourceManager.ArmOperation ForceUnlink(Azure.WaitUntil waitUntil, Azure.ResourceManager.RedisEnterprise.Models.ForceUnlinkRedisEnterpriseDatabaseContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task ForceUnlinkAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RedisEnterprise.Models.ForceUnlinkRedisEnterpriseDatabaseContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetAccessPolicyAssignment(string accessPolicyAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAccessPolicyAssignmentAsync(string accessPolicyAssignmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.RedisEnterprise.AccessPolicyAssignmentCollection GetAccessPolicyAssignments() { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetKeys(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetKeysAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -195,12 +138,9 @@ protected RedisEnterpriseDatabaseResource() { } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabasePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabasePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.ArmOperation UpgradeDBRedisVersion(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task UpgradeDBRedisVersionAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public static partial class RedisEnterpriseExtensions { - public static Azure.ResourceManager.RedisEnterprise.AccessPolicyAssignmentResource GetAccessPolicyAssignmentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetRedisEnterpriseCluster(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetRedisEnterpriseClusterAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.RedisEnterprise.RedisEnterpriseClusterResource GetRedisEnterpriseClusterResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -267,7 +207,6 @@ namespace Azure.ResourceManager.RedisEnterprise.Mocking public partial class MockableRedisEnterpriseArmClient : Azure.ResourceManager.ArmResource { protected MockableRedisEnterpriseArmClient() { } - public virtual Azure.ResourceManager.RedisEnterprise.AccessPolicyAssignmentResource GetAccessPolicyAssignmentResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.RedisEnterprise.RedisEnterpriseClusterResource GetRedisEnterpriseClusterResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.RedisEnterprise.RedisEnterpriseDatabaseResource GetRedisEnterpriseDatabaseResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.RedisEnterprise.RedisEnterprisePrivateEndpointConnectionResource GetRedisEnterprisePrivateEndpointConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -290,64 +229,19 @@ protected MockableRedisEnterpriseSubscriptionResource() { } } namespace Azure.ResourceManager.RedisEnterprise.Models { - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct AccessKeysAuthentication : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public AccessKeysAuthentication(string value) { throw null; } - public static Azure.ResourceManager.RedisEnterprise.Models.AccessKeysAuthentication Disabled { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.AccessKeysAuthentication Enabled { get { throw null; } } - public bool Equals(Azure.ResourceManager.RedisEnterprise.Models.AccessKeysAuthentication other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.RedisEnterprise.Models.AccessKeysAuthentication left, Azure.ResourceManager.RedisEnterprise.Models.AccessKeysAuthentication right) { throw null; } - public static implicit operator Azure.ResourceManager.RedisEnterprise.Models.AccessKeysAuthentication (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.RedisEnterprise.Models.AccessKeysAuthentication left, Azure.ResourceManager.RedisEnterprise.Models.AccessKeysAuthentication right) { throw null; } - public override string ToString() { throw null; } - } public static partial class ArmRedisEnterpriseModelFactory { - public static Azure.ResourceManager.RedisEnterprise.AccessPolicyAssignmentData AccessPolicyAssignmentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? provisioningState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus?), string accessPolicyName = null, System.Guid? userObjectId = default(System.Guid?)) { throw null; } - public static Azure.ResourceManager.RedisEnterprise.RedisEnterpriseClusterData RedisEnterpriseClusterData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSku sku = null, System.Collections.Generic.IEnumerable zones = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseHighAvailability? highAvailability = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseHighAvailability?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseTlsVersion? minimumTlsVersion = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseTlsVersion?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseCustomerManagedKeyEncryption customerManagedKeyEncryption = null, string hostName = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? provisioningState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode? redundancyMode = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? resourceState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState?), string redisVersion = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.RedisEnterprise.RedisEnterpriseClusterData RedisEnterpriseClusterData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSku sku, System.Collections.Generic.IEnumerable zones, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseTlsVersion? minimumTlsVersion, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseCustomerManagedKeyEncryption customerManagedKeyEncryption, string hostName, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? provisioningState, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? resourceState, string redisVersion, System.Collections.Generic.IEnumerable privateEndpointConnections) { throw null; } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterPatch RedisEnterpriseClusterPatch(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSku sku = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseHighAvailability? highAvailability = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseHighAvailability?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseTlsVersion? minimumTlsVersion = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseTlsVersion?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseCustomerManagedKeyEncryption customerManagedKeyEncryption = null, string hostName = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? provisioningState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode? redundancyMode = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? resourceState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState?), string redisVersion = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterPatch RedisEnterpriseClusterPatch(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSku sku, Azure.ResourceManager.Models.ManagedServiceIdentity identity, System.Collections.Generic.IDictionary tags, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseTlsVersion? minimumTlsVersion, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseCustomerManagedKeyEncryption customerManagedKeyEncryption, string hostName, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? provisioningState, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? resourceState, string redisVersion, System.Collections.Generic.IEnumerable privateEndpointConnections) { throw null; } + public static Azure.ResourceManager.RedisEnterprise.RedisEnterpriseClusterData RedisEnterpriseClusterData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSku sku = null, System.Collections.Generic.IEnumerable zones = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseTlsVersion? minimumTlsVersion = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseTlsVersion?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseCustomerManagedKeyEncryption customerManagedKeyEncryption = null, string hostName = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? provisioningState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? resourceState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState?), string redisVersion = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null) { throw null; } + public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterPatch RedisEnterpriseClusterPatch(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSku sku = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseTlsVersion? minimumTlsVersion = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseTlsVersion?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseCustomerManagedKeyEncryption customerManagedKeyEncryption = null, string hostName = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? provisioningState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? resourceState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState?), string redisVersion = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null) { throw null; } public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDataAccessKeys RedisEnterpriseDataAccessKeys(string primaryKey = null, string secondaryKey = null) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.RedisEnterprise.RedisEnterpriseDatabaseData RedisEnterpriseDatabaseData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClientProtocol? clientProtocol, int? port, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? provisioningState, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? resourceState, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusteringPolicy? clusteringPolicy, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy? evictionPolicy, Azure.ResourceManager.RedisEnterprise.Models.RedisPersistenceSettings persistence, System.Collections.Generic.IEnumerable modules, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabaseGeoReplication geoReplication) { throw null; } - public static Azure.ResourceManager.RedisEnterprise.RedisEnterpriseDatabaseData RedisEnterpriseDatabaseData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClientProtocol? clientProtocol = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClientProtocol?), int? port = default(int?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? provisioningState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? resourceState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusteringPolicy? clusteringPolicy = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusteringPolicy?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy? evictionPolicy = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy?), Azure.ResourceManager.RedisEnterprise.Models.RedisPersistenceSettings persistence = null, System.Collections.Generic.IEnumerable modules = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabaseGeoReplication geoReplication = null, string redisVersion = null, Azure.ResourceManager.RedisEnterprise.Models.DeferUpgradeSetting? deferUpgrade = default(Azure.ResourceManager.RedisEnterprise.Models.DeferUpgradeSetting?), Azure.ResourceManager.RedisEnterprise.Models.AccessKeysAuthentication? accessKeysAuthentication = default(Azure.ResourceManager.RedisEnterprise.Models.AccessKeysAuthentication?)) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabasePatch RedisEnterpriseDatabasePatch(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClientProtocol? clientProtocol, int? port, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? provisioningState, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? resourceState, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusteringPolicy? clusteringPolicy, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy? evictionPolicy, Azure.ResourceManager.RedisEnterprise.Models.RedisPersistenceSettings persistence, System.Collections.Generic.IEnumerable modules, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabaseGeoReplication geoReplication) { throw null; } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabasePatch RedisEnterpriseDatabasePatch(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClientProtocol? clientProtocol = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClientProtocol?), int? port = default(int?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? provisioningState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? resourceState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusteringPolicy? clusteringPolicy = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusteringPolicy?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy? evictionPolicy = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy?), Azure.ResourceManager.RedisEnterprise.Models.RedisPersistenceSettings persistence = null, System.Collections.Generic.IEnumerable modules = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabaseGeoReplication geoReplication = null, string redisVersion = null, Azure.ResourceManager.RedisEnterprise.Models.DeferUpgradeSetting? deferUpgrade = default(Azure.ResourceManager.RedisEnterprise.Models.DeferUpgradeSetting?), Azure.ResourceManager.RedisEnterprise.Models.AccessKeysAuthentication? accessKeysAuthentication = default(Azure.ResourceManager.RedisEnterprise.Models.AccessKeysAuthentication?)) { throw null; } + public static Azure.ResourceManager.RedisEnterprise.RedisEnterpriseDatabaseData RedisEnterpriseDatabaseData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClientProtocol? clientProtocol = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClientProtocol?), int? port = default(int?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? provisioningState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? resourceState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusteringPolicy? clusteringPolicy = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusteringPolicy?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy? evictionPolicy = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy?), Azure.ResourceManager.RedisEnterprise.Models.RedisPersistenceSettings persistence = null, System.Collections.Generic.IEnumerable modules = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabaseGeoReplication geoReplication = null) { throw null; } + public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabasePatch RedisEnterpriseDatabasePatch(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClientProtocol? clientProtocol = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClientProtocol?), int? port = default(int?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? provisioningState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? resourceState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusteringPolicy? clusteringPolicy = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusteringPolicy?), Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy? evictionPolicy = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy?), Azure.ResourceManager.RedisEnterprise.Models.RedisPersistenceSettings persistence = null, System.Collections.Generic.IEnumerable modules = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabaseGeoReplication geoReplication = null) { throw null; } public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseLinkedDatabase RedisEnterpriseLinkedDatabase(Azure.Core.ResourceIdentifier id = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabaseLinkState? state = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabaseLinkState?)) { throw null; } public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseModule RedisEnterpriseModule(string name = null, string args = null, string version = null) { throw null; } public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseOperationStatus RedisEnterpriseOperationStatus(Azure.Core.ResourceIdentifier id = null, string name = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), string status = null, Azure.ResponseError error = null) { throw null; } public static Azure.ResourceManager.RedisEnterprise.RedisEnterprisePrivateEndpointConnectionData RedisEnterprisePrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterprisePrivateLinkServiceConnectionState connectionState = null, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterprisePrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterprisePrivateEndpointConnectionProvisioningState?)) { throw null; } public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterprisePrivateLinkResource RedisEnterprisePrivateLinkResource(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct DeferUpgradeSetting : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public DeferUpgradeSetting(string value) { throw null; } - public static Azure.ResourceManager.RedisEnterprise.Models.DeferUpgradeSetting Deferred { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.DeferUpgradeSetting NotDeferred { get { throw null; } } - public bool Equals(Azure.ResourceManager.RedisEnterprise.Models.DeferUpgradeSetting other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.RedisEnterprise.Models.DeferUpgradeSetting left, Azure.ResourceManager.RedisEnterprise.Models.DeferUpgradeSetting right) { throw null; } - public static implicit operator Azure.ResourceManager.RedisEnterprise.Models.DeferUpgradeSetting (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.RedisEnterprise.Models.DeferUpgradeSetting left, Azure.ResourceManager.RedisEnterprise.Models.DeferUpgradeSetting right) { throw null; } - public override string ToString() { throw null; } - } public partial class ExportRedisEnterpriseDatabaseContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ExportRedisEnterpriseDatabaseContent(System.Uri sasUri) { } @@ -372,9 +266,8 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer } public partial class ForceLinkContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ForceLinkContent(string groupNickname, System.Collections.Generic.IEnumerable linkedDatabases) { } - public string GroupNickname { get { throw null; } } - public System.Collections.Generic.IList LinkedDatabases { get { throw null; } } + public ForceLinkContent(Azure.ResourceManager.RedisEnterprise.Models.ForceLinkParametersGeoReplication geoReplication) { } + public Azure.ResourceManager.RedisEnterprise.Models.ForceLinkParametersGeoReplication GeoReplication { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.RedisEnterprise.Models.ForceLinkContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -382,6 +275,18 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ForceLinkParametersGeoReplication : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ForceLinkParametersGeoReplication() { } + public string GroupNickname { get { throw null; } set { } } + public System.Collections.Generic.IList LinkedDatabases { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RedisEnterprise.Models.ForceLinkParametersGeoReplication System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RedisEnterprise.Models.ForceLinkParametersGeoReplication System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ForceUnlinkRedisEnterpriseDatabaseContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ForceUnlinkRedisEnterpriseDatabaseContent(System.Collections.Generic.IEnumerable ids) { } @@ -486,14 +391,12 @@ public partial class RedisEnterpriseClusterPatch : System.ClientModel.Primitives { public RedisEnterpriseClusterPatch() { } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseCustomerManagedKeyEncryption CustomerManagedKeyEncryption { get { throw null; } set { } } - public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseHighAvailability? HighAvailability { get { throw null; } set { } } public string HostName { get { throw null; } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseTlsVersion? MinimumTlsVersion { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList PrivateEndpointConnections { get { throw null; } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? ProvisioningState { get { throw null; } } public string RedisVersion { get { throw null; } } - public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode? RedundancyMode { get { throw null; } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? ResourceState { get { throw null; } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSku Sku { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } @@ -624,17 +527,14 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class RedisEnterpriseDatabasePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public RedisEnterpriseDatabasePatch() { } - public Azure.ResourceManager.RedisEnterprise.Models.AccessKeysAuthentication? AccessKeysAuthentication { get { throw null; } set { } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClientProtocol? ClientProtocol { get { throw null; } set { } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusteringPolicy? ClusteringPolicy { get { throw null; } set { } } - public Azure.ResourceManager.RedisEnterprise.Models.DeferUpgradeSetting? DeferUpgrade { get { throw null; } set { } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy? EvictionPolicy { get { throw null; } set { } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabaseGeoReplication GeoReplication { get { throw null; } set { } } public System.Collections.Generic.IList Modules { get { throw null; } } public Azure.ResourceManager.RedisEnterprise.Models.RedisPersistenceSettings Persistence { get { throw null; } set { } } public int? Port { get { throw null; } set { } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus? ProvisioningState { get { throw null; } } - public string RedisVersion { get { throw null; } } public Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseClusterResourceState? ResourceState { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseDatabasePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -667,24 +567,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy left, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseEvictionPolicy right) { throw null; } public override string ToString() { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct RedisEnterpriseHighAvailability : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public RedisEnterpriseHighAvailability(string value) { throw null; } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseHighAvailability Disabled { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseHighAvailability Enabled { get { throw null; } } - public bool Equals(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseHighAvailability other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseHighAvailability left, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseHighAvailability right) { throw null; } - public static implicit operator Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseHighAvailability (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseHighAvailability left, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseHighAvailability right) { throw null; } - public override string ToString() { throw null; } - } public partial class RedisEnterpriseLinkedDatabase : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public RedisEnterpriseLinkedDatabase() { } @@ -813,25 +695,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus left, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseProvisioningStatus right) { throw null; } public override string ToString() { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct RedisEnterpriseRedundancyMode : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public RedisEnterpriseRedundancyMode(string value) { throw null; } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode LR { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode None { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode ZR { get { throw null; } } - public bool Equals(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode left, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode right) { throw null; } - public static implicit operator Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode left, Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseRedundancyMode right) { throw null; } - public override string ToString() { throw null; } - } public partial class RedisEnterpriseRegenerateKeyContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public RedisEnterpriseRegenerateKeyContent(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseAccessKeyType keyType) { } @@ -861,31 +724,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly object _dummy; private readonly int _dummyPrimitive; public RedisEnterpriseSkuName(string value) { throw null; } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName BalancedB0 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName BalancedB1 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName BalancedB10 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName BalancedB100 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName BalancedB1000 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName BalancedB150 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName BalancedB20 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName BalancedB250 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName BalancedB3 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName BalancedB350 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName BalancedB5 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName BalancedB50 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName BalancedB500 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName BalancedB700 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName ComputeOptimizedX10 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName ComputeOptimizedX100 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName ComputeOptimizedX150 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName ComputeOptimizedX20 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName ComputeOptimizedX250 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName ComputeOptimizedX3 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName ComputeOptimizedX350 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName ComputeOptimizedX5 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName ComputeOptimizedX50 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName ComputeOptimizedX500 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName ComputeOptimizedX700 { get { throw null; } } public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName EnterpriseE1 { get { throw null; } } public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName EnterpriseE10 { get { throw null; } } public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName EnterpriseE100 { get { throw null; } } @@ -897,25 +735,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName EnterpriseFlashF1500 { get { throw null; } } public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName EnterpriseFlashF300 { get { throw null; } } public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName EnterpriseFlashF700 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName FlashOptimizedA1000 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName FlashOptimizedA1500 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName FlashOptimizedA2000 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName FlashOptimizedA250 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName FlashOptimizedA4500 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName FlashOptimizedA500 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName FlashOptimizedA700 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName MemoryOptimizedM10 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName MemoryOptimizedM100 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName MemoryOptimizedM1000 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName MemoryOptimizedM150 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName MemoryOptimizedM1500 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName MemoryOptimizedM20 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName MemoryOptimizedM2000 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName MemoryOptimizedM250 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName MemoryOptimizedM350 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName MemoryOptimizedM50 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName MemoryOptimizedM500 { get { throw null; } } - public static Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName MemoryOptimizedM700 { get { throw null; } } public bool Equals(Azure.ResourceManager.RedisEnterprise.Models.RedisEnterpriseSkuName other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/samples/Generated/Samples/Sample_RedisEnterpriseClusterCollection.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/samples/Generated/Samples/Sample_RedisEnterpriseClusterCollection.cs index 92b79b7c9b3f..576fe6aaa4df 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/samples/Generated/Samples/Sample_RedisEnterpriseClusterCollection.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/samples/Generated/Samples/Sample_RedisEnterpriseClusterCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_RedisEnterpriseClusterCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_RedisEnterpriseCreate() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseCreate.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseCreate.json // this example is just showing the usage of "RedisEnterprise_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -32,7 +32,7 @@ public async Task CreateOrUpdate_RedisEnterpriseCreate() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -84,7 +84,7 @@ public async Task CreateOrUpdate_RedisEnterpriseCreate() [Ignore("Only validating compilation of examples")] public async Task Get_RedisEnterpriseGet() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseGet.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseGet.json // this example is just showing the usage of "RedisEnterprise_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_RedisEnterpriseGet() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -117,7 +117,7 @@ public async Task Get_RedisEnterpriseGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_RedisEnterpriseListByResourceGroup() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseListByResourceGroup.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseListByResourceGroup.json // this example is just showing the usage of "RedisEnterprise_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -127,7 +127,7 @@ public async Task GetAll_RedisEnterpriseListByResourceGroup() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -152,7 +152,7 @@ public async Task GetAll_RedisEnterpriseListByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_RedisEnterpriseGet() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseGet.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseGet.json // this example is just showing the usage of "RedisEnterprise_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -162,7 +162,7 @@ public async Task Exists_RedisEnterpriseGet() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -181,7 +181,7 @@ public async Task Exists_RedisEnterpriseGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_RedisEnterpriseGet() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseGet.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseGet.json // this example is just showing the usage of "RedisEnterprise_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -191,7 +191,7 @@ public async Task GetIfExists_RedisEnterpriseGet() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/samples/Generated/Samples/Sample_RedisEnterpriseClusterResource.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/samples/Generated/Samples/Sample_RedisEnterpriseClusterResource.cs index 88fae7169482..cb961cf739ad 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/samples/Generated/Samples/Sample_RedisEnterpriseClusterResource.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/samples/Generated/Samples/Sample_RedisEnterpriseClusterResource.cs @@ -20,7 +20,7 @@ public partial class Sample_RedisEnterpriseClusterResource [Ignore("Only validating compilation of examples")] public async Task Get_RedisEnterpriseGet() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseGet.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseGet.json // this example is just showing the usage of "RedisEnterprise_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +30,7 @@ public async Task Get_RedisEnterpriseGet() // this example assumes you already have this RedisEnterpriseClusterResource created on azure // for more information of creating RedisEnterpriseClusterResource, please refer to the document of RedisEnterpriseClusterResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; string clusterName = "cache1"; ResourceIdentifier redisEnterpriseClusterResourceId = RedisEnterpriseClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); @@ -50,7 +50,7 @@ public async Task Get_RedisEnterpriseGet() [Ignore("Only validating compilation of examples")] public async Task Delete_RedisEnterpriseDelete() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDelete.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseDelete.json // this example is just showing the usage of "RedisEnterprise_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task Delete_RedisEnterpriseDelete() // this example assumes you already have this RedisEnterpriseClusterResource created on azure // for more information of creating RedisEnterpriseClusterResource, please refer to the document of RedisEnterpriseClusterResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; string clusterName = "cache1"; ResourceIdentifier redisEnterpriseClusterResourceId = RedisEnterpriseClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); @@ -76,7 +76,7 @@ public async Task Delete_RedisEnterpriseDelete() [Ignore("Only validating compilation of examples")] public async Task Update_RedisEnterpriseUpdate() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseUpdate.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseUpdate.json // this example is just showing the usage of "RedisEnterprise_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Update_RedisEnterpriseUpdate() // this example assumes you already have this RedisEnterpriseClusterResource created on azure // for more information of creating RedisEnterpriseClusterResource, please refer to the document of RedisEnterpriseClusterResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; string clusterName = "cache1"; ResourceIdentifier redisEnterpriseClusterResourceId = RedisEnterpriseClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); @@ -119,7 +119,7 @@ public async Task Update_RedisEnterpriseUpdate() [Ignore("Only validating compilation of examples")] public async Task GetPrivateLinkResourcesByCluster_RedisEnterpriseListPrivateLinkResources() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseListPrivateLinkResources.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseListPrivateLinkResources.json // this example is just showing the usage of "PrivateLinkResources_ListByCluster" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +129,7 @@ public async Task GetPrivateLinkResourcesByCluster_RedisEnterpriseListPrivateLin // this example assumes you already have this RedisEnterpriseClusterResource created on azure // for more information of creating RedisEnterpriseClusterResource, please refer to the document of RedisEnterpriseClusterResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; string clusterName = "cache1"; ResourceIdentifier redisEnterpriseClusterResourceId = RedisEnterpriseClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/samples/Generated/Samples/Sample_RedisEnterpriseDatabaseCollection.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/samples/Generated/Samples/Sample_RedisEnterpriseDatabaseCollection.cs index cd96fa9b53e0..2ecceb4abd30 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/samples/Generated/Samples/Sample_RedisEnterpriseDatabaseCollection.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/samples/Generated/Samples/Sample_RedisEnterpriseDatabaseCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_RedisEnterpriseDatabaseCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_RedisEnterpriseDatabasesCreate() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesCreate.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseDatabasesCreate.json // this example is just showing the usage of "Databases_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +30,7 @@ public async Task CreateOrUpdate_RedisEnterpriseDatabasesCreate() // this example assumes you already have this RedisEnterpriseClusterResource created on azure // for more information of creating RedisEnterpriseClusterResource, please refer to the document of RedisEnterpriseClusterResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; string clusterName = "cache1"; ResourceIdentifier redisEnterpriseClusterResourceId = RedisEnterpriseClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); @@ -59,8 +59,6 @@ public async Task CreateOrUpdate_RedisEnterpriseDatabasesCreate() { Args = "RETENTION_POLICY 20", }, new RedisEnterpriseModule("RediSearch")}, - DeferUpgrade = DeferUpgradeSetting.NotDeferred, - AccessKeysAuthentication = AccessKeysAuthentication.Enabled, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, databaseName, data); RedisEnterpriseDatabaseResource result = lro.Value; @@ -76,7 +74,7 @@ public async Task CreateOrUpdate_RedisEnterpriseDatabasesCreate() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_RedisEnterpriseDatabasesCreateWithActiveGeoReplication() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesCreateWithGeoReplication.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseDatabasesCreateWithGeoReplication.json // this example is just showing the usage of "Databases_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +84,7 @@ public async Task CreateOrUpdate_RedisEnterpriseDatabasesCreateWithActiveGeoRepl // this example assumes you already have this RedisEnterpriseClusterResource created on azure // for more information of creating RedisEnterpriseClusterResource, please refer to the document of RedisEnterpriseClusterResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid1"; string resourceGroupName = "rg1"; string clusterName = "cache1"; ResourceIdentifier redisEnterpriseClusterResourceId = RedisEnterpriseClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); @@ -108,13 +106,12 @@ public async Task CreateOrUpdate_RedisEnterpriseDatabasesCreateWithActiveGeoRepl GroupNickname = "groupName", LinkedDatabases = {new RedisEnterpriseLinkedDatabase { -Id = new ResourceIdentifier("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), +Id = new ResourceIdentifier("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), }, new RedisEnterpriseLinkedDatabase { -Id = new ResourceIdentifier("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8e/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default"), +Id = new ResourceIdentifier("/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default"), }}, }, - AccessKeysAuthentication = AccessKeysAuthentication.Enabled, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, databaseName, data); RedisEnterpriseDatabaseResource result = lro.Value; @@ -130,7 +127,7 @@ public async Task CreateOrUpdate_RedisEnterpriseDatabasesCreateWithActiveGeoRepl [Ignore("Only validating compilation of examples")] public async Task Get_RedisEnterpriseDatabasesGet() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesGet.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseDatabasesGet.json // this example is just showing the usage of "Databases_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -140,7 +137,7 @@ public async Task Get_RedisEnterpriseDatabasesGet() // this example assumes you already have this RedisEnterpriseClusterResource created on azure // for more information of creating RedisEnterpriseClusterResource, please refer to the document of RedisEnterpriseClusterResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; string clusterName = "cache1"; ResourceIdentifier redisEnterpriseClusterResourceId = RedisEnterpriseClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); @@ -164,7 +161,7 @@ public async Task Get_RedisEnterpriseDatabasesGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_RedisEnterpriseDatabasesListByCluster() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesListByCluster.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseDatabasesListByCluster.json // this example is just showing the usage of "Databases_ListByCluster" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -174,7 +171,7 @@ public async Task GetAll_RedisEnterpriseDatabasesListByCluster() // this example assumes you already have this RedisEnterpriseClusterResource created on azure // for more information of creating RedisEnterpriseClusterResource, please refer to the document of RedisEnterpriseClusterResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; string clusterName = "cache1"; ResourceIdentifier redisEnterpriseClusterResourceId = RedisEnterpriseClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); @@ -200,7 +197,7 @@ public async Task GetAll_RedisEnterpriseDatabasesListByCluster() [Ignore("Only validating compilation of examples")] public async Task Exists_RedisEnterpriseDatabasesGet() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesGet.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseDatabasesGet.json // this example is just showing the usage of "Databases_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -210,7 +207,7 @@ public async Task Exists_RedisEnterpriseDatabasesGet() // this example assumes you already have this RedisEnterpriseClusterResource created on azure // for more information of creating RedisEnterpriseClusterResource, please refer to the document of RedisEnterpriseClusterResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; string clusterName = "cache1"; ResourceIdentifier redisEnterpriseClusterResourceId = RedisEnterpriseClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); @@ -230,7 +227,7 @@ public async Task Exists_RedisEnterpriseDatabasesGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_RedisEnterpriseDatabasesGet() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesGet.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseDatabasesGet.json // this example is just showing the usage of "Databases_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -240,7 +237,7 @@ public async Task GetIfExists_RedisEnterpriseDatabasesGet() // this example assumes you already have this RedisEnterpriseClusterResource created on azure // for more information of creating RedisEnterpriseClusterResource, please refer to the document of RedisEnterpriseClusterResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; string clusterName = "cache1"; ResourceIdentifier redisEnterpriseClusterResourceId = RedisEnterpriseClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/samples/Generated/Samples/Sample_RedisEnterpriseDatabaseResource.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/samples/Generated/Samples/Sample_RedisEnterpriseDatabaseResource.cs index 5ce63722dcf7..dd5ade219ab9 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/samples/Generated/Samples/Sample_RedisEnterpriseDatabaseResource.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/samples/Generated/Samples/Sample_RedisEnterpriseDatabaseResource.cs @@ -20,7 +20,7 @@ public partial class Sample_RedisEnterpriseDatabaseResource [Ignore("Only validating compilation of examples")] public async Task Get_RedisEnterpriseDatabasesGet() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesGet.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseDatabasesGet.json // this example is just showing the usage of "Databases_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +30,7 @@ public async Task Get_RedisEnterpriseDatabasesGet() // this example assumes you already have this RedisEnterpriseDatabaseResource created on azure // for more information of creating RedisEnterpriseDatabaseResource, please refer to the document of RedisEnterpriseDatabaseResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; string clusterName = "cache1"; string databaseName = "default"; @@ -51,7 +51,7 @@ public async Task Get_RedisEnterpriseDatabasesGet() [Ignore("Only validating compilation of examples")] public async Task Delete_RedisEnterpriseDatabasesDelete() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesDelete.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseDatabasesDelete.json // this example is just showing the usage of "Databases_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +61,7 @@ public async Task Delete_RedisEnterpriseDatabasesDelete() // this example assumes you already have this RedisEnterpriseDatabaseResource created on azure // for more information of creating RedisEnterpriseDatabaseResource, please refer to the document of RedisEnterpriseDatabaseResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; string clusterName = "cache1"; string databaseName = "db1"; @@ -78,7 +78,7 @@ public async Task Delete_RedisEnterpriseDatabasesDelete() [Ignore("Only validating compilation of examples")] public async Task Update_RedisEnterpriseDatabasesUpdate() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesUpdate.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseDatabasesUpdate.json // this example is just showing the usage of "Databases_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +88,7 @@ public async Task Update_RedisEnterpriseDatabasesUpdate() // this example assumes you already have this RedisEnterpriseDatabaseResource created on azure // for more information of creating RedisEnterpriseDatabaseResource, please refer to the document of RedisEnterpriseDatabaseResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; string clusterName = "cache1"; string databaseName = "default"; @@ -105,7 +105,6 @@ public async Task Update_RedisEnterpriseDatabasesUpdate() IsRdbEnabled = true, RdbFrequency = PersistenceSettingRdbFrequency.TwelveHours, }, - AccessKeysAuthentication = AccessKeysAuthentication.Enabled, }; ArmOperation lro = await redisEnterpriseDatabase.UpdateAsync(WaitUntil.Completed, patch); RedisEnterpriseDatabaseResource result = lro.Value; @@ -121,7 +120,7 @@ public async Task Update_RedisEnterpriseDatabasesUpdate() [Ignore("Only validating compilation of examples")] public async Task GetKeys_RedisEnterpriseDatabasesListKeys() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesListKeys.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseDatabasesListKeys.json // this example is just showing the usage of "Databases_ListKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -131,7 +130,7 @@ public async Task GetKeys_RedisEnterpriseDatabasesListKeys() // this example assumes you already have this RedisEnterpriseDatabaseResource created on azure // for more information of creating RedisEnterpriseDatabaseResource, please refer to the document of RedisEnterpriseDatabaseResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; string clusterName = "cache1"; string databaseName = "default"; @@ -148,7 +147,7 @@ public async Task GetKeys_RedisEnterpriseDatabasesListKeys() [Ignore("Only validating compilation of examples")] public async Task RegenerateKey_RedisEnterpriseDatabasesRegenerateKey() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesRegenerateKey.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseDatabasesRegenerateKey.json // this example is just showing the usage of "Databases_RegenerateKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -158,7 +157,7 @@ public async Task RegenerateKey_RedisEnterpriseDatabasesRegenerateKey() // this example assumes you already have this RedisEnterpriseDatabaseResource created on azure // for more information of creating RedisEnterpriseDatabaseResource, please refer to the document of RedisEnterpriseDatabaseResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; string clusterName = "cache1"; string databaseName = "default"; @@ -177,7 +176,7 @@ public async Task RegenerateKey_RedisEnterpriseDatabasesRegenerateKey() [Ignore("Only validating compilation of examples")] public async Task Import_RedisEnterpriseDatabasesImport() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesImport.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseDatabasesImport.json // this example is just showing the usage of "Databases_Import" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -187,7 +186,7 @@ public async Task Import_RedisEnterpriseDatabasesImport() // this example assumes you already have this RedisEnterpriseDatabaseResource created on azure // for more information of creating RedisEnterpriseDatabaseResource, please refer to the document of RedisEnterpriseDatabaseResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; string clusterName = "cache1"; string databaseName = "default"; @@ -205,7 +204,7 @@ public async Task Import_RedisEnterpriseDatabasesImport() [Ignore("Only validating compilation of examples")] public async Task Export_RedisEnterpriseDatabasesExport() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesExport.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseDatabasesExport.json // this example is just showing the usage of "Databases_Export" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -215,7 +214,7 @@ public async Task Export_RedisEnterpriseDatabasesExport() // this example assumes you already have this RedisEnterpriseDatabaseResource created on azure // for more information of creating RedisEnterpriseDatabaseResource, please refer to the document of RedisEnterpriseDatabaseResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; string clusterName = "cache1"; string databaseName = "default"; @@ -233,7 +232,7 @@ public async Task Export_RedisEnterpriseDatabasesExport() [Ignore("Only validating compilation of examples")] public async Task ForceUnlink_HowToUnlinkADatabaseDuringARegionalOutage() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesForceUnlink.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseDatabasesForceUnlink.json // this example is just showing the usage of "Databases_ForceUnlink" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -243,7 +242,7 @@ public async Task ForceUnlink_HowToUnlinkADatabaseDuringARegionalOutage() // this example assumes you already have this RedisEnterpriseDatabaseResource created on azure // for more information of creating RedisEnterpriseDatabaseResource, please refer to the document of RedisEnterpriseDatabaseResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; string clusterName = "cache1"; string databaseName = "default"; @@ -251,7 +250,7 @@ public async Task ForceUnlink_HowToUnlinkADatabaseDuringARegionalOutage() RedisEnterpriseDatabaseResource redisEnterpriseDatabase = client.GetRedisEnterpriseDatabaseResource(redisEnterpriseDatabaseResourceId); // invoke the operation - ForceUnlinkRedisEnterpriseDatabaseContent content = new ForceUnlinkRedisEnterpriseDatabaseContent(new ResourceIdentifier[] { new ResourceIdentifier("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default") }); + ForceUnlinkRedisEnterpriseDatabaseContent content = new ForceUnlinkRedisEnterpriseDatabaseContent(new ResourceIdentifier[] { new ResourceIdentifier("/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default") }); await redisEnterpriseDatabase.ForceUnlinkAsync(WaitUntil.Completed, content); Console.WriteLine("Succeeded"); @@ -261,7 +260,7 @@ public async Task ForceUnlink_HowToUnlinkADatabaseDuringARegionalOutage() [Ignore("Only validating compilation of examples")] public async Task ForceLinkToReplicationGroup_HowToRelinkADatabaseAfterARegionalOutage() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesForceLink.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseDatabasesForceLink.json // this example is just showing the usage of "Databases_ForceLinkToReplicationGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -279,16 +278,16 @@ public async Task ForceLinkToReplicationGroup_HowToRelinkADatabaseAfterARegional RedisEnterpriseDatabaseResource redisEnterpriseDatabase = client.GetRedisEnterpriseDatabaseResource(redisEnterpriseDatabaseResourceId); // invoke the operation - ForceLinkContent content = new ForceLinkContent("groupName", new RedisEnterpriseLinkedDatabase[] + ForceLinkContent content = new ForceLinkContent(new ForceLinkParametersGeoReplication { -new RedisEnterpriseLinkedDatabase + GroupNickname = "groupName", + LinkedDatabases = {new RedisEnterpriseLinkedDatabase { Id = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), -}, -new RedisEnterpriseLinkedDatabase +}, new RedisEnterpriseLinkedDatabase { Id = new ResourceIdentifier("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default"), -} +}}, }); await redisEnterpriseDatabase.ForceLinkToReplicationGroupAsync(WaitUntil.Completed, content); @@ -299,7 +298,7 @@ public async Task ForceLinkToReplicationGroup_HowToRelinkADatabaseAfterARegional [Ignore("Only validating compilation of examples")] public async Task Flush_HowToFlushAllTheKeysInTheDatabase() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesFlush.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseDatabasesFlush.json // this example is just showing the usage of "Databases_Flush" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -309,7 +308,7 @@ public async Task Flush_HowToFlushAllTheKeysInTheDatabase() // this example assumes you already have this RedisEnterpriseDatabaseResource created on azure // for more information of creating RedisEnterpriseDatabaseResource, please refer to the document of RedisEnterpriseDatabaseResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; string clusterName = "cache1"; string databaseName = "default"; @@ -319,38 +318,11 @@ public async Task Flush_HowToFlushAllTheKeysInTheDatabase() // invoke the operation FlushRedisEnterpriseDatabaseContent content = new FlushRedisEnterpriseDatabaseContent { - Ids = { new ResourceIdentifier("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default") }, + Ids = { new ResourceIdentifier("/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default") }, }; await redisEnterpriseDatabase.FlushAsync(WaitUntil.Completed, content); Console.WriteLine("Succeeded"); } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task UpgradeDBRedisVersion_HowToUpgradeYourDatabaseRedisVersion() - { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDatabasesUpgradeDBRedisVersion.json - // this example is just showing the usage of "Databases_UpgradeDBRedisVersion" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this RedisEnterpriseDatabaseResource created on azure - // for more information of creating RedisEnterpriseDatabaseResource, please refer to the document of RedisEnterpriseDatabaseResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; - string resourceGroupName = "rg1"; - string clusterName = "cache1"; - string databaseName = "default"; - ResourceIdentifier redisEnterpriseDatabaseResourceId = RedisEnterpriseDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, databaseName); - RedisEnterpriseDatabaseResource redisEnterpriseDatabase = client.GetRedisEnterpriseDatabaseResource(redisEnterpriseDatabaseResourceId); - - // invoke the operation - await redisEnterpriseDatabase.UpgradeDBRedisVersionAsync(WaitUntil.Completed); - - Console.WriteLine("Succeeded"); - } } } diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/samples/Generated/Samples/Sample_RedisEnterprisePrivateEndpointConnectionCollection.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/samples/Generated/Samples/Sample_RedisEnterprisePrivateEndpointConnectionCollection.cs index 97d54a176a23..bd6deb5b4a31 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/samples/Generated/Samples/Sample_RedisEnterprisePrivateEndpointConnectionCollection.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/samples/Generated/Samples/Sample_RedisEnterprisePrivateEndpointConnectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_RedisEnterprisePrivateEndpointConnectionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_RedisEnterprisePutPrivateEndpointConnection() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterprisePutPrivateEndpointConnection.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterprisePutPrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_Put" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +30,7 @@ public async Task CreateOrUpdate_RedisEnterprisePutPrivateEndpointConnection() // this example assumes you already have this RedisEnterpriseClusterResource created on azure // for more information of creating RedisEnterpriseClusterResource, please refer to the document of RedisEnterpriseClusterResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; string clusterName = "cache1"; ResourceIdentifier redisEnterpriseClusterResourceId = RedisEnterpriseClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); @@ -63,7 +63,7 @@ public async Task CreateOrUpdate_RedisEnterprisePutPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Get_RedisEnterpriseGetPrivateEndpointConnection() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseGetPrivateEndpointConnection.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseGetPrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -73,7 +73,7 @@ public async Task Get_RedisEnterpriseGetPrivateEndpointConnection() // this example assumes you already have this RedisEnterpriseClusterResource created on azure // for more information of creating RedisEnterpriseClusterResource, please refer to the document of RedisEnterpriseClusterResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; string clusterName = "cache1"; ResourceIdentifier redisEnterpriseClusterResourceId = RedisEnterpriseClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); @@ -97,7 +97,7 @@ public async Task Get_RedisEnterpriseGetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetAll_RedisEnterpriseListPrivateEndpointConnections() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseListPrivateEndpointConnections.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseListPrivateEndpointConnections.json // this example is just showing the usage of "PrivateEndpointConnections_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -107,7 +107,7 @@ public async Task GetAll_RedisEnterpriseListPrivateEndpointConnections() // this example assumes you already have this RedisEnterpriseClusterResource created on azure // for more information of creating RedisEnterpriseClusterResource, please refer to the document of RedisEnterpriseClusterResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; string clusterName = "cache1"; ResourceIdentifier redisEnterpriseClusterResourceId = RedisEnterpriseClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); @@ -133,7 +133,7 @@ public async Task GetAll_RedisEnterpriseListPrivateEndpointConnections() [Ignore("Only validating compilation of examples")] public async Task Exists_RedisEnterpriseGetPrivateEndpointConnection() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseGetPrivateEndpointConnection.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseGetPrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -143,7 +143,7 @@ public async Task Exists_RedisEnterpriseGetPrivateEndpointConnection() // this example assumes you already have this RedisEnterpriseClusterResource created on azure // for more information of creating RedisEnterpriseClusterResource, please refer to the document of RedisEnterpriseClusterResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; string clusterName = "cache1"; ResourceIdentifier redisEnterpriseClusterResourceId = RedisEnterpriseClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); @@ -163,7 +163,7 @@ public async Task Exists_RedisEnterpriseGetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_RedisEnterpriseGetPrivateEndpointConnection() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseGetPrivateEndpointConnection.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseGetPrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -173,7 +173,7 @@ public async Task GetIfExists_RedisEnterpriseGetPrivateEndpointConnection() // this example assumes you already have this RedisEnterpriseClusterResource created on azure // for more information of creating RedisEnterpriseClusterResource, please refer to the document of RedisEnterpriseClusterResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; string clusterName = "cache1"; ResourceIdentifier redisEnterpriseClusterResourceId = RedisEnterpriseClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/samples/Generated/Samples/Sample_RedisEnterprisePrivateEndpointConnectionResource.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/samples/Generated/Samples/Sample_RedisEnterprisePrivateEndpointConnectionResource.cs index 1f240718e40b..38ae0de969c5 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/samples/Generated/Samples/Sample_RedisEnterprisePrivateEndpointConnectionResource.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/samples/Generated/Samples/Sample_RedisEnterprisePrivateEndpointConnectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_RedisEnterprisePrivateEndpointConnectionResource [Ignore("Only validating compilation of examples")] public async Task Get_RedisEnterpriseGetPrivateEndpointConnection() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseGetPrivateEndpointConnection.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseGetPrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -30,7 +30,7 @@ public async Task Get_RedisEnterpriseGetPrivateEndpointConnection() // this example assumes you already have this RedisEnterprisePrivateEndpointConnectionResource created on azure // for more information of creating RedisEnterprisePrivateEndpointConnectionResource, please refer to the document of RedisEnterprisePrivateEndpointConnectionResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; string clusterName = "cache1"; string privateEndpointConnectionName = "pectest01"; @@ -51,7 +51,7 @@ public async Task Get_RedisEnterpriseGetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Delete_RedisEnterpriseDeletePrivateEndpointConnection() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseDeletePrivateEndpointConnection.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseDeletePrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +61,7 @@ public async Task Delete_RedisEnterpriseDeletePrivateEndpointConnection() // this example assumes you already have this RedisEnterprisePrivateEndpointConnectionResource created on azure // for more information of creating RedisEnterprisePrivateEndpointConnectionResource, please refer to the document of RedisEnterprisePrivateEndpointConnectionResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; string clusterName = "cache1"; string privateEndpointConnectionName = "pectest01"; @@ -78,7 +78,7 @@ public async Task Delete_RedisEnterpriseDeletePrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Update_RedisEnterprisePutPrivateEndpointConnection() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterprisePutPrivateEndpointConnection.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterprisePutPrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_Put" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +88,7 @@ public async Task Update_RedisEnterprisePutPrivateEndpointConnection() // this example assumes you already have this RedisEnterprisePrivateEndpointConnectionResource created on azure // for more information of creating RedisEnterprisePrivateEndpointConnectionResource, please refer to the document of RedisEnterprisePrivateEndpointConnectionResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; string resourceGroupName = "rg1"; string clusterName = "cache1"; string privateEndpointConnectionName = "pectest01"; diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 91f60a57619c..528e778beeae 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -21,7 +21,7 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task GetRedisEnterpriseOperationsStatus_OperationsStatusGet() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/OperationsStatusGet.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/OperationsStatusGet.json // this example is just showing the usage of "OperationsStatus_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -31,7 +31,7 @@ public async Task GetRedisEnterpriseOperationsStatus_OperationsStatusGet() // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -47,7 +47,7 @@ public async Task GetRedisEnterpriseOperationsStatus_OperationsStatusGet() [Ignore("Only validating compilation of examples")] public async Task GetRedisEnterpriseClusters_RedisEnterpriseList() { - // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/RedisEnterpriseList.json + // Generated from example definition: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2024-10-01/examples/RedisEnterpriseList.json // this example is just showing the usage of "RedisEnterprise_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetRedisEnterpriseClusters_RedisEnterpriseList() // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f"; + string subscriptionId = "subid"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/AccessPolicyAssignmentCollection.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/AccessPolicyAssignmentCollection.cs deleted file mode 100644 index 78f01dc156bd..000000000000 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/AccessPolicyAssignmentCollection.cs +++ /dev/null @@ -1,493 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.RedisEnterprise -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get an instance call the GetAccessPolicyAssignments method from an instance of . - /// - public partial class AccessPolicyAssignmentCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _accessPolicyAssignmentClientDiagnostics; - private readonly AccessPolicyAssignmentRestOperations _accessPolicyAssignmentRestClient; - - /// Initializes a new instance of the class for mocking. - protected AccessPolicyAssignmentCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal AccessPolicyAssignmentCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _accessPolicyAssignmentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RedisEnterprise", AccessPolicyAssignmentResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(AccessPolicyAssignmentResource.ResourceType, out string accessPolicyAssignmentApiVersion); - _accessPolicyAssignmentRestClient = new AccessPolicyAssignmentRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, accessPolicyAssignmentApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != RedisEnterpriseDatabaseResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, RedisEnterpriseDatabaseResource.ResourceType), nameof(id)); - } - - /// - /// Creates/Updates a particular access policy assignment for a database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName} - /// - /// - /// Operation Id - /// AccessPolicyAssignment_CreateUpdate - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the Redis Enterprise database access policy assignment. - /// Parameters supplied to the create access policy assignment for database. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string accessPolicyAssignmentName, AccessPolicyAssignmentData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(accessPolicyAssignmentName, nameof(accessPolicyAssignmentName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _accessPolicyAssignmentClientDiagnostics.CreateScope("AccessPolicyAssignmentCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _accessPolicyAssignmentRestClient.CreateUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, accessPolicyAssignmentName, data, cancellationToken).ConfigureAwait(false); - var operation = new RedisEnterpriseArmOperation(new AccessPolicyAssignmentOperationSource(Client), _accessPolicyAssignmentClientDiagnostics, Pipeline, _accessPolicyAssignmentRestClient.CreateCreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, accessPolicyAssignmentName, data).Request, response, OperationFinalStateVia.OriginalUri); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates/Updates a particular access policy assignment for a database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName} - /// - /// - /// Operation Id - /// AccessPolicyAssignment_CreateUpdate - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the Redis Enterprise database access policy assignment. - /// Parameters supplied to the create access policy assignment for database. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string accessPolicyAssignmentName, AccessPolicyAssignmentData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(accessPolicyAssignmentName, nameof(accessPolicyAssignmentName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _accessPolicyAssignmentClientDiagnostics.CreateScope("AccessPolicyAssignmentCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _accessPolicyAssignmentRestClient.CreateUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, accessPolicyAssignmentName, data, cancellationToken); - var operation = new RedisEnterpriseArmOperation(new AccessPolicyAssignmentOperationSource(Client), _accessPolicyAssignmentClientDiagnostics, Pipeline, _accessPolicyAssignmentRestClient.CreateCreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, accessPolicyAssignmentName, data).Request, response, OperationFinalStateVia.OriginalUri); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets information about access policy assignment for database. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName} - /// - /// - /// Operation Id - /// AccessPolicyAssignment_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the Redis Enterprise database access policy assignment. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string accessPolicyAssignmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(accessPolicyAssignmentName, nameof(accessPolicyAssignmentName)); - - using var scope = _accessPolicyAssignmentClientDiagnostics.CreateScope("AccessPolicyAssignmentCollection.Get"); - scope.Start(); - try - { - var response = await _accessPolicyAssignmentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, accessPolicyAssignmentName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AccessPolicyAssignmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets information about access policy assignment for database. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName} - /// - /// - /// Operation Id - /// AccessPolicyAssignment_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the Redis Enterprise database access policy assignment. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string accessPolicyAssignmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(accessPolicyAssignmentName, nameof(accessPolicyAssignmentName)); - - using var scope = _accessPolicyAssignmentClientDiagnostics.CreateScope("AccessPolicyAssignmentCollection.Get"); - scope.Start(); - try - { - var response = _accessPolicyAssignmentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, accessPolicyAssignmentName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AccessPolicyAssignmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets all access policy assignments.. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments - /// - /// - /// Operation Id - /// AccessPolicyAssignment_List - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _accessPolicyAssignmentRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _accessPolicyAssignmentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AccessPolicyAssignmentResource(Client, AccessPolicyAssignmentData.DeserializeAccessPolicyAssignmentData(e)), _accessPolicyAssignmentClientDiagnostics, Pipeline, "AccessPolicyAssignmentCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Gets all access policy assignments.. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments - /// - /// - /// Operation Id - /// AccessPolicyAssignment_List - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _accessPolicyAssignmentRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _accessPolicyAssignmentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AccessPolicyAssignmentResource(Client, AccessPolicyAssignmentData.DeserializeAccessPolicyAssignmentData(e)), _accessPolicyAssignmentClientDiagnostics, Pipeline, "AccessPolicyAssignmentCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName} - /// - /// - /// Operation Id - /// AccessPolicyAssignment_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the Redis Enterprise database access policy assignment. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string accessPolicyAssignmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(accessPolicyAssignmentName, nameof(accessPolicyAssignmentName)); - - using var scope = _accessPolicyAssignmentClientDiagnostics.CreateScope("AccessPolicyAssignmentCollection.Exists"); - scope.Start(); - try - { - var response = await _accessPolicyAssignmentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, accessPolicyAssignmentName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName} - /// - /// - /// Operation Id - /// AccessPolicyAssignment_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the Redis Enterprise database access policy assignment. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string accessPolicyAssignmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(accessPolicyAssignmentName, nameof(accessPolicyAssignmentName)); - - using var scope = _accessPolicyAssignmentClientDiagnostics.CreateScope("AccessPolicyAssignmentCollection.Exists"); - scope.Start(); - try - { - var response = _accessPolicyAssignmentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, accessPolicyAssignmentName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName} - /// - /// - /// Operation Id - /// AccessPolicyAssignment_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the Redis Enterprise database access policy assignment. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string accessPolicyAssignmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(accessPolicyAssignmentName, nameof(accessPolicyAssignmentName)); - - using var scope = _accessPolicyAssignmentClientDiagnostics.CreateScope("AccessPolicyAssignmentCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _accessPolicyAssignmentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, accessPolicyAssignmentName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new AccessPolicyAssignmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName} - /// - /// - /// Operation Id - /// AccessPolicyAssignment_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the Redis Enterprise database access policy assignment. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string accessPolicyAssignmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(accessPolicyAssignmentName, nameof(accessPolicyAssignmentName)); - - using var scope = _accessPolicyAssignmentClientDiagnostics.CreateScope("AccessPolicyAssignmentCollection.GetIfExists"); - scope.Start(); - try - { - var response = _accessPolicyAssignmentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, accessPolicyAssignmentName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new AccessPolicyAssignmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/AccessPolicyAssignmentData.Serialization.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/AccessPolicyAssignmentData.Serialization.cs deleted file mode 100644 index 609b4e0b8829..000000000000 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/AccessPolicyAssignmentData.Serialization.cs +++ /dev/null @@ -1,330 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.RedisEnterprise.Models; - -namespace Azure.ResourceManager.RedisEnterprise -{ - public partial class AccessPolicyAssignmentData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(AccessPolicyAssignmentData)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (Optional.IsDefined(AccessPolicyName)) - { - writer.WritePropertyName("accessPolicyName"u8); - writer.WriteStringValue(AccessPolicyName); - } - if (Optional.IsDefined(User)) - { - writer.WritePropertyName("user"u8); - writer.WriteObjectValue(User, options); - } - writer.WriteEndObject(); - } - - AccessPolicyAssignmentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AccessPolicyAssignmentData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAccessPolicyAssignmentData(document.RootElement, options); - } - - internal static AccessPolicyAssignmentData DeserializeAccessPolicyAssignmentData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - RedisEnterpriseProvisioningStatus? provisioningState = default; - string accessPolicyName = default; - AccessPolicyAssignmentPropertiesUser user = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new RedisEnterpriseProvisioningStatus(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("accessPolicyName"u8)) - { - accessPolicyName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("user"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - user = AccessPolicyAssignmentPropertiesUser.DeserializeAccessPolicyAssignmentPropertiesUser(property0.Value, options); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new AccessPolicyAssignmentData( - id, - name, - type, - systemData, - provisioningState, - accessPolicyName, - user, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" provisioningState: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ProvisioningState)) - { - builder.Append(" provisioningState: "); - builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccessPolicyName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" accessPolicyName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(AccessPolicyName)) - { - builder.Append(" accessPolicyName: "); - if (AccessPolicyName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{AccessPolicyName}'''"); - } - else - { - builder.AppendLine($"'{AccessPolicyName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("UserObjectId", out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" user: "); - builder.AppendLine("{"); - builder.AppendLine(" user: {"); - builder.Append(" objectId: "); - builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); - builder.AppendLine(" }"); - } - else - { - if (Optional.IsDefined(User)) - { - builder.Append(" user: "); - BicepSerializationHelpers.AppendChildObject(builder, User, options, 4, false, " user: "); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(AccessPolicyAssignmentData)} does not support writing '{options.Format}' format."); - } - } - - AccessPolicyAssignmentData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAccessPolicyAssignmentData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AccessPolicyAssignmentData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/AccessPolicyAssignmentData.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/AccessPolicyAssignmentData.cs deleted file mode 100644 index e14867016d0c..000000000000 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/AccessPolicyAssignmentData.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.RedisEnterprise.Models; - -namespace Azure.ResourceManager.RedisEnterprise -{ - /// - /// A class representing the AccessPolicyAssignment data model. - /// Describes the access policy assignment of Redis Enterprise database - /// - public partial class AccessPolicyAssignmentData : ResourceData - { - /// - /// 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; - - /// Initializes a new instance of . - public AccessPolicyAssignmentData() - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Current provisioning status of the access policy assignment. - /// Name of access policy under specific access policy assignment. Only "default" policy is supported for now. - /// The user associated with the access policy. - /// Keeps track of any properties unknown to the library. - internal AccessPolicyAssignmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, RedisEnterpriseProvisioningStatus? provisioningState, string accessPolicyName, AccessPolicyAssignmentPropertiesUser user, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - ProvisioningState = provisioningState; - AccessPolicyName = accessPolicyName; - User = user; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Current provisioning status of the access policy assignment. - [WirePath("properties.provisioningState")] - public RedisEnterpriseProvisioningStatus? ProvisioningState { get; } - /// Name of access policy under specific access policy assignment. Only "default" policy is supported for now. - [WirePath("properties.accessPolicyName")] - public string AccessPolicyName { get; set; } - /// The user associated with the access policy. - internal AccessPolicyAssignmentPropertiesUser User { get; set; } - /// The object ID of the user. - [WirePath("properties.user.objectId")] - public Guid? UserObjectId - { - get => User is null ? default : User.ObjectId; - set - { - if (User is null) - User = new AccessPolicyAssignmentPropertiesUser(); - User.ObjectId = value; - } - } - } -} diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/AccessPolicyAssignmentResource.Serialization.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/AccessPolicyAssignmentResource.Serialization.cs deleted file mode 100644 index 7e0713486b87..000000000000 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/AccessPolicyAssignmentResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.RedisEnterprise -{ - public partial class AccessPolicyAssignmentResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - AccessPolicyAssignmentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - AccessPolicyAssignmentData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/ArmRedisEnterpriseModelFactory.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/ArmRedisEnterpriseModelFactory.cs index c379cb6494ef..956598b7a59a 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/ArmRedisEnterpriseModelFactory.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/ArmRedisEnterpriseModelFactory.cs @@ -7,7 +7,6 @@ using System; using System.Collections.Generic; -using System.ComponentModel; using System.Linq; using Azure.Core; using Azure.ResourceManager.Models; @@ -47,17 +46,15 @@ public static RedisEnterpriseOperationStatus RedisEnterpriseOperationStatus(Reso /// The SKU to create, which affects price, performance, and features. /// The Availability Zones where this cluster will be deployed. /// The identity of the resource. - /// Enabled by default. If highAvailability is disabled, the data set is not replicated. This affects the availability SLA, and increases the risk of data loss. - /// The minimum TLS version for the cluster to support, e.g. '1.2'. Newer versions can be added in the future. Note that TLS 1.0 and TLS 1.1 are now completely obsolete -- you cannot use them. They are mentioned only for the sake of consistency with old API versions. + /// The minimum TLS version for the cluster to support, e.g. '1.2'. /// Encryption-at-rest configuration for the cluster. /// DNS name of the cluster endpoint. /// Current provisioning status of the cluster. - /// Explains the current redundancy strategy of the cluster, which affects the expected SLA. /// Current resource status of the cluster. /// Version of redis the cluster supports, e.g. '6'. - /// List of private endpoint connections associated with the specified Redis Enterprise cluster. + /// List of private endpoint connections associated with the specified RedisEnterprise cluster. /// A new instance for mocking. - public static RedisEnterpriseClusterData RedisEnterpriseClusterData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, RedisEnterpriseSku sku = null, IEnumerable zones = null, ManagedServiceIdentity identity = null, RedisEnterpriseHighAvailability? highAvailability = null, RedisEnterpriseTlsVersion? minimumTlsVersion = null, RedisEnterpriseCustomerManagedKeyEncryption customerManagedKeyEncryption = null, string hostName = null, RedisEnterpriseProvisioningStatus? provisioningState = null, RedisEnterpriseRedundancyMode? redundancyMode = null, RedisEnterpriseClusterResourceState? resourceState = null, string redisVersion = null, IEnumerable privateEndpointConnections = null) + public static RedisEnterpriseClusterData RedisEnterpriseClusterData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, RedisEnterpriseSku sku = null, IEnumerable zones = null, ManagedServiceIdentity identity = null, RedisEnterpriseTlsVersion? minimumTlsVersion = null, RedisEnterpriseCustomerManagedKeyEncryption customerManagedKeyEncryption = null, string hostName = null, RedisEnterpriseProvisioningStatus? provisioningState = null, RedisEnterpriseClusterResourceState? resourceState = null, string redisVersion = null, IEnumerable privateEndpointConnections = null) { tags ??= new Dictionary(); zones ??= new List(); @@ -73,12 +70,10 @@ public static RedisEnterpriseClusterData RedisEnterpriseClusterData(ResourceIden sku, zones?.ToList(), identity, - highAvailability, minimumTlsVersion, customerManagedKeyEncryption != null ? new ClusterPropertiesEncryption(customerManagedKeyEncryption, serializedAdditionalRawData: null) : null, hostName, provisioningState, - redundancyMode, resourceState, redisVersion, privateEndpointConnections?.ToList(), @@ -111,17 +106,15 @@ public static RedisEnterprisePrivateEndpointConnectionData RedisEnterprisePrivat /// The SKU to create, which affects price, performance, and features. /// The identity of the resource. /// Resource tags. - /// Enabled by default. If highAvailability is disabled, the data set is not replicated. This affects the availability SLA, and increases the risk of data loss. - /// The minimum TLS version for the cluster to support, e.g. '1.2'. Newer versions can be added in the future. Note that TLS 1.0 and TLS 1.1 are now completely obsolete -- you cannot use them. They are mentioned only for the sake of consistency with old API versions. + /// The minimum TLS version for the cluster to support, e.g. '1.2'. /// Encryption-at-rest configuration for the cluster. /// DNS name of the cluster endpoint. /// Current provisioning status of the cluster. - /// Explains the current redundancy strategy of the cluster, which affects the expected SLA. /// Current resource status of the cluster. /// Version of redis the cluster supports, e.g. '6'. - /// List of private endpoint connections associated with the specified Redis Enterprise cluster. + /// List of private endpoint connections associated with the specified RedisEnterprise cluster. /// A new instance for mocking. - public static RedisEnterpriseClusterPatch RedisEnterpriseClusterPatch(RedisEnterpriseSku sku = null, ManagedServiceIdentity identity = null, IDictionary tags = null, RedisEnterpriseHighAvailability? highAvailability = null, RedisEnterpriseTlsVersion? minimumTlsVersion = null, RedisEnterpriseCustomerManagedKeyEncryption customerManagedKeyEncryption = null, string hostName = null, RedisEnterpriseProvisioningStatus? provisioningState = null, RedisEnterpriseRedundancyMode? redundancyMode = null, RedisEnterpriseClusterResourceState? resourceState = null, string redisVersion = null, IEnumerable privateEndpointConnections = null) + public static RedisEnterpriseClusterPatch RedisEnterpriseClusterPatch(RedisEnterpriseSku sku = null, ManagedServiceIdentity identity = null, IDictionary tags = null, RedisEnterpriseTlsVersion? minimumTlsVersion = null, RedisEnterpriseCustomerManagedKeyEncryption customerManagedKeyEncryption = null, string hostName = null, RedisEnterpriseProvisioningStatus? provisioningState = null, RedisEnterpriseClusterResourceState? resourceState = null, string redisVersion = null, IEnumerable privateEndpointConnections = null) { tags ??= new Dictionary(); privateEndpointConnections ??= new List(); @@ -130,12 +123,10 @@ public static RedisEnterpriseClusterPatch RedisEnterpriseClusterPatch(RedisEnter sku, identity, tags, - highAvailability, minimumTlsVersion, customerManagedKeyEncryption != null ? new ClusterPropertiesEncryption(customerManagedKeyEncryption, serializedAdditionalRawData: null) : null, hostName, provisioningState, - redundancyMode, resourceState, redisVersion, privateEndpointConnections?.ToList(), @@ -151,16 +142,13 @@ public static RedisEnterpriseClusterPatch RedisEnterpriseClusterPatch(RedisEnter /// TCP port of the database endpoint. Specified at create time. Defaults to an available port. /// Current provisioning status of the database. /// Current resource status of the database. - /// Clustering policy - default is OSSCluster. This property must be chosen at create time, and cannot be changed without deleting the database. + /// Clustering policy - default is OSSCluster. Specified at create time. /// Redis eviction policy - default is VolatileLRU. /// Persistence settings. /// Optional set of redis modules to enable in this database - modules can only be added at creation time. /// Optional set of properties to configure geo replication for this database. - /// Version of Redis the database is running on, e.g. '6.0'. - /// Option to defer upgrade when newest version is released - default is NotDeferred. Learn more: https://aka.ms/redisversionupgrade. - /// This property can be Enabled/Disabled to allow or deny access with the current access keys. Can be updated even after database is created. /// A new instance for mocking. - public static RedisEnterpriseDatabaseData RedisEnterpriseDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, RedisEnterpriseClientProtocol? clientProtocol = null, int? port = null, RedisEnterpriseProvisioningStatus? provisioningState = null, RedisEnterpriseClusterResourceState? resourceState = null, RedisEnterpriseClusteringPolicy? clusteringPolicy = null, RedisEnterpriseEvictionPolicy? evictionPolicy = null, RedisPersistenceSettings persistence = null, IEnumerable modules = null, RedisEnterpriseDatabaseGeoReplication geoReplication = null, string redisVersion = null, DeferUpgradeSetting? deferUpgrade = null, AccessKeysAuthentication? accessKeysAuthentication = null) + public static RedisEnterpriseDatabaseData RedisEnterpriseDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, RedisEnterpriseClientProtocol? clientProtocol = null, int? port = null, RedisEnterpriseProvisioningStatus? provisioningState = null, RedisEnterpriseClusterResourceState? resourceState = null, RedisEnterpriseClusteringPolicy? clusteringPolicy = null, RedisEnterpriseEvictionPolicy? evictionPolicy = null, RedisPersistenceSettings persistence = null, IEnumerable modules = null, RedisEnterpriseDatabaseGeoReplication geoReplication = null) { modules ??= new List(); @@ -178,9 +166,6 @@ public static RedisEnterpriseDatabaseData RedisEnterpriseDatabaseData(ResourceId persistence, modules?.ToList(), geoReplication, - redisVersion, - deferUpgrade, - accessKeysAuthentication, serializedAdditionalRawData: null); } @@ -208,16 +193,13 @@ public static RedisEnterpriseLinkedDatabase RedisEnterpriseLinkedDatabase(Resour /// TCP port of the database endpoint. Specified at create time. Defaults to an available port. /// Current provisioning status of the database. /// Current resource status of the database. - /// Clustering policy - default is OSSCluster. This property must be chosen at create time, and cannot be changed without deleting the database. + /// Clustering policy - default is OSSCluster. Specified at create time. /// Redis eviction policy - default is VolatileLRU. /// Persistence settings. /// Optional set of redis modules to enable in this database - modules can only be added at creation time. /// Optional set of properties to configure geo replication for this database. - /// Version of Redis the database is running on, e.g. '6.0'. - /// Option to defer upgrade when newest version is released - default is NotDeferred. Learn more: https://aka.ms/redisversionupgrade. - /// This property can be Enabled/Disabled to allow or deny access with the current access keys. Can be updated even after database is created. /// A new instance for mocking. - public static RedisEnterpriseDatabasePatch RedisEnterpriseDatabasePatch(RedisEnterpriseClientProtocol? clientProtocol = null, int? port = null, RedisEnterpriseProvisioningStatus? provisioningState = null, RedisEnterpriseClusterResourceState? resourceState = null, RedisEnterpriseClusteringPolicy? clusteringPolicy = null, RedisEnterpriseEvictionPolicy? evictionPolicy = null, RedisPersistenceSettings persistence = null, IEnumerable modules = null, RedisEnterpriseDatabaseGeoReplication geoReplication = null, string redisVersion = null, DeferUpgradeSetting? deferUpgrade = null, AccessKeysAuthentication? accessKeysAuthentication = null) + public static RedisEnterpriseDatabasePatch RedisEnterpriseDatabasePatch(RedisEnterpriseClientProtocol? clientProtocol = null, int? port = null, RedisEnterpriseProvisioningStatus? provisioningState = null, RedisEnterpriseClusterResourceState? resourceState = null, RedisEnterpriseClusteringPolicy? clusteringPolicy = null, RedisEnterpriseEvictionPolicy? evictionPolicy = null, RedisPersistenceSettings persistence = null, IEnumerable modules = null, RedisEnterpriseDatabaseGeoReplication geoReplication = null) { modules ??= new List(); @@ -231,9 +213,6 @@ public static RedisEnterpriseDatabasePatch RedisEnterpriseDatabasePatch(RedisEnt persistence, modules?.ToList(), geoReplication, - redisVersion, - deferUpgrade, - accessKeysAuthentication, serializedAdditionalRawData: null); } @@ -246,28 +225,6 @@ public static RedisEnterpriseDataAccessKeys RedisEnterpriseDataAccessKeys(string return new RedisEnterpriseDataAccessKeys(primaryKey, secondaryKey, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Current provisioning status of the access policy assignment. - /// Name of access policy under specific access policy assignment. Only "default" policy is supported for now. - /// The user associated with the access policy. - /// A new instance for mocking. - public static AccessPolicyAssignmentData AccessPolicyAssignmentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, RedisEnterpriseProvisioningStatus? provisioningState = null, string accessPolicyName = null, Guid? userObjectId = null) - { - return new AccessPolicyAssignmentData( - id, - name, - resourceType, - systemData, - provisioningState, - accessPolicyName, - userObjectId != null ? new AccessPolicyAssignmentPropertiesUser(userObjectId, serializedAdditionalRawData: null) : null, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -292,85 +249,5 @@ public static RedisEnterprisePrivateLinkResource RedisEnterprisePrivateLinkResou requiredZoneNames?.ToList(), serializedAdditionalRawData: null); } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The SKU to create, which affects price, performance, and features. - /// The Availability Zones where this cluster will be deployed. - /// The identity of the resource. - /// The minimum TLS version for the cluster to support, e.g. '1.2'. - /// Encryption-at-rest configuration for the cluster. - /// DNS name of the cluster endpoint. - /// Current provisioning status of the cluster. - /// Current resource status of the cluster. - /// Version of redis the cluster supports, e.g. '6'. - /// List of private endpoint connections associated with the specified RedisEnterprise cluster. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static RedisEnterpriseClusterData RedisEnterpriseClusterData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, RedisEnterpriseSku sku, IEnumerable zones, ManagedServiceIdentity identity, RedisEnterpriseTlsVersion? minimumTlsVersion, RedisEnterpriseCustomerManagedKeyEncryption customerManagedKeyEncryption, string hostName, RedisEnterpriseProvisioningStatus? provisioningState, RedisEnterpriseClusterResourceState? resourceState, string redisVersion, IEnumerable privateEndpointConnections) - { - return RedisEnterpriseClusterData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, sku: sku, zones: zones, identity: identity, highAvailability: default, minimumTlsVersion: minimumTlsVersion, customerManagedKeyEncryption: customerManagedKeyEncryption, hostName: hostName, provisioningState: provisioningState, redundancyMode: default, resourceState: resourceState, redisVersion: redisVersion, privateEndpointConnections: privateEndpointConnections); - } - - /// Initializes a new instance of . - /// The SKU to create, which affects price, performance, and features. - /// The identity of the resource. - /// Resource tags. - /// The minimum TLS version for the cluster to support, e.g. '1.2'. - /// Encryption-at-rest configuration for the cluster. - /// DNS name of the cluster endpoint. - /// Current provisioning status of the cluster. - /// Current resource status of the cluster. - /// Version of redis the cluster supports, e.g. '6'. - /// List of private endpoint connections associated with the specified RedisEnterprise cluster. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static RedisEnterpriseClusterPatch RedisEnterpriseClusterPatch(RedisEnterpriseSku sku, ManagedServiceIdentity identity, IDictionary tags, RedisEnterpriseTlsVersion? minimumTlsVersion, RedisEnterpriseCustomerManagedKeyEncryption customerManagedKeyEncryption, string hostName, RedisEnterpriseProvisioningStatus? provisioningState, RedisEnterpriseClusterResourceState? resourceState, string redisVersion, IEnumerable privateEndpointConnections) - { - return RedisEnterpriseClusterPatch(sku: sku, identity: identity, tags: tags, highAvailability: default, minimumTlsVersion: minimumTlsVersion, customerManagedKeyEncryption: customerManagedKeyEncryption, hostName: hostName, provisioningState: provisioningState, redundancyMode: default, resourceState: resourceState, redisVersion: redisVersion, privateEndpointConnections: privateEndpointConnections); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Specifies whether redis clients can connect using TLS-encrypted or plaintext redis protocols. Default is TLS-encrypted. - /// TCP port of the database endpoint. Specified at create time. Defaults to an available port. - /// Current provisioning status of the database. - /// Current resource status of the database. - /// Clustering policy - default is OSSCluster. Specified at create time. - /// Redis eviction policy - default is VolatileLRU. - /// Persistence settings. - /// Optional set of redis modules to enable in this database - modules can only be added at creation time. - /// Optional set of properties to configure geo replication for this database. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static RedisEnterpriseDatabaseData RedisEnterpriseDatabaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, RedisEnterpriseClientProtocol? clientProtocol, int? port, RedisEnterpriseProvisioningStatus? provisioningState, RedisEnterpriseClusterResourceState? resourceState, RedisEnterpriseClusteringPolicy? clusteringPolicy, RedisEnterpriseEvictionPolicy? evictionPolicy, RedisPersistenceSettings persistence, IEnumerable modules, RedisEnterpriseDatabaseGeoReplication geoReplication) - { - return RedisEnterpriseDatabaseData(id: id, name: name, resourceType: resourceType, systemData: systemData, clientProtocol: clientProtocol, port: port, provisioningState: provisioningState, resourceState: resourceState, clusteringPolicy: clusteringPolicy, evictionPolicy: evictionPolicy, persistence: persistence, modules: modules, geoReplication: geoReplication, redisVersion: default, deferUpgrade: default, accessKeysAuthentication: default); - } - - /// Initializes a new instance of . - /// Specifies whether redis clients can connect using TLS-encrypted or plaintext redis protocols. Default is TLS-encrypted. - /// TCP port of the database endpoint. Specified at create time. Defaults to an available port. - /// Current provisioning status of the database. - /// Current resource status of the database. - /// Clustering policy - default is OSSCluster. Specified at create time. - /// Redis eviction policy - default is VolatileLRU. - /// Persistence settings. - /// Optional set of redis modules to enable in this database - modules can only be added at creation time. - /// Optional set of properties to configure geo replication for this database. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static RedisEnterpriseDatabasePatch RedisEnterpriseDatabasePatch(RedisEnterpriseClientProtocol? clientProtocol, int? port, RedisEnterpriseProvisioningStatus? provisioningState, RedisEnterpriseClusterResourceState? resourceState, RedisEnterpriseClusteringPolicy? clusteringPolicy, RedisEnterpriseEvictionPolicy? evictionPolicy, RedisPersistenceSettings persistence, IEnumerable modules, RedisEnterpriseDatabaseGeoReplication geoReplication) - { - return RedisEnterpriseDatabasePatch(clientProtocol: clientProtocol, port: port, provisioningState: provisioningState, resourceState: resourceState, clusteringPolicy: clusteringPolicy, evictionPolicy: evictionPolicy, persistence: persistence, modules: modules, geoReplication: geoReplication, redisVersion: default, deferUpgrade: default, accessKeysAuthentication: default); - } } } diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/MockableRedisEnterpriseArmClient.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/MockableRedisEnterpriseArmClient.cs index 3b58a1e4d76d..c8046549d2e1 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/MockableRedisEnterpriseArmClient.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/MockableRedisEnterpriseArmClient.cs @@ -58,18 +58,6 @@ public virtual RedisEnterpriseDatabaseResource GetRedisEnterpriseDatabaseResourc return new RedisEnterpriseDatabaseResource(Client, id); } - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual AccessPolicyAssignmentResource GetAccessPolicyAssignmentResource(ResourceIdentifier id) - { - AccessPolicyAssignmentResource.ValidateResourceId(id); - return new AccessPolicyAssignmentResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/MockableRedisEnterpriseResourceGroupResource.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/MockableRedisEnterpriseResourceGroupResource.cs index de42a8769455..ef2aa46eb9b9 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/MockableRedisEnterpriseResourceGroupResource.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/MockableRedisEnterpriseResourceGroupResource.cs @@ -41,7 +41,7 @@ public virtual RedisEnterpriseClusterCollection GetRedisEnterpriseClusters() } /// - /// Gets information about a Redis Enterprise cluster + /// Gets information about a RedisEnterprise cluster /// /// /// Request Path @@ -53,7 +53,7 @@ public virtual RedisEnterpriseClusterCollection GetRedisEnterpriseClusters() /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -61,7 +61,7 @@ public virtual RedisEnterpriseClusterCollection GetRedisEnterpriseClusters() /// /// /// - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -72,7 +72,7 @@ public virtual async Task> GetRedisEnte } /// - /// Gets information about a Redis Enterprise cluster + /// Gets information about a RedisEnterprise cluster /// /// /// Request Path @@ -84,7 +84,7 @@ public virtual async Task> GetRedisEnte /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -92,7 +92,7 @@ public virtual async Task> GetRedisEnte /// /// /// - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/MockableRedisEnterpriseSubscriptionResource.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/MockableRedisEnterpriseSubscriptionResource.cs index 76fa42ad9eb5..c6ec89dedbfb 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/MockableRedisEnterpriseSubscriptionResource.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/MockableRedisEnterpriseSubscriptionResource.cs @@ -59,7 +59,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// @@ -99,7 +99,7 @@ public virtual async Task> GetRedisEnte /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// @@ -127,7 +127,7 @@ public virtual Response GetRedisEnterpriseOperat } /// - /// Lists all Redis Enterprise clusters in the specified subscription. + /// Gets all RedisEnterprise clusters in the specified subscription. /// /// /// Request Path @@ -139,7 +139,7 @@ public virtual Response GetRedisEnterpriseOperat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -157,7 +157,7 @@ public virtual AsyncPageable GetRedisEnterpriseC } /// - /// Lists all Redis Enterprise clusters in the specified subscription. + /// Gets all RedisEnterprise clusters in the specified subscription. /// /// /// Request Path @@ -169,7 +169,7 @@ public virtual AsyncPageable GetRedisEnterpriseC /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/RedisEnterpriseExtensions.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/RedisEnterpriseExtensions.cs index 92485e00357e..b5f679f96812 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/RedisEnterpriseExtensions.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/RedisEnterpriseExtensions.cs @@ -71,25 +71,6 @@ public static RedisEnterpriseDatabaseResource GetRedisEnterpriseDatabaseResource return GetMockableRedisEnterpriseArmClient(client).GetRedisEnterpriseDatabaseResource(id); } - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static AccessPolicyAssignmentResource GetAccessPolicyAssignmentResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableRedisEnterpriseArmClient(client).GetAccessPolicyAssignmentResource(id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -127,7 +108,7 @@ public static RedisEnterpriseClusterCollection GetRedisEnterpriseClusters(this R } /// - /// Gets information about a Redis Enterprise cluster + /// Gets information about a RedisEnterprise cluster /// /// /// Request Path @@ -139,7 +120,7 @@ public static RedisEnterpriseClusterCollection GetRedisEnterpriseClusters(this R /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -152,7 +133,7 @@ public static RedisEnterpriseClusterCollection GetRedisEnterpriseClusters(this R /// /// /// The instance the method will execute against. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -165,7 +146,7 @@ public static async Task> GetRedisEnter } /// - /// Gets information about a Redis Enterprise cluster + /// Gets information about a RedisEnterprise cluster /// /// /// Request Path @@ -177,7 +158,7 @@ public static async Task> GetRedisEnter /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -190,7 +171,7 @@ public static async Task> GetRedisEnter /// /// /// The instance the method will execute against. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -215,7 +196,7 @@ public static Response GetRedisEnterpriseCluster /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// @@ -249,7 +230,7 @@ public static async Task> GetRedisEnter /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// @@ -271,7 +252,7 @@ public static Response GetRedisEnterpriseOperati } /// - /// Lists all Redis Enterprise clusters in the specified subscription. + /// Gets all RedisEnterprise clusters in the specified subscription. /// /// /// Request Path @@ -283,7 +264,7 @@ public static Response GetRedisEnterpriseOperati /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -307,7 +288,7 @@ public static AsyncPageable GetRedisEnterpriseCl } /// - /// Lists all Redis Enterprise clusters in the specified subscription. + /// Gets all RedisEnterprise clusters in the specified subscription. /// /// /// Request Path @@ -319,7 +300,7 @@ public static AsyncPageable GetRedisEnterpriseCl /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/LongRunningOperation/AccessPolicyAssignmentOperationSource.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/LongRunningOperation/AccessPolicyAssignmentOperationSource.cs deleted file mode 100644 index 884898dd92db..000000000000 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/LongRunningOperation/AccessPolicyAssignmentOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.RedisEnterprise -{ - internal class AccessPolicyAssignmentOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal AccessPolicyAssignmentOperationSource(ArmClient client) - { - _client = client; - } - - AccessPolicyAssignmentResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = AccessPolicyAssignmentData.DeserializeAccessPolicyAssignmentData(document.RootElement); - return new AccessPolicyAssignmentResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = AccessPolicyAssignmentData.DeserializeAccessPolicyAssignmentData(document.RootElement); - return new AccessPolicyAssignmentResource(_client, data); - } - } -} diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/AccessKeysAuthentication.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/AccessKeysAuthentication.cs deleted file mode 100644 index 1c834a1b7061..000000000000 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/AccessKeysAuthentication.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.RedisEnterprise.Models -{ - /// This property can be Enabled/Disabled to allow or deny access with the current access keys. Can be updated even after database is created. - public readonly partial struct AccessKeysAuthentication : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AccessKeysAuthentication(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DisabledValue = "Disabled"; - private const string EnabledValue = "Enabled"; - - /// Disabled. - public static AccessKeysAuthentication Disabled { get; } = new AccessKeysAuthentication(DisabledValue); - /// Enabled. - public static AccessKeysAuthentication Enabled { get; } = new AccessKeysAuthentication(EnabledValue); - /// Determines if two values are the same. - public static bool operator ==(AccessKeysAuthentication left, AccessKeysAuthentication right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AccessKeysAuthentication left, AccessKeysAuthentication right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator AccessKeysAuthentication(string value) => new AccessKeysAuthentication(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AccessKeysAuthentication other && Equals(other); - /// - public bool Equals(AccessKeysAuthentication 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/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/DeferUpgradeSetting.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/DeferUpgradeSetting.cs deleted file mode 100644 index 2eb3f40cadb5..000000000000 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/DeferUpgradeSetting.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.RedisEnterprise.Models -{ - /// Option to defer upgrade when newest version is released - default is NotDeferred. Learn more: https://aka.ms/redisversionupgrade. - public readonly partial struct DeferUpgradeSetting : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DeferUpgradeSetting(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DeferredValue = "Deferred"; - private const string NotDeferredValue = "NotDeferred"; - - /// Deferred. - public static DeferUpgradeSetting Deferred { get; } = new DeferUpgradeSetting(DeferredValue); - /// NotDeferred. - public static DeferUpgradeSetting NotDeferred { get; } = new DeferUpgradeSetting(NotDeferredValue); - /// Determines if two values are the same. - public static bool operator ==(DeferUpgradeSetting left, DeferUpgradeSetting right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DeferUpgradeSetting left, DeferUpgradeSetting right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator DeferUpgradeSetting(string value) => new DeferUpgradeSetting(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DeferUpgradeSetting other && Equals(other); - /// - public bool Equals(DeferUpgradeSetting 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/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/ForceLinkContent.Serialization.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/ForceLinkContent.Serialization.cs index 61f9e9dc91ae..f81ba3da3a4f 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/ForceLinkContent.Serialization.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/ForceLinkContent.Serialization.cs @@ -34,15 +34,8 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ForceLinkContent)} does not support writing '{format}' format."); } - writer.WritePropertyName("groupNickname"u8); - writer.WriteStringValue(GroupNickname); - writer.WritePropertyName("linkedDatabases"u8); - writer.WriteStartArray(); - foreach (var item in LinkedDatabases) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WritePropertyName("geoReplication"u8); + writer.WriteObjectValue(GeoReplication, options); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -80,25 +73,14 @@ internal static ForceLinkContent DeserializeForceLinkContent(JsonElement element { return null; } - string groupNickname = default; - IList linkedDatabases = default; + ForceLinkParametersGeoReplication geoReplication = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("groupNickname"u8)) + if (property.NameEquals("geoReplication"u8)) { - groupNickname = property.Value.GetString(); - continue; - } - if (property.NameEquals("linkedDatabases"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(RedisEnterpriseLinkedDatabase.DeserializeRedisEnterpriseLinkedDatabase(item, options)); - } - linkedDatabases = array; + geoReplication = ForceLinkParametersGeoReplication.DeserializeForceLinkParametersGeoReplication(property.Value, options); continue; } if (options.Format != "W") @@ -107,7 +89,7 @@ internal static ForceLinkContent DeserializeForceLinkContent(JsonElement element } } serializedAdditionalRawData = rawDataDictionary; - return new ForceLinkContent(groupNickname, linkedDatabases, serializedAdditionalRawData); + return new ForceLinkContent(geoReplication, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/ForceLinkContent.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/ForceLinkContent.cs index 1cfdfd451f57..37eaab723ce3 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/ForceLinkContent.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/ForceLinkContent.cs @@ -7,7 +7,6 @@ using System; using System.Collections.Generic; -using System.Linq; namespace Azure.ResourceManager.RedisEnterprise.Models { @@ -47,26 +46,21 @@ public partial class ForceLinkContent private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The name of the group of linked database resources. This should match the existing replication group name. - /// The resource IDs of the databases that are expected to be linked and included in the replication group. This parameter is used to validate that the linking is to the expected (unlinked) part of the replication group, if it is splintered. - /// or is null. - public ForceLinkContent(string groupNickname, IEnumerable linkedDatabases) + /// Properties to configure geo replication for this database. + /// is null. + public ForceLinkContent(ForceLinkParametersGeoReplication geoReplication) { - Argument.AssertNotNull(groupNickname, nameof(groupNickname)); - Argument.AssertNotNull(linkedDatabases, nameof(linkedDatabases)); + Argument.AssertNotNull(geoReplication, nameof(geoReplication)); - GroupNickname = groupNickname; - LinkedDatabases = linkedDatabases.ToList(); + GeoReplication = geoReplication; } /// Initializes a new instance of . - /// The name of the group of linked database resources. This should match the existing replication group name. - /// The resource IDs of the databases that are expected to be linked and included in the replication group. This parameter is used to validate that the linking is to the expected (unlinked) part of the replication group, if it is splintered. + /// Properties to configure geo replication for this database. /// Keeps track of any properties unknown to the library. - internal ForceLinkContent(string groupNickname, IList linkedDatabases, IDictionary serializedAdditionalRawData) + internal ForceLinkContent(ForceLinkParametersGeoReplication geoReplication, IDictionary serializedAdditionalRawData) { - GroupNickname = groupNickname; - LinkedDatabases = linkedDatabases; + GeoReplication = geoReplication; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -75,11 +69,8 @@ internal ForceLinkContent() { } - /// The name of the group of linked database resources. This should match the existing replication group name. - [WirePath("groupNickname")] - public string GroupNickname { get; } - /// The resource IDs of the databases that are expected to be linked and included in the replication group. This parameter is used to validate that the linking is to the expected (unlinked) part of the replication group, if it is splintered. - [WirePath("linkedDatabases")] - public IList LinkedDatabases { get; } + /// Properties to configure geo replication for this database. + [WirePath("geoReplication")] + public ForceLinkParametersGeoReplication GeoReplication { get; } } } diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/ForceLinkParametersGeoReplication.Serialization.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/ForceLinkParametersGeoReplication.Serialization.cs new file mode 100644 index 000000000000..5064ba4afaf5 --- /dev/null +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/ForceLinkParametersGeoReplication.Serialization.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RedisEnterprise.Models +{ + public partial class ForceLinkParametersGeoReplication : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(ForceLinkParametersGeoReplication)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(GroupNickname)) + { + writer.WritePropertyName("groupNickname"u8); + writer.WriteStringValue(GroupNickname); + } + if (Optional.IsCollectionDefined(LinkedDatabases)) + { + writer.WritePropertyName("linkedDatabases"u8); + writer.WriteStartArray(); + foreach (var item in LinkedDatabases) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ForceLinkParametersGeoReplication IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ForceLinkParametersGeoReplication)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeForceLinkParametersGeoReplication(document.RootElement, options); + } + + internal static ForceLinkParametersGeoReplication DeserializeForceLinkParametersGeoReplication(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string groupNickname = default; + IList linkedDatabases = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("groupNickname"u8)) + { + groupNickname = property.Value.GetString(); + continue; + } + if (property.NameEquals("linkedDatabases"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RedisEnterpriseLinkedDatabase.DeserializeRedisEnterpriseLinkedDatabase(item, options)); + } + linkedDatabases = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ForceLinkParametersGeoReplication(groupNickname, linkedDatabases ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ForceLinkParametersGeoReplication)} does not support writing '{options.Format}' format."); + } + } + + ForceLinkParametersGeoReplication IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeForceLinkParametersGeoReplication(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ForceLinkParametersGeoReplication)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/ForceLinkParametersGeoReplication.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/ForceLinkParametersGeoReplication.cs new file mode 100644 index 000000000000..2b660595a13a --- /dev/null +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/ForceLinkParametersGeoReplication.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RedisEnterprise.Models +{ + /// Properties to configure geo replication for this database. + public partial class ForceLinkParametersGeoReplication + { + /// + /// 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; + + /// Initializes a new instance of . + public ForceLinkParametersGeoReplication() + { + LinkedDatabases = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The name of the group of linked database resources. This should match the existing replication group name. + /// The resource IDs of the databases that are expected to be linked and included in the replication group. This parameter is used to validate that the linking is to the expected (unlinked) part of the replication group, if it is splintered. + /// Keeps track of any properties unknown to the library. + internal ForceLinkParametersGeoReplication(string groupNickname, IList linkedDatabases, IDictionary serializedAdditionalRawData) + { + GroupNickname = groupNickname; + LinkedDatabases = linkedDatabases; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name of the group of linked database resources. This should match the existing replication group name. + [WirePath("groupNickname")] + public string GroupNickname { get; set; } + /// The resource IDs of the databases that are expected to be linked and included in the replication group. This parameter is used to validate that the linking is to the expected (unlinked) part of the replication group, if it is splintered. + [WirePath("linkedDatabases")] + public IList LinkedDatabases { get; } + } +} diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/ForceUnlinkRedisEnterpriseDatabaseContent.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/ForceUnlinkRedisEnterpriseDatabaseContent.cs index 2a2416186f70..5f1385b837a8 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/ForceUnlinkRedisEnterpriseDatabaseContent.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/ForceUnlinkRedisEnterpriseDatabaseContent.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.RedisEnterprise.Models { - /// Parameters for a redis enterprise active geo-replication force unlink operation. + /// Parameters for a Redis Enterprise Active Geo Replication Force Unlink operation. public partial class ForceUnlinkRedisEnterpriseDatabaseContent { /// diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/PersistenceSettingAofFrequency.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/PersistenceSettingAofFrequency.cs index ea251255ea55..f2157693799c 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/PersistenceSettingAofFrequency.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/PersistenceSettingAofFrequency.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.RedisEnterprise.Models { - /// Sets the frequency at which data is written to disk. Defaults to '1s', meaning 'every second'. Note that the 'always' setting is deprecated, because of its performance impact. + /// Sets the frequency at which data is written to disk. public readonly partial struct PersistenceSettingAofFrequency : IEquatable { private readonly string _value; diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseClusterPatch.Serialization.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseClusterPatch.Serialization.cs index 4d85d69a89a4..27ee056f3165 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseClusterPatch.Serialization.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseClusterPatch.Serialization.cs @@ -58,11 +58,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); - if (Optional.IsDefined(HighAvailability)) - { - writer.WritePropertyName("highAvailability"u8); - writer.WriteStringValue(HighAvailability.Value.ToString()); - } if (Optional.IsDefined(MinimumTlsVersion)) { writer.WritePropertyName("minimumTlsVersion"u8); @@ -83,11 +78,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("provisioningState"u8); writer.WriteStringValue(ProvisioningState.Value.ToString()); } - if (options.Format != "W" && Optional.IsDefined(RedundancyMode)) - { - writer.WritePropertyName("redundancyMode"u8); - writer.WriteStringValue(RedundancyMode.Value.ToString()); - } if (options.Format != "W" && Optional.IsDefined(ResourceState)) { writer.WritePropertyName("resourceState"u8); @@ -149,12 +139,10 @@ internal static RedisEnterpriseClusterPatch DeserializeRedisEnterpriseClusterPat RedisEnterpriseSku sku = default; ManagedServiceIdentity identity = default; IDictionary tags = default; - RedisEnterpriseHighAvailability? highAvailability = default; RedisEnterpriseTlsVersion? minimumTlsVersion = default; ClusterPropertiesEncryption encryption = default; string hostName = default; RedisEnterpriseProvisioningStatus? provisioningState = default; - RedisEnterpriseRedundancyMode? redundancyMode = default; RedisEnterpriseClusterResourceState? resourceState = default; string redisVersion = default; IReadOnlyList privateEndpointConnections = default; @@ -203,15 +191,6 @@ internal static RedisEnterpriseClusterPatch DeserializeRedisEnterpriseClusterPat } foreach (var property0 in property.Value.EnumerateObject()) { - if (property0.NameEquals("highAvailability"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - highAvailability = new RedisEnterpriseHighAvailability(property0.Value.GetString()); - continue; - } if (property0.NameEquals("minimumTlsVersion"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -244,15 +223,6 @@ internal static RedisEnterpriseClusterPatch DeserializeRedisEnterpriseClusterPat provisioningState = new RedisEnterpriseProvisioningStatus(property0.Value.GetString()); continue; } - if (property0.NameEquals("redundancyMode"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - redundancyMode = new RedisEnterpriseRedundancyMode(property0.Value.GetString()); - continue; - } if (property0.NameEquals("resourceState"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -294,12 +264,10 @@ internal static RedisEnterpriseClusterPatch DeserializeRedisEnterpriseClusterPat sku, identity, tags ?? new ChangeTrackingDictionary(), - highAvailability, minimumTlsVersion, encryption, hostName, provisioningState, - redundancyMode, resourceState, redisVersion, privateEndpointConnections ?? new ChangeTrackingList(), diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseClusterPatch.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseClusterPatch.cs index 93b6c439dfd7..b58f77884948 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseClusterPatch.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseClusterPatch.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.RedisEnterprise.Models { - /// A partial update to the Redis Enterprise cluster. + /// A partial update to the RedisEnterprise cluster. public partial class RedisEnterpriseClusterPatch { /// @@ -57,27 +57,23 @@ public RedisEnterpriseClusterPatch() /// The SKU to create, which affects price, performance, and features. /// The identity of the resource. /// Resource tags. - /// Enabled by default. If highAvailability is disabled, the data set is not replicated. This affects the availability SLA, and increases the risk of data loss. - /// The minimum TLS version for the cluster to support, e.g. '1.2'. Newer versions can be added in the future. Note that TLS 1.0 and TLS 1.1 are now completely obsolete -- you cannot use them. They are mentioned only for the sake of consistency with old API versions. + /// The minimum TLS version for the cluster to support, e.g. '1.2'. /// Encryption-at-rest configuration for the cluster. /// DNS name of the cluster endpoint. /// Current provisioning status of the cluster. - /// Explains the current redundancy strategy of the cluster, which affects the expected SLA. /// Current resource status of the cluster. /// Version of redis the cluster supports, e.g. '6'. - /// List of private endpoint connections associated with the specified Redis Enterprise cluster. + /// List of private endpoint connections associated with the specified RedisEnterprise cluster. /// Keeps track of any properties unknown to the library. - internal RedisEnterpriseClusterPatch(RedisEnterpriseSku sku, ManagedServiceIdentity identity, IDictionary tags, RedisEnterpriseHighAvailability? highAvailability, RedisEnterpriseTlsVersion? minimumTlsVersion, ClusterPropertiesEncryption encryption, string hostName, RedisEnterpriseProvisioningStatus? provisioningState, RedisEnterpriseRedundancyMode? redundancyMode, RedisEnterpriseClusterResourceState? resourceState, string redisVersion, IReadOnlyList privateEndpointConnections, IDictionary serializedAdditionalRawData) + internal RedisEnterpriseClusterPatch(RedisEnterpriseSku sku, ManagedServiceIdentity identity, IDictionary tags, RedisEnterpriseTlsVersion? minimumTlsVersion, ClusterPropertiesEncryption encryption, string hostName, RedisEnterpriseProvisioningStatus? provisioningState, RedisEnterpriseClusterResourceState? resourceState, string redisVersion, IReadOnlyList privateEndpointConnections, IDictionary serializedAdditionalRawData) { Sku = sku; Identity = identity; Tags = tags; - HighAvailability = highAvailability; MinimumTlsVersion = minimumTlsVersion; Encryption = encryption; HostName = hostName; ProvisioningState = provisioningState; - RedundancyMode = redundancyMode; ResourceState = resourceState; RedisVersion = redisVersion; PrivateEndpointConnections = privateEndpointConnections; @@ -93,10 +89,7 @@ internal RedisEnterpriseClusterPatch(RedisEnterpriseSku sku, ManagedServiceIdent /// Resource tags. [WirePath("tags")] public IDictionary Tags { get; } - /// Enabled by default. If highAvailability is disabled, the data set is not replicated. This affects the availability SLA, and increases the risk of data loss. - [WirePath("properties.highAvailability")] - public RedisEnterpriseHighAvailability? HighAvailability { get; set; } - /// The minimum TLS version for the cluster to support, e.g. '1.2'. Newer versions can be added in the future. Note that TLS 1.0 and TLS 1.1 are now completely obsolete -- you cannot use them. They are mentioned only for the sake of consistency with old API versions. + /// The minimum TLS version for the cluster to support, e.g. '1.2'. [WirePath("properties.minimumTlsVersion")] public RedisEnterpriseTlsVersion? MinimumTlsVersion { get; set; } /// Encryption-at-rest configuration for the cluster. @@ -120,16 +113,13 @@ public RedisEnterpriseCustomerManagedKeyEncryption CustomerManagedKeyEncryption /// Current provisioning status of the cluster. [WirePath("properties.provisioningState")] public RedisEnterpriseProvisioningStatus? ProvisioningState { get; } - /// Explains the current redundancy strategy of the cluster, which affects the expected SLA. - [WirePath("properties.redundancyMode")] - public RedisEnterpriseRedundancyMode? RedundancyMode { get; } /// Current resource status of the cluster. [WirePath("properties.resourceState")] public RedisEnterpriseClusterResourceState? ResourceState { get; } /// Version of redis the cluster supports, e.g. '6'. [WirePath("properties.redisVersion")] public string RedisVersion { get; } - /// List of private endpoint connections associated with the specified Redis Enterprise cluster. + /// List of private endpoint connections associated with the specified RedisEnterprise cluster. [WirePath("properties.privateEndpointConnections")] public IReadOnlyList PrivateEndpointConnections { get; } } diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseClusteringPolicy.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseClusteringPolicy.cs index 744e243fdb81..28d99fba6951 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseClusteringPolicy.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseClusteringPolicy.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.RedisEnterprise.Models { - /// Clustering policy - default is OSSCluster. This property must be chosen at create time, and cannot be changed without deleting the database. + /// Clustering policy - default is OSSCluster. Specified at create time. public readonly partial struct RedisEnterpriseClusteringPolicy : IEquatable { private readonly string _value; @@ -25,9 +25,9 @@ public RedisEnterpriseClusteringPolicy(string value) private const string EnterpriseClusterValue = "EnterpriseCluster"; private const string OssClusterValue = "OSSCluster"; - /// Enterprise clustering policy uses only the classic redis protocol, which does not support redis cluster commands. + /// EnterpriseCluster. public static RedisEnterpriseClusteringPolicy EnterpriseCluster { get; } = new RedisEnterpriseClusteringPolicy(EnterpriseClusterValue); - /// OSS clustering policy follows the redis cluster specification, and requires all clients to support redis clustering. + /// OSSCluster. public static RedisEnterpriseClusteringPolicy OssCluster { get; } = new RedisEnterpriseClusteringPolicy(OssClusterValue); /// Determines if two values are the same. public static bool operator ==(RedisEnterpriseClusteringPolicy left, RedisEnterpriseClusteringPolicy right) => left.Equals(right); diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseDatabasePatch.Serialization.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseDatabasePatch.Serialization.cs index bd813434214b..a3e63d1358ff 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseDatabasePatch.Serialization.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseDatabasePatch.Serialization.cs @@ -86,21 +86,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("geoReplication"u8); writer.WriteObjectValue(GeoReplication, options); } - if (options.Format != "W" && Optional.IsDefined(RedisVersion)) - { - writer.WritePropertyName("redisVersion"u8); - writer.WriteStringValue(RedisVersion); - } - if (Optional.IsDefined(DeferUpgrade)) - { - writer.WritePropertyName("deferUpgrade"u8); - writer.WriteStringValue(DeferUpgrade.Value.ToString()); - } - if (Optional.IsDefined(AccessKeysAuthentication)) - { - writer.WritePropertyName("accessKeysAuthentication"u8); - writer.WriteStringValue(AccessKeysAuthentication.Value.ToString()); - } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -148,9 +133,6 @@ internal static RedisEnterpriseDatabasePatch DeserializeRedisEnterpriseDatabaseP RedisPersistenceSettings persistence = default; IList modules = default; RedisEnterpriseDatabaseGeoReplication geoReplication = default; - string redisVersion = default; - DeferUpgradeSetting? deferUpgrade = default; - AccessKeysAuthentication? accessKeysAuthentication = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -250,29 +232,6 @@ internal static RedisEnterpriseDatabasePatch DeserializeRedisEnterpriseDatabaseP geoReplication = RedisEnterpriseDatabaseGeoReplication.DeserializeRedisEnterpriseDatabaseGeoReplication(property0.Value, options); continue; } - if (property0.NameEquals("redisVersion"u8)) - { - redisVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("deferUpgrade"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - deferUpgrade = new DeferUpgradeSetting(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("accessKeysAuthentication"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - accessKeysAuthentication = new AccessKeysAuthentication(property0.Value.GetString()); - continue; - } } continue; } @@ -292,9 +251,6 @@ internal static RedisEnterpriseDatabasePatch DeserializeRedisEnterpriseDatabaseP persistence, modules ?? new ChangeTrackingList(), geoReplication, - redisVersion, - deferUpgrade, - accessKeysAuthentication, serializedAdditionalRawData); } diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseDatabasePatch.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseDatabasePatch.cs index de783d270bcd..341f7a3831db 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseDatabasePatch.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseDatabasePatch.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.RedisEnterprise.Models { - /// A partial update to the Redis Enterprise database. + /// A partial update to the RedisEnterprise database. public partial class RedisEnterpriseDatabasePatch { /// @@ -56,16 +56,13 @@ public RedisEnterpriseDatabasePatch() /// TCP port of the database endpoint. Specified at create time. Defaults to an available port. /// Current provisioning status of the database. /// Current resource status of the database. - /// Clustering policy - default is OSSCluster. This property must be chosen at create time, and cannot be changed without deleting the database. + /// Clustering policy - default is OSSCluster. Specified at create time. /// Redis eviction policy - default is VolatileLRU. /// Persistence settings. /// Optional set of redis modules to enable in this database - modules can only be added at creation time. /// Optional set of properties to configure geo replication for this database. - /// Version of Redis the database is running on, e.g. '6.0'. - /// Option to defer upgrade when newest version is released - default is NotDeferred. Learn more: https://aka.ms/redisversionupgrade. - /// This property can be Enabled/Disabled to allow or deny access with the current access keys. Can be updated even after database is created. /// Keeps track of any properties unknown to the library. - internal RedisEnterpriseDatabasePatch(RedisEnterpriseClientProtocol? clientProtocol, int? port, RedisEnterpriseProvisioningStatus? provisioningState, RedisEnterpriseClusterResourceState? resourceState, RedisEnterpriseClusteringPolicy? clusteringPolicy, RedisEnterpriseEvictionPolicy? evictionPolicy, RedisPersistenceSettings persistence, IList modules, RedisEnterpriseDatabaseGeoReplication geoReplication, string redisVersion, DeferUpgradeSetting? deferUpgrade, AccessKeysAuthentication? accessKeysAuthentication, IDictionary serializedAdditionalRawData) + internal RedisEnterpriseDatabasePatch(RedisEnterpriseClientProtocol? clientProtocol, int? port, RedisEnterpriseProvisioningStatus? provisioningState, RedisEnterpriseClusterResourceState? resourceState, RedisEnterpriseClusteringPolicy? clusteringPolicy, RedisEnterpriseEvictionPolicy? evictionPolicy, RedisPersistenceSettings persistence, IList modules, RedisEnterpriseDatabaseGeoReplication geoReplication, IDictionary serializedAdditionalRawData) { ClientProtocol = clientProtocol; Port = port; @@ -76,9 +73,6 @@ internal RedisEnterpriseDatabasePatch(RedisEnterpriseClientProtocol? clientProto Persistence = persistence; Modules = modules; GeoReplication = geoReplication; - RedisVersion = redisVersion; - DeferUpgrade = deferUpgrade; - AccessKeysAuthentication = accessKeysAuthentication; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -94,7 +88,7 @@ internal RedisEnterpriseDatabasePatch(RedisEnterpriseClientProtocol? clientProto /// Current resource status of the database. [WirePath("properties.resourceState")] public RedisEnterpriseClusterResourceState? ResourceState { get; } - /// Clustering policy - default is OSSCluster. This property must be chosen at create time, and cannot be changed without deleting the database. + /// Clustering policy - default is OSSCluster. Specified at create time. [WirePath("properties.clusteringPolicy")] public RedisEnterpriseClusteringPolicy? ClusteringPolicy { get; set; } /// Redis eviction policy - default is VolatileLRU. @@ -109,14 +103,5 @@ internal RedisEnterpriseDatabasePatch(RedisEnterpriseClientProtocol? clientProto /// Optional set of properties to configure geo replication for this database. [WirePath("properties.geoReplication")] public RedisEnterpriseDatabaseGeoReplication GeoReplication { get; set; } - /// Version of Redis the database is running on, e.g. '6.0'. - [WirePath("properties.redisVersion")] - public string RedisVersion { get; } - /// Option to defer upgrade when newest version is released - default is NotDeferred. Learn more: https://aka.ms/redisversionupgrade. - [WirePath("properties.deferUpgrade")] - public DeferUpgradeSetting? DeferUpgrade { get; set; } - /// This property can be Enabled/Disabled to allow or deny access with the current access keys. Can be updated even after database is created. - [WirePath("properties.accessKeysAuthentication")] - public AccessKeysAuthentication? AccessKeysAuthentication { get; set; } } } diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseHighAvailability.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseHighAvailability.cs deleted file mode 100644 index b151479108c1..000000000000 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseHighAvailability.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.RedisEnterprise.Models -{ - /// Enabled by default. If highAvailability is disabled, the data set is not replicated. This affects the availability SLA, and increases the risk of data loss. - public readonly partial struct RedisEnterpriseHighAvailability : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public RedisEnterpriseHighAvailability(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string EnabledValue = "Enabled"; - private const string DisabledValue = "Disabled"; - - /// Enabled. - public static RedisEnterpriseHighAvailability Enabled { get; } = new RedisEnterpriseHighAvailability(EnabledValue); - /// Disabled. - public static RedisEnterpriseHighAvailability Disabled { get; } = new RedisEnterpriseHighAvailability(DisabledValue); - /// Determines if two values are the same. - public static bool operator ==(RedisEnterpriseHighAvailability left, RedisEnterpriseHighAvailability right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(RedisEnterpriseHighAvailability left, RedisEnterpriseHighAvailability right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator RedisEnterpriseHighAvailability(string value) => new RedisEnterpriseHighAvailability(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is RedisEnterpriseHighAvailability other && Equals(other); - /// - public bool Equals(RedisEnterpriseHighAvailability 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/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseRedundancyMode.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseRedundancyMode.cs deleted file mode 100644 index 6083927226e3..000000000000 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseRedundancyMode.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.RedisEnterprise.Models -{ - /// Explains the current redundancy strategy of the cluster, which affects the expected SLA. - public readonly partial struct RedisEnterpriseRedundancyMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public RedisEnterpriseRedundancyMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NoneValue = "None"; - private const string LRValue = "LR"; - private const string ZRValue = "ZR"; - - /// No redundancy. Availability loss will occur. - public static RedisEnterpriseRedundancyMode None { get; } = new RedisEnterpriseRedundancyMode(NoneValue); - /// Local redundancy with high availability. - public static RedisEnterpriseRedundancyMode LR { get; } = new RedisEnterpriseRedundancyMode(LRValue); - /// Zone redundant. Higher availability. - public static RedisEnterpriseRedundancyMode ZR { get; } = new RedisEnterpriseRedundancyMode(ZRValue); - /// Determines if two values are the same. - public static bool operator ==(RedisEnterpriseRedundancyMode left, RedisEnterpriseRedundancyMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(RedisEnterpriseRedundancyMode left, RedisEnterpriseRedundancyMode right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator RedisEnterpriseRedundancyMode(string value) => new RedisEnterpriseRedundancyMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is RedisEnterpriseRedundancyMode other && Equals(other); - /// - public bool Equals(RedisEnterpriseRedundancyMode 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/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseSku.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseSku.cs index 89fd4f424332..818ec8f6d6d7 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseSku.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseSku.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.RedisEnterprise.Models { - /// SKU parameters supplied to the create Redis Enterprise cluster operation. + /// SKU parameters supplied to the create RedisEnterprise operation. public partial class RedisEnterpriseSku { /// @@ -46,15 +46,15 @@ public partial class RedisEnterpriseSku private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The level of Redis Enterprise cluster to deploy. Possible values: ('Balanced_B5', 'MemoryOptimized_M10', 'ComputeOptimized_X5', etc.). For more information on SKUs see the latest pricing documentation. Note that additional SKUs may become supported in the future. + /// The type of RedisEnterprise cluster to deploy. Possible values: (Enterprise_E10, EnterpriseFlash_F300 etc.). public RedisEnterpriseSku(RedisEnterpriseSkuName name) { Name = name; } /// Initializes a new instance of . - /// The level of Redis Enterprise cluster to deploy. Possible values: ('Balanced_B5', 'MemoryOptimized_M10', 'ComputeOptimized_X5', etc.). For more information on SKUs see the latest pricing documentation. Note that additional SKUs may become supported in the future. - /// This property is only used with Enterprise and EnterpriseFlash SKUs. Determines the size of the cluster. Valid values are (2, 4, 6, ...) for Enterprise SKUs and (3, 9, 15, ...) for EnterpriseFlash SKUs. + /// The type of RedisEnterprise cluster to deploy. Possible values: (Enterprise_E10, EnterpriseFlash_F300 etc.). + /// The size of the RedisEnterprise cluster. Defaults to 2 or 3 depending on SKU. Valid values are (2, 4, 6, ...) for Enterprise SKUs and (3, 9, 15, ...) for Flash SKUs. /// Keeps track of any properties unknown to the library. internal RedisEnterpriseSku(RedisEnterpriseSkuName name, int? capacity, IDictionary serializedAdditionalRawData) { @@ -68,10 +68,10 @@ internal RedisEnterpriseSku() { } - /// The level of Redis Enterprise cluster to deploy. Possible values: ('Balanced_B5', 'MemoryOptimized_M10', 'ComputeOptimized_X5', etc.). For more information on SKUs see the latest pricing documentation. Note that additional SKUs may become supported in the future. + /// The type of RedisEnterprise cluster to deploy. Possible values: (Enterprise_E10, EnterpriseFlash_F300 etc.). [WirePath("name")] public RedisEnterpriseSkuName Name { get; set; } - /// This property is only used with Enterprise and EnterpriseFlash SKUs. Determines the size of the cluster. Valid values are (2, 4, 6, ...) for Enterprise SKUs and (3, 9, 15, ...) for EnterpriseFlash SKUs. + /// The size of the RedisEnterprise cluster. Defaults to 2 or 3 depending on SKU. Valid values are (2, 4, 6, ...) for Enterprise SKUs and (3, 9, 15, ...) for Flash SKUs. [WirePath("capacity")] public int? Capacity { get; set; } } diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseSkuName.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseSkuName.cs index 5ac7888a8837..6e8b15ed215c 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseSkuName.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseSkuName.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.RedisEnterprise.Models { - /// The level of Redis Enterprise cluster to deploy. Possible values: ('Balanced_B5', 'MemoryOptimized_M10', 'ComputeOptimized_X5', etc.). For more information on SKUs see the latest pricing documentation. Note that additional SKUs may become supported in the future. + /// The type of RedisEnterprise cluster to deploy. Possible values: (Enterprise_E10, EnterpriseFlash_F300 etc.). public readonly partial struct RedisEnterpriseSkuName : IEquatable { private readonly string _value; @@ -33,50 +33,6 @@ public RedisEnterpriseSkuName(string value) private const string EnterpriseFlashF300Value = "EnterpriseFlash_F300"; private const string EnterpriseFlashF700Value = "EnterpriseFlash_F700"; private const string EnterpriseFlashF1500Value = "EnterpriseFlash_F1500"; - private const string BalancedB0Value = "Balanced_B0"; - private const string BalancedB1Value = "Balanced_B1"; - private const string BalancedB3Value = "Balanced_B3"; - private const string BalancedB5Value = "Balanced_B5"; - private const string BalancedB10Value = "Balanced_B10"; - private const string BalancedB20Value = "Balanced_B20"; - private const string BalancedB50Value = "Balanced_B50"; - private const string BalancedB100Value = "Balanced_B100"; - private const string BalancedB150Value = "Balanced_B150"; - private const string BalancedB250Value = "Balanced_B250"; - private const string BalancedB350Value = "Balanced_B350"; - private const string BalancedB500Value = "Balanced_B500"; - private const string BalancedB700Value = "Balanced_B700"; - private const string BalancedB1000Value = "Balanced_B1000"; - private const string MemoryOptimizedM10Value = "MemoryOptimized_M10"; - private const string MemoryOptimizedM20Value = "MemoryOptimized_M20"; - private const string MemoryOptimizedM50Value = "MemoryOptimized_M50"; - private const string MemoryOptimizedM100Value = "MemoryOptimized_M100"; - private const string MemoryOptimizedM150Value = "MemoryOptimized_M150"; - private const string MemoryOptimizedM250Value = "MemoryOptimized_M250"; - private const string MemoryOptimizedM350Value = "MemoryOptimized_M350"; - private const string MemoryOptimizedM500Value = "MemoryOptimized_M500"; - private const string MemoryOptimizedM700Value = "MemoryOptimized_M700"; - private const string MemoryOptimizedM1000Value = "MemoryOptimized_M1000"; - private const string MemoryOptimizedM1500Value = "MemoryOptimized_M1500"; - private const string MemoryOptimizedM2000Value = "MemoryOptimized_M2000"; - private const string ComputeOptimizedX3Value = "ComputeOptimized_X3"; - private const string ComputeOptimizedX5Value = "ComputeOptimized_X5"; - private const string ComputeOptimizedX10Value = "ComputeOptimized_X10"; - private const string ComputeOptimizedX20Value = "ComputeOptimized_X20"; - private const string ComputeOptimizedX50Value = "ComputeOptimized_X50"; - private const string ComputeOptimizedX100Value = "ComputeOptimized_X100"; - private const string ComputeOptimizedX150Value = "ComputeOptimized_X150"; - private const string ComputeOptimizedX250Value = "ComputeOptimized_X250"; - private const string ComputeOptimizedX350Value = "ComputeOptimized_X350"; - private const string ComputeOptimizedX500Value = "ComputeOptimized_X500"; - private const string ComputeOptimizedX700Value = "ComputeOptimized_X700"; - private const string FlashOptimizedA250Value = "FlashOptimized_A250"; - private const string FlashOptimizedA500Value = "FlashOptimized_A500"; - private const string FlashOptimizedA700Value = "FlashOptimized_A700"; - private const string FlashOptimizedA1000Value = "FlashOptimized_A1000"; - private const string FlashOptimizedA1500Value = "FlashOptimized_A1500"; - private const string FlashOptimizedA2000Value = "FlashOptimized_A2000"; - private const string FlashOptimizedA4500Value = "FlashOptimized_A4500"; /// Enterprise_E1. public static RedisEnterpriseSkuName EnterpriseE1 { get; } = new RedisEnterpriseSkuName(EnterpriseE1Value); @@ -100,94 +56,6 @@ public RedisEnterpriseSkuName(string value) public static RedisEnterpriseSkuName EnterpriseFlashF700 { get; } = new RedisEnterpriseSkuName(EnterpriseFlashF700Value); /// EnterpriseFlash_F1500. public static RedisEnterpriseSkuName EnterpriseFlashF1500 { get; } = new RedisEnterpriseSkuName(EnterpriseFlashF1500Value); - /// Balanced_B0. - public static RedisEnterpriseSkuName BalancedB0 { get; } = new RedisEnterpriseSkuName(BalancedB0Value); - /// Balanced_B1. - public static RedisEnterpriseSkuName BalancedB1 { get; } = new RedisEnterpriseSkuName(BalancedB1Value); - /// Balanced_B3. - public static RedisEnterpriseSkuName BalancedB3 { get; } = new RedisEnterpriseSkuName(BalancedB3Value); - /// Balanced_B5. - public static RedisEnterpriseSkuName BalancedB5 { get; } = new RedisEnterpriseSkuName(BalancedB5Value); - /// Balanced_B10. - public static RedisEnterpriseSkuName BalancedB10 { get; } = new RedisEnterpriseSkuName(BalancedB10Value); - /// Balanced_B20. - public static RedisEnterpriseSkuName BalancedB20 { get; } = new RedisEnterpriseSkuName(BalancedB20Value); - /// Balanced_B50. - public static RedisEnterpriseSkuName BalancedB50 { get; } = new RedisEnterpriseSkuName(BalancedB50Value); - /// Balanced_B100. - public static RedisEnterpriseSkuName BalancedB100 { get; } = new RedisEnterpriseSkuName(BalancedB100Value); - /// Balanced_B150. - public static RedisEnterpriseSkuName BalancedB150 { get; } = new RedisEnterpriseSkuName(BalancedB150Value); - /// Balanced_B250. - public static RedisEnterpriseSkuName BalancedB250 { get; } = new RedisEnterpriseSkuName(BalancedB250Value); - /// Balanced_B350. - public static RedisEnterpriseSkuName BalancedB350 { get; } = new RedisEnterpriseSkuName(BalancedB350Value); - /// Balanced_B500. - public static RedisEnterpriseSkuName BalancedB500 { get; } = new RedisEnterpriseSkuName(BalancedB500Value); - /// Balanced_B700. - public static RedisEnterpriseSkuName BalancedB700 { get; } = new RedisEnterpriseSkuName(BalancedB700Value); - /// Balanced_B1000. - public static RedisEnterpriseSkuName BalancedB1000 { get; } = new RedisEnterpriseSkuName(BalancedB1000Value); - /// MemoryOptimized_M10. - public static RedisEnterpriseSkuName MemoryOptimizedM10 { get; } = new RedisEnterpriseSkuName(MemoryOptimizedM10Value); - /// MemoryOptimized_M20. - public static RedisEnterpriseSkuName MemoryOptimizedM20 { get; } = new RedisEnterpriseSkuName(MemoryOptimizedM20Value); - /// MemoryOptimized_M50. - public static RedisEnterpriseSkuName MemoryOptimizedM50 { get; } = new RedisEnterpriseSkuName(MemoryOptimizedM50Value); - /// MemoryOptimized_M100. - public static RedisEnterpriseSkuName MemoryOptimizedM100 { get; } = new RedisEnterpriseSkuName(MemoryOptimizedM100Value); - /// MemoryOptimized_M150. - public static RedisEnterpriseSkuName MemoryOptimizedM150 { get; } = new RedisEnterpriseSkuName(MemoryOptimizedM150Value); - /// MemoryOptimized_M250. - public static RedisEnterpriseSkuName MemoryOptimizedM250 { get; } = new RedisEnterpriseSkuName(MemoryOptimizedM250Value); - /// MemoryOptimized_M350. - public static RedisEnterpriseSkuName MemoryOptimizedM350 { get; } = new RedisEnterpriseSkuName(MemoryOptimizedM350Value); - /// MemoryOptimized_M500. - public static RedisEnterpriseSkuName MemoryOptimizedM500 { get; } = new RedisEnterpriseSkuName(MemoryOptimizedM500Value); - /// MemoryOptimized_M700. - public static RedisEnterpriseSkuName MemoryOptimizedM700 { get; } = new RedisEnterpriseSkuName(MemoryOptimizedM700Value); - /// MemoryOptimized_M1000. - public static RedisEnterpriseSkuName MemoryOptimizedM1000 { get; } = new RedisEnterpriseSkuName(MemoryOptimizedM1000Value); - /// MemoryOptimized_M1500. - public static RedisEnterpriseSkuName MemoryOptimizedM1500 { get; } = new RedisEnterpriseSkuName(MemoryOptimizedM1500Value); - /// MemoryOptimized_M2000. - public static RedisEnterpriseSkuName MemoryOptimizedM2000 { get; } = new RedisEnterpriseSkuName(MemoryOptimizedM2000Value); - /// ComputeOptimized_X3. - public static RedisEnterpriseSkuName ComputeOptimizedX3 { get; } = new RedisEnterpriseSkuName(ComputeOptimizedX3Value); - /// ComputeOptimized_X5. - public static RedisEnterpriseSkuName ComputeOptimizedX5 { get; } = new RedisEnterpriseSkuName(ComputeOptimizedX5Value); - /// ComputeOptimized_X10. - public static RedisEnterpriseSkuName ComputeOptimizedX10 { get; } = new RedisEnterpriseSkuName(ComputeOptimizedX10Value); - /// ComputeOptimized_X20. - public static RedisEnterpriseSkuName ComputeOptimizedX20 { get; } = new RedisEnterpriseSkuName(ComputeOptimizedX20Value); - /// ComputeOptimized_X50. - public static RedisEnterpriseSkuName ComputeOptimizedX50 { get; } = new RedisEnterpriseSkuName(ComputeOptimizedX50Value); - /// ComputeOptimized_X100. - public static RedisEnterpriseSkuName ComputeOptimizedX100 { get; } = new RedisEnterpriseSkuName(ComputeOptimizedX100Value); - /// ComputeOptimized_X150. - public static RedisEnterpriseSkuName ComputeOptimizedX150 { get; } = new RedisEnterpriseSkuName(ComputeOptimizedX150Value); - /// ComputeOptimized_X250. - public static RedisEnterpriseSkuName ComputeOptimizedX250 { get; } = new RedisEnterpriseSkuName(ComputeOptimizedX250Value); - /// ComputeOptimized_X350. - public static RedisEnterpriseSkuName ComputeOptimizedX350 { get; } = new RedisEnterpriseSkuName(ComputeOptimizedX350Value); - /// ComputeOptimized_X500. - public static RedisEnterpriseSkuName ComputeOptimizedX500 { get; } = new RedisEnterpriseSkuName(ComputeOptimizedX500Value); - /// ComputeOptimized_X700. - public static RedisEnterpriseSkuName ComputeOptimizedX700 { get; } = new RedisEnterpriseSkuName(ComputeOptimizedX700Value); - /// FlashOptimized_A250. - public static RedisEnterpriseSkuName FlashOptimizedA250 { get; } = new RedisEnterpriseSkuName(FlashOptimizedA250Value); - /// FlashOptimized_A500. - public static RedisEnterpriseSkuName FlashOptimizedA500 { get; } = new RedisEnterpriseSkuName(FlashOptimizedA500Value); - /// FlashOptimized_A700. - public static RedisEnterpriseSkuName FlashOptimizedA700 { get; } = new RedisEnterpriseSkuName(FlashOptimizedA700Value); - /// FlashOptimized_A1000. - public static RedisEnterpriseSkuName FlashOptimizedA1000 { get; } = new RedisEnterpriseSkuName(FlashOptimizedA1000Value); - /// FlashOptimized_A1500. - public static RedisEnterpriseSkuName FlashOptimizedA1500 { get; } = new RedisEnterpriseSkuName(FlashOptimizedA1500Value); - /// FlashOptimized_A2000. - public static RedisEnterpriseSkuName FlashOptimizedA2000 { get; } = new RedisEnterpriseSkuName(FlashOptimizedA2000Value); - /// FlashOptimized_A4500. - public static RedisEnterpriseSkuName FlashOptimizedA4500 { get; } = new RedisEnterpriseSkuName(FlashOptimizedA4500Value); /// Determines if two values are the same. public static bool operator ==(RedisEnterpriseSkuName left, RedisEnterpriseSkuName right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseTlsVersion.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseTlsVersion.cs index 05335d16e2f4..0ca4792dc1d5 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseTlsVersion.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisEnterpriseTlsVersion.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.RedisEnterprise.Models { - /// The minimum TLS version for the cluster to support, e.g. '1.2'. Newer versions can be added in the future. Note that TLS 1.0 and TLS 1.1 are now completely obsolete -- you cannot use them. They are mentioned only for the sake of consistency with old API versions. + /// The minimum TLS version for the cluster to support, e.g. '1.2'. public readonly partial struct RedisEnterpriseTlsVersion : IEquatable { private readonly string _value; diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisPersistenceSettings.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisPersistenceSettings.cs index db298bad5c44..66088b5388e7 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisPersistenceSettings.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Models/RedisPersistenceSettings.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.RedisEnterprise.Models { - /// Persistence-related configuration for the Redis Enterprise database. + /// Persistence-related configuration for the RedisEnterprise database. public partial class RedisPersistenceSettings { /// @@ -51,9 +51,9 @@ public RedisPersistenceSettings() } /// Initializes a new instance of . - /// Sets whether AOF is enabled. Note that at most one of AOF or RDB persistence may be enabled. - /// Sets whether RDB is enabled. Note that at most one of AOF or RDB persistence may be enabled. - /// Sets the frequency at which data is written to disk. Defaults to '1s', meaning 'every second'. Note that the 'always' setting is deprecated, because of its performance impact. + /// Sets whether AOF is enabled. + /// Sets whether RDB is enabled. + /// Sets the frequency at which data is written to disk. /// Sets the frequency at which a snapshot of the database is created. /// Keeps track of any properties unknown to the library. internal RedisPersistenceSettings(bool? isAofEnabled, bool? isRdbEnabled, PersistenceSettingAofFrequency? aofFrequency, PersistenceSettingRdbFrequency? rdbFrequency, IDictionary serializedAdditionalRawData) @@ -65,13 +65,13 @@ internal RedisPersistenceSettings(bool? isAofEnabled, bool? isRdbEnabled, Persis _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Sets whether AOF is enabled. Note that at most one of AOF or RDB persistence may be enabled. + /// Sets whether AOF is enabled. [WirePath("aofEnabled")] public bool? IsAofEnabled { get; set; } - /// Sets whether RDB is enabled. Note that at most one of AOF or RDB persistence may be enabled. + /// Sets whether RDB is enabled. [WirePath("rdbEnabled")] public bool? IsRdbEnabled { get; set; } - /// Sets the frequency at which data is written to disk. Defaults to '1s', meaning 'every second'. Note that the 'always' setting is deprecated, because of its performance impact. + /// Sets the frequency at which data is written to disk. [WirePath("aofFrequency")] public PersistenceSettingAofFrequency? AofFrequency { get; set; } /// Sets the frequency at which a snapshot of the database is created. diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseClusterCollection.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseClusterCollection.cs index 2dd2610596ba..303e1d6c9246 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseClusterCollection.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseClusterCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -74,8 +74,8 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the Redis Enterprise cluster. - /// Parameters supplied to the Create Redis Enterprise operation. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + /// Parameters supplied to the Create RedisEnterprise operation. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. @@ -114,7 +114,7 @@ public virtual async Task> CreateOr /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -123,8 +123,8 @@ public virtual async Task> CreateOr /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the Redis Enterprise cluster. - /// Parameters supplied to the Create Redis Enterprise operation. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + /// Parameters supplied to the Create RedisEnterprise operation. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. @@ -151,7 +151,7 @@ public virtual ArmOperation CreateOrUpdate(WaitU } /// - /// Gets information about a Redis Enterprise cluster + /// Gets information about a RedisEnterprise cluster /// /// /// Request Path @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitU /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -171,7 +171,7 @@ public virtual ArmOperation CreateOrUpdate(WaitU /// /// /// - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -196,7 +196,7 @@ public virtual async Task> GetAsync(str } /// - /// Gets information about a Redis Enterprise cluster + /// Gets information about a RedisEnterprise cluster /// /// /// Request Path @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(str /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -216,7 +216,7 @@ public virtual async Task> GetAsync(str /// /// /// - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -241,7 +241,7 @@ public virtual Response Get(string clusterName, } /// - /// Lists all Redis Enterprise clusters in a resource group. + /// Lists all RedisEnterprise clusters in a resource group. /// /// /// Request Path @@ -253,7 +253,7 @@ public virtual Response Get(string clusterName, /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -271,7 +271,7 @@ public virtual AsyncPageable GetAllAsync(Cancell } /// - /// Lists all Redis Enterprise clusters in a resource group. + /// Lists all RedisEnterprise clusters in a resource group. /// /// /// Request Path @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -321,7 +321,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string clusterName, Cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -364,7 +364,7 @@ public virtual async Task> ExistsAsync(string clusterName, Cancel /// /// /// - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -399,7 +399,7 @@ public virtual Response Exists(string clusterName, CancellationToken cance /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -407,7 +407,7 @@ public virtual Response Exists(string clusterName, CancellationToken cance /// /// /// - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -444,7 +444,7 @@ public virtual async Task> GetI /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -452,7 +452,7 @@ public virtual async Task> GetI /// /// /// - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseClusterData.Serialization.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseClusterData.Serialization.cs index 051541890733..c92ed4bd2c21 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseClusterData.Serialization.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseClusterData.Serialization.cs @@ -58,11 +58,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); - if (Optional.IsDefined(HighAvailability)) - { - writer.WritePropertyName("highAvailability"u8); - writer.WriteStringValue(HighAvailability.Value.ToString()); - } if (Optional.IsDefined(MinimumTlsVersion)) { writer.WritePropertyName("minimumTlsVersion"u8); @@ -83,11 +78,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("provisioningState"u8); writer.WriteStringValue(ProvisioningState.Value.ToString()); } - if (options.Format != "W" && Optional.IsDefined(RedundancyMode)) - { - writer.WritePropertyName("redundancyMode"u8); - writer.WriteStringValue(RedundancyMode.Value.ToString()); - } if (options.Format != "W" && Optional.IsDefined(ResourceState)) { writer.WritePropertyName("resourceState"u8); @@ -140,12 +130,10 @@ internal static RedisEnterpriseClusterData DeserializeRedisEnterpriseClusterData string name = default; ResourceType type = default; SystemData systemData = default; - RedisEnterpriseHighAvailability? highAvailability = default; RedisEnterpriseTlsVersion? minimumTlsVersion = default; ClusterPropertiesEncryption encryption = default; string hostName = default; RedisEnterpriseProvisioningStatus? provisioningState = default; - RedisEnterpriseRedundancyMode? redundancyMode = default; RedisEnterpriseClusterResourceState? resourceState = default; string redisVersion = default; IReadOnlyList privateEndpointConnections = default; @@ -233,15 +221,6 @@ internal static RedisEnterpriseClusterData DeserializeRedisEnterpriseClusterData } foreach (var property0 in property.Value.EnumerateObject()) { - if (property0.NameEquals("highAvailability"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - highAvailability = new RedisEnterpriseHighAvailability(property0.Value.GetString()); - continue; - } if (property0.NameEquals("minimumTlsVersion"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -274,15 +253,6 @@ internal static RedisEnterpriseClusterData DeserializeRedisEnterpriseClusterData provisioningState = new RedisEnterpriseProvisioningStatus(property0.Value.GetString()); continue; } - if (property0.NameEquals("redundancyMode"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - redundancyMode = new RedisEnterpriseRedundancyMode(property0.Value.GetString()); - continue; - } if (property0.NameEquals("resourceState"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -330,12 +300,10 @@ internal static RedisEnterpriseClusterData DeserializeRedisEnterpriseClusterData sku, zones ?? new ChangeTrackingList(), identity, - highAvailability, minimumTlsVersion, encryption, hostName, provisioningState, - redundancyMode, resourceState, redisVersion, privateEndpointConnections ?? new ChangeTrackingList(), @@ -523,21 +491,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.Append(" properties:"); builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(HighAvailability), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" highAvailability: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(HighAvailability)) - { - builder.Append(" highAvailability: "); - builder.AppendLine($"'{HighAvailability.Value.ToString()}'"); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MinimumTlsVersion), out propertyOverride); if (hasPropertyOverride) { @@ -611,21 +564,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RedundancyMode), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" redundancyMode: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(RedundancyMode)) - { - builder.Append(" redundancyMode: "); - builder.AppendLine($"'{RedundancyMode.Value.ToString()}'"); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ResourceState), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseClusterData.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseClusterData.cs index ee91c5ec444c..71e0a3f1b2df 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseClusterData.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseClusterData.cs @@ -15,7 +15,7 @@ namespace Azure.ResourceManager.RedisEnterprise { /// /// A class representing the RedisEnterpriseCluster data model. - /// Describes the Redis Enterprise cluster + /// Describes the RedisEnterprise cluster /// public partial class RedisEnterpriseClusterData : TrackedResourceData { @@ -74,27 +74,23 @@ public RedisEnterpriseClusterData(AzureLocation location, RedisEnterpriseSku sku /// The SKU to create, which affects price, performance, and features. /// The Availability Zones where this cluster will be deployed. /// The identity of the resource. - /// Enabled by default. If highAvailability is disabled, the data set is not replicated. This affects the availability SLA, and increases the risk of data loss. - /// The minimum TLS version for the cluster to support, e.g. '1.2'. Newer versions can be added in the future. Note that TLS 1.0 and TLS 1.1 are now completely obsolete -- you cannot use them. They are mentioned only for the sake of consistency with old API versions. + /// The minimum TLS version for the cluster to support, e.g. '1.2'. /// Encryption-at-rest configuration for the cluster. /// DNS name of the cluster endpoint. /// Current provisioning status of the cluster. - /// Explains the current redundancy strategy of the cluster, which affects the expected SLA. /// Current resource status of the cluster. /// Version of redis the cluster supports, e.g. '6'. - /// List of private endpoint connections associated with the specified Redis Enterprise cluster. + /// List of private endpoint connections associated with the specified RedisEnterprise cluster. /// Keeps track of any properties unknown to the library. - internal RedisEnterpriseClusterData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, RedisEnterpriseSku sku, IList zones, ManagedServiceIdentity identity, RedisEnterpriseHighAvailability? highAvailability, RedisEnterpriseTlsVersion? minimumTlsVersion, ClusterPropertiesEncryption encryption, string hostName, RedisEnterpriseProvisioningStatus? provisioningState, RedisEnterpriseRedundancyMode? redundancyMode, RedisEnterpriseClusterResourceState? resourceState, string redisVersion, IReadOnlyList privateEndpointConnections, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal RedisEnterpriseClusterData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, RedisEnterpriseSku sku, IList zones, ManagedServiceIdentity identity, RedisEnterpriseTlsVersion? minimumTlsVersion, ClusterPropertiesEncryption encryption, string hostName, RedisEnterpriseProvisioningStatus? provisioningState, RedisEnterpriseClusterResourceState? resourceState, string redisVersion, IReadOnlyList privateEndpointConnections, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Sku = sku; Zones = zones; Identity = identity; - HighAvailability = highAvailability; MinimumTlsVersion = minimumTlsVersion; Encryption = encryption; HostName = hostName; ProvisioningState = provisioningState; - RedundancyMode = redundancyMode; ResourceState = resourceState; RedisVersion = redisVersion; PrivateEndpointConnections = privateEndpointConnections; @@ -115,10 +111,7 @@ internal RedisEnterpriseClusterData() /// The identity of the resource. [WirePath("identity")] public ManagedServiceIdentity Identity { get; set; } - /// Enabled by default. If highAvailability is disabled, the data set is not replicated. This affects the availability SLA, and increases the risk of data loss. - [WirePath("properties.highAvailability")] - public RedisEnterpriseHighAvailability? HighAvailability { get; set; } - /// The minimum TLS version for the cluster to support, e.g. '1.2'. Newer versions can be added in the future. Note that TLS 1.0 and TLS 1.1 are now completely obsolete -- you cannot use them. They are mentioned only for the sake of consistency with old API versions. + /// The minimum TLS version for the cluster to support, e.g. '1.2'. [WirePath("properties.minimumTlsVersion")] public RedisEnterpriseTlsVersion? MinimumTlsVersion { get; set; } /// Encryption-at-rest configuration for the cluster. @@ -142,16 +135,13 @@ public RedisEnterpriseCustomerManagedKeyEncryption CustomerManagedKeyEncryption /// Current provisioning status of the cluster. [WirePath("properties.provisioningState")] public RedisEnterpriseProvisioningStatus? ProvisioningState { get; } - /// Explains the current redundancy strategy of the cluster, which affects the expected SLA. - [WirePath("properties.redundancyMode")] - public RedisEnterpriseRedundancyMode? RedundancyMode { get; } /// Current resource status of the cluster. [WirePath("properties.resourceState")] public RedisEnterpriseClusterResourceState? ResourceState { get; } /// Version of redis the cluster supports, e.g. '6'. [WirePath("properties.redisVersion")] public string RedisVersion { get; } - /// List of private endpoint connections associated with the specified Redis Enterprise cluster. + /// List of private endpoint connections associated with the specified RedisEnterprise cluster. [WirePath("properties.privateEndpointConnections")] public IReadOnlyList PrivateEndpointConnections { get; } } diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseClusterResource.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseClusterResource.cs index 0e9a8301e3ec..0ec07848d9fc 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseClusterResource.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseClusterResource.cs @@ -103,7 +103,7 @@ public virtual RedisEnterpriseDatabaseCollection GetRedisEnterpriseDatabases() } /// - /// Gets information about a database in a Redis Enterprise cluster. + /// Gets information about a database in a RedisEnterprise cluster. /// /// /// Request Path @@ -115,7 +115,7 @@ public virtual RedisEnterpriseDatabaseCollection GetRedisEnterpriseDatabases() /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -134,7 +134,7 @@ public virtual async Task> GetRedisEnt } /// - /// Gets information about a database in a Redis Enterprise cluster. + /// Gets information about a database in a RedisEnterprise cluster. /// /// /// Request Path @@ -146,7 +146,7 @@ public virtual async Task> GetRedisEnt /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -172,7 +172,7 @@ public virtual RedisEnterprisePrivateEndpointConnectionCollection GetRedisEnterp } /// - /// Gets the specified private endpoint connection associated with the Redis Enterprise cluster. + /// Gets the specified private endpoint connection associated with the RedisEnterprise cluster. /// /// /// Request Path @@ -184,7 +184,7 @@ public virtual RedisEnterprisePrivateEndpointConnectionCollection GetRedisEnterp /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -203,7 +203,7 @@ public virtual async Task - /// Gets the specified private endpoint connection associated with the Redis Enterprise cluster. + /// Gets the specified private endpoint connection associated with the RedisEnterprise cluster. /// /// /// Request Path @@ -215,7 +215,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -234,7 +234,7 @@ public virtual Response GetRed } /// - /// Gets information about a Redis Enterprise cluster + /// Gets information about a RedisEnterprise cluster /// /// /// Request Path @@ -246,7 +246,7 @@ public virtual Response GetRed /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -274,7 +274,7 @@ public virtual async Task> GetAsync(Can } /// - /// Gets information about a Redis Enterprise cluster + /// Gets information about a RedisEnterprise cluster /// /// /// Request Path @@ -286,7 +286,7 @@ public virtual async Task> GetAsync(Can /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual Response Get(CancellationToken ca } /// - /// Deletes a Redis Enterprise cache cluster. + /// Deletes a RedisEnterprise cache cluster. /// /// /// Request Path @@ -326,7 +326,7 @@ public virtual Response Get(CancellationToken ca /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell } /// - /// Deletes a Redis Enterprise cache cluster. + /// Deletes a RedisEnterprise cache cluster. /// /// /// Request Path @@ -368,7 +368,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// Updates an existing Redis Enterprise cluster + /// Updates an existing RedisEnterprise cluster /// /// /// Request Path @@ -410,7 +410,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -419,7 +419,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Parameters supplied to the Update Redis Enterprise operation. + /// Parameters supplied to the Update RedisEnterprise operation. /// The cancellation token to use. /// is null. public virtual async Task> UpdateAsync(WaitUntil waitUntil, RedisEnterpriseClusterPatch patch, CancellationToken cancellationToken = default) @@ -444,7 +444,7 @@ public virtual async Task> UpdateAs } /// - /// Updates an existing Redis Enterprise cluster + /// Updates an existing RedisEnterprise cluster /// /// /// Request Path @@ -456,7 +456,7 @@ public virtual async Task> UpdateAs /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -465,7 +465,7 @@ public virtual async Task> UpdateAs /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Parameters supplied to the Update Redis Enterprise operation. + /// Parameters supplied to the Update RedisEnterprise operation. /// The cancellation token to use. /// is null. public virtual ArmOperation Update(WaitUntil waitUntil, RedisEnterpriseClusterPatch patch, CancellationToken cancellationToken = default) @@ -490,7 +490,7 @@ public virtual ArmOperation Update(WaitUntil wai } /// - /// Gets the private link resources that need to be created for a Redis Enterprise cluster. + /// Gets the private link resources that need to be created for a RedisEnterprise cluster. /// /// /// Request Path @@ -502,7 +502,7 @@ public virtual ArmOperation Update(WaitUntil wai /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// @@ -515,7 +515,7 @@ public virtual AsyncPageable GetPrivateLinkR } /// - /// Gets the private link resources that need to be created for a Redis Enterprise cluster. + /// Gets the private link resources that need to be created for a RedisEnterprise cluster. /// /// /// Request Path @@ -527,7 +527,7 @@ public virtual AsyncPageable GetPrivateLinkR /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// @@ -552,7 +552,7 @@ public virtual Pageable GetPrivateLinkResour /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -614,7 +614,7 @@ public virtual async Task> AddTagAsync( /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -676,7 +676,7 @@ public virtual Response AddTag(string key, strin /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -733,7 +733,7 @@ public virtual async Task> SetTagsAsync /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -790,7 +790,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -850,7 +850,7 @@ public virtual async Task> RemoveTagAsy /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseDatabaseCollection.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseDatabaseCollection.cs index 47c5fb7ce31d..3184f47b9449 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseDatabaseCollection.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseDatabaseCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> CreateO /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -150,7 +150,7 @@ public virtual ArmOperation CreateOrUpdate(Wait } /// - /// Gets information about a database in a Redis Enterprise cluster. + /// Gets information about a database in a RedisEnterprise cluster. /// /// /// Request Path @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(Wait /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -195,7 +195,7 @@ public virtual async Task> GetAsync(st } /// - /// Gets information about a database in a Redis Enterprise cluster. + /// Gets information about a database in a RedisEnterprise cluster. /// /// /// Request Path @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(st /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -240,7 +240,7 @@ public virtual Response Get(string databaseName } /// - /// Gets all databases in the specified Redis Enterprise cluster. + /// Gets all databases in the specified RedisEnterprise cluster. /// /// /// Request Path @@ -252,7 +252,7 @@ public virtual Response Get(string databaseName /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -270,7 +270,7 @@ public virtual AsyncPageable GetAllAsync(Cancel } /// - /// Gets all databases in the specified Redis Enterprise cluster. + /// Gets all databases in the specified RedisEnterprise cluster. /// /// /// Request Path @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(CancellationToke /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string databaseName, Cance /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string databaseName, CancellationToken canc /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseDatabaseData.Serialization.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseDatabaseData.Serialization.cs index 93dcc6e6e292..5dff5794fcd2 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseDatabaseData.Serialization.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseDatabaseData.Serialization.cs @@ -91,21 +91,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("geoReplication"u8); writer.WriteObjectValue(GeoReplication, options); } - if (options.Format != "W" && Optional.IsDefined(RedisVersion)) - { - writer.WritePropertyName("redisVersion"u8); - writer.WriteStringValue(RedisVersion); - } - if (Optional.IsDefined(DeferUpgrade)) - { - writer.WritePropertyName("deferUpgrade"u8); - writer.WriteStringValue(DeferUpgrade.Value.ToString()); - } - if (Optional.IsDefined(AccessKeysAuthentication)) - { - writer.WritePropertyName("accessKeysAuthentication"u8); - writer.WriteStringValue(AccessKeysAuthentication.Value.ToString()); - } writer.WriteEndObject(); } @@ -142,9 +127,6 @@ internal static RedisEnterpriseDatabaseData DeserializeRedisEnterpriseDatabaseDa RedisPersistenceSettings persistence = default; IList modules = default; RedisEnterpriseDatabaseGeoReplication geoReplication = default; - string redisVersion = default; - DeferUpgradeSetting? deferUpgrade = default; - AccessKeysAuthentication? accessKeysAuthentication = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -268,29 +250,6 @@ internal static RedisEnterpriseDatabaseData DeserializeRedisEnterpriseDatabaseDa geoReplication = RedisEnterpriseDatabaseGeoReplication.DeserializeRedisEnterpriseDatabaseGeoReplication(property0.Value, options); continue; } - if (property0.NameEquals("redisVersion"u8)) - { - redisVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("deferUpgrade"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - deferUpgrade = new DeferUpgradeSetting(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("accessKeysAuthentication"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - accessKeysAuthentication = new AccessKeysAuthentication(property0.Value.GetString()); - continue; - } } continue; } @@ -314,9 +273,6 @@ internal static RedisEnterpriseDatabaseData DeserializeRedisEnterpriseDatabaseDa persistence, modules ?? new ChangeTrackingList(), geoReplication, - redisVersion, - deferUpgrade, - accessKeysAuthentication, serializedAdditionalRawData); } @@ -529,59 +485,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RedisVersion), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" redisVersion: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(RedisVersion)) - { - builder.Append(" redisVersion: "); - if (RedisVersion.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{RedisVersion}'''"); - } - else - { - builder.AppendLine($"'{RedisVersion}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DeferUpgrade), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" deferUpgrade: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(DeferUpgrade)) - { - builder.Append(" deferUpgrade: "); - builder.AppendLine($"'{DeferUpgrade.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccessKeysAuthentication), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" accessKeysAuthentication: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(AccessKeysAuthentication)) - { - builder.Append(" accessKeysAuthentication: "); - builder.AppendLine($"'{AccessKeysAuthentication.Value.ToString()}'"); - } - } - builder.AppendLine(" }"); builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseDatabaseData.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseDatabaseData.cs index b19f9eb8690e..5460d7dadaec 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseDatabaseData.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseDatabaseData.cs @@ -15,7 +15,7 @@ namespace Azure.ResourceManager.RedisEnterprise { /// /// A class representing the RedisEnterpriseDatabase data model. - /// Describes a database on the Redis Enterprise cluster + /// Describes a database on the RedisEnterprise cluster /// public partial class RedisEnterpriseDatabaseData : ResourceData { @@ -66,16 +66,13 @@ public RedisEnterpriseDatabaseData() /// TCP port of the database endpoint. Specified at create time. Defaults to an available port. /// Current provisioning status of the database. /// Current resource status of the database. - /// Clustering policy - default is OSSCluster. This property must be chosen at create time, and cannot be changed without deleting the database. + /// Clustering policy - default is OSSCluster. Specified at create time. /// Redis eviction policy - default is VolatileLRU. /// Persistence settings. /// Optional set of redis modules to enable in this database - modules can only be added at creation time. /// Optional set of properties to configure geo replication for this database. - /// Version of Redis the database is running on, e.g. '6.0'. - /// Option to defer upgrade when newest version is released - default is NotDeferred. Learn more: https://aka.ms/redisversionupgrade. - /// This property can be Enabled/Disabled to allow or deny access with the current access keys. Can be updated even after database is created. /// Keeps track of any properties unknown to the library. - internal RedisEnterpriseDatabaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, RedisEnterpriseClientProtocol? clientProtocol, int? port, RedisEnterpriseProvisioningStatus? provisioningState, RedisEnterpriseClusterResourceState? resourceState, RedisEnterpriseClusteringPolicy? clusteringPolicy, RedisEnterpriseEvictionPolicy? evictionPolicy, RedisPersistenceSettings persistence, IList modules, RedisEnterpriseDatabaseGeoReplication geoReplication, string redisVersion, DeferUpgradeSetting? deferUpgrade, AccessKeysAuthentication? accessKeysAuthentication, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal RedisEnterpriseDatabaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, RedisEnterpriseClientProtocol? clientProtocol, int? port, RedisEnterpriseProvisioningStatus? provisioningState, RedisEnterpriseClusterResourceState? resourceState, RedisEnterpriseClusteringPolicy? clusteringPolicy, RedisEnterpriseEvictionPolicy? evictionPolicy, RedisPersistenceSettings persistence, IList modules, RedisEnterpriseDatabaseGeoReplication geoReplication, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { ClientProtocol = clientProtocol; Port = port; @@ -86,9 +83,6 @@ internal RedisEnterpriseDatabaseData(ResourceIdentifier id, string name, Resourc Persistence = persistence; Modules = modules; GeoReplication = geoReplication; - RedisVersion = redisVersion; - DeferUpgrade = deferUpgrade; - AccessKeysAuthentication = accessKeysAuthentication; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -104,7 +98,7 @@ internal RedisEnterpriseDatabaseData(ResourceIdentifier id, string name, Resourc /// Current resource status of the database. [WirePath("properties.resourceState")] public RedisEnterpriseClusterResourceState? ResourceState { get; } - /// Clustering policy - default is OSSCluster. This property must be chosen at create time, and cannot be changed without deleting the database. + /// Clustering policy - default is OSSCluster. Specified at create time. [WirePath("properties.clusteringPolicy")] public RedisEnterpriseClusteringPolicy? ClusteringPolicy { get; set; } /// Redis eviction policy - default is VolatileLRU. @@ -119,14 +113,5 @@ internal RedisEnterpriseDatabaseData(ResourceIdentifier id, string name, Resourc /// Optional set of properties to configure geo replication for this database. [WirePath("properties.geoReplication")] public RedisEnterpriseDatabaseGeoReplication GeoReplication { get; set; } - /// Version of Redis the database is running on, e.g. '6.0'. - [WirePath("properties.redisVersion")] - public string RedisVersion { get; } - /// Option to defer upgrade when newest version is released - default is NotDeferred. Learn more: https://aka.ms/redisversionupgrade. - [WirePath("properties.deferUpgrade")] - public DeferUpgradeSetting? DeferUpgrade { get; set; } - /// This property can be Enabled/Disabled to allow or deny access with the current access keys. Can be updated even after database is created. - [WirePath("properties.accessKeysAuthentication")] - public AccessKeysAuthentication? AccessKeysAuthentication { get; set; } } } diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseDatabaseResource.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseDatabaseResource.cs index af5ade33699c..b1a3da1bd3df 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseDatabaseResource.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseDatabaseResource.cs @@ -89,77 +89,8 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } - /// Gets a collection of AccessPolicyAssignmentResources in the RedisEnterpriseDatabase. - /// An object representing collection of AccessPolicyAssignmentResources and their operations over a AccessPolicyAssignmentResource. - public virtual AccessPolicyAssignmentCollection GetAccessPolicyAssignments() - { - return GetCachedClient(client => new AccessPolicyAssignmentCollection(client, Id)); - } - - /// - /// Gets information about access policy assignment for database. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName} - /// - /// - /// Operation Id - /// AccessPolicyAssignment_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the Redis Enterprise database access policy assignment. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetAccessPolicyAssignmentAsync(string accessPolicyAssignmentName, CancellationToken cancellationToken = default) - { - return await GetAccessPolicyAssignments().GetAsync(accessPolicyAssignmentName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets information about access policy assignment for database. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName} - /// - /// - /// Operation Id - /// AccessPolicyAssignment_Get - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the Redis Enterprise database access policy assignment. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetAccessPolicyAssignment(string accessPolicyAssignmentName, CancellationToken cancellationToken = default) - { - return GetAccessPolicyAssignments().Get(accessPolicyAssignmentName, cancellationToken); - } - /// - /// Gets information about a database in a Redis Enterprise cluster. + /// Gets information about a database in a RedisEnterprise cluster. /// /// /// Request Path @@ -171,7 +102,7 @@ public virtual Response GetAccessPolicyAssignmen /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -199,7 +130,7 @@ public virtual async Task> GetAsync(Ca } /// - /// Gets information about a database in a Redis Enterprise cluster. + /// Gets information about a database in a RedisEnterprise cluster. /// /// /// Request Path @@ -211,7 +142,7 @@ public virtual async Task> GetAsync(Ca /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -251,7 +182,7 @@ public virtual Response Get(CancellationToken c /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -293,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -335,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -381,7 +312,7 @@ public virtual async Task> UpdateA /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -415,7 +346,7 @@ public virtual ArmOperation Update(WaitUntil wa } /// - /// Retrieves the access keys for the Redis Enterprise database. + /// Retrieves the access keys for the RedisEnterprise database. /// /// /// Request Path @@ -427,7 +358,7 @@ public virtual ArmOperation Update(WaitUntil wa /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -453,7 +384,7 @@ public virtual async Task> GetKeysAsync( } /// - /// Retrieves the access keys for the Redis Enterprise database. + /// Retrieves the access keys for the RedisEnterprise database. /// /// /// Request Path @@ -465,7 +396,7 @@ public virtual async Task> GetKeysAsync( /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -491,7 +422,7 @@ public virtual Response GetKeys(CancellationToken } /// - /// Regenerates the Redis Enterprise database's access keys. + /// Regenerates the RedisEnterprise database's access keys. /// /// /// Request Path @@ -503,7 +434,7 @@ public virtual Response GetKeys(CancellationToken /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -537,7 +468,7 @@ public virtual async Task> Regenerat } /// - /// Regenerates the Redis Enterprise database's access keys. + /// Regenerates the RedisEnterprise database's access keys. /// /// /// Request Path @@ -549,7 +480,7 @@ public virtual async Task> Regenerat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -595,7 +526,7 @@ public virtual ArmOperation RegenerateKey(WaitUnt /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -641,7 +572,7 @@ public virtual async Task ImportAsync(WaitUntil waitUntil, ImportR /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -687,7 +618,7 @@ public virtual ArmOperation Import(WaitUntil waitUntil, ImportRedisEnterpriseDat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -733,7 +664,7 @@ public virtual async Task ExportAsync(WaitUntil waitUntil, ExportR /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -779,7 +710,7 @@ public virtual ArmOperation Export(WaitUntil waitUntil, ExportRedisEnterpriseDat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -825,7 +756,7 @@ public virtual async Task ForceUnlinkAsync(WaitUntil waitUntil, Fo /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -871,7 +802,7 @@ public virtual ArmOperation ForceUnlink(WaitUntil waitUntil, ForceUnlinkRedisEnt /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -917,7 +848,7 @@ public virtual async Task ForceLinkToReplicationGroupAsync(WaitUnt /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -963,7 +894,7 @@ public virtual ArmOperation ForceLinkToReplicationGroup(WaitUntil waitUntil, For /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -1009,7 +940,7 @@ public virtual async Task FlushAsync(WaitUntil waitUntil, FlushRed /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -1041,89 +972,5 @@ public virtual ArmOperation Flush(WaitUntil waitUntil, FlushRedisEnterpriseDatab throw; } } - - /// - /// Upgrades the database Redis version to the latest available. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/upgradeDBRedisVersion - /// - /// - /// Operation Id - /// Databases_UpgradeDBRedisVersion - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task UpgradeDBRedisVersionAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _redisEnterpriseDatabaseDatabasesClientDiagnostics.CreateScope("RedisEnterpriseDatabaseResource.UpgradeDBRedisVersion"); - scope.Start(); - try - { - var response = await _redisEnterpriseDatabaseDatabasesRestClient.UpgradeDBRedisVersionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new RedisEnterpriseArmOperation(_redisEnterpriseDatabaseDatabasesClientDiagnostics, Pipeline, _redisEnterpriseDatabaseDatabasesRestClient.CreateUpgradeDBRedisVersionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Upgrades the database Redis version to the latest available. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/upgradeDBRedisVersion - /// - /// - /// Operation Id - /// Databases_UpgradeDBRedisVersion - /// - /// - /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation UpgradeDBRedisVersion(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _redisEnterpriseDatabaseDatabasesClientDiagnostics.CreateScope("RedisEnterpriseDatabaseResource.UpgradeDBRedisVersion"); - scope.Start(); - try - { - var response = _redisEnterpriseDatabaseDatabasesRestClient.UpgradeDBRedisVersion(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new RedisEnterpriseArmOperation(_redisEnterpriseDatabaseDatabasesClientDiagnostics, Pipeline, _redisEnterpriseDatabaseDatabasesRestClient.CreateUpgradeDBRedisVersionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } } } diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterprisePrivateEndpointConnectionCollection.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterprisePrivateEndpointConnectionCollection.cs index 5422b448979f..81fcfdb89441 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterprisePrivateEndpointConnectionCollection.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterprisePrivateEndpointConnectionCollection.cs @@ -52,7 +52,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) } /// - /// Updates the state of the specified private endpoint connection associated with the Redis Enterprise cluster. + /// Updates the state of the specified private endpoint connection associated with the RedisEnterprise cluster. /// /// /// Request Path @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -101,7 +101,7 @@ public virtual async Task - /// Updates the state of the specified private endpoint connection associated with the Redis Enterprise cluster. + /// Updates the state of the specified private endpoint connection associated with the RedisEnterprise cluster. /// /// /// Request Path @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -150,7 +150,7 @@ public virtual ArmOperation Cr } /// - /// Gets the specified private endpoint connection associated with the Redis Enterprise cluster. + /// Gets the specified private endpoint connection associated with the RedisEnterprise cluster. /// /// /// Request Path @@ -162,7 +162,7 @@ public virtual ArmOperation Cr /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -195,7 +195,7 @@ public virtual async Task - /// Gets the specified private endpoint connection associated with the Redis Enterprise cluster. + /// Gets the specified private endpoint connection associated with the RedisEnterprise cluster. /// /// /// Request Path @@ -207,7 +207,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -240,7 +240,7 @@ public virtual Response Get(st } /// - /// Lists all the private endpoint connections associated with the Redis Enterprise cluster. + /// Lists all the private endpoint connections associated with the RedisEnterprise cluster. /// /// /// Request Path @@ -252,7 +252,7 @@ public virtual Response Get(st /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual AsyncPageable G } /// - /// Lists all the private endpoint connections associated with the Redis Enterprise cluster. + /// Lists all the private endpoint connections associated with the RedisEnterprise cluster. /// /// /// Request Path @@ -281,7 +281,7 @@ public virtual AsyncPageable G /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -310,7 +310,7 @@ public virtual Pageable GetAll /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -353,7 +353,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -396,7 +396,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -441,7 +441,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterprisePrivateEndpointConnectionResource.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterprisePrivateEndpointConnectionResource.cs index 725ce1bd6933..64d47dad745d 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterprisePrivateEndpointConnectionResource.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterprisePrivateEndpointConnectionResource.cs @@ -89,7 +89,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) } /// - /// Gets the specified private endpoint connection associated with the Redis Enterprise cluster. + /// Gets the specified private endpoint connection associated with the RedisEnterprise cluster. /// /// /// Request Path @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -129,7 +129,7 @@ public virtual async Task - /// Gets the specified private endpoint connection associated with the Redis Enterprise cluster. + /// Gets the specified private endpoint connection associated with the RedisEnterprise cluster. /// /// /// Request Path @@ -141,7 +141,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -169,7 +169,7 @@ public virtual Response Get(Ca } /// - /// Deletes the specified private endpoint connection associated with the Redis Enterprise cluster. + /// Deletes the specified private endpoint connection associated with the RedisEnterprise cluster. /// /// /// Request Path @@ -181,7 +181,7 @@ public virtual Response Get(Ca /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell } /// - /// Deletes the specified private endpoint connection associated with the Redis Enterprise cluster. + /// Deletes the specified private endpoint connection associated with the RedisEnterprise cluster. /// /// /// Request Path @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// Updates the state of the specified private endpoint connection associated with the Redis Enterprise cluster. + /// Updates the state of the specified private endpoint connection associated with the RedisEnterprise cluster. /// /// /// Request Path @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource @@ -299,7 +299,7 @@ public virtual async Task - /// Updates the state of the specified private endpoint connection associated with the Redis Enterprise cluster. + /// Updates the state of the specified private endpoint connection associated with the RedisEnterprise cluster. /// /// /// Request Path @@ -311,7 +311,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-10-01 /// /// /// Resource diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RestOperations/DatabasesRestOperations.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RestOperations/DatabasesRestOperations.cs index b355e644672b..668fbab2b33b 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RestOperations/DatabasesRestOperations.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RestOperations/DatabasesRestOperations.cs @@ -32,7 +32,7 @@ public DatabasesRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-09-01-preview"; + _apiVersion = apiVersion ?? "2024-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -72,10 +72,10 @@ internal HttpMessage CreateListByClusterRequest(string subscriptionId, string re return message; } - /// Gets all databases in the specified Redis Enterprise cluster. + /// Gets all databases in the specified RedisEnterprise cluster. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -101,10 +101,10 @@ public async Task> ListByClusterAsync(stri } } - /// Gets all databases in the specified Redis Enterprise cluster. + /// Gets all databases in the specified RedisEnterprise cluster. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -175,7 +175,7 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG /// Creates a database. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The name of the Redis Enterprise database. /// Parameters supplied to the create or update database operation. /// The cancellation token to use. @@ -204,7 +204,7 @@ public async Task CreateAsync(string subscriptionId, string resourceGr /// Creates a database. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The name of the Redis Enterprise database. /// Parameters supplied to the create or update database operation. /// The cancellation token to use. @@ -275,7 +275,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG /// Updates a database. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The name of the Redis Enterprise database. /// Parameters supplied to the create or update database operation. /// The cancellation token to use. @@ -304,7 +304,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr /// Updates a database. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The name of the Redis Enterprise database. /// Parameters supplied to the create or update database operation. /// The cancellation token to use. @@ -368,10 +368,10 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou return message; } - /// Gets information about a database in a Redis Enterprise cluster. + /// Gets information about a database in a RedisEnterprise cluster. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The name of the Redis Enterprise database. /// The cancellation token to use. /// , , or is null. @@ -401,10 +401,10 @@ public async Task> GetAsync(string subscri } } - /// Gets information about a database in a Redis Enterprise cluster. + /// Gets information about a database in a RedisEnterprise cluster. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The name of the Redis Enterprise database. /// The cancellation token to use. /// , , or is null. @@ -475,7 +475,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG /// Deletes a single database. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The name of the Redis Enterprise database. /// The cancellation token to use. /// , , or is null. @@ -503,7 +503,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr /// Deletes a single database. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The name of the Redis Enterprise database. /// The cancellation token to use. /// , , or is null. @@ -568,10 +568,10 @@ internal HttpMessage CreateListKeysRequest(string subscriptionId, string resourc return message; } - /// Retrieves the access keys for the Redis Enterprise database. + /// Retrieves the access keys for the RedisEnterprise database. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The name of the Redis Enterprise database. /// The cancellation token to use. /// , , or is null. @@ -599,10 +599,10 @@ public async Task> ListKeysAsync(string } } - /// Retrieves the access keys for the Redis Enterprise database. + /// Retrieves the access keys for the RedisEnterprise database. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The name of the Redis Enterprise database. /// The cancellation token to use. /// , , or is null. @@ -674,10 +674,10 @@ internal HttpMessage CreateRegenerateKeyRequest(string subscriptionId, string re return message; } - /// Regenerates the Redis Enterprise database's access keys. + /// Regenerates the RedisEnterprise database's access keys. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The name of the Redis Enterprise database. /// Specifies which key to regenerate. /// The cancellation token to use. @@ -703,10 +703,10 @@ public async Task RegenerateKeyAsync(string subscriptionId, string res } } - /// Regenerates the Redis Enterprise database's access keys. + /// Regenerates the RedisEnterprise database's access keys. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The name of the Redis Enterprise database. /// Specifies which key to regenerate. /// The cancellation token to use. @@ -779,7 +779,7 @@ internal HttpMessage CreateImportRequest(string subscriptionId, string resourceG /// Imports database files to target database. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The name of the Redis Enterprise database. /// Storage information for importing into the cluster. /// The cancellation token to use. @@ -808,7 +808,7 @@ public async Task ImportAsync(string subscriptionId, string resourceGr /// Imports database files to target database. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The name of the Redis Enterprise database. /// Storage information for importing into the cluster. /// The cancellation token to use. @@ -881,7 +881,7 @@ internal HttpMessage CreateExportRequest(string subscriptionId, string resourceG /// Exports a database file from target database. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The name of the Redis Enterprise database. /// Storage information for exporting into the cluster. /// The cancellation token to use. @@ -910,7 +910,7 @@ public async Task ExportAsync(string subscriptionId, string resourceGr /// Exports a database file from target database. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The name of the Redis Enterprise database. /// Storage information for exporting into the cluster. /// The cancellation token to use. @@ -983,7 +983,7 @@ internal HttpMessage CreateForceUnlinkRequest(string subscriptionId, string reso /// Forcibly removes the link to the specified database resource. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The name of the Redis Enterprise database. /// Information identifying the database to be unlinked. /// The cancellation token to use. @@ -1012,7 +1012,7 @@ public async Task ForceUnlinkAsync(string subscriptionId, string resou /// Forcibly removes the link to the specified database resource. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The name of the Redis Enterprise database. /// Information identifying the database to be unlinked. /// The cancellation token to use. @@ -1085,7 +1085,7 @@ internal HttpMessage CreateForceLinkToReplicationGroupRequest(string subscriptio /// Forcibly recreates an existing database on the specified cluster, and rejoins it to an existing replication group. **IMPORTANT NOTE:** All data in this database will be discarded, and the database will temporarily be unavailable while rejoining the replication group. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The name of the Redis Enterprise database. /// Information identifying the database to be unlinked. /// The cancellation token to use. @@ -1113,7 +1113,7 @@ public async Task ForceLinkToReplicationGroupAsync(string subscription /// Forcibly recreates an existing database on the specified cluster, and rejoins it to an existing replication group. **IMPORTANT NOTE:** All data in this database will be discarded, and the database will temporarily be unavailable while rejoining the replication group. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The name of the Redis Enterprise database. /// Information identifying the database to be unlinked. /// The cancellation token to use. @@ -1185,7 +1185,7 @@ internal HttpMessage CreateFlushRequest(string subscriptionId, string resourceGr /// Flushes all the keys in this database and also from its linked databases. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The name of the Redis Enterprise database. /// Information identifying the databases to be flushed. /// The cancellation token to use. @@ -1214,7 +1214,7 @@ public async Task FlushAsync(string subscriptionId, string resourceGro /// Flushes all the keys in this database and also from its linked databases. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The name of the Redis Enterprise database. /// Information identifying the databases to be flushed. /// The cancellation token to use. @@ -1240,98 +1240,6 @@ public Response Flush(string subscriptionId, string resourceGroupName, string cl } } - internal RequestUriBuilder CreateUpgradeDBRedisVersionRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string databaseName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Cache/redisEnterprise/", false); - uri.AppendPath(clusterName, true); - uri.AppendPath("/databases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/upgradeDBRedisVersion", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateUpgradeDBRedisVersionRequest(string subscriptionId, string resourceGroupName, string clusterName, string databaseName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Cache/redisEnterprise/", false); - uri.AppendPath(clusterName, true); - uri.AppendPath("/databases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/upgradeDBRedisVersion", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Upgrades the database Redis version to the latest available. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. - /// The name of the Redis Enterprise database. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task UpgradeDBRedisVersionAsync(string subscriptionId, string resourceGroupName, string clusterName, string databaseName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - - using var message = CreateUpgradeDBRedisVersionRequest(subscriptionId, resourceGroupName, clusterName, databaseName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Upgrades the database Redis version to the latest available. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. - /// The name of the Redis Enterprise database. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response UpgradeDBRedisVersion(string subscriptionId, string resourceGroupName, string clusterName, string databaseName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - - using var message = CreateUpgradeDBRedisVersionRequest(subscriptionId, resourceGroupName, clusterName, databaseName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateListByClusterNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string clusterName) { var uri = new RawRequestUriBuilder(); @@ -1354,11 +1262,11 @@ internal HttpMessage CreateListByClusterNextPageRequest(string nextLink, string return message; } - /// Gets all databases in the specified Redis Enterprise cluster. + /// Gets all databases in the specified RedisEnterprise cluster. /// The URL to the next page of results. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -1385,11 +1293,11 @@ public async Task> ListByClusterNextPageAs } } - /// Gets all databases in the specified Redis Enterprise cluster. + /// Gets all databases in the specified RedisEnterprise cluster. /// The URL to the next page of results. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RestOperations/OperationsStatusRestOperations.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RestOperations/OperationsStatusRestOperations.cs index c1807c6ef5aa..915c6d104c0a 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RestOperations/OperationsStatusRestOperations.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RestOperations/OperationsStatusRestOperations.cs @@ -32,7 +32,7 @@ public OperationsStatusRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-09-01-preview"; + _apiVersion = apiVersion ?? "2024-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index 493bb73b6e2c..dd222b605a18 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -32,7 +32,7 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-09-01-preview"; + _apiVersion = apiVersion ?? "2024-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -72,10 +72,10 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro return message; } - /// Lists all the private endpoint connections associated with the Redis Enterprise cluster. + /// Lists all the private endpoint connections associated with the RedisEnterprise cluster. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -101,10 +101,10 @@ public async Task> } } - /// Lists all the private endpoint connections associated with the Redis Enterprise cluster. + /// Lists all the private endpoint connections associated with the RedisEnterprise cluster. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -168,10 +168,10 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou return message; } - /// Gets the specified private endpoint connection associated with the Redis Enterprise cluster. + /// Gets the specified private endpoint connection associated with the RedisEnterprise cluster. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. /// , , or is null. @@ -201,10 +201,10 @@ public async Task> GetAsy } } - /// Gets the specified private endpoint connection associated with the Redis Enterprise cluster. + /// Gets the specified private endpoint connection associated with the RedisEnterprise cluster. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. /// , , or is null. @@ -276,10 +276,10 @@ internal HttpMessage CreatePutRequest(string subscriptionId, string resourceGrou return message; } - /// Updates the state of the specified private endpoint connection associated with the Redis Enterprise cluster. + /// Updates the state of the specified private endpoint connection associated with the RedisEnterprise cluster. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The name of the private endpoint connection associated with the Azure resource. /// The private endpoint connection properties. /// The cancellation token to use. @@ -304,10 +304,10 @@ public async Task PutAsync(string subscriptionId, string resourceGroup } } - /// Updates the state of the specified private endpoint connection associated with the Redis Enterprise cluster. + /// Updates the state of the specified private endpoint connection associated with the RedisEnterprise cluster. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The name of the private endpoint connection associated with the Azure resource. /// The private endpoint connection properties. /// The cancellation token to use. @@ -370,10 +370,10 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG return message; } - /// Deletes the specified private endpoint connection associated with the Redis Enterprise cluster. + /// Deletes the specified private endpoint connection associated with the RedisEnterprise cluster. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. /// , , or is null. @@ -398,10 +398,10 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } } - /// Deletes the specified private endpoint connection associated with the Redis Enterprise cluster. + /// Deletes the specified private endpoint connection associated with the RedisEnterprise cluster. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. /// , , or is null. diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs index 2c43088b7f75..d8bedb28853e 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -32,7 +32,7 @@ public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-09-01-preview"; + _apiVersion = apiVersion ?? "2024-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -72,10 +72,10 @@ internal HttpMessage CreateListByClusterRequest(string subscriptionId, string re return message; } - /// Gets the private link resources that need to be created for a Redis Enterprise cluster. + /// Gets the private link resources that need to be created for a RedisEnterprise cluster. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -101,10 +101,10 @@ public async Task> ListBy } } - /// Gets the private link resources that need to be created for a Redis Enterprise cluster. + /// Gets the private link resources that need to be created for a RedisEnterprise cluster. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RestOperations/RedisEnterpriseRestOperations.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RestOperations/RedisEnterpriseRestOperations.cs index 919742449ed3..9832c3624570 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RestOperations/RedisEnterpriseRestOperations.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RestOperations/RedisEnterpriseRestOperations.cs @@ -32,7 +32,7 @@ public RedisEnterpriseRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-09-01-preview"; + _apiVersion = apiVersion ?? "2024-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -77,8 +77,8 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG /// Creates or updates an existing (overwrite/recreate, with potential downtime) cache cluster. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. - /// Parameters supplied to the Create Redis Enterprise operation. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + /// Parameters supplied to the Create RedisEnterprise operation. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -104,8 +104,8 @@ public async Task CreateAsync(string subscriptionId, string resourceGr /// Creates or updates an existing (overwrite/recreate, with potential downtime) cache cluster. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. - /// Parameters supplied to the Create Redis Enterprise operation. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + /// Parameters supplied to the Create RedisEnterprise operation. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -166,11 +166,11 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG return message; } - /// Updates an existing Redis Enterprise cluster. + /// Updates an existing RedisEnterprise cluster. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. - /// Parameters supplied to the Update Redis Enterprise operation. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + /// Parameters supplied to the Update RedisEnterprise operation. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -193,11 +193,11 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } } - /// Updates an existing Redis Enterprise cluster. + /// Updates an existing RedisEnterprise cluster. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. - /// Parameters supplied to the Update Redis Enterprise operation. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. + /// Parameters supplied to the Update RedisEnterprise operation. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -254,10 +254,10 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG return message; } - /// Deletes a Redis Enterprise cache cluster. + /// Deletes a RedisEnterprise cache cluster. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -280,10 +280,10 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } } - /// Deletes a Redis Enterprise cache cluster. + /// Deletes a RedisEnterprise cache cluster. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -340,10 +340,10 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou return message; } - /// Gets information about a Redis Enterprise cluster. + /// Gets information about a RedisEnterprise cluster. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -371,10 +371,10 @@ public async Task> GetAsync(string subscrip } } - /// Gets information about a Redis Enterprise cluster. + /// Gets information about a RedisEnterprise cluster. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Redis Enterprise cluster. + /// The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -434,7 +434,7 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str return message; } - /// Lists all Redis Enterprise clusters in a resource group. + /// Lists all RedisEnterprise clusters in a resource group. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. @@ -461,7 +461,7 @@ public async Task> ListByResourceGroupAsync } } - /// Lists all Redis Enterprise clusters in a resource group. + /// Lists all RedisEnterprise clusters in a resource group. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. @@ -516,7 +516,7 @@ internal HttpMessage CreateListRequest(string subscriptionId) return message; } - /// Lists all Redis Enterprise clusters in the specified subscription. + /// Gets all RedisEnterprise clusters in the specified subscription. /// The ID of the target subscription. /// The cancellation token to use. /// is null. @@ -541,7 +541,7 @@ public async Task> ListAsync(string subscri } } - /// Lists all Redis Enterprise clusters in the specified subscription. + /// Gets all RedisEnterprise clusters in the specified subscription. /// The ID of the target subscription. /// The cancellation token to use. /// is null. @@ -588,7 +588,7 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s return message; } - /// Lists all Redis Enterprise clusters in a resource group. + /// Lists all RedisEnterprise clusters in a resource group. /// The URL to the next page of results. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. @@ -617,7 +617,7 @@ public async Task> ListByResourceGroupNextP } } - /// Lists all Redis Enterprise clusters in a resource group. + /// Lists all RedisEnterprise clusters in a resource group. /// The URL to the next page of results. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. @@ -668,7 +668,7 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript return message; } - /// Lists all Redis Enterprise clusters in the specified subscription. + /// Gets all RedisEnterprise clusters in the specified subscription. /// The URL to the next page of results. /// The ID of the target subscription. /// The cancellation token to use. @@ -695,7 +695,7 @@ public async Task> ListNextPageAsync(string } } - /// Lists all Redis Enterprise clusters in the specified subscription. + /// Gets all RedisEnterprise clusters in the specified subscription. /// The URL to the next page of results. /// The ID of the target subscription. /// The cancellation token to use. diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/autorest.md b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/autorest.md index 9fcc129bfa07..808cfad202b7 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/autorest.md +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: RedisEnterprise namespace: Azure.ResourceManager.RedisEnterprise -require: https://github.com/Azure/azure-rest-api-specs/blob/f5321f9b29083f9ea4c028e7484504875e04a758/specification/redisenterprise/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/redisenterprise/resource-manager/readme.md #tag: package-preview-2024-09 output-folder: $(this-folder)/Generated clear-output-folder: true diff --git a/sdk/redisenterprise/ci.mgmt.yml b/sdk/redisenterprise/ci.mgmt.yml index 93641cfe3983..c03891bf4d43 100644 --- a/sdk/redisenterprise/ci.mgmt.yml +++ b/sdk/redisenterprise/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/redisenterprise/ci.mgmt.yml - sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/redisenterprise/ci.mgmt.yml + - sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/redisenterprise/ci.mgmt.yml + - sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/redisenterprise/ci.mgmt.yml + - sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/redisenterprise/ci.mgmt.yml + - sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/redisenterprise/ci.mgmt.yml + - sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/redisenterprise/ci.mgmt.yml + - sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/redisenterprise/ci.mgmt.yml + - sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/redisenterprise/ci.mgmt.yml + - sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/redisenterprise/ci.mgmt.yml + - sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/relay/ci.mgmt.yml b/sdk/relay/ci.mgmt.yml index b69a1efbd0f9..b20b629d8d71 100644 --- a/sdk/relay/ci.mgmt.yml +++ b/sdk/relay/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/relay/ci.mgmt.yml - sdk/relay/Azure.ResourceManager.Relay/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/relay/ci.mgmt.yml + - sdk/relay/Azure.ResourceManager.Relay/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/relay/ci.mgmt.yml + - sdk/relay/Azure.ResourceManager.Relay/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/relay/ci.mgmt.yml + - sdk/relay/Azure.ResourceManager.Relay/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/relay/ci.mgmt.yml + - sdk/relay/Azure.ResourceManager.Relay/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/relay/ci.mgmt.yml + - sdk/relay/Azure.ResourceManager.Relay/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/relay/ci.mgmt.yml + - sdk/relay/Azure.ResourceManager.Relay/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/relay/ci.mgmt.yml + - sdk/relay/Azure.ResourceManager.Relay/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/relay/ci.mgmt.yml + - sdk/relay/Azure.ResourceManager.Relay/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/relay/ci.mgmt.yml + - sdk/relay/Azure.ResourceManager.Relay/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/reservations/ci.mgmt.yml b/sdk/reservations/ci.mgmt.yml index c46c8c69cd2e..c4d6665c7cb0 100644 --- a/sdk/reservations/ci.mgmt.yml +++ b/sdk/reservations/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/reservations/ci.mgmt.yml - sdk/reservations/Azure.ResourceManager.Reservations/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/reservations/ci.mgmt.yml + - sdk/reservations/Azure.ResourceManager.Reservations/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/reservations/ci.mgmt.yml + - sdk/reservations/Azure.ResourceManager.Reservations/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/reservations/ci.mgmt.yml + - sdk/reservations/Azure.ResourceManager.Reservations/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/reservations/ci.mgmt.yml + - sdk/reservations/Azure.ResourceManager.Reservations/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/reservations/ci.mgmt.yml + - sdk/reservations/Azure.ResourceManager.Reservations/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/reservations/ci.mgmt.yml + - sdk/reservations/Azure.ResourceManager.Reservations/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/reservations/ci.mgmt.yml + - sdk/reservations/Azure.ResourceManager.Reservations/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/reservations/ci.mgmt.yml + - sdk/reservations/Azure.ResourceManager.Reservations/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/reservations/ci.mgmt.yml + - sdk/reservations/Azure.ResourceManager.Reservations/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/resourceconnector/ci.mgmt.yml b/sdk/resourceconnector/ci.mgmt.yml index 81269b9113c7..887c44fff557 100644 --- a/sdk/resourceconnector/ci.mgmt.yml +++ b/sdk/resourceconnector/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/resourceconnector/ci.mgmt.yml - sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourceconnector/ci.mgmt.yml + - sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourceconnector/ci.mgmt.yml + - sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourceconnector/ci.mgmt.yml + - sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourceconnector/ci.mgmt.yml + - sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourceconnector/ci.mgmt.yml + - sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourceconnector/ci.mgmt.yml + - sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourceconnector/ci.mgmt.yml + - sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourceconnector/ci.mgmt.yml + - sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourceconnector/ci.mgmt.yml + - sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/resourcegraph/ci.mgmt.yml b/sdk/resourcegraph/ci.mgmt.yml index 5abe050f7709..5cf8455c34fc 100644 --- a/sdk/resourcegraph/ci.mgmt.yml +++ b/sdk/resourcegraph/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/resourcegraph/ci.mgmt.yml - sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcegraph/ci.mgmt.yml + - sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcegraph/ci.mgmt.yml + - sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcegraph/ci.mgmt.yml + - sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcegraph/ci.mgmt.yml + - sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcegraph/ci.mgmt.yml + - sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcegraph/ci.mgmt.yml + - sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcegraph/ci.mgmt.yml + - sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcegraph/ci.mgmt.yml + - sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcegraph/ci.mgmt.yml + - sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/resourcehealth/ci.mgmt.yml b/sdk/resourcehealth/ci.mgmt.yml index fb0a27171a69..2dfda276f69c 100644 --- a/sdk/resourcehealth/ci.mgmt.yml +++ b/sdk/resourcehealth/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/resourcehealth/ci.mgmt.yml - sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcehealth/ci.mgmt.yml + - sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcehealth/ci.mgmt.yml + - sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcehealth/ci.mgmt.yml + - sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcehealth/ci.mgmt.yml + - sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcehealth/ci.mgmt.yml + - sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcehealth/ci.mgmt.yml + - sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcehealth/ci.mgmt.yml + - sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcehealth/ci.mgmt.yml + - sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcehealth/ci.mgmt.yml + - sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/resourcemanager/ci.mgmt.yml b/sdk/resourcemanager/ci.mgmt.yml index 960151044171..f3411c81d9dc 100644 --- a/sdk/resourcemanager/ci.mgmt.yml +++ b/sdk/resourcemanager/ci.mgmt.yml @@ -107,6 +107,7 @@ trigger: - sdk/iot/Azure.ResourceManager.IotFirmwareDefense - sdk/iotcentral/Azure.ResourceManager.IotCentral - sdk/iothub/Azure.ResourceManager.IotHub + - sdk/iotoperations/Azure.ResourceManager.IoTOperations - sdk/keyvault/Azure.ResourceManager.KeyVault - sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration - sdk/kusto/Azure.ResourceManager.Kusto @@ -312,6 +313,7 @@ pr: - sdk/iot/Azure.ResourceManager.IotFirmwareDefense - sdk/iotcentral/Azure.ResourceManager.IotCentral - sdk/iothub/Azure.ResourceManager.IotHub + - sdk/iotoperations/Azure.ResourceManager.IoTOperations - sdk/keyvault/Azure.ResourceManager.KeyVault - sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration - sdk/kusto/Azure.ResourceManager.Kusto diff --git a/sdk/resourcemover/ci.mgmt.yml b/sdk/resourcemover/ci.mgmt.yml index 519b8a431926..cbefa36a4708 100644 --- a/sdk/resourcemover/ci.mgmt.yml +++ b/sdk/resourcemover/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/resourcemover/ci.mgmt.yml - sdk/resourcemover/Azure.ResourceManager.ResourceMover/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcemover/ci.mgmt.yml + - sdk/resourcemover/Azure.ResourceManager.ResourceMover/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcemover/ci.mgmt.yml + - sdk/resourcemover/Azure.ResourceManager.ResourceMover/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcemover/ci.mgmt.yml + - sdk/resourcemover/Azure.ResourceManager.ResourceMover/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcemover/ci.mgmt.yml + - sdk/resourcemover/Azure.ResourceManager.ResourceMover/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcemover/ci.mgmt.yml + - sdk/resourcemover/Azure.ResourceManager.ResourceMover/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcemover/ci.mgmt.yml + - sdk/resourcemover/Azure.ResourceManager.ResourceMover/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcemover/ci.mgmt.yml + - sdk/resourcemover/Azure.ResourceManager.ResourceMover/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcemover/ci.mgmt.yml + - sdk/resourcemover/Azure.ResourceManager.ResourceMover/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcemover/ci.mgmt.yml + - sdk/resourcemover/Azure.ResourceManager.ResourceMover/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/resources/ci.mgmt.yml b/sdk/resources/ci.mgmt.yml index 3fefd5254c85..4b6ce2e09200 100644 --- a/sdk/resources/ci.mgmt.yml +++ b/sdk/resources/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/resources/ci.mgmt.yml - sdk/resources/Azure.ResourceManager.Resources/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resources/ci.mgmt.yml + - sdk/resources/Azure.ResourceManager.Resources/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resources/ci.mgmt.yml + - sdk/resources/Azure.ResourceManager.Resources/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resources/ci.mgmt.yml + - sdk/resources/Azure.ResourceManager.Resources/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resources/ci.mgmt.yml + - sdk/resources/Azure.ResourceManager.Resources/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resources/ci.mgmt.yml + - sdk/resources/Azure.ResourceManager.Resources/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resources/ci.mgmt.yml + - sdk/resources/Azure.ResourceManager.Resources/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resources/ci.mgmt.yml + - sdk/resources/Azure.ResourceManager.Resources/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resources/ci.mgmt.yml + - sdk/resources/Azure.ResourceManager.Resources/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resources/ci.mgmt.yml + - sdk/resources/Azure.ResourceManager.Resources/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/AIStudioModelCatalogName.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/AIStudioModelCatalogName.cs index 0d246bf5fa6e..2349b09b1aa8 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/AIStudioModelCatalogName.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/AIStudioModelCatalogName.cs @@ -10,7 +10,7 @@ namespace Azure.Search.Documents.Indexes.Models { - /// The name of the embedding model from the Azure AI Studio Catalog that will be called. + /// The name of the embedding model from the Azure AI Foundry Catalog that will be called. public readonly partial struct AIStudioModelCatalogName : IEquatable { private readonly string _value; diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/AzureMachineLearningParameters.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/AzureMachineLearningParameters.cs index 98d1b67d46ae..4f15f4fc0c98 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/AzureMachineLearningParameters.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/AzureMachineLearningParameters.cs @@ -25,7 +25,7 @@ public AzureMachineLearningParameters(Uri scoringUri) /// (Required for token authentication). The Azure Resource Manager resource ID of the AML service. It should be in the format subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.MachineLearningServices/workspaces/{workspace-name}/services/{service_name}. /// (Optional) When specified, indicates the timeout for the http client making the API call. /// (Optional for token authentication). The region the AML service is deployed in. - /// The name of the embedding model from the Azure AI Studio Catalog that is deployed at the provided endpoint. + /// The name of the embedding model from the Azure AI Foundry Catalog that is deployed at the provided endpoint. internal AzureMachineLearningParameters(Uri scoringUri, string authenticationKey, string resourceId, TimeSpan? timeout, string region, AIStudioModelCatalogName? modelName) { ScoringUri = scoringUri; @@ -46,7 +46,7 @@ internal AzureMachineLearningParameters(Uri scoringUri, string authenticationKey public TimeSpan? Timeout { get; set; } /// (Optional for token authentication). The region the AML service is deployed in. public string Region { get; set; } - /// The name of the embedding model from the Azure AI Studio Catalog that is deployed at the provided endpoint. + /// The name of the embedding model from the Azure AI Foundry Catalog that is deployed at the provided endpoint. public AIStudioModelCatalogName? ModelName { get; set; } } } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/AzureMachineLearningVectorizer.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/AzureMachineLearningVectorizer.cs index 7aef8e982c11..a459785ad47d 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/AzureMachineLearningVectorizer.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/AzureMachineLearningVectorizer.cs @@ -9,7 +9,7 @@ namespace Azure.Search.Documents.Indexes.Models { - /// Specifies an Azure Machine Learning endpoint deployed via the Azure AI Studio Model Catalog for generating the vector embedding of a query string. + /// Specifies an Azure Machine Learning endpoint deployed via the Azure AI Foundry Model Catalog for generating the vector embedding of a query string. public partial class AzureMachineLearningVectorizer : VectorSearchVectorizer { /// Initializes a new instance of . diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/DebugInfo.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/DebugInfo.Serialization.cs deleted file mode 100644 index 31c08d33c7e2..000000000000 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/DebugInfo.Serialization.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; - -namespace Azure.Search.Documents.Models -{ - public partial class DebugInfo - { - internal static DebugInfo DeserializeDebugInfo(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - QueryRewritesDebugInfo queryRewrites = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("queryRewrites"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - queryRewrites = QueryRewritesDebugInfo.DeserializeQueryRewritesDebugInfo(property.Value); - continue; - } - } - return new DebugInfo(queryRewrites); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static DebugInfo FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDebugInfo(document.RootElement); - } - } -} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/DebugInfo.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/DebugInfo.cs index b50ff0c0537f..d1d31fc1c682 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/DebugInfo.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/DebugInfo.cs @@ -8,7 +8,7 @@ namespace Azure.Search.Documents.Models { /// Contains debugging information that can be used to further explore your search results. - public partial class DebugInfo + internal partial class DebugInfo { /// Initializes a new instance of . internal DebugInfo() diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesDebugInfo.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesDebugInfo.Serialization.cs deleted file mode 100644 index ff03080d8132..000000000000 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesDebugInfo.Serialization.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.Search.Documents.Models -{ - public partial class QueryRewritesDebugInfo - { - internal static QueryRewritesDebugInfo DeserializeQueryRewritesDebugInfo(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - QueryRewritesValuesDebugInfo text = default; - IReadOnlyList vectors = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("text"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - text = QueryRewritesValuesDebugInfo.DeserializeQueryRewritesValuesDebugInfo(property.Value); - continue; - } - if (property.NameEquals("vectors"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(QueryRewritesValuesDebugInfo.DeserializeQueryRewritesValuesDebugInfo(item)); - } - vectors = array; - continue; - } - } - return new QueryRewritesDebugInfo(text, vectors ?? new ChangeTrackingList()); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static QueryRewritesDebugInfo FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeQueryRewritesDebugInfo(document.RootElement); - } - } -} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesDebugInfo.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesDebugInfo.cs index 29f0f869191e..4e49dafcbcb5 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesDebugInfo.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesDebugInfo.cs @@ -10,7 +10,7 @@ namespace Azure.Search.Documents.Models { /// Contains debugging information specific to query rewrites. - public partial class QueryRewritesDebugInfo + internal partial class QueryRewritesDebugInfo { /// Initializes a new instance of . internal QueryRewritesDebugInfo() diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesValuesDebugInfo.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesValuesDebugInfo.Serialization.cs deleted file mode 100644 index a1d641a36434..000000000000 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesValuesDebugInfo.Serialization.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.Search.Documents.Models -{ - public partial class QueryRewritesValuesDebugInfo - { - internal static QueryRewritesValuesDebugInfo DeserializeQueryRewritesValuesDebugInfo(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string inputQuery = default; - IReadOnlyList rewrites = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("inputQuery"u8)) - { - inputQuery = property.Value.GetString(); - continue; - } - if (property.NameEquals("rewrites"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - rewrites = array; - continue; - } - } - return new QueryRewritesValuesDebugInfo(inputQuery, rewrites ?? new ChangeTrackingList()); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static QueryRewritesValuesDebugInfo FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeQueryRewritesValuesDebugInfo(document.RootElement); - } - } -} diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesValuesDebugInfo.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesValuesDebugInfo.cs index 953d64ae6719..6234f39ac435 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesValuesDebugInfo.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryRewritesValuesDebugInfo.cs @@ -10,7 +10,7 @@ namespace Azure.Search.Documents.Models { /// Contains debugging information specific to query rewrites. - public partial class QueryRewritesValuesDebugInfo + internal partial class QueryRewritesValuesDebugInfo { /// Initializes a new instance of . internal QueryRewritesValuesDebugInfo() diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchDocumentsResult.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchDocumentsResult.Serialization.cs index e2ab7861359d..19c568fe9c5c 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchDocumentsResult.Serialization.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchDocumentsResult.Serialization.cs @@ -28,7 +28,6 @@ internal static SearchDocumentsResult DeserializeSearchDocumentsResult(JsonEleme SemanticErrorReason? searchSemanticPartialResponseReason = default; SemanticSearchResultsType? searchSemanticPartialResponseType = default; SemanticQueryRewritesResultType? searchSemanticQueryRewritesResultType = default; - DebugInfo searchDebug = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("@odata.count"u8)) @@ -141,16 +140,6 @@ internal static SearchDocumentsResult DeserializeSearchDocumentsResult(JsonEleme searchSemanticQueryRewritesResultType = new SemanticQueryRewritesResultType(property.Value.GetString()); continue; } - if (property.NameEquals("@search.debug"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - searchDebug = null; - continue; - } - searchDebug = DebugInfo.DeserializeDebugInfo(property.Value); - continue; - } } return new SearchDocumentsResult( odataCount, @@ -162,8 +151,7 @@ internal static SearchDocumentsResult DeserializeSearchDocumentsResult(JsonEleme odataNextLink, searchSemanticPartialResponseReason, searchSemanticPartialResponseType, - searchSemanticQueryRewritesResultType, - searchDebug); + searchSemanticQueryRewritesResultType); } /// Deserializes the model from a raw response. diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchDocumentsResult.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchDocumentsResult.cs index 972d1a451da5..4397ef67b236 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchDocumentsResult.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchDocumentsResult.cs @@ -33,8 +33,7 @@ internal SearchDocumentsResult(IEnumerable results) /// Reason that a partial response was returned for a semantic ranking request. /// Type of partial response that was returned for a semantic ranking request. /// Type of query rewrite that was used to retrieve documents. - /// Debug information that applies to the search results as a whole. - internal SearchDocumentsResult(long? count, double? coverage, IReadOnlyDictionary> facets, IReadOnlyList answers, SearchOptions nextPageParameters, IReadOnlyList results, string nextLink, SemanticErrorReason? semanticPartialResponseReason, SemanticSearchResultsType? semanticPartialResponseType, SemanticQueryRewritesResultType? semanticQueryRewritesResultType, DebugInfo debugInfo) + internal SearchDocumentsResult(long? count, double? coverage, IReadOnlyDictionary> facets, IReadOnlyList answers, SearchOptions nextPageParameters, IReadOnlyList results, string nextLink, SemanticErrorReason? semanticPartialResponseReason, SemanticSearchResultsType? semanticPartialResponseType, SemanticQueryRewritesResultType? semanticQueryRewritesResultType) { Count = count; Coverage = coverage; @@ -46,7 +45,6 @@ internal SearchDocumentsResult(long? count, double? coverage, IReadOnlyDictionar SemanticPartialResponseReason = semanticPartialResponseReason; SemanticPartialResponseType = semanticPartialResponseType; SemanticQueryRewritesResultType = semanticQueryRewritesResultType; - DebugInfo = debugInfo; } /// The total count of results found by the search operation, or null if the count was not requested. If present, the count may be greater than the number of results in this response. This can happen if you use the $top or $skip parameters, or if the query can't return all the requested documents in a single response. @@ -69,7 +67,5 @@ internal SearchDocumentsResult(long? count, double? coverage, IReadOnlyDictionar public SemanticSearchResultsType? SemanticPartialResponseType { get; } /// Type of query rewrite that was used to retrieve documents. public SemanticQueryRewritesResultType? SemanticQueryRewritesResultType { get; } - /// Debug information that applies to the search results as a whole. - public DebugInfo DebugInfo { get; } } } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/TokenFilterName.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/TokenFilterName.cs index 4a73a4c73841..218e1c1685af 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/TokenFilterName.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/TokenFilterName.cs @@ -65,7 +65,7 @@ public TokenFilterName(string value) public static TokenFilterName AsciiFolding { get; } = new TokenFilterName(AsciiFoldingValue); /// Forms bigrams of CJK terms that are generated from the standard tokenizer. See http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/cjk/CJKBigramFilter.html. public static TokenFilterName CjkBigram { get; } = new TokenFilterName(CjkBigramValue); - /// Normalizes CJK width differences. Folds fullwidth ASCII variants into the equivalent basic Latin, and half-width Katakana variants into the equivalent Kana. See http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/cjk/CJKWidthFilter.html. + /// Normalizes CJK width differences. Folds full-width ASCII variants into the equivalent basic Latin, and half-width Katakana variants into the equivalent Kana. See http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/cjk/CJKWidthFilter.html. public static TokenFilterName CjkWidth { get; } = new TokenFilterName(CjkWidthValue); /// Removes English possessives, and dots from acronyms. See http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/standard/ClassicFilter.html. public static TokenFilterName Classic { get; } = new TokenFilterName(ClassicValue); diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorSearchVectorizerKind.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorSearchVectorizerKind.cs index bef6730ac985..7443589ba5fc 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorSearchVectorizerKind.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorSearchVectorizerKind.cs @@ -33,7 +33,7 @@ public VectorSearchVectorizerKind(string value) public static VectorSearchVectorizerKind CustomWebApi { get; } = new VectorSearchVectorizerKind(CustomWebApiValue); /// Generate embeddings for an image or text input at query time using the Azure AI Services Vision Vectorize API. public static VectorSearchVectorizerKind AIServicesVision { get; } = new VectorSearchVectorizerKind(AIServicesVisionValue); - /// Generate embeddings using an Azure Machine Learning endpoint deployed via the Azure AI Studio Model Catalog at query time. + /// Generate embeddings using an Azure Machine Learning endpoint deployed via the Azure AI Foundry Model Catalog at query time. public static VectorSearchVectorizerKind AML { get; } = new VectorSearchVectorizerKind(AMLValue); /// Determines if two values are the same. public static bool operator ==(VectorSearchVectorizerKind left, VectorSearchVectorizerKind right) => left.Equals(right); diff --git a/sdk/search/Azure.Search.Documents/src/Generated/SearchModelFactory.cs b/sdk/search/Azure.Search.Documents/src/Generated/SearchModelFactory.cs index 6b392475902e..742e27797e10 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/SearchModelFactory.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/SearchModelFactory.cs @@ -15,165 +15,6 @@ namespace Azure.Search.Documents.Models /// Model factory for models. public static partial class SearchModelFactory { - /// Initializes a new instance of . - /// The approximate count of documents falling within the bucket described by this facet. - /// The nested facet query results for the search operation, organized as a collection of buckets for each faceted field; null if the query did not contain any nested facets. - /// Additional Properties. - /// A new instance for mocking. - public static FacetResult FacetResult(long? count = null, IReadOnlyDictionary> facets = null, IReadOnlyDictionary additionalProperties = null) - { - facets ??= new Dictionary>(); - additionalProperties ??= new Dictionary(); - - return new FacetResult(count, facets, additionalProperties); - } - - /// Initializes a new instance of . - /// The score value represents how relevant the answer is to the query relative to other answers returned for the query. - /// The key of the document the answer was extracted from. - /// The text passage extracted from the document contents as the answer. - /// Same text passage as in the Text property with highlighted text phrases most relevant to the query. - /// Additional Properties. - /// A new instance for mocking. - public static QueryAnswerResult QueryAnswerResult(double? score = null, string key = null, string text = null, string highlights = null, IReadOnlyDictionary additionalProperties = null) - { - additionalProperties ??= new Dictionary(); - - return new QueryAnswerResult(score, key, text, highlights, additionalProperties); - } - - /// Initializes a new instance of . - /// A representative text passage extracted from the document most relevant to the search query. - /// Same text passage as in the Text property with highlighted phrases most relevant to the query. - /// Additional Properties. - /// A new instance for mocking. - public static QueryCaptionResult QueryCaptionResult(string text = null, string highlights = null, IReadOnlyDictionary additionalProperties = null) - { - additionalProperties ??= new Dictionary(); - - return new QueryCaptionResult(text, highlights, additionalProperties); - } - - /// Initializes a new instance of . - /// Contains debugging information specific to semantic ranking requests. - /// Contains debugging information specific to vector and hybrid search. - /// A new instance for mocking. - public static DocumentDebugInfo DocumentDebugInfo(SemanticDebugInfo semantic = null, VectorsDebugInfo vectors = null) - { - return new DocumentDebugInfo(semantic, vectors); - } - - /// Initializes a new instance of . - /// The title field that was sent to the semantic enrichment process, as well as how it was used. - /// The content fields that were sent to the semantic enrichment process, as well as how they were used. - /// The keyword fields that were sent to the semantic enrichment process, as well as how they were used. - /// The raw concatenated strings that were sent to the semantic enrichment process. - /// A new instance for mocking. - public static SemanticDebugInfo SemanticDebugInfo(QueryResultDocumentSemanticField titleField = null, IEnumerable contentFields = null, IEnumerable keywordFields = null, QueryResultDocumentRerankerInput rerankerInput = null) - { - contentFields ??= new List(); - keywordFields ??= new List(); - - return new SemanticDebugInfo(titleField, contentFields?.ToList(), keywordFields?.ToList(), rerankerInput); - } - - /// Initializes a new instance of . - /// The name of the field that was sent to the semantic enrichment process. - /// The way the field was used for the semantic enrichment process (fully used, partially used, or unused). - /// A new instance for mocking. - public static QueryResultDocumentSemanticField QueryResultDocumentSemanticField(string name = null, SemanticFieldState? state = null) - { - return new QueryResultDocumentSemanticField(name, state); - } - - /// Initializes a new instance of . - /// The raw string for the title field that was used for semantic enrichment. - /// The raw concatenated strings for the content fields that were used for semantic enrichment. - /// The raw concatenated strings for the keyword fields that were used for semantic enrichment. - /// A new instance for mocking. - public static QueryResultDocumentRerankerInput QueryResultDocumentRerankerInput(string title = null, string content = null, string keywords = null) - { - return new QueryResultDocumentRerankerInput(title, content, keywords); - } - - /// Initializes a new instance of . - /// The breakdown of subscores of the document prior to the chosen result set fusion/combination method such as RRF. - /// A new instance for mocking. - public static VectorsDebugInfo VectorsDebugInfo(QueryResultDocumentSubscores subscores = null) - { - return new VectorsDebugInfo(subscores); - } - - /// Initializes a new instance of . - /// The BM25 or Classic score for the text portion of the query. - /// The vector similarity and @search.score values for each vector query. - /// The BM25 or Classic score for the text portion of the query. - /// A new instance for mocking. - public static QueryResultDocumentSubscores QueryResultDocumentSubscores(TextResult text = null, IEnumerable> vectors = null, double? documentBoost = null) - { - vectors ??= new List>(); - - return new QueryResultDocumentSubscores(text, vectors?.ToList(), documentBoost); - } - - /// Initializes a new instance of . - /// The BM25 or Classic score for the text portion of the query. - /// A new instance for mocking. - public static TextResult TextResult(double? searchScore = null) - { - return new TextResult(searchScore); - } - - /// Initializes a new instance of . - /// The @search.score value that is calculated from the vector similarity score. This is the score that's visible in a pure single-field single-vector query. - /// The vector similarity score for this document. Note this is the canonical definition of similarity metric, not the 'distance' version. For example, cosine similarity instead of cosine distance. - /// A new instance for mocking. - public static SingleVectorFieldResult SingleVectorFieldResult(double? searchScore = null, double? vectorSimilarity = null) - { - return new SingleVectorFieldResult(searchScore, vectorSimilarity); - } - - /// Initializes a new instance of . - /// Contains debugging information specific to query rewrites. - /// A new instance for mocking. - public static DebugInfo DebugInfo(QueryRewritesDebugInfo queryRewrites = null) - { - return new DebugInfo(queryRewrites); - } - - /// Initializes a new instance of . - /// List of query rewrites generated for the text query. - /// List of query rewrites generated for the vectorizable text queries. - /// A new instance for mocking. - public static QueryRewritesDebugInfo QueryRewritesDebugInfo(QueryRewritesValuesDebugInfo text = null, IEnumerable vectors = null) - { - vectors ??= new List(); - - return new QueryRewritesDebugInfo(text, vectors?.ToList()); - } - - /// Initializes a new instance of . - /// The input text to the generative query rewriting model. There may be cases where the user query and the input to the generative model are not identical. - /// List of query rewrites. - /// A new instance for mocking. - public static QueryRewritesValuesDebugInfo QueryRewritesValuesDebugInfo(string inputQuery = null, IEnumerable rewrites = null) - { - rewrites ??= new List(); - - return new QueryRewritesValuesDebugInfo(inputQuery, rewrites?.ToList()); - } - - /// Initializes a new instance of . - /// A value indicating the percentage of the index that was considered by the autocomplete request, or null if minimumCoverage was not specified in the request. - /// The list of returned Autocompleted items. - /// A new instance for mocking. - public static AutocompleteResults AutocompleteResults(double? coverage = null, IEnumerable results = null) - { - results ??= new List(); - - return new AutocompleteResults(coverage, results?.ToList()); - } - /// Initializes a new instance of . /// Overall indexer status. /// The result of the most recent or an in-progress indexer execution. @@ -305,5 +146,134 @@ public static SearchServiceLimits SearchServiceLimits(int? maxFieldsPerIndex = n { return new SearchServiceLimits(maxFieldsPerIndex, maxFieldNestingDepthPerIndex, maxComplexCollectionFieldsPerIndex, maxComplexObjectsInCollectionsPerDocument, maxStoragePerIndexInBytes); } + + /// Initializes a new instance of . + /// The approximate count of documents falling within the bucket described by this facet. + /// The nested facet query results for the search operation, organized as a collection of buckets for each faceted field; null if the query did not contain any nested facets. + /// Additional Properties. + /// A new instance for mocking. + public static FacetResult FacetResult(long? count = null, IReadOnlyDictionary> facets = null, IReadOnlyDictionary additionalProperties = null) + { + facets ??= new Dictionary>(); + additionalProperties ??= new Dictionary(); + + return new FacetResult(count, facets, additionalProperties); + } + + /// Initializes a new instance of . + /// The score value represents how relevant the answer is to the query relative to other answers returned for the query. + /// The key of the document the answer was extracted from. + /// The text passage extracted from the document contents as the answer. + /// Same text passage as in the Text property with highlighted text phrases most relevant to the query. + /// Additional Properties. + /// A new instance for mocking. + public static QueryAnswerResult QueryAnswerResult(double? score = null, string key = null, string text = null, string highlights = null, IReadOnlyDictionary additionalProperties = null) + { + additionalProperties ??= new Dictionary(); + + return new QueryAnswerResult(score, key, text, highlights, additionalProperties); + } + + /// Initializes a new instance of . + /// A representative text passage extracted from the document most relevant to the search query. + /// Same text passage as in the Text property with highlighted phrases most relevant to the query. + /// Additional Properties. + /// A new instance for mocking. + public static QueryCaptionResult QueryCaptionResult(string text = null, string highlights = null, IReadOnlyDictionary additionalProperties = null) + { + additionalProperties ??= new Dictionary(); + + return new QueryCaptionResult(text, highlights, additionalProperties); + } + + /// Initializes a new instance of . + /// Contains debugging information specific to semantic ranking requests. + /// Contains debugging information specific to vector and hybrid search. + /// A new instance for mocking. + public static DocumentDebugInfo DocumentDebugInfo(SemanticDebugInfo semantic = null, VectorsDebugInfo vectors = null) + { + return new DocumentDebugInfo(semantic, vectors); + } + + /// Initializes a new instance of . + /// The title field that was sent to the semantic enrichment process, as well as how it was used. + /// The content fields that were sent to the semantic enrichment process, as well as how they were used. + /// The keyword fields that were sent to the semantic enrichment process, as well as how they were used. + /// The raw concatenated strings that were sent to the semantic enrichment process. + /// A new instance for mocking. + public static SemanticDebugInfo SemanticDebugInfo(QueryResultDocumentSemanticField titleField = null, IEnumerable contentFields = null, IEnumerable keywordFields = null, QueryResultDocumentRerankerInput rerankerInput = null) + { + contentFields ??= new List(); + keywordFields ??= new List(); + + return new SemanticDebugInfo(titleField, contentFields?.ToList(), keywordFields?.ToList(), rerankerInput); + } + + /// Initializes a new instance of . + /// The name of the field that was sent to the semantic enrichment process. + /// The way the field was used for the semantic enrichment process (fully used, partially used, or unused). + /// A new instance for mocking. + public static QueryResultDocumentSemanticField QueryResultDocumentSemanticField(string name = null, SemanticFieldState? state = null) + { + return new QueryResultDocumentSemanticField(name, state); + } + + /// Initializes a new instance of . + /// The raw string for the title field that was used for semantic enrichment. + /// The raw concatenated strings for the content fields that were used for semantic enrichment. + /// The raw concatenated strings for the keyword fields that were used for semantic enrichment. + /// A new instance for mocking. + public static QueryResultDocumentRerankerInput QueryResultDocumentRerankerInput(string title = null, string content = null, string keywords = null) + { + return new QueryResultDocumentRerankerInput(title, content, keywords); + } + + /// Initializes a new instance of . + /// The breakdown of subscores of the document prior to the chosen result set fusion/combination method such as RRF. + /// A new instance for mocking. + public static VectorsDebugInfo VectorsDebugInfo(QueryResultDocumentSubscores subscores = null) + { + return new VectorsDebugInfo(subscores); + } + + /// Initializes a new instance of . + /// The BM25 or Classic score for the text portion of the query. + /// The vector similarity and @search.score values for each vector query. + /// The BM25 or Classic score for the text portion of the query. + /// A new instance for mocking. + public static QueryResultDocumentSubscores QueryResultDocumentSubscores(TextResult text = null, IEnumerable> vectors = null, double? documentBoost = null) + { + vectors ??= new List>(); + + return new QueryResultDocumentSubscores(text, vectors?.ToList(), documentBoost); + } + + /// Initializes a new instance of . + /// The BM25 or Classic score for the text portion of the query. + /// A new instance for mocking. + public static TextResult TextResult(double? searchScore = null) + { + return new TextResult(searchScore); + } + + /// Initializes a new instance of . + /// The @search.score value that is calculated from the vector similarity score. This is the score that's visible in a pure single-field single-vector query. + /// The vector similarity score for this document. Note this is the canonical definition of similarity metric, not the 'distance' version. For example, cosine similarity instead of cosine distance. + /// A new instance for mocking. + public static SingleVectorFieldResult SingleVectorFieldResult(double? searchScore = null, double? vectorSimilarity = null) + { + return new SingleVectorFieldResult(searchScore, vectorSimilarity); + } + + /// Initializes a new instance of . + /// A value indicating the percentage of the index that was considered by the autocomplete request, or null if minimumCoverage was not specified in the request. + /// The list of returned Autocompleted items. + /// A new instance for mocking. + public static AutocompleteResults AutocompleteResults(double? coverage = null, IEnumerable results = null) + { + results ??= new List(); + + return new AutocompleteResults(coverage, results?.ToList()); + } } } diff --git a/sdk/search/Azure.Search.Documents/src/autorest.md b/sdk/search/Azure.Search.Documents/src/autorest.md index a0b16fa58568..c39ebe72e777 100644 --- a/sdk/search/Azure.Search.Documents/src/autorest.md +++ b/sdk/search/Azure.Search.Documents/src/autorest.md @@ -10,9 +10,8 @@ See the [Contributing guidelines](https://github.com/Azure/azure-sdk-for-net/blo ## Swagger Source(s) ```yaml title: SearchServiceClient -input-file: - - https://github.com/Azure/azure-rest-api-specs/blob/14531a7cf6101c1dd57e7c1c83103a047bb8f5bb/specification/search/data-plane/Azure.Search/preview/2024-11-01-preview/searchindex.json - - https://github.com/Azure/azure-rest-api-specs/blob/14531a7cf6101c1dd57e7c1c83103a047bb8f5bb/specification/search/data-plane/Azure.Search/preview/2024-11-01-preview/searchservice.json +require: +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/search/data-plane/Azure.Search/readme.md generation1-convenience-client: true deserialize-null-collection-as-null-value: true ``` @@ -550,3 +549,4 @@ directive: "modelAsString": false } ``` + diff --git a/sdk/search/ci.mgmt.yml b/sdk/search/ci.mgmt.yml index a8c2a632c1c8..22789e3e14e7 100644 --- a/sdk/search/ci.mgmt.yml +++ b/sdk/search/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/search/ci.mgmt.yml - sdk/search/Azure.ResourceManager.Search/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/search/ci.mgmt.yml + - sdk/search/Azure.ResourceManager.Search/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/search/ci.mgmt.yml + - sdk/search/Azure.ResourceManager.Search/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/search/ci.mgmt.yml + - sdk/search/Azure.ResourceManager.Search/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/search/ci.mgmt.yml + - sdk/search/Azure.ResourceManager.Search/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/search/ci.mgmt.yml + - sdk/search/Azure.ResourceManager.Search/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/search/ci.mgmt.yml + - sdk/search/Azure.ResourceManager.Search/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/search/ci.mgmt.yml + - sdk/search/Azure.ResourceManager.Search/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/search/ci.mgmt.yml + - sdk/search/Azure.ResourceManager.Search/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/search/ci.mgmt.yml + - sdk/search/Azure.ResourceManager.Search/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/securitycenter/ci.mgmt.yml b/sdk/securitycenter/ci.mgmt.yml index c728522efab2..41f5ee05cc58 100644 --- a/sdk/securitycenter/ci.mgmt.yml +++ b/sdk/securitycenter/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/securitycenter/ci.mgmt.yml - sdk/securitycenter/Azure.ResourceManager.SecurityCenter/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securitycenter/ci.mgmt.yml + - sdk/securitycenter/Azure.ResourceManager.SecurityCenter/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securitycenter/ci.mgmt.yml + - sdk/securitycenter/Azure.ResourceManager.SecurityCenter/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securitycenter/ci.mgmt.yml + - sdk/securitycenter/Azure.ResourceManager.SecurityCenter/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securitycenter/ci.mgmt.yml + - sdk/securitycenter/Azure.ResourceManager.SecurityCenter/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securitycenter/ci.mgmt.yml + - sdk/securitycenter/Azure.ResourceManager.SecurityCenter/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securitycenter/ci.mgmt.yml + - sdk/securitycenter/Azure.ResourceManager.SecurityCenter/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securitycenter/ci.mgmt.yml + - sdk/securitycenter/Azure.ResourceManager.SecurityCenter/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securitycenter/ci.mgmt.yml + - sdk/securitycenter/Azure.ResourceManager.SecurityCenter/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securitycenter/ci.mgmt.yml + - sdk/securitycenter/Azure.ResourceManager.SecurityCenter/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/securitydevops/ci.mgmt.yml b/sdk/securitydevops/ci.mgmt.yml index c5a54a9ad206..ee1405858ef5 100644 --- a/sdk/securitydevops/ci.mgmt.yml +++ b/sdk/securitydevops/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/securitydevops/ci.mgmt.yml - sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securitydevops/ci.mgmt.yml + - sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securitydevops/ci.mgmt.yml + - sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securitydevops/ci.mgmt.yml + - sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securitydevops/ci.mgmt.yml + - sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securitydevops/ci.mgmt.yml + - sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securitydevops/ci.mgmt.yml + - sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securitydevops/ci.mgmt.yml + - sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securitydevops/ci.mgmt.yml + - sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securitydevops/ci.mgmt.yml + - sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/autorest.md b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/autorest.md index 714eb0f51a6a..c7317fd5c538 100644 --- a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/autorest.md +++ b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: SecurityInsights namespace: Azure.ResourceManager.SecurityInsights -require: https://github.com/Azure/azure-rest-api-specs/blob/2d973fccf9f28681a481e9760fa12b2334216e21/specification/securityinsights/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/securityinsights/resource-manager/readme.md tag: package-preview-2024-01 output-folder: $(this-folder)/Generated clear-output-folder: true diff --git a/sdk/securityinsights/ci.mgmt.yml b/sdk/securityinsights/ci.mgmt.yml index f1d428ebef90..0e3b5845f6f2 100644 --- a/sdk/securityinsights/ci.mgmt.yml +++ b/sdk/securityinsights/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/securityinsights/ci.mgmt.yml - sdk/securityinsights/Azure.ResourceManager.SecurityInsights/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securityinsights/ci.mgmt.yml + - sdk/securityinsights/Azure.ResourceManager.SecurityInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securityinsights/ci.mgmt.yml + - sdk/securityinsights/Azure.ResourceManager.SecurityInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securityinsights/ci.mgmt.yml + - sdk/securityinsights/Azure.ResourceManager.SecurityInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securityinsights/ci.mgmt.yml + - sdk/securityinsights/Azure.ResourceManager.SecurityInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securityinsights/ci.mgmt.yml + - sdk/securityinsights/Azure.ResourceManager.SecurityInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securityinsights/ci.mgmt.yml + - sdk/securityinsights/Azure.ResourceManager.SecurityInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securityinsights/ci.mgmt.yml + - sdk/securityinsights/Azure.ResourceManager.SecurityInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securityinsights/ci.mgmt.yml + - sdk/securityinsights/Azure.ResourceManager.SecurityInsights/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securityinsights/ci.mgmt.yml + - sdk/securityinsights/Azure.ResourceManager.SecurityInsights/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/selfhelp/ci.mgmt.yml b/sdk/selfhelp/ci.mgmt.yml index bb6a162210eb..1e34876859ab 100644 --- a/sdk/selfhelp/ci.mgmt.yml +++ b/sdk/selfhelp/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/selfhelp/ci.mgmt.yml - sdk/selfhelp/Azure.ResourceManager.SelfHelp/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/selfhelp/ci.mgmt.yml + - sdk/selfhelp/Azure.ResourceManager.SelfHelp/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/selfhelp/ci.mgmt.yml + - sdk/selfhelp/Azure.ResourceManager.SelfHelp/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/selfhelp/ci.mgmt.yml + - sdk/selfhelp/Azure.ResourceManager.SelfHelp/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/selfhelp/ci.mgmt.yml + - sdk/selfhelp/Azure.ResourceManager.SelfHelp/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/selfhelp/ci.mgmt.yml + - sdk/selfhelp/Azure.ResourceManager.SelfHelp/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/selfhelp/ci.mgmt.yml + - sdk/selfhelp/Azure.ResourceManager.SelfHelp/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/selfhelp/ci.mgmt.yml + - sdk/selfhelp/Azure.ResourceManager.SelfHelp/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/selfhelp/ci.mgmt.yml + - sdk/selfhelp/Azure.ResourceManager.SelfHelp/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/selfhelp/ci.mgmt.yml + - sdk/selfhelp/Azure.ResourceManager.SelfHelp/ + extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/servicebus/ci.mgmt.yml b/sdk/servicebus/ci.mgmt.yml index 02c45dc88e18..be7c714e48df 100644 --- a/sdk/servicebus/ci.mgmt.yml +++ b/sdk/servicebus/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/servicebus/ci.mgmt.yml - sdk/servicebus/Azure.ResourceManager.ServiceBus/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicebus/ci.mgmt.yml + - sdk/servicebus/Azure.ResourceManager.ServiceBus/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicebus/ci.mgmt.yml + - sdk/servicebus/Azure.ResourceManager.ServiceBus/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicebus/ci.mgmt.yml + - sdk/servicebus/Azure.ResourceManager.ServiceBus/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicebus/ci.mgmt.yml + - sdk/servicebus/Azure.ResourceManager.ServiceBus/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicebus/ci.mgmt.yml + - sdk/servicebus/Azure.ResourceManager.ServiceBus/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicebus/ci.mgmt.yml + - sdk/servicebus/Azure.ResourceManager.ServiceBus/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicebus/ci.mgmt.yml + - sdk/servicebus/Azure.ResourceManager.ServiceBus/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicebus/ci.mgmt.yml + - sdk/servicebus/Azure.ResourceManager.ServiceBus/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicebus/ci.mgmt.yml + - sdk/servicebus/Azure.ResourceManager.ServiceBus/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/servicefabric/ci.mgmt.yml b/sdk/servicefabric/ci.mgmt.yml index 430f48c8c87b..f2b7269cf658 100644 --- a/sdk/servicefabric/ci.mgmt.yml +++ b/sdk/servicefabric/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/servicefabric/ci.mgmt.yml - sdk/servicefabric/Azure.ResourceManager.ServiceFabric/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicefabric/ci.mgmt.yml + - sdk/servicefabric/Azure.ResourceManager.ServiceFabric/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicefabric/ci.mgmt.yml + - sdk/servicefabric/Azure.ResourceManager.ServiceFabric/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicefabric/ci.mgmt.yml + - sdk/servicefabric/Azure.ResourceManager.ServiceFabric/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicefabric/ci.mgmt.yml + - sdk/servicefabric/Azure.ResourceManager.ServiceFabric/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicefabric/ci.mgmt.yml + - sdk/servicefabric/Azure.ResourceManager.ServiceFabric/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicefabric/ci.mgmt.yml + - sdk/servicefabric/Azure.ResourceManager.ServiceFabric/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicefabric/ci.mgmt.yml + - sdk/servicefabric/Azure.ResourceManager.ServiceFabric/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicefabric/ci.mgmt.yml + - sdk/servicefabric/Azure.ResourceManager.ServiceFabric/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicefabric/ci.mgmt.yml + - sdk/servicefabric/Azure.ResourceManager.ServiceFabric/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/servicefabricmanagedclusters/ci.mgmt.yml b/sdk/servicefabricmanagedclusters/ci.mgmt.yml index e73289f589f4..ecc667076456 100644 --- a/sdk/servicefabricmanagedclusters/ci.mgmt.yml +++ b/sdk/servicefabricmanagedclusters/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/servicefabricmanagedclusters/ci.mgmt.yml - sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicefabricmanagedclusters/ci.mgmt.yml + - sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicefabricmanagedclusters/ci.mgmt.yml + - sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicefabricmanagedclusters/ci.mgmt.yml + - sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicefabricmanagedclusters/ci.mgmt.yml + - sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicefabricmanagedclusters/ci.mgmt.yml + - sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicefabricmanagedclusters/ci.mgmt.yml + - sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicefabricmanagedclusters/ci.mgmt.yml + - sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicefabricmanagedclusters/ci.mgmt.yml + - sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicefabricmanagedclusters/ci.mgmt.yml + - sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/servicelinker/ci.mgmt.yml b/sdk/servicelinker/ci.mgmt.yml index 77df314e977a..5b9eb259a8fd 100644 --- a/sdk/servicelinker/ci.mgmt.yml +++ b/sdk/servicelinker/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/servicelinker/ci.mgmt.yml - sdk/servicelinker/Azure.ResourceManager.ServiceLinker/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicelinker/ci.mgmt.yml + - sdk/servicelinker/Azure.ResourceManager.ServiceLinker/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicelinker/ci.mgmt.yml + - sdk/servicelinker/Azure.ResourceManager.ServiceLinker/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicelinker/ci.mgmt.yml + - sdk/servicelinker/Azure.ResourceManager.ServiceLinker/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicelinker/ci.mgmt.yml + - sdk/servicelinker/Azure.ResourceManager.ServiceLinker/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicelinker/ci.mgmt.yml + - sdk/servicelinker/Azure.ResourceManager.ServiceLinker/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicelinker/ci.mgmt.yml + - sdk/servicelinker/Azure.ResourceManager.ServiceLinker/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicelinker/ci.mgmt.yml + - sdk/servicelinker/Azure.ResourceManager.ServiceLinker/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicelinker/ci.mgmt.yml + - sdk/servicelinker/Azure.ResourceManager.ServiceLinker/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicelinker/ci.mgmt.yml + - sdk/servicelinker/Azure.ResourceManager.ServiceLinker/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/servicenetworking/ci.mgmt.yml b/sdk/servicenetworking/ci.mgmt.yml index b2332ae15224..c8b52766db9d 100644 --- a/sdk/servicenetworking/ci.mgmt.yml +++ b/sdk/servicenetworking/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/servicenetworking/ci.mgmt.yml - sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicenetworking/ci.mgmt.yml + - sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicenetworking/ci.mgmt.yml + - sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicenetworking/ci.mgmt.yml + - sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicenetworking/ci.mgmt.yml + - sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicenetworking/ci.mgmt.yml + - sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicenetworking/ci.mgmt.yml + - sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicenetworking/ci.mgmt.yml + - sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicenetworking/ci.mgmt.yml + - sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicenetworking/ci.mgmt.yml + - sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/signalr/ci.mgmt.yml b/sdk/signalr/ci.mgmt.yml index c934ed4314fa..e8794b81e2fa 100644 --- a/sdk/signalr/ci.mgmt.yml +++ b/sdk/signalr/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/signalr/ci.mgmt.yml - sdk/signalr/Azure.ResourceManager.SignalR/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/signalr/ci.mgmt.yml + - sdk/signalr/Azure.ResourceManager.SignalR/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/signalr/ci.mgmt.yml + - sdk/signalr/Azure.ResourceManager.SignalR/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/signalr/ci.mgmt.yml + - sdk/signalr/Azure.ResourceManager.SignalR/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/signalr/ci.mgmt.yml + - sdk/signalr/Azure.ResourceManager.SignalR/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/signalr/ci.mgmt.yml + - sdk/signalr/Azure.ResourceManager.SignalR/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/signalr/ci.mgmt.yml + - sdk/signalr/Azure.ResourceManager.SignalR/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/signalr/ci.mgmt.yml + - sdk/signalr/Azure.ResourceManager.SignalR/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/signalr/ci.mgmt.yml + - sdk/signalr/Azure.ResourceManager.SignalR/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/signalr/ci.mgmt.yml + - sdk/signalr/Azure.ResourceManager.SignalR/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/sphere/ci.mgmt.yml b/sdk/sphere/ci.mgmt.yml index f3f33e9d00f4..b5935418a798 100644 --- a/sdk/sphere/ci.mgmt.yml +++ b/sdk/sphere/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/sphere/ci.mgmt.yml - sdk/sphere/Azure.ResourceManager.Sphere/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sphere/ci.mgmt.yml + - sdk/sphere/Azure.ResourceManager.Sphere/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sphere/ci.mgmt.yml + - sdk/sphere/Azure.ResourceManager.Sphere/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sphere/ci.mgmt.yml + - sdk/sphere/Azure.ResourceManager.Sphere/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sphere/ci.mgmt.yml + - sdk/sphere/Azure.ResourceManager.Sphere/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sphere/ci.mgmt.yml + - sdk/sphere/Azure.ResourceManager.Sphere/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sphere/ci.mgmt.yml + - sdk/sphere/Azure.ResourceManager.Sphere/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sphere/ci.mgmt.yml + - sdk/sphere/Azure.ResourceManager.Sphere/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sphere/ci.mgmt.yml + - sdk/sphere/Azure.ResourceManager.Sphere/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sphere/ci.mgmt.yml + - sdk/sphere/Azure.ResourceManager.Sphere/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/springappdiscovery/ci.mgmt.yml b/sdk/springappdiscovery/ci.mgmt.yml index 7676386684df..b5cec658c5bf 100644 --- a/sdk/springappdiscovery/ci.mgmt.yml +++ b/sdk/springappdiscovery/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/springappdiscovery/ci.mgmt.yml - sdk/springappdiscovery/Azure.ResourceManager.SpringAppDiscovery/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/springappdiscovery/ci.mgmt.yml + - sdk/springappdiscovery/Azure.ResourceManager.SpringAppDiscovery/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/springappdiscovery/ci.mgmt.yml + - sdk/springappdiscovery/Azure.ResourceManager.SpringAppDiscovery/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/springappdiscovery/ci.mgmt.yml + - sdk/springappdiscovery/Azure.ResourceManager.SpringAppDiscovery/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/springappdiscovery/ci.mgmt.yml + - sdk/springappdiscovery/Azure.ResourceManager.SpringAppDiscovery/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/springappdiscovery/ci.mgmt.yml + - sdk/springappdiscovery/Azure.ResourceManager.SpringAppDiscovery/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/springappdiscovery/ci.mgmt.yml + - sdk/springappdiscovery/Azure.ResourceManager.SpringAppDiscovery/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/springappdiscovery/ci.mgmt.yml + - sdk/springappdiscovery/Azure.ResourceManager.SpringAppDiscovery/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/springappdiscovery/ci.mgmt.yml + - sdk/springappdiscovery/Azure.ResourceManager.SpringAppDiscovery/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/springappdiscovery/ci.mgmt.yml + - sdk/springappdiscovery/Azure.ResourceManager.SpringAppDiscovery/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/sqlmanagement/ci.mgmt.yml b/sdk/sqlmanagement/ci.mgmt.yml index da93d03f2d33..b7490d88a6b7 100644 --- a/sdk/sqlmanagement/ci.mgmt.yml +++ b/sdk/sqlmanagement/ci.mgmt.yml @@ -2,6 +2,7 @@ # This file is generated automatically and any changes will be lost. trigger: none + pr: branches: include: @@ -14,6 +15,114 @@ pr: - sdk/sqlmanagement/ci.mgmt.yml - sdk/sqlmanagement/Azure.ResourceManager.Sql/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sqlmanagement/ci.mgmt.yml + - sdk/sqlmanagement/Azure.ResourceManager.Sql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sqlmanagement/ci.mgmt.yml + - sdk/sqlmanagement/Azure.ResourceManager.Sql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sqlmanagement/ci.mgmt.yml + - sdk/sqlmanagement/Azure.ResourceManager.Sql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sqlmanagement/ci.mgmt.yml + - sdk/sqlmanagement/Azure.ResourceManager.Sql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sqlmanagement/ci.mgmt.yml + - sdk/sqlmanagement/Azure.ResourceManager.Sql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sqlmanagement/ci.mgmt.yml + - sdk/sqlmanagement/Azure.ResourceManager.Sql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sqlmanagement/ci.mgmt.yml + - sdk/sqlmanagement/Azure.ResourceManager.Sql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sqlmanagement/ci.mgmt.yml + - sdk/sqlmanagement/Azure.ResourceManager.Sql/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sqlmanagement/ci.mgmt.yml + - sdk/sqlmanagement/Azure.ResourceManager.Sql/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/sqlvirtualmachine/ci.mgmt.yml b/sdk/sqlvirtualmachine/ci.mgmt.yml index 28c6192fa86b..2d154a0067b3 100644 --- a/sdk/sqlvirtualmachine/ci.mgmt.yml +++ b/sdk/sqlvirtualmachine/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/sqlvirtualmachine/ci.mgmt.yml - sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sqlvirtualmachine/ci.mgmt.yml + - sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sqlvirtualmachine/ci.mgmt.yml + - sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sqlvirtualmachine/ci.mgmt.yml + - sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sqlvirtualmachine/ci.mgmt.yml + - sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sqlvirtualmachine/ci.mgmt.yml + - sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sqlvirtualmachine/ci.mgmt.yml + - sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sqlvirtualmachine/ci.mgmt.yml + - sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sqlvirtualmachine/ci.mgmt.yml + - sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sqlvirtualmachine/ci.mgmt.yml + - sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/Configuration.json b/sdk/standbypool/Azure.ResourceManager.StandbyPool/Configuration.json new file mode 100644 index 000000000000..0a2d1af62ece --- /dev/null +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/Configuration.json @@ -0,0 +1,12 @@ +{ + "output-folder": ".", + "namespace": "Azure.ResourceManager.StandbyPool", + "library-name": "Azure.ResourceManager.StandbyPool", + "flavor": "azure", + "use-model-reader-writer": true, + "shared-source-folders": [ + "../../TempTypeSpecFiles/node_modules/@autorest/csharp/Generator.Shared", + "../../TempTypeSpecFiles/node_modules/@autorest/csharp/Azure.Core.Shared" + ], + "azure-arm": true +} diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/tsp-location.yaml b/sdk/standbypool/Azure.ResourceManager.StandbyPool/tsp-location.yaml index cb68b5fb577a..5de555b089ad 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/tsp-location.yaml +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/tsp-location.yaml @@ -1,3 +1,4 @@ -directory: specification\standbypool\StandbyPool.Management -commit: 3519c80fe510a268f6e59a29ccac8a53fdec15b6 -repo: Azure/azure-rest-api-specs \ No newline at end of file +directory: specification/standbypool/StandbyPool.Management +commit: 7c52cf4d9a41dd06846b099946e8b85a9504cf1e +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/tspCodeModel.json b/sdk/standbypool/Azure.ResourceManager.StandbyPool/tspCodeModel.json new file mode 100644 index 000000000000..969ce9e235ce --- /dev/null +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/tspCodeModel.json @@ -0,0 +1,13011 @@ +{ + "$id": "1", + "Name": "Microsoft.StandbyPool", + "ApiVersions": [ + "2024-03-01" + ], + "Enums": [ + { + "$id": "2", + "kind": "enum", + "name": "StandbyProvisioningState", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ProvisioningState", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Resource has been created.", + "decorators": [] + }, + { + "$id": "6", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Resource creation failed.", + "decorators": [] + }, + { + "$id": "8", + "kind": "enumvalue", + "name": "Canceled", + "value": "Canceled", + "valueType": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Resource creation was canceled.", + "decorators": [] + }, + { + "$id": "10", + "kind": "enumvalue", + "name": "Deleting", + "value": "Deleting", + "valueType": { + "$id": "11", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Resource is being deleted.", + "decorators": [] + } + ], + "doc": "Provisioning state", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "12", + "kind": "enum", + "name": "createdByType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.createdByType", + "valueType": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "14", + "kind": "enumvalue", + "name": "User", + "value": "User", + "valueType": { + "$id": "15", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "12" + }, + "doc": "The entity was created by a user.", + "decorators": [] + }, + { + "$id": "16", + "kind": "enumvalue", + "name": "Application", + "value": "Application", + "valueType": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "12" + }, + "doc": "The entity was created by an application.", + "decorators": [] + }, + { + "$id": "18", + "kind": "enumvalue", + "name": "ManagedIdentity", + "value": "ManagedIdentity", + "valueType": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "12" + }, + "doc": "The entity was created by a managed identity.", + "decorators": [] + }, + { + "$id": "20", + "kind": "enumvalue", + "name": "Key", + "value": "Key", + "valueType": { + "$id": "21", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "12" + }, + "doc": "The entity was created by a key.", + "decorators": [] + } + ], + "doc": "The kind of entity that created the resource.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "22", + "kind": "enum", + "name": "StandbyRefillPolicy", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.RefillPolicy", + "valueType": { + "$id": "23", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "24", + "kind": "enumvalue", + "name": "always", + "value": "always", + "valueType": { + "$id": "25", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "22" + }, + "doc": "A refill policy that standby pool is automatically refilled to maintain maxReadyCapacity.", + "decorators": [] + } + ], + "doc": "Refill policy of standby pool", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "26", + "kind": "enum", + "name": "ResourceProvisioningState", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceProvisioningState", + "valueType": { + "$id": "27", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "28", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$id": "29", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "26" + }, + "doc": "Resource has been created.", + "decorators": [] + }, + { + "$id": "30", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$id": "31", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "26" + }, + "doc": "Resource creation failed.", + "decorators": [] + }, + { + "$id": "32", + "kind": "enumvalue", + "name": "Canceled", + "value": "Canceled", + "valueType": { + "$id": "33", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "26" + }, + "doc": "Resource creation was canceled.", + "decorators": [] + } + ], + "doc": "The provisioning state of a resource type.", + "isFixed": false, + "isFlags": false, + "usage": "LroPolling", + "decorators": [] + }, + { + "$id": "34", + "kind": "enum", + "name": "StandbyVirtualMachineState", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.VirtualMachineState", + "valueType": { + "$id": "35", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "36", + "kind": "enumvalue", + "name": "Running", + "value": "Running", + "valueType": { + "$id": "37", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "34" + }, + "doc": "The virtual machine is up and running.", + "decorators": [] + }, + { + "$id": "38", + "kind": "enumvalue", + "name": "Deallocated", + "value": "Deallocated", + "valueType": { + "$id": "39", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "34" + }, + "doc": "The virtual machine has released the lease on the underlying hardware and is powered off.", + "decorators": [] + } + ], + "doc": "State of standby virtual machines", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "40", + "kind": "enum", + "name": "Origin", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Origin", + "valueType": { + "$id": "41", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "42", + "kind": "enumvalue", + "name": "user", + "value": "user", + "valueType": { + "$id": "43", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "40" + }, + "doc": "Indicates the operation is initiated by a user.", + "decorators": [] + }, + { + "$id": "44", + "kind": "enumvalue", + "name": "system", + "value": "system", + "valueType": { + "$id": "45", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "40" + }, + "doc": "Indicates the operation is initiated by a system.", + "decorators": [] + }, + { + "$id": "46", + "kind": "enumvalue", + "name": "user,system", + "value": "user,system", + "valueType": { + "$id": "47", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "40" + }, + "doc": "Indicates the operation is initiated by a user or system.", + "decorators": [] + } + ], + "doc": "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\"", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "48", + "kind": "enum", + "name": "ActionType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ActionType", + "valueType": { + "$id": "49", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "50", + "kind": "enumvalue", + "name": "Internal", + "value": "Internal", + "valueType": { + "$id": "51", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "doc": "Actions are for internal-only APIs.", + "decorators": [] + } + ], + "doc": "Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "52", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.Versions", + "valueType": { + "$id": "53", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "54", + "kind": "enumvalue", + "name": "2024-03-01", + "value": "2024-03-01", + "valueType": { + "$id": "55", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "52" + }, + "doc": "API Version 2024-03-01.", + "decorators": [] + } + ], + "doc": "Supported API Versions for Microsoft.StandbyPool", + "isFixed": true, + "isFlags": false, + "usage": "ApiVersionEnum", + "decorators": [] + } + ], + "Models": [ + { + "$id": "56", + "kind": "model", + "name": "StandbyContainerGroupPoolRuntimeView", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViewResource", + "usage": "Output,Json", + "doc": "Contains information about a standby container group pool as last known by the StandbyPool resource provider.", + "decorators": [], + "baseModel": { + "$id": "57", + "kind": "model", + "name": "ProxyResource", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ProxyResource", + "usage": "Output,Json", + "doc": "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location", + "decorators": [], + "baseModel": { + "$id": "58", + "kind": "model", + "name": "Resource", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Common fields that are returned in the response for all Azure Resource Manager resources", + "decorators": [], + "properties": [ + { + "$id": "59", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}", + "type": { + "$id": "60", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "61", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.id" + }, + { + "$id": "62", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the resource", + "type": { + "$id": "63", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.name" + }, + { + "$id": "64", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\"", + "type": { + "$id": "65", + "kind": "string", + "name": "armResourceType", + "crossLanguageDefinitionId": "Azure.Core.armResourceType", + "baseType": { + "$id": "66", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.type" + }, + { + "$id": "67", + "kind": "property", + "name": "systemData", + "serializedName": "systemData", + "doc": "Azure Resource Manager metadata containing createdBy and modifiedBy information.", + "type": { + "$id": "68", + "kind": "model", + "name": "SystemData", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData", + "usage": "Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Metadata pertaining to creation and last modification of the resource.", + "decorators": [], + "properties": [ + { + "$id": "69", + "kind": "property", + "name": "createdBy", + "serializedName": "createdBy", + "doc": "The identity that created the resource.", + "type": { + "$id": "70", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdBy" + }, + { + "$id": "71", + "kind": "property", + "name": "createdByType", + "serializedName": "createdByType", + "doc": "The type of identity that created the resource.", + "type": { + "$ref": "12" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdByType" + }, + { + "$id": "72", + "kind": "property", + "name": "createdAt", + "serializedName": "createdAt", + "doc": "The timestamp of resource creation (UTC).", + "type": { + "$id": "73", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "74", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdAt" + }, + { + "$id": "75", + "kind": "property", + "name": "lastModifiedBy", + "serializedName": "lastModifiedBy", + "doc": "The identity that last modified the resource.", + "type": { + "$id": "76", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedBy" + }, + { + "$id": "77", + "kind": "property", + "name": "lastModifiedByType", + "serializedName": "lastModifiedByType", + "doc": "The type of identity that last modified the resource.", + "type": { + "$ref": "12" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedByType" + }, + { + "$id": "78", + "kind": "property", + "name": "lastModifiedAt", + "serializedName": "lastModifiedAt", + "doc": "The timestamp of resource last modification (UTC)", + "type": { + "$id": "79", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "80", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedAt" + } + ] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.systemData" + } + ] + }, + "properties": [] + }, + "properties": [ + { + "$id": "81", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "82", + "kind": "model", + "name": "StandbyContainerGroupPoolRuntimeViewProperties", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViewResourceProperties", + "usage": "Output,Json", + "doc": "Contains information about a standby pool as last known by the StandbyPool resource provider.", + "decorators": [], + "properties": [ + { + "$id": "83", + "kind": "property", + "name": "instanceCountSummary", + "serializedName": "instanceCountSummary", + "doc": "A list containing the counts of container groups in each possible state, as known by the StandbyPool resource provider.", + "type": { + "$id": "84", + "kind": "array", + "name": "ArrayContainerGroupInstanceCountSummary", + "valueType": { + "$id": "85", + "kind": "model", + "name": "ContainerGroupInstanceCountSummary", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupInstanceCountSummary", + "usage": "Output,Json", + "doc": "Displays the counts of container groups in each state, as known by the StandbyPool resource provider.", + "decorators": [], + "properties": [ + { + "$id": "86", + "kind": "property", + "name": "instanceCountsByState", + "serializedName": "instanceCountsByState", + "doc": "The count of pooled resources in each state.", + "type": { + "$id": "87", + "kind": "array", + "name": "ArrayPoolResourceStateCount", + "valueType": { + "$id": "88", + "kind": "model", + "name": "PoolResourceStateCount", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.PoolResourceStateCount", + "usage": "Output,Json", + "doc": "Displays the counts of pooled resources in each state, as known by the StandbyPool resource provider.", + "decorators": [], + "properties": [ + { + "$id": "89", + "kind": "property", + "name": "state", + "serializedName": "state", + "doc": "The state that the pooled resources count is for.", + "type": { + "$id": "90", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.PoolResourceStateCount.state" + }, + { + "$id": "91", + "kind": "property", + "name": "count", + "serializedName": "count", + "doc": "The count of pooled resources in the given state.", + "type": { + "$id": "92", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.PoolResourceStateCount.count" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupInstanceCountSummary.instanceCountsByState" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViewResourceProperties.instanceCountSummary" + }, + { + "$id": "93", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "Displays the provisioning state of the standby pool", + "type": { + "$ref": "2" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViewResourceProperties.provisioningState" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViewResource.properties" + } + ] + }, + { + "$ref": "82" + }, + { + "$ref": "85" + }, + { + "$ref": "88" + }, + { + "$ref": "57" + }, + { + "$ref": "58" + }, + { + "$ref": "68" + }, + { + "$id": "94", + "kind": "model", + "name": "ErrorResponse", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "usage": "Error,Json,Exception", + "doc": "Common error response for all Azure Resource Manager APIs to return error details for failed operations.", + "decorators": [], + "properties": [ + { + "$id": "95", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "The error object.", + "type": { + "$id": "96", + "kind": "model", + "name": "ErrorDetail", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "usage": "Json,Exception,LroPolling", + "doc": "The error detail.", + "decorators": [], + "properties": [ + { + "$id": "97", + "kind": "property", + "name": "code", + "serializedName": "code", + "doc": "The error code.", + "type": { + "$id": "98", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.code" + }, + { + "$id": "99", + "kind": "property", + "name": "message", + "serializedName": "message", + "doc": "The error message.", + "type": { + "$id": "100", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.message" + }, + { + "$id": "101", + "kind": "property", + "name": "target", + "serializedName": "target", + "doc": "The error target.", + "type": { + "$id": "102", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.target" + }, + { + "$id": "103", + "kind": "property", + "name": "details", + "serializedName": "details", + "doc": "The error details.", + "type": { + "$id": "104", + "kind": "array", + "name": "ArrayErrorDetail", + "valueType": { + "$ref": "96" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.details" + }, + { + "$id": "105", + "kind": "property", + "name": "additionalInfo", + "serializedName": "additionalInfo", + "doc": "The error additional info.", + "type": { + "$id": "106", + "kind": "array", + "name": "ArrayErrorAdditionalInfo", + "valueType": { + "$id": "107", + "kind": "model", + "name": "ErrorAdditionalInfo", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "usage": "Json,Exception,LroPolling", + "doc": "The resource management error additional info.", + "decorators": [], + "properties": [ + { + "$id": "108", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The additional info type.", + "type": { + "$id": "109", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.type" + }, + { + "$id": "110", + "kind": "property", + "name": "info", + "serializedName": "info", + "doc": "The additional info.", + "type": { + "$id": "111", + "kind": "model", + "name": "ErrorAdditionalInfoInfo", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.info.anonymous", + "usage": "Json,Exception,LroPolling", + "decorators": [], + "properties": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.info" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.additionalInfo" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse.error" + } + ] + }, + { + "$ref": "96" + }, + { + "$ref": "107" + }, + { + "$ref": "111" + }, + { + "$id": "112", + "kind": "model", + "name": "StandbyContainerGroupPoolRuntimeViewResourceListResult", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a StandbyContainerGroupPoolRuntimeViewResource list operation.", + "decorators": [], + "properties": [ + { + "$id": "113", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The StandbyContainerGroupPoolRuntimeViewResource items on this page", + "type": { + "$id": "114", + "kind": "array", + "name": "ArrayStandbyContainerGroupPoolRuntimeViewResource", + "valueType": { + "$ref": "56" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value" + }, + { + "$id": "115", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "116", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "117", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink" + } + ] + }, + { + "$id": "118", + "kind": "model", + "name": "StandbyContainerGroupPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolResource", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "A StandbyContainerGroupPoolResource.", + "decorators": [], + "baseModel": { + "$id": "119", + "kind": "model", + "name": "TrackedResource", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'", + "decorators": [], + "baseModel": { + "$ref": "58" + }, + "properties": [ + { + "$id": "120", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "121", + "kind": "dict", + "keyType": { + "$id": "122", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "123", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource.tags" + }, + { + "$id": "124", + "kind": "property", + "name": "location", + "serializedName": "location", + "doc": "The geo-location where the resource lives", + "type": { + "$id": "125", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource.location" + } + ] + }, + "properties": [ + { + "$id": "126", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "127", + "kind": "model", + "name": "StandbyContainerGroupPoolProperties", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolResourceProperties", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Details of the StandbyContainerGroupPool.", + "decorators": [], + "properties": [ + { + "$id": "128", + "kind": "property", + "name": "elasticityProfile", + "serializedName": "elasticityProfile", + "doc": "Specifies elasticity profile of standby container group pools.", + "type": { + "$id": "129", + "kind": "model", + "name": "StandbyContainerGroupPoolElasticityProfile", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolElasticityProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Specifies the elasticity profile of the standby container group pools.", + "decorators": [], + "properties": [ + { + "$id": "130", + "kind": "property", + "name": "maxReadyCapacity", + "serializedName": "maxReadyCapacity", + "doc": "Specifies maximum number of standby container groups in the standby pool.", + "type": { + "$id": "131", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolElasticityProfile.maxReadyCapacity" + }, + { + "$id": "132", + "kind": "property", + "name": "refillPolicy", + "serializedName": "refillPolicy", + "doc": "Specifies refill policy of the pool.", + "type": { + "$ref": "22" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolElasticityProfile.refillPolicy" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolResourceProperties.elasticityProfile" + }, + { + "$id": "133", + "kind": "property", + "name": "containerGroupProperties", + "serializedName": "containerGroupProperties", + "doc": "Specifies container group properties of standby container group pools.", + "type": { + "$id": "134", + "kind": "model", + "name": "StandbyContainerGroupProperties", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupProperties", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Details of the ContainerGroupProperties.", + "decorators": [], + "properties": [ + { + "$id": "135", + "kind": "property", + "name": "containerGroupProfile", + "serializedName": "containerGroupProfile", + "doc": "Specifies container group profile of standby container groups.", + "type": { + "$id": "136", + "kind": "model", + "name": "StandbyContainerGroupProfile", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Details of the ContainerGroupProfile.", + "decorators": [], + "properties": [ + { + "$id": "137", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Specifies container group profile id of standby container groups.", + "type": { + "$id": "138", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "139", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupProfile.id" + }, + { + "$id": "140", + "kind": "property", + "name": "revision", + "serializedName": "revision", + "doc": "Specifies revision of container group profile.", + "type": { + "$id": "141", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupProfile.revision" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupProperties.containerGroupProfile" + }, + { + "$id": "142", + "kind": "property", + "name": "subnetIds", + "serializedName": "subnetIds", + "doc": "Specifies subnet Ids for container group.", + "type": { + "$id": "143", + "kind": "array", + "name": "ArraySubnet", + "valueType": { + "$id": "144", + "kind": "model", + "name": "Subnet", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.Subnet", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Subnet of container group", + "decorators": [], + "properties": [ + { + "$id": "145", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Specifies ARM resource id of the subnet.", + "type": { + "$id": "146", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "147", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.Subnet.id" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupProperties.subnetIds" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolResourceProperties.containerGroupProperties" + }, + { + "$id": "148", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The status of the last operation.", + "type": { + "$ref": "2" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolResourceProperties.provisioningState" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolResource.properties" + } + ] + }, + { + "$ref": "127" + }, + { + "$ref": "129" + }, + { + "$ref": "134" + }, + { + "$ref": "136" + }, + { + "$ref": "144" + }, + { + "$ref": "119" + }, + { + "$id": "149", + "kind": "model", + "name": "ArmOperationStatusResourceProvisioningState", + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus", + "usage": "LroPolling", + "doc": "Standard Azure Resource Manager operation status response", + "decorators": [], + "properties": [ + { + "$id": "150", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The operation status", + "type": { + "$ref": "26" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.status" + }, + { + "$id": "151", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the operationStatus resource", + "type": { + "$id": "152", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.name" + }, + { + "$id": "153", + "kind": "property", + "name": "startTime", + "serializedName": "startTime", + "doc": "Operation start time", + "type": { + "$id": "154", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "155", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.startTime" + }, + { + "$id": "156", + "kind": "property", + "name": "endTime", + "serializedName": "endTime", + "doc": "Operation complete time", + "type": { + "$id": "157", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "158", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.endTime" + }, + { + "$id": "159", + "kind": "property", + "name": "percentComplete", + "serializedName": "percentComplete", + "doc": "The progress made toward completing the operation", + "type": { + "$id": "160", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.percentComplete" + }, + { + "$id": "161", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "Errors that occurred if the operation ended with Canceled or Failed status", + "type": { + "$ref": "96" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.error" + } + ] + }, + { + "$id": "162", + "kind": "model", + "name": "StandbyContainerGroupPoolResourceUpdate", + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "usage": "Input,Json", + "doc": "The type used for update operations of the StandbyContainerGroupPoolResource.", + "decorators": [], + "properties": [ + { + "$id": "163", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "164", + "kind": "dict", + "keyType": { + "$id": "165", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "166", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel.tags" + }, + { + "$id": "167", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "168", + "kind": "model", + "name": "StandbyContainerGroupPoolResourceUpdateProperties", + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", + "usage": "Input,Json", + "doc": "The updatable properties of the StandbyContainerGroupPoolResource.", + "decorators": [], + "properties": [ + { + "$id": "169", + "kind": "property", + "name": "elasticityProfile", + "serializedName": "elasticityProfile", + "doc": "Specifies elasticity profile of standby container group pools.", + "type": { + "$ref": "129" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties.elasticityProfile" + }, + { + "$id": "170", + "kind": "property", + "name": "containerGroupProperties", + "serializedName": "containerGroupProperties", + "doc": "Specifies container group properties of standby container group pools.", + "type": { + "$ref": "134" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties.containerGroupProperties" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel.properties" + } + ] + }, + { + "$ref": "168" + }, + { + "$id": "171", + "kind": "model", + "name": "StandbyContainerGroupPoolResourceListResult", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a StandbyContainerGroupPoolResource list operation.", + "decorators": [], + "properties": [ + { + "$id": "172", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The StandbyContainerGroupPoolResource items on this page", + "type": { + "$id": "173", + "kind": "array", + "name": "ArrayStandbyContainerGroupPoolResource", + "valueType": { + "$ref": "118" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value" + }, + { + "$id": "174", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "175", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "176", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink" + } + ] + }, + { + "$id": "177", + "kind": "model", + "name": "StandbyVirtualMachinePoolRuntimeView", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViewResource", + "usage": "Output,Json", + "doc": "Contains information about a standby virtual machine pool as last known by the StandbyPool resource provider.", + "decorators": [], + "baseModel": { + "$ref": "57" + }, + "properties": [ + { + "$id": "178", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "179", + "kind": "model", + "name": "StandbyVirtualMachinePoolRuntimeViewProperties", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViewResourceProperties", + "usage": "Output,Json", + "doc": "Contains information about a standby pool as last known by the StandbyPool resource provider.", + "decorators": [], + "properties": [ + { + "$id": "180", + "kind": "property", + "name": "instanceCountSummary", + "serializedName": "instanceCountSummary", + "doc": "A list containing the counts of virtual machines in each possible power state for each zone if enabled, as known by the StandbyPool resource provider. If zones are not enabled on the attached VMSS, the list will contain a single entry without zone values. Note: any resources in the Running state may still be installing extensions / not fully provisioned.", + "type": { + "$id": "181", + "kind": "array", + "name": "ArrayVirtualMachineInstanceCountSummary", + "valueType": { + "$id": "182", + "kind": "model", + "name": "StandbyVirtualMachineInstanceCountSummary", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.VirtualMachineInstanceCountSummary", + "usage": "Output,Json", + "doc": "Contains the counts of VMs in each power state in a given zone, fault domain, as known by the StandbyPool resource provider. Note: any resources in the Running state may still be installing extensions / not fully provisioned.", + "decorators": [], + "properties": [ + { + "$id": "183", + "kind": "property", + "name": "zone", + "serializedName": "zone", + "doc": "The zone that the provided counts are in. This is null if zones are not enabled on the attached VMSS.", + "type": { + "$id": "184", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.VirtualMachineInstanceCountSummary.zone" + }, + { + "$id": "185", + "kind": "property", + "name": "instanceCountsByState", + "serializedName": "instanceCountsByState", + "doc": "The count of pooled resources in each state for the given zone.", + "type": { + "$id": "186", + "kind": "array", + "name": "ArrayPoolResourceStateCount", + "valueType": { + "$ref": "88" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.VirtualMachineInstanceCountSummary.instanceCountsByState" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViewResourceProperties.instanceCountSummary" + }, + { + "$id": "187", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "Displays the provisioning state of the standby pool", + "type": { + "$ref": "2" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViewResourceProperties.provisioningState" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViewResource.properties" + } + ] + }, + { + "$ref": "179" + }, + { + "$ref": "182" + }, + { + "$id": "188", + "kind": "model", + "name": "StandbyVirtualMachinePoolRuntimeViewResourceListResult", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a StandbyVirtualMachinePoolRuntimeViewResource list operation.", + "decorators": [], + "properties": [ + { + "$id": "189", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The StandbyVirtualMachinePoolRuntimeViewResource items on this page", + "type": { + "$id": "190", + "kind": "array", + "name": "ArrayStandbyVirtualMachinePoolRuntimeViewResource", + "valueType": { + "$ref": "177" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value" + }, + { + "$id": "191", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "192", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "193", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink" + } + ] + }, + { + "$id": "194", + "kind": "model", + "name": "StandbyVirtualMachine", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachineResource", + "usage": "Output,Json", + "doc": "Concrete proxy resource types can be created by aliasing this type using a specific property type.", + "decorators": [], + "baseModel": { + "$ref": "57" + }, + "properties": [ + { + "$id": "195", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "196", + "kind": "model", + "name": "StandbyVirtualMachineProperties", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachineResourceProperties", + "usage": "Output,Json", + "doc": "Details of the StandbyVirtualMachine.", + "decorators": [], + "properties": [ + { + "$id": "197", + "kind": "property", + "name": "virtualMachineResourceId", + "serializedName": "virtualMachineResourceId", + "doc": "Resource id of the virtual machine.", + "type": { + "$id": "198", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "199", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachineResourceProperties.virtualMachineResourceId" + }, + { + "$id": "200", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The status of the last operation.", + "type": { + "$ref": "2" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachineResourceProperties.provisioningState" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachineResource.properties" + } + ] + }, + { + "$ref": "196" + }, + { + "$id": "201", + "kind": "model", + "name": "StandbyVirtualMachineResourceListResult", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a StandbyVirtualMachineResource list operation.", + "decorators": [], + "properties": [ + { + "$id": "202", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The StandbyVirtualMachineResource items on this page", + "type": { + "$id": "203", + "kind": "array", + "name": "ArrayStandbyVirtualMachineResource", + "valueType": { + "$ref": "194" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value" + }, + { + "$id": "204", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "205", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "206", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink" + } + ] + }, + { + "$id": "207", + "kind": "model", + "name": "StandbyVirtualMachinePool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResource", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "A StandbyVirtualMachinePoolResource.", + "decorators": [], + "baseModel": { + "$ref": "119" + }, + "properties": [ + { + "$id": "208", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "209", + "kind": "model", + "name": "StandbyVirtualMachinePoolProperties", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResourceProperties", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Details of the StandbyVirtualMachinePool.", + "decorators": [], + "properties": [ + { + "$id": "210", + "kind": "property", + "name": "elasticityProfile", + "serializedName": "elasticityProfile", + "doc": "Specifies the elasticity profile of the standby virtual machine pools.", + "type": { + "$id": "211", + "kind": "model", + "name": "StandbyVirtualMachinePoolElasticityProfile", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolElasticityProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Details of the elasticity profile.", + "decorators": [], + "properties": [ + { + "$id": "212", + "kind": "property", + "name": "maxReadyCapacity", + "serializedName": "maxReadyCapacity", + "doc": "Specifies the maximum number of virtual machines in the standby virtual machine pool.", + "type": { + "$id": "213", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolElasticityProfile.maxReadyCapacity" + }, + { + "$id": "214", + "kind": "property", + "name": "minReadyCapacity", + "serializedName": "minReadyCapacity", + "doc": "Specifies the desired minimum number of virtual machines in the standby virtual machine pool. MinReadyCapacity cannot exceed MaxReadyCapacity.", + "type": { + "$id": "215", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolElasticityProfile.minReadyCapacity" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResourceProperties.elasticityProfile" + }, + { + "$id": "216", + "kind": "property", + "name": "virtualMachineState", + "serializedName": "virtualMachineState", + "doc": "Specifies the desired state of virtual machines in the pool.", + "type": { + "$ref": "34" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResourceProperties.virtualMachineState" + }, + { + "$id": "217", + "kind": "property", + "name": "attachedVirtualMachineScaleSetId", + "serializedName": "attachedVirtualMachineScaleSetId", + "doc": "Specifies the fully qualified resource ID of a virtual machine scale set the pool is attached to.", + "type": { + "$id": "218", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "219", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResourceProperties.attachedVirtualMachineScaleSetId" + }, + { + "$id": "220", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The status of the last operation.", + "type": { + "$ref": "2" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResourceProperties.provisioningState" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResource.properties" + } + ] + }, + { + "$ref": "209" + }, + { + "$ref": "211" + }, + { + "$id": "221", + "kind": "model", + "name": "StandbyVirtualMachinePoolResourceUpdate", + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "usage": "Input,Json", + "doc": "The type used for update operations of the StandbyVirtualMachinePoolResource.", + "decorators": [], + "properties": [ + { + "$id": "222", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "223", + "kind": "dict", + "keyType": { + "$id": "224", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "225", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel.tags" + }, + { + "$id": "226", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "227", + "kind": "model", + "name": "StandbyVirtualMachinePoolResourceUpdateProperties", + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", + "usage": "Input,Json", + "doc": "The updatable properties of the StandbyVirtualMachinePoolResource.", + "decorators": [], + "properties": [ + { + "$id": "228", + "kind": "property", + "name": "elasticityProfile", + "serializedName": "elasticityProfile", + "doc": "Specifies the elasticity profile of the standby virtual machine pools.", + "type": { + "$ref": "211" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties.elasticityProfile" + }, + { + "$id": "229", + "kind": "property", + "name": "virtualMachineState", + "serializedName": "virtualMachineState", + "doc": "Specifies the desired state of virtual machines in the pool.", + "type": { + "$ref": "34" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties.virtualMachineState" + }, + { + "$id": "230", + "kind": "property", + "name": "attachedVirtualMachineScaleSetId", + "serializedName": "attachedVirtualMachineScaleSetId", + "doc": "Specifies the fully qualified resource ID of a virtual machine scale set the pool is attached to.", + "type": { + "$id": "231", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "232", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties.attachedVirtualMachineScaleSetId" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel.properties" + } + ] + }, + { + "$ref": "227" + }, + { + "$id": "233", + "kind": "model", + "name": "StandbyVirtualMachinePoolResourceListResult", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a StandbyVirtualMachinePoolResource list operation.", + "decorators": [], + "properties": [ + { + "$id": "234", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The StandbyVirtualMachinePoolResource items on this page", + "type": { + "$id": "235", + "kind": "array", + "name": "ArrayStandbyVirtualMachinePoolResource", + "valueType": { + "$ref": "207" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value" + }, + { + "$id": "236", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "237", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "238", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink" + } + ] + }, + { + "$id": "239", + "kind": "model", + "name": "OperationListResult", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult", + "usage": "Output,Json", + "doc": "A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.", + "decorators": [], + "properties": [ + { + "$id": "240", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The Operation items on this page", + "type": { + "$id": "241", + "kind": "array", + "name": "ArrayOperation", + "valueType": { + "$id": "242", + "kind": "model", + "name": "Operation", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation", + "usage": "Output,Json", + "doc": "Details of a REST API operation, returned from the Resource Provider Operations API", + "decorators": [], + "properties": [ + { + "$id": "243", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the operation, as per Resource-Based Access Control (RBAC). Examples: \"Microsoft.Compute/virtualMachines/write\", \"Microsoft.Compute/virtualMachines/capture/action\"", + "type": { + "$id": "244", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.name" + }, + { + "$id": "245", + "kind": "property", + "name": "isDataAction", + "serializedName": "isDataAction", + "doc": "Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for Azure Resource Manager/control-plane operations.", + "type": { + "$id": "246", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.isDataAction" + }, + { + "$id": "247", + "kind": "property", + "name": "display", + "serializedName": "display", + "doc": "Localized display information for this particular operation.", + "type": { + "$id": "248", + "kind": "model", + "name": "OperationDisplay", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "usage": "Output,Json", + "doc": "Localized display information for and operation.", + "decorators": [], + "properties": [ + { + "$id": "249", + "kind": "property", + "name": "provider", + "serializedName": "provider", + "doc": "The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring Insights\" or \"Microsoft Compute\".", + "type": { + "$id": "250", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.provider" + }, + { + "$id": "251", + "kind": "property", + "name": "resource", + "serializedName": "resource", + "doc": "The localized friendly name of the resource type related to this operation. E.g. \"Virtual Machines\" or \"Job Schedule Collections\".", + "type": { + "$id": "252", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.resource" + }, + { + "$id": "253", + "kind": "property", + "name": "operation", + "serializedName": "operation", + "doc": "The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create or Update Virtual Machine\", \"Restart Virtual Machine\".", + "type": { + "$id": "254", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.operation" + }, + { + "$id": "255", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "The short, localized friendly description of the operation; suitable for tool tips and detailed views.", + "type": { + "$id": "256", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.description" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.display" + }, + { + "$id": "257", + "kind": "property", + "name": "origin", + "serializedName": "origin", + "doc": "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\"", + "type": { + "$ref": "40" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.origin" + }, + { + "$id": "258", + "kind": "property", + "name": "actionType", + "serializedName": "actionType", + "doc": "Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs.", + "type": { + "$ref": "48" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.actionType" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult.value" + }, + { + "$id": "259", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "260", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "261", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult.nextLink" + } + ] + }, + { + "$ref": "242" + }, + { + "$ref": "248" + } + ], + "Clients": [ + { + "$id": "262", + "Name": "StandbyPoolClient", + "Operations": [], + "Protocol": { + "$id": "263" + }, + "Parameters": [ + { + "$id": "264", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "265", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "266", + "Type": { + "$id": "267", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "268", + "Name": "Operations", + "Operations": [ + { + "$id": "269", + "Name": "list", + "ResourceName": "Operations", + "Doc": "List the operations for the provider", + "Accessibility": "internal", + "Parameters": [ + { + "$id": "270", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "271", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "272", + "Type": { + "$id": "273", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "274", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "275", + "kind": "constant", + "valueType": { + "$id": "276", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "277", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "239" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/providers/Microsoft.StandbyPool/operations", + "BufferResponse": true, + "Paging": { + "$id": "278", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Azure.ResourceManager.Operations.list", + "Decorators": [], + "Examples": [ + { + "$id": "279", + "kind": "http", + "name": "Operations_List", + "description": "Operations_List", + "filePath": "2024-03-01/Operations_List.json", + "parameters": [ + { + "$id": "280", + "parameter": { + "$ref": "270" + }, + "value": { + "$id": "281", + "kind": "string", + "type": { + "$ref": "271" + }, + "value": "2024-03-01" + } + } + ], + "responses": [ + { + "$id": "282", + "response": { + "$ref": "277" + }, + "statusCode": 200, + "bodyValue": { + "$id": "283", + "kind": "model", + "type": { + "$ref": "239" + }, + "value": { + "$id": "284", + "value": { + "$id": "285", + "kind": "array", + "type": { + "$ref": "241" + }, + "value": [ + { + "$id": "286", + "kind": "model", + "type": { + "$ref": "242" + }, + "value": { + "$id": "287", + "name": { + "$id": "288", + "kind": "string", + "type": { + "$ref": "244" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools/write" + }, + "isDataAction": { + "$id": "289", + "kind": "boolean", + "type": { + "$ref": "246" + }, + "value": true + }, + "display": { + "$id": "290", + "kind": "model", + "type": { + "$ref": "248" + }, + "value": { + "$id": "291", + "provider": { + "$id": "292", + "kind": "string", + "type": { + "$ref": "250" + }, + "value": "Microsoft.StandbyPool" + }, + "resource": { + "$id": "293", + "kind": "string", + "type": { + "$ref": "252" + }, + "value": "standbyContainerGroupPools" + }, + "operation": { + "$id": "294", + "kind": "string", + "type": { + "$ref": "254" + }, + "value": "StandbyContainerGroupPools_Create" + }, + "description": { + "$id": "295", + "kind": "string", + "type": { + "$ref": "256" + }, + "value": "Create a StandbyContainerGroupPools Resource" + } + } + }, + "origin": { + "$id": "296", + "kind": "string", + "type": { + "$ref": "40" + }, + "value": "user" + }, + "actionType": { + "$id": "297", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Internal" + } + } + } + ] + }, + "nextLink": { + "$id": "298", + "kind": "string", + "type": { + "$ref": "260" + }, + "value": "https://example.com/providers/Microsoft.StandbyPool/operations" + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "299" + }, + "Parent": "StandbyPoolClient", + "Parameters": [ + { + "$id": "300", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "301", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "302", + "Type": { + "$id": "303", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "304", + "Name": "StandbyVirtualMachinePools", + "Operations": [ + { + "$id": "305", + "Name": "get", + "ResourceName": "StandbyVirtualMachinePoolResource", + "Doc": "Get a StandbyVirtualMachinePoolResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "306", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "307", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "308", + "Type": { + "$id": "309", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "310", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "311", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "312", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "313", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "314", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "315", + "Name": "standbyVirtualMachinePoolName", + "NameInRequest": "standbyVirtualMachinePoolName", + "Doc": "Name of the standby virtual machine pool", + "Type": { + "$id": "316", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "317", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "318", + "kind": "constant", + "valueType": { + "$id": "319", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "320", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "207" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools.get", + "Decorators": [], + "Examples": [ + { + "$id": "321", + "kind": "http", + "name": "StandbyVirtualMachinePools_Get", + "description": "StandbyVirtualMachinePools_Get", + "filePath": "2024-03-01/StandbyVirtualMachinePools_Get.json", + "parameters": [ + { + "$id": "322", + "parameter": { + "$ref": "306" + }, + "value": { + "$id": "323", + "kind": "string", + "type": { + "$ref": "307" + }, + "value": "2024-03-01" + } + }, + { + "$id": "324", + "parameter": { + "$ref": "310" + }, + "value": { + "$id": "325", + "kind": "string", + "type": { + "$ref": "311" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "326", + "parameter": { + "$ref": "313" + }, + "value": { + "$id": "327", + "kind": "string", + "type": { + "$ref": "314" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "328", + "parameter": { + "$ref": "315" + }, + "value": { + "$id": "329", + "kind": "string", + "type": { + "$ref": "316" + }, + "value": "pool" + } + } + ], + "responses": [ + { + "$id": "330", + "response": { + "$ref": "320" + }, + "statusCode": 200, + "bodyValue": { + "$id": "331", + "kind": "model", + "type": { + "$ref": "207" + }, + "value": { + "$id": "332", + "properties": { + "$id": "333", + "kind": "model", + "type": { + "$ref": "209" + }, + "value": { + "$id": "334", + "elasticityProfile": { + "$id": "335", + "kind": "model", + "type": { + "$ref": "211" + }, + "value": { + "$id": "336", + "maxReadyCapacity": { + "$id": "337", + "kind": "number", + "type": { + "$ref": "213" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "338", + "kind": "number", + "type": { + "$ref": "215" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "339", + "kind": "string", + "type": { + "$ref": "34" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "340", + "kind": "string", + "type": { + "$ref": "218" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + }, + "provisioningState": { + "$id": "341", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + } + } + }, + "tags": { + "$id": "342", + "kind": "dict", + "type": { + "$ref": "121" + }, + "value": { + "$id": "343" + } + }, + "location": { + "$id": "344", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "West US" + }, + "id": { + "$id": "345", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool" + }, + "name": { + "$id": "346", + "kind": "string", + "type": { + "$id": "347", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "pool" + }, + "type": { + "$id": "348", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools" + }, + "systemData": { + "$id": "349", + "kind": "model", + "type": { + "$ref": "68" + }, + "value": { + "$id": "350", + "createdBy": { + "$id": "351", + "kind": "string", + "type": { + "$ref": "70" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "352", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "353", + "kind": "string", + "type": { + "$ref": "73" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "354", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "355", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "356", + "kind": "string", + "type": { + "$ref": "79" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "357", + "Name": "createOrUpdate", + "ResourceName": "StandbyVirtualMachinePoolResource", + "Doc": "Create a StandbyVirtualMachinePoolResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "358", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "359", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "360", + "Type": { + "$id": "361", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "362", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "363", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "364", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "365", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "366", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "367", + "Name": "standbyVirtualMachinePoolName", + "NameInRequest": "standbyVirtualMachinePoolName", + "Doc": "Name of the standby virtual machine pool", + "Type": { + "$id": "368", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "369", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "370", + "kind": "constant", + "valueType": { + "$id": "371", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "372", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "373", + "kind": "constant", + "valueType": { + "$id": "374", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "375", + "Name": "resource", + "NameInRequest": "resource", + "Doc": "Resource create parameters.", + "Type": { + "$ref": "207" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "376", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "207" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + }, + { + "$id": "377", + "StatusCodes": [ + 201 + ], + "BodyType": { + "$ref": "207" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "378", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "379", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "380", + "FinalStateVia": 0, + "FinalResponse": { + "$id": "381", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "207" + }, + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools.createOrUpdate", + "Decorators": [ + { + "$id": "382", + "name": "Azure.Core.@useFinalStateVia", + "arguments": { + "$id": "383", + "finalState": "azure-async-operation" + } + } + ], + "Examples": [ + { + "$id": "384", + "kind": "http", + "name": "StandbyVirtualMachinePools_CreateOrUpdate", + "description": "StandbyVirtualMachinePools_CreateOrUpdate", + "filePath": "2024-03-01/StandbyVirtualMachinePools_CreateOrUpdate.json", + "parameters": [ + { + "$id": "385", + "parameter": { + "$ref": "358" + }, + "value": { + "$id": "386", + "kind": "string", + "type": { + "$ref": "359" + }, + "value": "2024-03-01" + } + }, + { + "$id": "387", + "parameter": { + "$ref": "362" + }, + "value": { + "$id": "388", + "kind": "string", + "type": { + "$ref": "363" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "389", + "parameter": { + "$ref": "365" + }, + "value": { + "$id": "390", + "kind": "string", + "type": { + "$ref": "366" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "391", + "parameter": { + "$ref": "367" + }, + "value": { + "$id": "392", + "kind": "string", + "type": { + "$ref": "368" + }, + "value": "pool" + } + }, + { + "$id": "393", + "parameter": { + "$ref": "375" + }, + "value": { + "$id": "394", + "kind": "model", + "type": { + "$ref": "207" + }, + "value": { + "$id": "395", + "properties": { + "$id": "396", + "kind": "model", + "type": { + "$ref": "209" + }, + "value": { + "$id": "397", + "elasticityProfile": { + "$id": "398", + "kind": "model", + "type": { + "$ref": "211" + }, + "value": { + "$id": "399", + "maxReadyCapacity": { + "$id": "400", + "kind": "number", + "type": { + "$ref": "213" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "401", + "kind": "number", + "type": { + "$ref": "215" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "402", + "kind": "string", + "type": { + "$ref": "34" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "403", + "kind": "string", + "type": { + "$ref": "218" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + } + } + }, + "tags": { + "$id": "404", + "kind": "dict", + "type": { + "$ref": "121" + }, + "value": { + "$id": "405" + } + }, + "location": { + "$id": "406", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "West US" + } + } + } + } + ], + "responses": [ + { + "$id": "407", + "response": { + "$ref": "376" + }, + "statusCode": 200, + "bodyValue": { + "$id": "408", + "kind": "model", + "type": { + "$ref": "207" + }, + "value": { + "$id": "409", + "properties": { + "$id": "410", + "kind": "model", + "type": { + "$ref": "209" + }, + "value": { + "$id": "411", + "elasticityProfile": { + "$id": "412", + "kind": "model", + "type": { + "$ref": "211" + }, + "value": { + "$id": "413", + "maxReadyCapacity": { + "$id": "414", + "kind": "number", + "type": { + "$ref": "213" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "415", + "kind": "number", + "type": { + "$ref": "215" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "416", + "kind": "string", + "type": { + "$ref": "34" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "417", + "kind": "string", + "type": { + "$ref": "218" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + }, + "provisioningState": { + "$id": "418", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + } + } + }, + "tags": { + "$id": "419", + "kind": "dict", + "type": { + "$ref": "121" + }, + "value": { + "$id": "420" + } + }, + "location": { + "$id": "421", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "West US" + }, + "id": { + "$id": "422", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool" + }, + "name": { + "$id": "423", + "kind": "string", + "type": { + "$ref": "347" + }, + "value": "pool" + }, + "type": { + "$id": "424", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools" + }, + "systemData": { + "$id": "425", + "kind": "model", + "type": { + "$ref": "68" + }, + "value": { + "$id": "426", + "createdBy": { + "$id": "427", + "kind": "string", + "type": { + "$ref": "70" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "428", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "429", + "kind": "string", + "type": { + "$ref": "73" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "430", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "431", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "432", + "kind": "string", + "type": { + "$ref": "79" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + }, + { + "$id": "433", + "response": { + "$ref": "377" + }, + "statusCode": 201, + "bodyValue": { + "$id": "434", + "kind": "model", + "type": { + "$ref": "207" + }, + "value": { + "$id": "435", + "properties": { + "$id": "436", + "kind": "model", + "type": { + "$ref": "209" + }, + "value": { + "$id": "437", + "elasticityProfile": { + "$id": "438", + "kind": "model", + "type": { + "$ref": "211" + }, + "value": { + "$id": "439", + "maxReadyCapacity": { + "$id": "440", + "kind": "number", + "type": { + "$ref": "213" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "441", + "kind": "number", + "type": { + "$ref": "215" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "442", + "kind": "string", + "type": { + "$ref": "34" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "443", + "kind": "string", + "type": { + "$ref": "218" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + }, + "provisioningState": { + "$id": "444", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + } + } + }, + "tags": { + "$id": "445", + "kind": "dict", + "type": { + "$ref": "121" + }, + "value": { + "$id": "446" + } + }, + "location": { + "$id": "447", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "West US" + }, + "id": { + "$id": "448", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool" + }, + "name": { + "$id": "449", + "kind": "string", + "type": { + "$ref": "347" + }, + "value": "pool" + }, + "type": { + "$id": "450", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools" + }, + "systemData": { + "$id": "451", + "kind": "model", + "type": { + "$ref": "68" + }, + "value": { + "$id": "452", + "createdBy": { + "$id": "453", + "kind": "string", + "type": { + "$ref": "70" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "454", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "455", + "kind": "string", + "type": { + "$ref": "73" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "456", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "457", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "458", + "kind": "string", + "type": { + "$ref": "79" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "459", + "Name": "delete", + "ResourceName": "StandbyVirtualMachinePoolResource", + "Doc": "Delete a StandbyVirtualMachinePoolResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "460", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "461", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "462", + "Type": { + "$id": "463", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "464", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "465", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "466", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "467", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "468", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "469", + "Name": "standbyVirtualMachinePoolName", + "NameInRequest": "standbyVirtualMachinePoolName", + "Doc": "Name of the standby virtual machine pool", + "Type": { + "$id": "470", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "471", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "472", + "kind": "constant", + "valueType": { + "$id": "473", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "474", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "475", + "Name": "location", + "NameInResponse": "Location", + "Doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "Type": { + "$id": "476", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "477", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "478", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false + }, + { + "$id": "479", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "DELETE", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}", + "BufferResponse": true, + "LongRunning": { + "$id": "480", + "FinalStateVia": 1, + "FinalResponse": { + "$id": "481", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools.delete", + "Decorators": [], + "Examples": [ + { + "$id": "482", + "kind": "http", + "name": "StandbyVirtualMachinePools_Delete", + "description": "StandbyVirtualMachinePools_Delete", + "filePath": "2024-03-01/StandbyVirtualMachinePools_Delete.json", + "parameters": [ + { + "$id": "483", + "parameter": { + "$ref": "460" + }, + "value": { + "$id": "484", + "kind": "string", + "type": { + "$ref": "461" + }, + "value": "2024-03-01" + } + }, + { + "$id": "485", + "parameter": { + "$ref": "464" + }, + "value": { + "$id": "486", + "kind": "string", + "type": { + "$ref": "465" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "487", + "parameter": { + "$ref": "467" + }, + "value": { + "$id": "488", + "kind": "string", + "type": { + "$ref": "468" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "489", + "parameter": { + "$ref": "469" + }, + "value": { + "$id": "490", + "kind": "string", + "type": { + "$ref": "470" + }, + "value": "pool" + } + } + ], + "responses": [ + { + "$id": "491", + "response": { + "$ref": "474" + }, + "statusCode": 202 + }, + { + "$id": "492", + "response": { + "$ref": "479" + }, + "statusCode": 204 + } + ] + } + ] + }, + { + "$id": "493", + "Name": "update", + "ResourceName": "StandbyVirtualMachinePoolResource", + "Doc": "Update a StandbyVirtualMachinePoolResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "494", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "495", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "496", + "Type": { + "$id": "497", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "498", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "499", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "500", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "501", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "502", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "503", + "Name": "standbyVirtualMachinePoolName", + "NameInRequest": "standbyVirtualMachinePoolName", + "Doc": "Name of the standby virtual machine pool", + "Type": { + "$id": "504", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "505", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "506", + "kind": "constant", + "valueType": { + "$id": "507", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "508", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "509", + "kind": "constant", + "valueType": { + "$id": "510", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "511", + "Name": "properties", + "NameInRequest": "properties", + "Doc": "The resource properties to be updated.", + "Type": { + "$ref": "221" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "512", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "207" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools.update", + "Decorators": [], + "Examples": [ + { + "$id": "513", + "kind": "http", + "name": "StandbyVirtualMachinePools_Update", + "description": "StandbyVirtualMachinePools_Update", + "filePath": "2024-03-01/StandbyVirtualMachinePools_Update.json", + "parameters": [ + { + "$id": "514", + "parameter": { + "$ref": "494" + }, + "value": { + "$id": "515", + "kind": "string", + "type": { + "$ref": "495" + }, + "value": "2024-03-01" + } + }, + { + "$id": "516", + "parameter": { + "$ref": "498" + }, + "value": { + "$id": "517", + "kind": "string", + "type": { + "$ref": "499" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "518", + "parameter": { + "$ref": "501" + }, + "value": { + "$id": "519", + "kind": "string", + "type": { + "$ref": "502" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "520", + "parameter": { + "$ref": "503" + }, + "value": { + "$id": "521", + "kind": "string", + "type": { + "$ref": "504" + }, + "value": "pool" + } + }, + { + "$id": "522", + "parameter": { + "$ref": "511" + }, + "value": { + "$id": "523", + "kind": "model", + "type": { + "$ref": "221" + }, + "value": { + "$id": "524", + "tags": { + "$id": "525", + "kind": "dict", + "type": { + "$ref": "223" + }, + "value": { + "$id": "526" + } + }, + "properties": { + "$id": "527", + "kind": "model", + "type": { + "$ref": "227" + }, + "value": { + "$id": "528", + "elasticityProfile": { + "$id": "529", + "kind": "model", + "type": { + "$ref": "211" + }, + "value": { + "$id": "530", + "maxReadyCapacity": { + "$id": "531", + "kind": "number", + "type": { + "$ref": "213" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "532", + "kind": "number", + "type": { + "$ref": "215" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "533", + "kind": "string", + "type": { + "$ref": "34" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "534", + "kind": "string", + "type": { + "$ref": "231" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "535", + "response": { + "$ref": "512" + }, + "statusCode": 200, + "bodyValue": { + "$id": "536", + "kind": "model", + "type": { + "$ref": "207" + }, + "value": { + "$id": "537", + "properties": { + "$id": "538", + "kind": "model", + "type": { + "$ref": "209" + }, + "value": { + "$id": "539", + "elasticityProfile": { + "$id": "540", + "kind": "model", + "type": { + "$ref": "211" + }, + "value": { + "$id": "541", + "maxReadyCapacity": { + "$id": "542", + "kind": "number", + "type": { + "$ref": "213" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "543", + "kind": "number", + "type": { + "$ref": "215" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "544", + "kind": "string", + "type": { + "$ref": "34" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "545", + "kind": "string", + "type": { + "$ref": "218" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + }, + "provisioningState": { + "$id": "546", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + } + } + }, + "tags": { + "$id": "547", + "kind": "dict", + "type": { + "$ref": "121" + }, + "value": { + "$id": "548" + } + }, + "location": { + "$id": "549", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "West US" + }, + "id": { + "$id": "550", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool" + }, + "name": { + "$id": "551", + "kind": "string", + "type": { + "$ref": "347" + }, + "value": "pool" + }, + "type": { + "$id": "552", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools" + }, + "systemData": { + "$id": "553", + "kind": "model", + "type": { + "$ref": "68" + }, + "value": { + "$id": "554", + "createdBy": { + "$id": "555", + "kind": "string", + "type": { + "$ref": "70" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "556", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "557", + "kind": "string", + "type": { + "$ref": "73" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "558", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "559", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "560", + "kind": "string", + "type": { + "$ref": "79" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "561", + "Name": "listByResourceGroup", + "ResourceName": "StandbyVirtualMachinePoolResource", + "Doc": "List StandbyVirtualMachinePoolResource resources by resource group", + "Accessibility": "public", + "Parameters": [ + { + "$id": "562", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "563", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "564", + "Type": { + "$id": "565", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "566", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "567", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "568", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "569", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "570", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "571", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "572", + "kind": "constant", + "valueType": { + "$id": "573", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "574", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "233" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools", + "BufferResponse": true, + "Paging": { + "$id": "575", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools.listByResourceGroup", + "Decorators": [], + "Examples": [ + { + "$id": "576", + "kind": "http", + "name": "StandbyVirtualMachinePools_ListByResourceGroup", + "description": "StandbyVirtualMachinePools_ListByResourceGroup", + "filePath": "2024-03-01/StandbyVirtualMachinePools_ListByResourceGroup.json", + "parameters": [ + { + "$id": "577", + "parameter": { + "$ref": "562" + }, + "value": { + "$id": "578", + "kind": "string", + "type": { + "$ref": "563" + }, + "value": "2024-03-01" + } + }, + { + "$id": "579", + "parameter": { + "$ref": "566" + }, + "value": { + "$id": "580", + "kind": "string", + "type": { + "$ref": "567" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "581", + "parameter": { + "$ref": "569" + }, + "value": { + "$id": "582", + "kind": "string", + "type": { + "$ref": "570" + }, + "value": "rgstandbypool" + } + } + ], + "responses": [ + { + "$id": "583", + "response": { + "$ref": "574" + }, + "statusCode": 200, + "bodyValue": { + "$id": "584", + "kind": "model", + "type": { + "$ref": "233" + }, + "value": { + "$id": "585", + "value": { + "$id": "586", + "kind": "array", + "type": { + "$ref": "235" + }, + "value": [ + { + "$id": "587", + "kind": "model", + "type": { + "$ref": "207" + }, + "value": { + "$id": "588", + "properties": { + "$id": "589", + "kind": "model", + "type": { + "$ref": "209" + }, + "value": { + "$id": "590", + "elasticityProfile": { + "$id": "591", + "kind": "model", + "type": { + "$ref": "211" + }, + "value": { + "$id": "592", + "maxReadyCapacity": { + "$id": "593", + "kind": "number", + "type": { + "$ref": "213" + }, + "value": 304 + } + } + }, + "virtualMachineState": { + "$id": "594", + "kind": "string", + "type": { + "$ref": "34" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "595", + "kind": "string", + "type": { + "$ref": "218" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + }, + "provisioningState": { + "$id": "596", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + } + } + }, + "tags": { + "$id": "597", + "kind": "dict", + "type": { + "$ref": "121" + }, + "value": { + "$id": "598" + } + }, + "location": { + "$id": "599", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "West US" + }, + "id": { + "$id": "600", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool" + }, + "name": { + "$id": "601", + "kind": "string", + "type": { + "$ref": "347" + }, + "value": "pool" + }, + "type": { + "$id": "602", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools" + }, + "systemData": { + "$id": "603", + "kind": "model", + "type": { + "$ref": "68" + }, + "value": { + "$id": "604", + "createdBy": { + "$id": "605", + "kind": "string", + "type": { + "$ref": "70" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "606", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "607", + "kind": "string", + "type": { + "$ref": "73" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "608", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "609", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "610", + "kind": "string", + "type": { + "$ref": "79" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "611", + "kind": "string", + "type": { + "$ref": "237" + }, + "value": "https://example.com/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools" + } + } + } + } + ] + } + ] + }, + { + "$id": "612", + "Name": "listBySubscription", + "ResourceName": "StandbyVirtualMachinePoolResource", + "Doc": "List StandbyVirtualMachinePoolResource resources by subscription ID", + "Accessibility": "public", + "Parameters": [ + { + "$id": "613", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "614", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "615", + "Type": { + "$id": "616", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "617", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "618", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "619", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "620", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "621", + "kind": "constant", + "valueType": { + "$id": "622", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "623", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "233" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools", + "BufferResponse": true, + "Paging": { + "$id": "624", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools.listBySubscription", + "Decorators": [], + "Examples": [ + { + "$id": "625", + "kind": "http", + "name": "StandbyVirtualMachinePools_ListBySubscription", + "description": "StandbyVirtualMachinePools_ListBySubscription", + "filePath": "2024-03-01/StandbyVirtualMachinePools_ListBySubscription.json", + "parameters": [ + { + "$id": "626", + "parameter": { + "$ref": "613" + }, + "value": { + "$id": "627", + "kind": "string", + "type": { + "$ref": "614" + }, + "value": "2024-03-01" + } + }, + { + "$id": "628", + "parameter": { + "$ref": "617" + }, + "value": { + "$id": "629", + "kind": "string", + "type": { + "$ref": "618" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + } + ], + "responses": [ + { + "$id": "630", + "response": { + "$ref": "623" + }, + "statusCode": 200, + "bodyValue": { + "$id": "631", + "kind": "model", + "type": { + "$ref": "233" + }, + "value": { + "$id": "632", + "value": { + "$id": "633", + "kind": "array", + "type": { + "$ref": "235" + }, + "value": [ + { + "$id": "634", + "kind": "model", + "type": { + "$ref": "207" + }, + "value": { + "$id": "635", + "properties": { + "$id": "636", + "kind": "model", + "type": { + "$ref": "209" + }, + "value": { + "$id": "637", + "elasticityProfile": { + "$id": "638", + "kind": "model", + "type": { + "$ref": "211" + }, + "value": { + "$id": "639", + "maxReadyCapacity": { + "$id": "640", + "kind": "number", + "type": { + "$ref": "213" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "641", + "kind": "number", + "type": { + "$ref": "215" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "642", + "kind": "string", + "type": { + "$ref": "34" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "643", + "kind": "string", + "type": { + "$ref": "218" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + }, + "provisioningState": { + "$id": "644", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + } + } + }, + "tags": { + "$id": "645", + "kind": "dict", + "type": { + "$ref": "121" + }, + "value": { + "$id": "646" + } + }, + "location": { + "$id": "647", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "West US" + }, + "id": { + "$id": "648", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool" + }, + "name": { + "$id": "649", + "kind": "string", + "type": { + "$ref": "347" + }, + "value": "pool" + }, + "type": { + "$id": "650", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools" + }, + "systemData": { + "$id": "651", + "kind": "model", + "type": { + "$ref": "68" + }, + "value": { + "$id": "652", + "createdBy": { + "$id": "653", + "kind": "string", + "type": { + "$ref": "70" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "654", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "655", + "kind": "string", + "type": { + "$ref": "73" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "656", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "657", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "658", + "kind": "string", + "type": { + "$ref": "79" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "659", + "kind": "string", + "type": { + "$ref": "237" + }, + "value": "https://example.com/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools" + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "660" + }, + "Parent": "StandbyPoolClient", + "Parameters": [ + { + "$id": "661", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "662", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "663", + "Type": { + "$id": "664", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "665", + "Name": "StandbyVirtualMachines", + "Operations": [ + { + "$id": "666", + "Name": "get", + "ResourceName": "StandbyVirtualMachineResource", + "Doc": "Get a StandbyVirtualMachineResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "667", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "668", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "669", + "Type": { + "$id": "670", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "671", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "672", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "673", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "674", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "675", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "676", + "Name": "standbyVirtualMachinePoolName", + "NameInRequest": "standbyVirtualMachinePoolName", + "Doc": "Name of the standby virtual machine pool", + "Type": { + "$id": "677", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "678", + "Name": "standbyVirtualMachineName", + "NameInRequest": "standbyVirtualMachineName", + "Doc": "Name of the standby virtual machine", + "Type": { + "$id": "679", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "680", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "681", + "kind": "constant", + "valueType": { + "$id": "682", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "683", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "194" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}/standbyVirtualMachines/{standbyVirtualMachineName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachines.get", + "Decorators": [], + "Examples": [ + { + "$id": "684", + "kind": "http", + "name": "StandbyVirtualMachines_Get", + "description": "StandbyVirtualMachines_Get", + "filePath": "2024-03-01/StandbyVirtualMachines_Get.json", + "parameters": [ + { + "$id": "685", + "parameter": { + "$ref": "667" + }, + "value": { + "$id": "686", + "kind": "string", + "type": { + "$ref": "668" + }, + "value": "2024-03-01" + } + }, + { + "$id": "687", + "parameter": { + "$ref": "671" + }, + "value": { + "$id": "688", + "kind": "string", + "type": { + "$ref": "672" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "689", + "parameter": { + "$ref": "674" + }, + "value": { + "$id": "690", + "kind": "string", + "type": { + "$ref": "675" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "691", + "parameter": { + "$ref": "676" + }, + "value": { + "$id": "692", + "kind": "string", + "type": { + "$ref": "677" + }, + "value": "pool" + } + }, + { + "$id": "693", + "parameter": { + "$ref": "678" + }, + "value": { + "$id": "694", + "kind": "string", + "type": { + "$ref": "679" + }, + "value": "virtualMachine" + } + } + ], + "responses": [ + { + "$id": "695", + "response": { + "$ref": "683" + }, + "statusCode": 200, + "bodyValue": { + "$id": "696", + "kind": "model", + "type": { + "$ref": "194" + }, + "value": { + "$id": "697", + "properties": { + "$id": "698", + "kind": "model", + "type": { + "$ref": "196" + }, + "value": { + "$id": "699", + "virtualMachineResourceId": { + "$id": "700", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachines/virtualMachine" + }, + "provisioningState": { + "$id": "701", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + } + } + }, + "id": { + "$id": "702", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool/standbyVirtualMachines/virtualMachine" + }, + "name": { + "$id": "703", + "kind": "string", + "type": { + "$id": "704", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "pool" + }, + "type": { + "$id": "705", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools/virtualMachines" + }, + "systemData": { + "$id": "706", + "kind": "model", + "type": { + "$ref": "68" + }, + "value": { + "$id": "707", + "createdBy": { + "$id": "708", + "kind": "string", + "type": { + "$ref": "70" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "709", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "710", + "kind": "string", + "type": { + "$ref": "73" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "711", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "712", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "713", + "kind": "string", + "type": { + "$ref": "79" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "714", + "Name": "listByStandbyVirtualMachinePoolResource", + "ResourceName": "StandbyVirtualMachineResource", + "Doc": "List StandbyVirtualMachineResource resources by StandbyVirtualMachinePoolResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "715", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "716", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "717", + "Type": { + "$id": "718", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "719", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "720", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "721", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "722", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "723", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "724", + "Name": "standbyVirtualMachinePoolName", + "NameInRequest": "standbyVirtualMachinePoolName", + "Doc": "Name of the standby virtual machine pool", + "Type": { + "$id": "725", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "726", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "727", + "kind": "constant", + "valueType": { + "$id": "728", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "729", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "201" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}/standbyVirtualMachines", + "BufferResponse": true, + "Paging": { + "$id": "730", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachines.listByStandbyVirtualMachinePoolResource", + "Decorators": [], + "Examples": [ + { + "$id": "731", + "kind": "http", + "name": "StandbyVirtualMachines_ListByStandbyVirtualMachinePoolResource", + "description": "StandbyVirtualMachines_ListByStandbyVirtualMachinePoolResource", + "filePath": "2024-03-01/StandbyVirtualMachines_ListByStandbyVirtualMachinePoolResource.json", + "parameters": [ + { + "$id": "732", + "parameter": { + "$ref": "715" + }, + "value": { + "$id": "733", + "kind": "string", + "type": { + "$ref": "716" + }, + "value": "2024-03-01" + } + }, + { + "$id": "734", + "parameter": { + "$ref": "719" + }, + "value": { + "$id": "735", + "kind": "string", + "type": { + "$ref": "720" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "736", + "parameter": { + "$ref": "722" + }, + "value": { + "$id": "737", + "kind": "string", + "type": { + "$ref": "723" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "738", + "parameter": { + "$ref": "724" + }, + "value": { + "$id": "739", + "kind": "string", + "type": { + "$ref": "725" + }, + "value": "pool" + } + } + ], + "responses": [ + { + "$id": "740", + "response": { + "$ref": "729" + }, + "statusCode": 200, + "bodyValue": { + "$id": "741", + "kind": "model", + "type": { + "$ref": "201" + }, + "value": { + "$id": "742", + "value": { + "$id": "743", + "kind": "array", + "type": { + "$ref": "203" + }, + "value": [ + { + "$id": "744", + "kind": "model", + "type": { + "$ref": "194" + }, + "value": { + "$id": "745", + "properties": { + "$id": "746", + "kind": "model", + "type": { + "$ref": "196" + }, + "value": { + "$id": "747", + "virtualMachineResourceId": { + "$id": "748", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachines/virtualMachine" + }, + "provisioningState": { + "$id": "749", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + } + } + }, + "id": { + "$id": "750", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool/standbyVirtualMachines/virtualMachine" + }, + "name": { + "$id": "751", + "kind": "string", + "type": { + "$ref": "704" + }, + "value": "pool" + }, + "type": { + "$id": "752", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools/virtualMachines" + }, + "systemData": { + "$id": "753", + "kind": "model", + "type": { + "$ref": "68" + }, + "value": { + "$id": "754", + "createdBy": { + "$id": "755", + "kind": "string", + "type": { + "$ref": "70" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "756", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "757", + "kind": "string", + "type": { + "$ref": "73" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "758", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "759", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "760", + "kind": "string", + "type": { + "$ref": "79" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "761", + "kind": "string", + "type": { + "$ref": "205" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "762" + }, + "Parent": "StandbyPoolClient", + "Parameters": [ + { + "$id": "763", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "764", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "765", + "Type": { + "$id": "766", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "767", + "Name": "StandbyVirtualMachinePoolRuntimeViews", + "Operations": [ + { + "$id": "768", + "Name": "get", + "ResourceName": "StandbyVirtualMachinePoolRuntimeViewResource", + "Doc": "Get a StandbyVirtualMachinePoolRuntimeViewResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "769", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "770", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "771", + "Type": { + "$id": "772", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "773", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "774", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "775", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "776", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "777", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "778", + "Name": "standbyVirtualMachinePoolName", + "NameInRequest": "standbyVirtualMachinePoolName", + "Doc": "Name of the standby virtual machine pool", + "Type": { + "$id": "779", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "780", + "Name": "runtimeView", + "NameInRequest": "runtimeView", + "Doc": "The unique identifier for the runtime view. The input string should be the word 'latest', which will get the latest runtime view of the pool, otherwise the request will fail with NotFound exception.", + "Type": { + "$id": "781", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "782", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "783", + "kind": "constant", + "valueType": { + "$id": "784", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "785", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "177" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}/runtimeViews/{runtimeView}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViews.get", + "Decorators": [], + "Examples": [ + { + "$id": "786", + "kind": "http", + "name": "StandbyVirtualMachinePoolRuntimeViews_Get", + "description": "StandbyVirtualMachinePoolRuntimeViews_Get", + "filePath": "2024-03-01/StandbyVirtualMachinePoolRuntimeViews_Get.json", + "parameters": [ + { + "$id": "787", + "parameter": { + "$ref": "769" + }, + "value": { + "$id": "788", + "kind": "string", + "type": { + "$ref": "770" + }, + "value": "2024-03-01" + } + }, + { + "$id": "789", + "parameter": { + "$ref": "773" + }, + "value": { + "$id": "790", + "kind": "string", + "type": { + "$ref": "774" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "791", + "parameter": { + "$ref": "776" + }, + "value": { + "$id": "792", + "kind": "string", + "type": { + "$ref": "777" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "793", + "parameter": { + "$ref": "778" + }, + "value": { + "$id": "794", + "kind": "string", + "type": { + "$ref": "779" + }, + "value": "pool" + } + }, + { + "$id": "795", + "parameter": { + "$ref": "780" + }, + "value": { + "$id": "796", + "kind": "string", + "type": { + "$ref": "781" + }, + "value": "latest" + } + } + ], + "responses": [ + { + "$id": "797", + "response": { + "$ref": "785" + }, + "statusCode": 200, + "bodyValue": { + "$id": "798", + "kind": "model", + "type": { + "$ref": "177" + }, + "value": { + "$id": "799", + "properties": { + "$id": "800", + "kind": "model", + "type": { + "$ref": "179" + }, + "value": { + "$id": "801", + "instanceCountSummary": { + "$id": "802", + "kind": "array", + "type": { + "$ref": "181" + }, + "value": [ + { + "$id": "803", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "804", + "zone": { + "$id": "805", + "kind": "number", + "type": { + "$ref": "184" + }, + "value": 1 + }, + "instanceCountsByState": { + "$id": "806", + "kind": "array", + "type": { + "$ref": "186" + }, + "value": [ + { + "$id": "807", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "808", + "state": { + "$id": "809", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "creating" + }, + "count": { + "$id": "810", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 100 + } + } + }, + { + "$id": "811", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "812", + "state": { + "$id": "813", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "running" + }, + "count": { + "$id": "814", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 20 + } + } + }, + { + "$id": "815", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "816", + "state": { + "$id": "817", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "deallocating" + }, + "count": { + "$id": "818", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 10 + } + } + }, + { + "$id": "819", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "820", + "state": { + "$id": "821", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "deallocated" + }, + "count": { + "$id": "822", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 100 + } + } + }, + { + "$id": "823", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "824", + "state": { + "$id": "825", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "starting" + }, + "count": { + "$id": "826", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 0 + } + } + }, + { + "$id": "827", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "828", + "state": { + "$id": "829", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "deleting" + }, + "count": { + "$id": "830", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 0 + } + } + } + ] + } + } + }, + { + "$id": "831", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "832", + "zone": { + "$id": "833", + "kind": "number", + "type": { + "$ref": "184" + }, + "value": 2 + }, + "instanceCountsByState": { + "$id": "834", + "kind": "array", + "type": { + "$ref": "186" + }, + "value": [ + { + "$id": "835", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "836", + "state": { + "$id": "837", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "creating" + }, + "count": { + "$id": "838", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 100 + } + } + }, + { + "$id": "839", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "840", + "state": { + "$id": "841", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "running" + }, + "count": { + "$id": "842", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 20 + } + } + }, + { + "$id": "843", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "844", + "state": { + "$id": "845", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "deallocating" + }, + "count": { + "$id": "846", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 10 + } + } + }, + { + "$id": "847", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "848", + "state": { + "$id": "849", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "deallocated" + }, + "count": { + "$id": "850", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 100 + } + } + }, + { + "$id": "851", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "852", + "state": { + "$id": "853", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "starting" + }, + "count": { + "$id": "854", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 0 + } + } + }, + { + "$id": "855", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "856", + "state": { + "$id": "857", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "deleting" + }, + "count": { + "$id": "858", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 0 + } + } + } + ] + } + } + }, + { + "$id": "859", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "860", + "zone": { + "$id": "861", + "kind": "number", + "type": { + "$ref": "184" + }, + "value": 3 + }, + "instanceCountsByState": { + "$id": "862", + "kind": "array", + "type": { + "$ref": "186" + }, + "value": [ + { + "$id": "863", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "864", + "state": { + "$id": "865", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "creating" + }, + "count": { + "$id": "866", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 100 + } + } + }, + { + "$id": "867", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "868", + "state": { + "$id": "869", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "running" + }, + "count": { + "$id": "870", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 20 + } + } + }, + { + "$id": "871", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "872", + "state": { + "$id": "873", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "deallocating" + }, + "count": { + "$id": "874", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 10 + } + } + }, + { + "$id": "875", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "876", + "state": { + "$id": "877", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "deallocated" + }, + "count": { + "$id": "878", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 100 + } + } + }, + { + "$id": "879", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "880", + "state": { + "$id": "881", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "starting" + }, + "count": { + "$id": "882", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 0 + } + } + }, + { + "$id": "883", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "884", + "state": { + "$id": "885", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "deleting" + }, + "count": { + "$id": "886", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 0 + } + } + } + ] + } + } + } + ] + }, + "provisioningState": { + "$id": "887", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + } + } + }, + "id": { + "$id": "888", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool/runtimeViews/latest" + }, + "name": { + "$id": "889", + "kind": "string", + "type": { + "$id": "890", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "pool" + }, + "type": { + "$id": "891", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools/runtimeViews" + }, + "systemData": { + "$id": "892", + "kind": "model", + "type": { + "$ref": "68" + }, + "value": { + "$id": "893", + "createdBy": { + "$id": "894", + "kind": "string", + "type": { + "$ref": "70" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "895", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "896", + "kind": "string", + "type": { + "$ref": "73" + }, + "value": "2024-02-14T23:31:59.679Z" + }, + "lastModifiedBy": { + "$id": "897", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "898", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "899", + "kind": "string", + "type": { + "$ref": "79" + }, + "value": "2024-02-14T23:31:59.679Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "900", + "Name": "listByStandbyPool", + "ResourceName": "StandbyVirtualMachinePoolRuntimeViewResource", + "Doc": "List StandbyVirtualMachinePoolRuntimeViewResource resources by StandbyVirtualMachinePoolResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "901", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "902", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "903", + "Type": { + "$id": "904", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "905", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "906", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "907", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "908", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "909", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "910", + "Name": "standbyVirtualMachinePoolName", + "NameInRequest": "standbyVirtualMachinePoolName", + "Doc": "Name of the standby virtual machine pool", + "Type": { + "$id": "911", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "912", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "913", + "kind": "constant", + "valueType": { + "$id": "914", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "915", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "188" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}/runtimeViews", + "BufferResponse": true, + "Paging": { + "$id": "916", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViews.listByStandbyPool", + "Decorators": [], + "Examples": [ + { + "$id": "917", + "kind": "http", + "name": "StandbyVirtualMachinePoolRuntimeViews_ListByStandbyPool", + "description": "StandbyVirtualMachinePoolRuntimeViews_ListByStandbyPool", + "filePath": "2024-03-01/StandbyVirtualMachinePoolRuntimeViews_ListByStandbyPool.json", + "parameters": [ + { + "$id": "918", + "parameter": { + "$ref": "901" + }, + "value": { + "$id": "919", + "kind": "string", + "type": { + "$ref": "902" + }, + "value": "2024-03-01" + } + }, + { + "$id": "920", + "parameter": { + "$ref": "905" + }, + "value": { + "$id": "921", + "kind": "string", + "type": { + "$ref": "906" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "922", + "parameter": { + "$ref": "908" + }, + "value": { + "$id": "923", + "kind": "string", + "type": { + "$ref": "909" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "924", + "parameter": { + "$ref": "910" + }, + "value": { + "$id": "925", + "kind": "string", + "type": { + "$ref": "911" + }, + "value": "pool" + } + } + ], + "responses": [ + { + "$id": "926", + "response": { + "$ref": "915" + }, + "statusCode": 200, + "bodyValue": { + "$id": "927", + "kind": "model", + "type": { + "$ref": "188" + }, + "value": { + "$id": "928", + "value": { + "$id": "929", + "kind": "array", + "type": { + "$ref": "190" + }, + "value": [ + { + "$id": "930", + "kind": "model", + "type": { + "$ref": "177" + }, + "value": { + "$id": "931", + "properties": { + "$id": "932", + "kind": "model", + "type": { + "$ref": "179" + }, + "value": { + "$id": "933", + "instanceCountSummary": { + "$id": "934", + "kind": "array", + "type": { + "$ref": "181" + }, + "value": [ + { + "$id": "935", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "936", + "zone": { + "$id": "937", + "kind": "number", + "type": { + "$ref": "184" + }, + "value": 1 + }, + "instanceCountsByState": { + "$id": "938", + "kind": "array", + "type": { + "$ref": "186" + }, + "value": [ + { + "$id": "939", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "940", + "state": { + "$id": "941", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "creating" + }, + "count": { + "$id": "942", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 100 + } + } + }, + { + "$id": "943", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "944", + "state": { + "$id": "945", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "running" + }, + "count": { + "$id": "946", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 20 + } + } + }, + { + "$id": "947", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "948", + "state": { + "$id": "949", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "deallocating" + }, + "count": { + "$id": "950", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 10 + } + } + }, + { + "$id": "951", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "952", + "state": { + "$id": "953", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "deallocated" + }, + "count": { + "$id": "954", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 100 + } + } + }, + { + "$id": "955", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "956", + "state": { + "$id": "957", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "starting" + }, + "count": { + "$id": "958", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 0 + } + } + }, + { + "$id": "959", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "960", + "state": { + "$id": "961", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "deleting" + }, + "count": { + "$id": "962", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 0 + } + } + } + ] + } + } + }, + { + "$id": "963", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "964", + "zone": { + "$id": "965", + "kind": "number", + "type": { + "$ref": "184" + }, + "value": 2 + }, + "instanceCountsByState": { + "$id": "966", + "kind": "array", + "type": { + "$ref": "186" + }, + "value": [ + { + "$id": "967", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "968", + "state": { + "$id": "969", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "creating" + }, + "count": { + "$id": "970", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 100 + } + } + }, + { + "$id": "971", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "972", + "state": { + "$id": "973", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "running" + }, + "count": { + "$id": "974", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 20 + } + } + }, + { + "$id": "975", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "976", + "state": { + "$id": "977", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "deallocating" + }, + "count": { + "$id": "978", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 10 + } + } + }, + { + "$id": "979", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "980", + "state": { + "$id": "981", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "deallocated" + }, + "count": { + "$id": "982", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 100 + } + } + }, + { + "$id": "983", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "984", + "state": { + "$id": "985", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "starting" + }, + "count": { + "$id": "986", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 0 + } + } + }, + { + "$id": "987", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "988", + "state": { + "$id": "989", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "deleting" + }, + "count": { + "$id": "990", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 0 + } + } + } + ] + } + } + }, + { + "$id": "991", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "992", + "zone": { + "$id": "993", + "kind": "number", + "type": { + "$ref": "184" + }, + "value": 3 + }, + "instanceCountsByState": { + "$id": "994", + "kind": "array", + "type": { + "$ref": "186" + }, + "value": [ + { + "$id": "995", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "996", + "state": { + "$id": "997", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "creating" + }, + "count": { + "$id": "998", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 100 + } + } + }, + { + "$id": "999", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "1000", + "state": { + "$id": "1001", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "running" + }, + "count": { + "$id": "1002", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 20 + } + } + }, + { + "$id": "1003", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "1004", + "state": { + "$id": "1005", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "deallocating" + }, + "count": { + "$id": "1006", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 10 + } + } + }, + { + "$id": "1007", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "1008", + "state": { + "$id": "1009", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "deallocated" + }, + "count": { + "$id": "1010", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 100 + } + } + }, + { + "$id": "1011", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "1012", + "state": { + "$id": "1013", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "starting" + }, + "count": { + "$id": "1014", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 0 + } + } + }, + { + "$id": "1015", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "1016", + "state": { + "$id": "1017", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "deleting" + }, + "count": { + "$id": "1018", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 0 + } + } + } + ] + } + } + } + ] + }, + "provisioningState": { + "$id": "1019", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + } + } + }, + "id": { + "$id": "1020", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool/runtimeViews/latest" + }, + "name": { + "$id": "1021", + "kind": "string", + "type": { + "$ref": "890" + }, + "value": "pool" + }, + "type": { + "$id": "1022", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools/runtimeViews" + }, + "systemData": { + "$id": "1023", + "kind": "model", + "type": { + "$ref": "68" + }, + "value": { + "$id": "1024", + "createdBy": { + "$id": "1025", + "kind": "string", + "type": { + "$ref": "70" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1026", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "1027", + "kind": "string", + "type": { + "$ref": "73" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1028", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1029", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1030", + "kind": "string", + "type": { + "$ref": "79" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "1031", + "kind": "string", + "type": { + "$ref": "192" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "1032" + }, + "Parent": "StandbyPoolClient", + "Parameters": [ + { + "$id": "1033", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "1034", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "1035", + "Type": { + "$id": "1036", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "1037", + "Name": "StandbyContainerGroupPools", + "Operations": [ + { + "$id": "1038", + "Name": "get", + "ResourceName": "StandbyContainerGroupPoolResource", + "Doc": "Get a StandbyContainerGroupPoolResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1039", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1040", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1041", + "Type": { + "$id": "1042", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1043", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1044", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1045", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1046", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1047", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1048", + "Name": "standbyContainerGroupPoolName", + "NameInRequest": "standbyContainerGroupPoolName", + "Doc": "Name of the standby container group pool", + "Type": { + "$id": "1049", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1050", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1051", + "kind": "constant", + "valueType": { + "$id": "1052", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1053", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "118" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools.get", + "Decorators": [], + "Examples": [ + { + "$id": "1054", + "kind": "http", + "name": "StandbyContainerGroupPools_Get", + "description": "StandbyContainerGroupPools_Get", + "filePath": "2024-03-01/StandbyContainerGroupPools_Get.json", + "parameters": [ + { + "$id": "1055", + "parameter": { + "$ref": "1039" + }, + "value": { + "$id": "1056", + "kind": "string", + "type": { + "$ref": "1040" + }, + "value": "2024-03-01" + } + }, + { + "$id": "1057", + "parameter": { + "$ref": "1043" + }, + "value": { + "$id": "1058", + "kind": "string", + "type": { + "$ref": "1044" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1059", + "parameter": { + "$ref": "1046" + }, + "value": { + "$id": "1060", + "kind": "string", + "type": { + "$ref": "1047" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1061", + "parameter": { + "$ref": "1048" + }, + "value": { + "$id": "1062", + "kind": "string", + "type": { + "$ref": "1049" + }, + "value": "pool" + } + } + ], + "responses": [ + { + "$id": "1063", + "response": { + "$ref": "1053" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1064", + "kind": "model", + "type": { + "$ref": "118" + }, + "value": { + "$id": "1065", + "properties": { + "$id": "1066", + "kind": "model", + "type": { + "$ref": "127" + }, + "value": { + "$id": "1067", + "elasticityProfile": { + "$id": "1068", + "kind": "model", + "type": { + "$ref": "129" + }, + "value": { + "$id": "1069", + "maxReadyCapacity": { + "$id": "1070", + "kind": "number", + "type": { + "$ref": "131" + }, + "value": 688 + }, + "refillPolicy": { + "$id": "1071", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "always" + } + } + }, + "provisioningState": { + "$id": "1072", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + }, + "containerGroupProperties": { + "$id": "1073", + "kind": "model", + "type": { + "$ref": "134" + }, + "value": { + "$id": "1074", + "containerGroupProfile": { + "$id": "1075", + "kind": "model", + "type": { + "$ref": "136" + }, + "value": { + "$id": "1076", + "id": { + "$id": "1077", + "kind": "string", + "type": { + "$ref": "138" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1078", + "kind": "number", + "type": { + "$ref": "141" + }, + "value": 1 + } + } + }, + "subnetIds": { + "$id": "1079", + "kind": "array", + "type": { + "$ref": "143" + }, + "value": [ + { + "$id": "1080", + "kind": "model", + "type": { + "$ref": "144" + }, + "value": { + "$id": "1081", + "id": { + "$id": "1082", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + } + } + }, + "tags": { + "$id": "1083", + "kind": "dict", + "type": { + "$ref": "121" + }, + "value": { + "$id": "1084" + } + }, + "location": { + "$id": "1085", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "West US" + }, + "id": { + "$id": "1086", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool" + }, + "name": { + "$id": "1087", + "kind": "string", + "type": { + "$id": "1088", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "pool" + }, + "type": { + "$id": "1089", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools" + }, + "systemData": { + "$id": "1090", + "kind": "model", + "type": { + "$ref": "68" + }, + "value": { + "$id": "1091", + "createdBy": { + "$id": "1092", + "kind": "string", + "type": { + "$ref": "70" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1093", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "1094", + "kind": "string", + "type": { + "$ref": "73" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1095", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1096", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1097", + "kind": "string", + "type": { + "$ref": "79" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1098", + "Name": "createOrUpdate", + "ResourceName": "StandbyContainerGroupPoolResource", + "Doc": "Create a StandbyContainerGroupPoolResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1099", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1100", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1101", + "Type": { + "$id": "1102", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1103", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1104", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1105", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1106", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1107", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1108", + "Name": "standbyContainerGroupPoolName", + "NameInRequest": "standbyContainerGroupPoolName", + "Doc": "Name of the standby container group pool", + "Type": { + "$id": "1109", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1110", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "1111", + "kind": "constant", + "valueType": { + "$id": "1112", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1113", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1114", + "kind": "constant", + "valueType": { + "$id": "1115", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1116", + "Name": "resource", + "NameInRequest": "resource", + "Doc": "Resource create parameters.", + "Type": { + "$ref": "118" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1117", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "118" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + }, + { + "$id": "1118", + "StatusCodes": [ + 201 + ], + "BodyType": { + "$ref": "118" + }, + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "1119", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "1120", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "1121", + "FinalStateVia": 0, + "FinalResponse": { + "$id": "1122", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "118" + }, + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools.createOrUpdate", + "Decorators": [ + { + "$id": "1123", + "name": "Azure.Core.@useFinalStateVia", + "arguments": { + "$id": "1124", + "finalState": "azure-async-operation" + } + } + ], + "Examples": [ + { + "$id": "1125", + "kind": "http", + "name": "StandbyContainerGroupPools_CreateOrUpdate", + "description": "StandbyContainerGroupPools_CreateOrUpdate", + "filePath": "2024-03-01/StandbyContainerGroupPools_CreateOrUpdate.json", + "parameters": [ + { + "$id": "1126", + "parameter": { + "$ref": "1099" + }, + "value": { + "$id": "1127", + "kind": "string", + "type": { + "$ref": "1100" + }, + "value": "2024-03-01" + } + }, + { + "$id": "1128", + "parameter": { + "$ref": "1103" + }, + "value": { + "$id": "1129", + "kind": "string", + "type": { + "$ref": "1104" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1130", + "parameter": { + "$ref": "1106" + }, + "value": { + "$id": "1131", + "kind": "string", + "type": { + "$ref": "1107" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1132", + "parameter": { + "$ref": "1108" + }, + "value": { + "$id": "1133", + "kind": "string", + "type": { + "$ref": "1109" + }, + "value": "pool" + } + }, + { + "$id": "1134", + "parameter": { + "$ref": "1116" + }, + "value": { + "$id": "1135", + "kind": "model", + "type": { + "$ref": "118" + }, + "value": { + "$id": "1136", + "properties": { + "$id": "1137", + "kind": "model", + "type": { + "$ref": "127" + }, + "value": { + "$id": "1138", + "elasticityProfile": { + "$id": "1139", + "kind": "model", + "type": { + "$ref": "129" + }, + "value": { + "$id": "1140", + "maxReadyCapacity": { + "$id": "1141", + "kind": "number", + "type": { + "$ref": "131" + }, + "value": 688 + }, + "refillPolicy": { + "$id": "1142", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "always" + } + } + }, + "containerGroupProperties": { + "$id": "1143", + "kind": "model", + "type": { + "$ref": "134" + }, + "value": { + "$id": "1144", + "containerGroupProfile": { + "$id": "1145", + "kind": "model", + "type": { + "$ref": "136" + }, + "value": { + "$id": "1146", + "id": { + "$id": "1147", + "kind": "string", + "type": { + "$ref": "138" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1148", + "kind": "number", + "type": { + "$ref": "141" + }, + "value": 1 + } + } + }, + "subnetIds": { + "$id": "1149", + "kind": "array", + "type": { + "$ref": "143" + }, + "value": [ + { + "$id": "1150", + "kind": "model", + "type": { + "$ref": "144" + }, + "value": { + "$id": "1151", + "id": { + "$id": "1152", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + } + } + }, + "tags": { + "$id": "1153", + "kind": "dict", + "type": { + "$ref": "121" + }, + "value": { + "$id": "1154" + } + }, + "location": { + "$id": "1155", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "West US" + } + } + } + } + ], + "responses": [ + { + "$id": "1156", + "response": { + "$ref": "1117" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1157", + "kind": "model", + "type": { + "$ref": "118" + }, + "value": { + "$id": "1158", + "properties": { + "$id": "1159", + "kind": "model", + "type": { + "$ref": "127" + }, + "value": { + "$id": "1160", + "elasticityProfile": { + "$id": "1161", + "kind": "model", + "type": { + "$ref": "129" + }, + "value": { + "$id": "1162", + "maxReadyCapacity": { + "$id": "1163", + "kind": "number", + "type": { + "$ref": "131" + }, + "value": 688 + }, + "refillPolicy": { + "$id": "1164", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "always" + } + } + }, + "provisioningState": { + "$id": "1165", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + }, + "containerGroupProperties": { + "$id": "1166", + "kind": "model", + "type": { + "$ref": "134" + }, + "value": { + "$id": "1167", + "containerGroupProfile": { + "$id": "1168", + "kind": "model", + "type": { + "$ref": "136" + }, + "value": { + "$id": "1169", + "id": { + "$id": "1170", + "kind": "string", + "type": { + "$ref": "138" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1171", + "kind": "number", + "type": { + "$ref": "141" + }, + "value": 1 + } + } + }, + "subnetIds": { + "$id": "1172", + "kind": "array", + "type": { + "$ref": "143" + }, + "value": [ + { + "$id": "1173", + "kind": "model", + "type": { + "$ref": "144" + }, + "value": { + "$id": "1174", + "id": { + "$id": "1175", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + } + } + }, + "tags": { + "$id": "1176", + "kind": "dict", + "type": { + "$ref": "121" + }, + "value": { + "$id": "1177" + } + }, + "location": { + "$id": "1178", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "West US" + }, + "id": { + "$id": "1179", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool" + }, + "name": { + "$id": "1180", + "kind": "string", + "type": { + "$ref": "1088" + }, + "value": "pool" + }, + "type": { + "$id": "1181", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools" + }, + "systemData": { + "$id": "1182", + "kind": "model", + "type": { + "$ref": "68" + }, + "value": { + "$id": "1183", + "createdBy": { + "$id": "1184", + "kind": "string", + "type": { + "$ref": "70" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1185", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "1186", + "kind": "string", + "type": { + "$ref": "73" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1187", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1188", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1189", + "kind": "string", + "type": { + "$ref": "79" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + }, + { + "$id": "1190", + "response": { + "$ref": "1118" + }, + "statusCode": 201, + "bodyValue": { + "$id": "1191", + "kind": "model", + "type": { + "$ref": "118" + }, + "value": { + "$id": "1192", + "properties": { + "$id": "1193", + "kind": "model", + "type": { + "$ref": "127" + }, + "value": { + "$id": "1194", + "elasticityProfile": { + "$id": "1195", + "kind": "model", + "type": { + "$ref": "129" + }, + "value": { + "$id": "1196", + "maxReadyCapacity": { + "$id": "1197", + "kind": "number", + "type": { + "$ref": "131" + }, + "value": 688 + }, + "refillPolicy": { + "$id": "1198", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "always" + } + } + }, + "provisioningState": { + "$id": "1199", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + }, + "containerGroupProperties": { + "$id": "1200", + "kind": "model", + "type": { + "$ref": "134" + }, + "value": { + "$id": "1201", + "containerGroupProfile": { + "$id": "1202", + "kind": "model", + "type": { + "$ref": "136" + }, + "value": { + "$id": "1203", + "id": { + "$id": "1204", + "kind": "string", + "type": { + "$ref": "138" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1205", + "kind": "number", + "type": { + "$ref": "141" + }, + "value": 1 + } + } + }, + "subnetIds": { + "$id": "1206", + "kind": "array", + "type": { + "$ref": "143" + }, + "value": [ + { + "$id": "1207", + "kind": "model", + "type": { + "$ref": "144" + }, + "value": { + "$id": "1208", + "id": { + "$id": "1209", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + } + } + }, + "tags": { + "$id": "1210", + "kind": "dict", + "type": { + "$ref": "121" + }, + "value": { + "$id": "1211" + } + }, + "location": { + "$id": "1212", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "West US" + }, + "id": { + "$id": "1213", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool" + }, + "name": { + "$id": "1214", + "kind": "string", + "type": { + "$ref": "1088" + }, + "value": "pool" + }, + "type": { + "$id": "1215", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools" + }, + "systemData": { + "$id": "1216", + "kind": "model", + "type": { + "$ref": "68" + }, + "value": { + "$id": "1217", + "createdBy": { + "$id": "1218", + "kind": "string", + "type": { + "$ref": "70" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1219", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "1220", + "kind": "string", + "type": { + "$ref": "73" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1221", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1222", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1223", + "kind": "string", + "type": { + "$ref": "79" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1224", + "Name": "delete", + "ResourceName": "StandbyContainerGroupPoolResource", + "Doc": "Delete a StandbyContainerGroupPoolResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1225", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1226", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1227", + "Type": { + "$id": "1228", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1229", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1230", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1231", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1232", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1233", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1234", + "Name": "standbyContainerGroupPoolName", + "NameInRequest": "standbyContainerGroupPoolName", + "Doc": "Name of the standby container group pool", + "Type": { + "$id": "1235", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1236", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1237", + "kind": "constant", + "valueType": { + "$id": "1238", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1239", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "1240", + "Name": "location", + "NameInResponse": "Location", + "Doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "Type": { + "$id": "1241", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1242", + "Name": "retryAfter", + "NameInResponse": "Retry-After", + "Doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "Type": { + "$id": "1243", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "IsErrorResponse": false + }, + { + "$id": "1244", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "DELETE", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}", + "BufferResponse": true, + "LongRunning": { + "$id": "1245", + "FinalStateVia": 1, + "FinalResponse": { + "$id": "1246", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools.delete", + "Decorators": [], + "Examples": [ + { + "$id": "1247", + "kind": "http", + "name": "StandbyContainerGroupPools_Delete", + "description": "StandbyContainerGroupPools_Delete", + "filePath": "2024-03-01/StandbyContainerGroupPools_Delete.json", + "parameters": [ + { + "$id": "1248", + "parameter": { + "$ref": "1225" + }, + "value": { + "$id": "1249", + "kind": "string", + "type": { + "$ref": "1226" + }, + "value": "2024-03-01" + } + }, + { + "$id": "1250", + "parameter": { + "$ref": "1229" + }, + "value": { + "$id": "1251", + "kind": "string", + "type": { + "$ref": "1230" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1252", + "parameter": { + "$ref": "1232" + }, + "value": { + "$id": "1253", + "kind": "string", + "type": { + "$ref": "1233" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1254", + "parameter": { + "$ref": "1234" + }, + "value": { + "$id": "1255", + "kind": "string", + "type": { + "$ref": "1235" + }, + "value": "pool" + } + } + ], + "responses": [ + { + "$id": "1256", + "response": { + "$ref": "1239" + }, + "statusCode": 202 + }, + { + "$id": "1257", + "response": { + "$ref": "1244" + }, + "statusCode": 204 + } + ] + } + ] + }, + { + "$id": "1258", + "Name": "update", + "ResourceName": "StandbyContainerGroupPoolResource", + "Doc": "Update a StandbyContainerGroupPoolResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1259", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1260", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1261", + "Type": { + "$id": "1262", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1263", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1264", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1265", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1266", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1267", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1268", + "Name": "standbyContainerGroupPoolName", + "NameInRequest": "standbyContainerGroupPoolName", + "Doc": "Name of the standby container group pool", + "Type": { + "$id": "1269", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1270", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Doc": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "1271", + "kind": "constant", + "valueType": { + "$id": "1272", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1273", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1274", + "kind": "constant", + "valueType": { + "$id": "1275", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1276", + "Name": "properties", + "NameInRequest": "properties", + "Doc": "The resource properties to be updated.", + "Type": { + "$ref": "162" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1277", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "118" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools.update", + "Decorators": [], + "Examples": [ + { + "$id": "1278", + "kind": "http", + "name": "StandbyContainerGroupPools_Update", + "description": "StandbyContainerGroupPools_Update", + "filePath": "2024-03-01/StandbyContainerGroupPools_Update.json", + "parameters": [ + { + "$id": "1279", + "parameter": { + "$ref": "1259" + }, + "value": { + "$id": "1280", + "kind": "string", + "type": { + "$ref": "1260" + }, + "value": "2024-03-01" + } + }, + { + "$id": "1281", + "parameter": { + "$ref": "1263" + }, + "value": { + "$id": "1282", + "kind": "string", + "type": { + "$ref": "1264" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1283", + "parameter": { + "$ref": "1266" + }, + "value": { + "$id": "1284", + "kind": "string", + "type": { + "$ref": "1267" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1285", + "parameter": { + "$ref": "1268" + }, + "value": { + "$id": "1286", + "kind": "string", + "type": { + "$ref": "1269" + }, + "value": "pool" + } + }, + { + "$id": "1287", + "parameter": { + "$ref": "1276" + }, + "value": { + "$id": "1288", + "kind": "model", + "type": { + "$ref": "162" + }, + "value": { + "$id": "1289", + "tags": { + "$id": "1290", + "kind": "dict", + "type": { + "$ref": "164" + }, + "value": { + "$id": "1291" + } + }, + "properties": { + "$id": "1292", + "kind": "model", + "type": { + "$ref": "168" + }, + "value": { + "$id": "1293", + "elasticityProfile": { + "$id": "1294", + "kind": "model", + "type": { + "$ref": "129" + }, + "value": { + "$id": "1295", + "maxReadyCapacity": { + "$id": "1296", + "kind": "number", + "type": { + "$ref": "131" + }, + "value": 1743 + }, + "refillPolicy": { + "$id": "1297", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "always" + } + } + }, + "containerGroupProperties": { + "$id": "1298", + "kind": "model", + "type": { + "$ref": "134" + }, + "value": { + "$id": "1299", + "containerGroupProfile": { + "$id": "1300", + "kind": "model", + "type": { + "$ref": "136" + }, + "value": { + "$id": "1301", + "id": { + "$id": "1302", + "kind": "string", + "type": { + "$ref": "138" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1303", + "kind": "number", + "type": { + "$ref": "141" + }, + "value": 2 + } + } + }, + "subnetIds": { + "$id": "1304", + "kind": "array", + "type": { + "$ref": "143" + }, + "value": [ + { + "$id": "1305", + "kind": "model", + "type": { + "$ref": "144" + }, + "value": { + "$id": "1306", + "id": { + "$id": "1307", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "1308", + "response": { + "$ref": "1277" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1309", + "kind": "model", + "type": { + "$ref": "118" + }, + "value": { + "$id": "1310", + "properties": { + "$id": "1311", + "kind": "model", + "type": { + "$ref": "127" + }, + "value": { + "$id": "1312", + "elasticityProfile": { + "$id": "1313", + "kind": "model", + "type": { + "$ref": "129" + }, + "value": { + "$id": "1314", + "maxReadyCapacity": { + "$id": "1315", + "kind": "number", + "type": { + "$ref": "131" + }, + "value": 1743 + }, + "refillPolicy": { + "$id": "1316", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "always" + } + } + }, + "provisioningState": { + "$id": "1317", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + }, + "containerGroupProperties": { + "$id": "1318", + "kind": "model", + "type": { + "$ref": "134" + }, + "value": { + "$id": "1319", + "containerGroupProfile": { + "$id": "1320", + "kind": "model", + "type": { + "$ref": "136" + }, + "value": { + "$id": "1321", + "id": { + "$id": "1322", + "kind": "string", + "type": { + "$ref": "138" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1323", + "kind": "number", + "type": { + "$ref": "141" + }, + "value": 2 + } + } + }, + "subnetIds": { + "$id": "1324", + "kind": "array", + "type": { + "$ref": "143" + }, + "value": [ + { + "$id": "1325", + "kind": "model", + "type": { + "$ref": "144" + }, + "value": { + "$id": "1326", + "id": { + "$id": "1327", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + } + } + }, + "tags": { + "$id": "1328", + "kind": "dict", + "type": { + "$ref": "121" + }, + "value": { + "$id": "1329" + } + }, + "location": { + "$id": "1330", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "West US" + }, + "id": { + "$id": "1331", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool" + }, + "name": { + "$id": "1332", + "kind": "string", + "type": { + "$ref": "1088" + }, + "value": "pool" + }, + "type": { + "$id": "1333", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools" + }, + "systemData": { + "$id": "1334", + "kind": "model", + "type": { + "$ref": "68" + }, + "value": { + "$id": "1335", + "createdBy": { + "$id": "1336", + "kind": "string", + "type": { + "$ref": "70" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1337", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "1338", + "kind": "string", + "type": { + "$ref": "73" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1339", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1340", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1341", + "kind": "string", + "type": { + "$ref": "79" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1342", + "Name": "listByResourceGroup", + "ResourceName": "StandbyContainerGroupPoolResource", + "Doc": "List StandbyContainerGroupPoolResource resources by resource group", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1343", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1344", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1345", + "Type": { + "$id": "1346", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1347", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1348", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1349", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1350", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1351", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1352", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1353", + "kind": "constant", + "valueType": { + "$id": "1354", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1355", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "171" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools", + "BufferResponse": true, + "Paging": { + "$id": "1356", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools.listByResourceGroup", + "Decorators": [], + "Examples": [ + { + "$id": "1357", + "kind": "http", + "name": "StandbyContainerGroupPools_ListByResourceGroup", + "description": "StandbyContainerGroupPools_ListByResourceGroup", + "filePath": "2024-03-01/StandbyContainerGroupPools_ListByResourceGroup.json", + "parameters": [ + { + "$id": "1358", + "parameter": { + "$ref": "1343" + }, + "value": { + "$id": "1359", + "kind": "string", + "type": { + "$ref": "1344" + }, + "value": "2024-03-01" + } + }, + { + "$id": "1360", + "parameter": { + "$ref": "1347" + }, + "value": { + "$id": "1361", + "kind": "string", + "type": { + "$ref": "1348" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1362", + "parameter": { + "$ref": "1350" + }, + "value": { + "$id": "1363", + "kind": "string", + "type": { + "$ref": "1351" + }, + "value": "rgstandbypool" + } + } + ], + "responses": [ + { + "$id": "1364", + "response": { + "$ref": "1355" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1365", + "kind": "model", + "type": { + "$ref": "171" + }, + "value": { + "$id": "1366", + "value": { + "$id": "1367", + "kind": "array", + "type": { + "$ref": "173" + }, + "value": [ + { + "$id": "1368", + "kind": "model", + "type": { + "$ref": "118" + }, + "value": { + "$id": "1369", + "properties": { + "$id": "1370", + "kind": "model", + "type": { + "$ref": "127" + }, + "value": { + "$id": "1371", + "elasticityProfile": { + "$id": "1372", + "kind": "model", + "type": { + "$ref": "129" + }, + "value": { + "$id": "1373", + "maxReadyCapacity": { + "$id": "1374", + "kind": "number", + "type": { + "$ref": "131" + }, + "value": 688 + }, + "refillPolicy": { + "$id": "1375", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "always" + } + } + }, + "provisioningState": { + "$id": "1376", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + }, + "containerGroupProperties": { + "$id": "1377", + "kind": "model", + "type": { + "$ref": "134" + }, + "value": { + "$id": "1378", + "containerGroupProfile": { + "$id": "1379", + "kind": "model", + "type": { + "$ref": "136" + }, + "value": { + "$id": "1380", + "id": { + "$id": "1381", + "kind": "string", + "type": { + "$ref": "138" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1382", + "kind": "number", + "type": { + "$ref": "141" + }, + "value": 1 + } + } + }, + "subnetIds": { + "$id": "1383", + "kind": "array", + "type": { + "$ref": "143" + }, + "value": [ + { + "$id": "1384", + "kind": "model", + "type": { + "$ref": "144" + }, + "value": { + "$id": "1385", + "id": { + "$id": "1386", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + } + } + }, + "tags": { + "$id": "1387", + "kind": "dict", + "type": { + "$ref": "121" + }, + "value": { + "$id": "1388" + } + }, + "location": { + "$id": "1389", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "West US" + }, + "id": { + "$id": "1390", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool" + }, + "name": { + "$id": "1391", + "kind": "string", + "type": { + "$ref": "1088" + }, + "value": "pool" + }, + "type": { + "$id": "1392", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools" + }, + "systemData": { + "$id": "1393", + "kind": "model", + "type": { + "$ref": "68" + }, + "value": { + "$id": "1394", + "createdBy": { + "$id": "1395", + "kind": "string", + "type": { + "$ref": "70" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1396", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "1397", + "kind": "string", + "type": { + "$ref": "73" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1398", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1399", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1400", + "kind": "string", + "type": { + "$ref": "79" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "1401", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + }, + { + "$id": "1402", + "Name": "listBySubscription", + "ResourceName": "StandbyContainerGroupPoolResource", + "Doc": "List StandbyContainerGroupPoolResource resources by subscription ID", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1403", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1404", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1405", + "Type": { + "$id": "1406", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1407", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1408", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1409", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1410", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1411", + "kind": "constant", + "valueType": { + "$id": "1412", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1413", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "171" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/providers/Microsoft.StandbyPool/standbyContainerGroupPools", + "BufferResponse": true, + "Paging": { + "$id": "1414", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools.listBySubscription", + "Decorators": [], + "Examples": [ + { + "$id": "1415", + "kind": "http", + "name": "StandbyContainerGroupPools_ListBySubscription", + "description": "StandbyContainerGroupPools_ListBySubscription", + "filePath": "2024-03-01/StandbyContainerGroupPools_ListBySubscription.json", + "parameters": [ + { + "$id": "1416", + "parameter": { + "$ref": "1403" + }, + "value": { + "$id": "1417", + "kind": "string", + "type": { + "$ref": "1404" + }, + "value": "2024-03-01" + } + }, + { + "$id": "1418", + "parameter": { + "$ref": "1407" + }, + "value": { + "$id": "1419", + "kind": "string", + "type": { + "$ref": "1408" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + } + ], + "responses": [ + { + "$id": "1420", + "response": { + "$ref": "1413" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1421", + "kind": "model", + "type": { + "$ref": "171" + }, + "value": { + "$id": "1422", + "value": { + "$id": "1423", + "kind": "array", + "type": { + "$ref": "173" + }, + "value": [ + { + "$id": "1424", + "kind": "model", + "type": { + "$ref": "118" + }, + "value": { + "$id": "1425", + "properties": { + "$id": "1426", + "kind": "model", + "type": { + "$ref": "127" + }, + "value": { + "$id": "1427", + "elasticityProfile": { + "$id": "1428", + "kind": "model", + "type": { + "$ref": "129" + }, + "value": { + "$id": "1429", + "maxReadyCapacity": { + "$id": "1430", + "kind": "number", + "type": { + "$ref": "131" + }, + "value": 688 + }, + "refillPolicy": { + "$id": "1431", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "always" + } + } + }, + "provisioningState": { + "$id": "1432", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + }, + "containerGroupProperties": { + "$id": "1433", + "kind": "model", + "type": { + "$ref": "134" + }, + "value": { + "$id": "1434", + "containerGroupProfile": { + "$id": "1435", + "kind": "model", + "type": { + "$ref": "136" + }, + "value": { + "$id": "1436", + "id": { + "$id": "1437", + "kind": "string", + "type": { + "$ref": "138" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1438", + "kind": "number", + "type": { + "$ref": "141" + }, + "value": 1 + } + } + }, + "subnetIds": { + "$id": "1439", + "kind": "array", + "type": { + "$ref": "143" + }, + "value": [ + { + "$id": "1440", + "kind": "model", + "type": { + "$ref": "144" + }, + "value": { + "$id": "1441", + "id": { + "$id": "1442", + "kind": "string", + "type": { + "$ref": "146" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + } + } + }, + "tags": { + "$id": "1443", + "kind": "dict", + "type": { + "$ref": "121" + }, + "value": { + "$id": "1444" + } + }, + "location": { + "$id": "1445", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "West US" + }, + "id": { + "$id": "1446", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool" + }, + "name": { + "$id": "1447", + "kind": "string", + "type": { + "$ref": "1088" + }, + "value": "pool" + }, + "type": { + "$id": "1448", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools" + }, + "systemData": { + "$id": "1449", + "kind": "model", + "type": { + "$ref": "68" + }, + "value": { + "$id": "1450", + "createdBy": { + "$id": "1451", + "kind": "string", + "type": { + "$ref": "70" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1452", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "1453", + "kind": "string", + "type": { + "$ref": "73" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1454", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1455", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1456", + "kind": "string", + "type": { + "$ref": "79" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "1457", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "1458" + }, + "Parent": "StandbyPoolClient", + "Parameters": [ + { + "$id": "1459", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "1460", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "1461", + "Type": { + "$id": "1462", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + }, + { + "$id": "1463", + "Name": "StandbyContainerGroupPoolRuntimeViews", + "Operations": [ + { + "$id": "1464", + "Name": "get", + "ResourceName": "StandbyContainerGroupPoolRuntimeViewResource", + "Doc": "Get a StandbyContainerGroupPoolRuntimeViewResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1465", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1466", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1467", + "Type": { + "$id": "1468", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1469", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1470", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1471", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1472", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1473", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1474", + "Name": "standbyContainerGroupPoolName", + "NameInRequest": "standbyContainerGroupPoolName", + "Doc": "Name of the standby container group pool", + "Type": { + "$id": "1475", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1476", + "Name": "runtimeView", + "NameInRequest": "runtimeView", + "Doc": "The unique identifier for the runtime view. The input string should be the word 'latest', which will get the latest runtime view of the pool, otherwise the request will fail with NotFound exception.", + "Type": { + "$id": "1477", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1478", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1479", + "kind": "constant", + "valueType": { + "$id": "1480", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1481", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "56" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}/runtimeViews/{runtimeView}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViews.get", + "Decorators": [], + "Examples": [ + { + "$id": "1482", + "kind": "http", + "name": "StandbyContainerGroupPoolRuntimeViews_Get", + "description": "StandbyContainerGroupPoolRuntimeViews_Get", + "filePath": "2024-03-01/StandbyContainerGroupPoolRuntimeViews_Get.json", + "parameters": [ + { + "$id": "1483", + "parameter": { + "$ref": "1465" + }, + "value": { + "$id": "1484", + "kind": "string", + "type": { + "$ref": "1466" + }, + "value": "2024-03-01" + } + }, + { + "$id": "1485", + "parameter": { + "$ref": "1469" + }, + "value": { + "$id": "1486", + "kind": "string", + "type": { + "$ref": "1470" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1487", + "parameter": { + "$ref": "1472" + }, + "value": { + "$id": "1488", + "kind": "string", + "type": { + "$ref": "1473" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1489", + "parameter": { + "$ref": "1474" + }, + "value": { + "$id": "1490", + "kind": "string", + "type": { + "$ref": "1475" + }, + "value": "pool" + } + }, + { + "$id": "1491", + "parameter": { + "$ref": "1476" + }, + "value": { + "$id": "1492", + "kind": "string", + "type": { + "$ref": "1477" + }, + "value": "latest" + } + } + ], + "responses": [ + { + "$id": "1493", + "response": { + "$ref": "1481" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1494", + "kind": "model", + "type": { + "$ref": "56" + }, + "value": { + "$id": "1495", + "properties": { + "$id": "1496", + "kind": "model", + "type": { + "$ref": "82" + }, + "value": { + "$id": "1497", + "instanceCountSummary": { + "$id": "1498", + "kind": "array", + "type": { + "$ref": "84" + }, + "value": [ + { + "$id": "1499", + "kind": "model", + "type": { + "$ref": "85" + }, + "value": { + "$id": "1500", + "instanceCountsByState": { + "$id": "1501", + "kind": "array", + "type": { + "$ref": "87" + }, + "value": [ + { + "$id": "1502", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "1503", + "state": { + "$id": "1504", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "creating" + }, + "count": { + "$id": "1505", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 100 + } + } + }, + { + "$id": "1506", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "1507", + "state": { + "$id": "1508", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "running" + }, + "count": { + "$id": "1509", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 500 + } + } + }, + { + "$id": "1510", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "1511", + "state": { + "$id": "1512", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "deleting" + }, + "count": { + "$id": "1513", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 20 + } + } + } + ] + } + } + } + ] + }, + "provisioningState": { + "$id": "1514", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + } + } + }, + "id": { + "$id": "1515", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool/runtimeViews/latest" + }, + "name": { + "$id": "1516", + "kind": "string", + "type": { + "$id": "1517", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "pool" + }, + "type": { + "$id": "1518", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools/runtimeViews" + }, + "systemData": { + "$id": "1519", + "kind": "model", + "type": { + "$ref": "68" + }, + "value": { + "$id": "1520", + "createdBy": { + "$id": "1521", + "kind": "string", + "type": { + "$ref": "70" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1522", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "1523", + "kind": "string", + "type": { + "$ref": "73" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1524", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1525", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1526", + "kind": "string", + "type": { + "$ref": "79" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1527", + "Name": "listByStandbyPool", + "ResourceName": "StandbyContainerGroupPoolRuntimeViewResource", + "Doc": "List StandbyContainerGroupPoolRuntimeViewResource resources by StandbyContainerGroupPoolResource", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1528", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Doc": "The API version to use for this operation.", + "Type": { + "$id": "1529", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1530", + "Type": { + "$id": "1531", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-03-01" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1532", + "Name": "subscriptionId", + "NameInRequest": "subscriptionId", + "Doc": "The ID of the target subscription. The value must be an UUID.", + "Type": { + "$id": "1533", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1534", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1535", + "Name": "resourceGroupName", + "NameInRequest": "resourceGroupName", + "Doc": "The name of the resource group. The name is case insensitive.", + "Type": { + "$id": "1536", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1537", + "Name": "standbyContainerGroupPoolName", + "NameInRequest": "standbyContainerGroupPoolName", + "Doc": "Name of the standby container group pool", + "Type": { + "$id": "1538", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1539", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1540", + "kind": "constant", + "valueType": { + "$id": "1541", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1542", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "112" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}/runtimeViews", + "BufferResponse": true, + "Paging": { + "$id": "1543", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViews.listByStandbyPool", + "Decorators": [], + "Examples": [ + { + "$id": "1544", + "kind": "http", + "name": "StandbyContainerGroupPoolRuntimeViews_ListByStandbyPool", + "description": "StandbyContainerGroupPoolRuntimeViews_ListByStandbyPool", + "filePath": "2024-03-01/StandbyContainerGroupPoolRuntimeViews_ListByStandbyPool.json", + "parameters": [ + { + "$id": "1545", + "parameter": { + "$ref": "1528" + }, + "value": { + "$id": "1546", + "kind": "string", + "type": { + "$ref": "1529" + }, + "value": "2024-03-01" + } + }, + { + "$id": "1547", + "parameter": { + "$ref": "1532" + }, + "value": { + "$id": "1548", + "kind": "string", + "type": { + "$ref": "1533" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1549", + "parameter": { + "$ref": "1535" + }, + "value": { + "$id": "1550", + "kind": "string", + "type": { + "$ref": "1536" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1551", + "parameter": { + "$ref": "1537" + }, + "value": { + "$id": "1552", + "kind": "string", + "type": { + "$ref": "1538" + }, + "value": "pool" + } + } + ], + "responses": [ + { + "$id": "1553", + "response": { + "$ref": "1542" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1554", + "kind": "model", + "type": { + "$ref": "112" + }, + "value": { + "$id": "1555", + "value": { + "$id": "1556", + "kind": "array", + "type": { + "$ref": "114" + }, + "value": [ + { + "$id": "1557", + "kind": "model", + "type": { + "$ref": "56" + }, + "value": { + "$id": "1558", + "properties": { + "$id": "1559", + "kind": "model", + "type": { + "$ref": "82" + }, + "value": { + "$id": "1560", + "instanceCountSummary": { + "$id": "1561", + "kind": "array", + "type": { + "$ref": "84" + }, + "value": [ + { + "$id": "1562", + "kind": "model", + "type": { + "$ref": "85" + }, + "value": { + "$id": "1563", + "instanceCountsByState": { + "$id": "1564", + "kind": "array", + "type": { + "$ref": "87" + }, + "value": [ + { + "$id": "1565", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "1566", + "state": { + "$id": "1567", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "creating" + }, + "count": { + "$id": "1568", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 100 + } + } + }, + { + "$id": "1569", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "1570", + "state": { + "$id": "1571", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "running" + }, + "count": { + "$id": "1572", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 500 + } + } + }, + { + "$id": "1573", + "kind": "model", + "type": { + "$ref": "88" + }, + "value": { + "$id": "1574", + "state": { + "$id": "1575", + "kind": "string", + "type": { + "$ref": "90" + }, + "value": "deleting" + }, + "count": { + "$id": "1576", + "kind": "number", + "type": { + "$ref": "92" + }, + "value": 20 + } + } + } + ] + } + } + } + ] + }, + "provisioningState": { + "$id": "1577", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Succeeded" + } + } + }, + "id": { + "$id": "1578", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool/runtimeViews/latest" + }, + "name": { + "$id": "1579", + "kind": "string", + "type": { + "$ref": "1517" + }, + "value": "pool" + }, + "type": { + "$id": "1580", + "kind": "string", + "type": { + "$ref": "65" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools/runtimeViews" + }, + "systemData": { + "$id": "1581", + "kind": "model", + "type": { + "$ref": "68" + }, + "value": { + "$id": "1582", + "createdBy": { + "$id": "1583", + "kind": "string", + "type": { + "$ref": "70" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1584", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "createdAt": { + "$id": "1585", + "kind": "string", + "type": { + "$ref": "73" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1586", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1587", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1588", + "kind": "string", + "type": { + "$ref": "79" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "1589", + "kind": "string", + "type": { + "$ref": "116" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + } + ], + "Protocol": { + "$id": "1590" + }, + "Parent": "StandbyPoolClient", + "Parameters": [ + { + "$id": "1591", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Doc": "Service host", + "Type": { + "$id": "1592", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "1593", + "Type": { + "$id": "1594", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "https://management.azure.com" + } + } + ], + "Decorators": [] + } + ], + "Auth": { + "$id": "1595", + "OAuth2": { + "$id": "1596", + "Scopes": [ + "user_impersonation" + ] + } + } +} diff --git a/sdk/standbypool/ci.mgmt.yml b/sdk/standbypool/ci.mgmt.yml index 0763a516e2c1..96f2908263af 100644 --- a/sdk/standbypool/ci.mgmt.yml +++ b/sdk/standbypool/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/standbypool/ci.mgmt.yml - sdk/standbypool/Azure.ResourceManager.StandbyPool/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/standbypool/ci.mgmt.yml + - sdk/standbypool/Azure.ResourceManager.StandbyPool/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/standbypool/ci.mgmt.yml + - sdk/standbypool/Azure.ResourceManager.StandbyPool/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/standbypool/ci.mgmt.yml + - sdk/standbypool/Azure.ResourceManager.StandbyPool/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/standbypool/ci.mgmt.yml + - sdk/standbypool/Azure.ResourceManager.StandbyPool/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/standbypool/ci.mgmt.yml + - sdk/standbypool/Azure.ResourceManager.StandbyPool/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/standbypool/ci.mgmt.yml + - sdk/standbypool/Azure.ResourceManager.StandbyPool/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/standbypool/ci.mgmt.yml + - sdk/standbypool/Azure.ResourceManager.StandbyPool/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/standbypool/ci.mgmt.yml + - sdk/standbypool/Azure.ResourceManager.StandbyPool/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/standbypool/ci.mgmt.yml + - sdk/standbypool/Azure.ResourceManager.StandbyPool/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/storage/ci.mgmt.yml b/sdk/storage/ci.mgmt.yml index 95bc19b325d5..0a1a4a404228 100644 --- a/sdk/storage/ci.mgmt.yml +++ b/sdk/storage/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/storage/ci.mgmt.yml - sdk/storage/Azure.ResourceManager.Storage/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storage/ci.mgmt.yml + - sdk/storage/Azure.ResourceManager.Storage/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storage/ci.mgmt.yml + - sdk/storage/Azure.ResourceManager.Storage/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storage/ci.mgmt.yml + - sdk/storage/Azure.ResourceManager.Storage/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storage/ci.mgmt.yml + - sdk/storage/Azure.ResourceManager.Storage/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storage/ci.mgmt.yml + - sdk/storage/Azure.ResourceManager.Storage/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storage/ci.mgmt.yml + - sdk/storage/Azure.ResourceManager.Storage/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storage/ci.mgmt.yml + - sdk/storage/Azure.ResourceManager.Storage/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storage/ci.mgmt.yml + - sdk/storage/Azure.ResourceManager.Storage/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storage/ci.mgmt.yml + - sdk/storage/Azure.ResourceManager.Storage/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/storageactions/ci.mgmt.yml b/sdk/storageactions/ci.mgmt.yml index 27062b4565a8..917a3c1fdd96 100644 --- a/sdk/storageactions/ci.mgmt.yml +++ b/sdk/storageactions/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/storageactions/ci.mgmt.yml - sdk/storageactions/Azure.ResourceManager.StorageActions/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storageactions/ci.mgmt.yml + - sdk/storageactions/Azure.ResourceManager.StorageActions/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storageactions/ci.mgmt.yml + - sdk/storageactions/Azure.ResourceManager.StorageActions/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storageactions/ci.mgmt.yml + - sdk/storageactions/Azure.ResourceManager.StorageActions/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storageactions/ci.mgmt.yml + - sdk/storageactions/Azure.ResourceManager.StorageActions/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storageactions/ci.mgmt.yml + - sdk/storageactions/Azure.ResourceManager.StorageActions/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storageactions/ci.mgmt.yml + - sdk/storageactions/Azure.ResourceManager.StorageActions/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storageactions/ci.mgmt.yml + - sdk/storageactions/Azure.ResourceManager.StorageActions/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storageactions/ci.mgmt.yml + - sdk/storageactions/Azure.ResourceManager.StorageActions/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storageactions/ci.mgmt.yml + - sdk/storageactions/Azure.ResourceManager.StorageActions/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/storagecache/ci.mgmt.yml b/sdk/storagecache/ci.mgmt.yml index c6abf63baf2c..b3849f7ed687 100644 --- a/sdk/storagecache/ci.mgmt.yml +++ b/sdk/storagecache/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/storagecache/ci.mgmt.yml - sdk/storagecache/Azure.ResourceManager.StorageCache/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagecache/ci.mgmt.yml + - sdk/storagecache/Azure.ResourceManager.StorageCache/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagecache/ci.mgmt.yml + - sdk/storagecache/Azure.ResourceManager.StorageCache/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagecache/ci.mgmt.yml + - sdk/storagecache/Azure.ResourceManager.StorageCache/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagecache/ci.mgmt.yml + - sdk/storagecache/Azure.ResourceManager.StorageCache/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagecache/ci.mgmt.yml + - sdk/storagecache/Azure.ResourceManager.StorageCache/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagecache/ci.mgmt.yml + - sdk/storagecache/Azure.ResourceManager.StorageCache/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagecache/ci.mgmt.yml + - sdk/storagecache/Azure.ResourceManager.StorageCache/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagecache/ci.mgmt.yml + - sdk/storagecache/Azure.ResourceManager.StorageCache/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagecache/ci.mgmt.yml + - sdk/storagecache/Azure.ResourceManager.StorageCache/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/storagemover/ci.mgmt.yml b/sdk/storagemover/ci.mgmt.yml index e9055f49e1a9..bb6059f33135 100644 --- a/sdk/storagemover/ci.mgmt.yml +++ b/sdk/storagemover/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/storagemover/ci.mgmt.yml - sdk/storagemover/Azure.ResourceManager.StorageMover/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagemover/ci.mgmt.yml + - sdk/storagemover/Azure.ResourceManager.StorageMover/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagemover/ci.mgmt.yml + - sdk/storagemover/Azure.ResourceManager.StorageMover/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagemover/ci.mgmt.yml + - sdk/storagemover/Azure.ResourceManager.StorageMover/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagemover/ci.mgmt.yml + - sdk/storagemover/Azure.ResourceManager.StorageMover/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagemover/ci.mgmt.yml + - sdk/storagemover/Azure.ResourceManager.StorageMover/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagemover/ci.mgmt.yml + - sdk/storagemover/Azure.ResourceManager.StorageMover/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagemover/ci.mgmt.yml + - sdk/storagemover/Azure.ResourceManager.StorageMover/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagemover/ci.mgmt.yml + - sdk/storagemover/Azure.ResourceManager.StorageMover/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagemover/ci.mgmt.yml + - sdk/storagemover/Azure.ResourceManager.StorageMover/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/storagepool/ci.mgmt.yml b/sdk/storagepool/ci.mgmt.yml index 2178fc390757..e36a4bd0d45b 100644 --- a/sdk/storagepool/ci.mgmt.yml +++ b/sdk/storagepool/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/storagepool/ci.mgmt.yml - sdk/storagepool/Azure.ResourceManager.StoragePool/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagepool/ci.mgmt.yml + - sdk/storagepool/Azure.ResourceManager.StoragePool/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagepool/ci.mgmt.yml + - sdk/storagepool/Azure.ResourceManager.StoragePool/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagepool/ci.mgmt.yml + - sdk/storagepool/Azure.ResourceManager.StoragePool/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagepool/ci.mgmt.yml + - sdk/storagepool/Azure.ResourceManager.StoragePool/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagepool/ci.mgmt.yml + - sdk/storagepool/Azure.ResourceManager.StoragePool/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagepool/ci.mgmt.yml + - sdk/storagepool/Azure.ResourceManager.StoragePool/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagepool/ci.mgmt.yml + - sdk/storagepool/Azure.ResourceManager.StoragePool/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagepool/ci.mgmt.yml + - sdk/storagepool/Azure.ResourceManager.StoragePool/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagepool/ci.mgmt.yml + - sdk/storagepool/Azure.ResourceManager.StoragePool/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/storagesync/ci.mgmt.yml b/sdk/storagesync/ci.mgmt.yml index a8789947c687..2a3b7859760d 100644 --- a/sdk/storagesync/ci.mgmt.yml +++ b/sdk/storagesync/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/storagesync/ci.mgmt.yml - sdk/storagesync/Azure.ResourceManager.StorageSync/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagesync/ci.mgmt.yml + - sdk/storagesync/Azure.ResourceManager.StorageSync/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagesync/ci.mgmt.yml + - sdk/storagesync/Azure.ResourceManager.StorageSync/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagesync/ci.mgmt.yml + - sdk/storagesync/Azure.ResourceManager.StorageSync/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagesync/ci.mgmt.yml + - sdk/storagesync/Azure.ResourceManager.StorageSync/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagesync/ci.mgmt.yml + - sdk/storagesync/Azure.ResourceManager.StorageSync/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagesync/ci.mgmt.yml + - sdk/storagesync/Azure.ResourceManager.StorageSync/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagesync/ci.mgmt.yml + - sdk/storagesync/Azure.ResourceManager.StorageSync/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagesync/ci.mgmt.yml + - sdk/storagesync/Azure.ResourceManager.StorageSync/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagesync/ci.mgmt.yml + - sdk/storagesync/Azure.ResourceManager.StorageSync/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/streamanalytics/ci.mgmt.yml b/sdk/streamanalytics/ci.mgmt.yml index 09d108a1a7d9..b1d7df9b1eb5 100644 --- a/sdk/streamanalytics/ci.mgmt.yml +++ b/sdk/streamanalytics/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/streamanalytics/ci.mgmt.yml - sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/streamanalytics/ci.mgmt.yml + - sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/streamanalytics/ci.mgmt.yml + - sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/streamanalytics/ci.mgmt.yml + - sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/streamanalytics/ci.mgmt.yml + - sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/streamanalytics/ci.mgmt.yml + - sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/streamanalytics/ci.mgmt.yml + - sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/streamanalytics/ci.mgmt.yml + - sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/streamanalytics/ci.mgmt.yml + - sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/streamanalytics/ci.mgmt.yml + - sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/subscription/ci.mgmt.yml b/sdk/subscription/ci.mgmt.yml index f9067b4c0af3..73fff8dbebd0 100644 --- a/sdk/subscription/ci.mgmt.yml +++ b/sdk/subscription/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/subscription/ci.mgmt.yml - sdk/subscription/Azure.ResourceManager.Subscription/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/subscription/ci.mgmt.yml + - sdk/subscription/Azure.ResourceManager.Subscription/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/subscription/ci.mgmt.yml + - sdk/subscription/Azure.ResourceManager.Subscription/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/subscription/ci.mgmt.yml + - sdk/subscription/Azure.ResourceManager.Subscription/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/subscription/ci.mgmt.yml + - sdk/subscription/Azure.ResourceManager.Subscription/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/subscription/ci.mgmt.yml + - sdk/subscription/Azure.ResourceManager.Subscription/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/subscription/ci.mgmt.yml + - sdk/subscription/Azure.ResourceManager.Subscription/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/subscription/ci.mgmt.yml + - sdk/subscription/Azure.ResourceManager.Subscription/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/subscription/ci.mgmt.yml + - sdk/subscription/Azure.ResourceManager.Subscription/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/subscription/ci.mgmt.yml + - sdk/subscription/Azure.ResourceManager.Subscription/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/support/ci.mgmt.yml b/sdk/support/ci.mgmt.yml index 5a947c4c4939..eca069b9c318 100644 --- a/sdk/support/ci.mgmt.yml +++ b/sdk/support/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/support/ci.mgmt.yml - sdk/support/Azure.ResourceManager.Support/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/support/ci.mgmt.yml + - sdk/support/Azure.ResourceManager.Support/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/support/ci.mgmt.yml + - sdk/support/Azure.ResourceManager.Support/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/support/ci.mgmt.yml + - sdk/support/Azure.ResourceManager.Support/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/support/ci.mgmt.yml + - sdk/support/Azure.ResourceManager.Support/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/support/ci.mgmt.yml + - sdk/support/Azure.ResourceManager.Support/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/support/ci.mgmt.yml + - sdk/support/Azure.ResourceManager.Support/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/support/ci.mgmt.yml + - sdk/support/Azure.ResourceManager.Support/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/support/ci.mgmt.yml + - sdk/support/Azure.ResourceManager.Support/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/support/ci.mgmt.yml + - sdk/support/Azure.ResourceManager.Support/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/samples/Generated/Samples/Sample_SynapseBigDataPoolInfoCollection.cs b/sdk/synapse/Azure.ResourceManager.Synapse/samples/Generated/Samples/Sample_SynapseBigDataPoolInfoCollection.cs index e3e5647857c1..137308683108 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/samples/Generated/Samples/Sample_SynapseBigDataPoolInfoCollection.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/samples/Generated/Samples/Sample_SynapseBigDataPoolInfoCollection.cs @@ -62,7 +62,7 @@ public async Task CreateOrUpdate_CreateOrUpdateABigDataPool() Content = "", Filename = "requirements.txt", }, - SparkVersion = "2.4", + SparkVersion = "3.3", DefaultSparkLogFolder = "/logs", NodeSize = BigDataPoolNodeSize.Medium, NodeSizeFamily = BigDataPoolNodeSizeFamily.MemoryOptimized, diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/samples/Generated/Samples/Sample_SynapseSqlPoolResource.cs b/sdk/synapse/Azure.ResourceManager.Synapse/samples/Generated/Samples/Sample_SynapseSqlPoolResource.cs index c194424ac45b..ca5e44922b7c 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/samples/Generated/Samples/Sample_SynapseSqlPoolResource.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/samples/Generated/Samples/Sample_SynapseSqlPoolResource.cs @@ -176,34 +176,6 @@ public async Task Resume_ResumeASQLAnalyticsPool() Console.WriteLine($"Succeeded: {result}"); } - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Rename_RenameASQLAnalyticsPool() - { - // Generated from example definition: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/RenameSqlPool.json - // this example is just showing the usage of "SqlPools_Rename" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SynapseSqlPoolResource created on azure - // for more information of creating SynapseSqlPoolResource, please refer to the document of SynapseSqlPoolResource - string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "Default-SQL-SouthEastAsia"; - string workspaceName = "testsvr"; - string sqlPoolName = "testdb"; - ResourceIdentifier synapseSqlPoolResourceId = SynapseSqlPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, sqlPoolName); - SynapseSqlPoolResource synapseSqlPool = client.GetSynapseSqlPoolResource(synapseSqlPoolResourceId); - - // invoke the operation - SynapseResourceMoveDefinition synapseResourceMoveDefinition = new SynapseResourceMoveDefinition(new ResourceIdentifier("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Synapse/workspaces/testsvr/sqlPools/newtestdb")); - await synapseSqlPool.RenameAsync(synapseResourceMoveDefinition); - - Console.WriteLine("Succeeded"); - } - [Test] [Ignore("Only validating compilation of examples")] public async Task CreateSqlPoolRestorePoint_CreatesSqlPoolRestorePoint() diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/ArmSynapseModelFactory.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/ArmSynapseModelFactory.cs index e4b4aa2638e9..99fa8067885c 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/ArmSynapseModelFactory.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/ArmSynapseModelFactory.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Net; using Azure.Core; @@ -1657,12 +1658,11 @@ public static SynapseDedicatedSqlMinimalTlsSettingData SynapseDedicatedSqlMinima /// Enable or Disable AzureADOnlyAuthentication on All Workspace subresource. /// Is trustedServiceBypassEnabled for the workspace. /// A new instance for mocking. - public static SynapseWorkspaceData SynapseWorkspaceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, SynapseDataLakeStorageAccountDetails defaultDataLakeStorage = null, string sqlAdministratorLoginPassword = null, string managedResourceGroupName = null, string provisioningState = null, string sqlAdministratorLogin = null, string virtualNetworkComputeSubnetId = null, IDictionary connectivityEndpoints = null, string managedVirtualNetwork = null, IEnumerable privateEndpointConnections = null, SynapseEncryptionDetails encryption = null, Guid? workspaceUid = null, IReadOnlyDictionary extraProperties = null, SynapseManagedVirtualNetworkSettings managedVirtualNetworkSettings = null, SynapseWorkspaceRepositoryConfiguration workspaceRepositoryConfiguration = null, ResourceIdentifier purviewResourceId = null, ResourceIdentifier adlaResourceId = null, WorkspacePublicNetworkAccess? publicNetworkAccess = null, Guid? initialWorkspaceAdminObjectId = null, IReadOnlyDictionary settings = null, bool? isAadOnlyAuthenticationEnabled = null, bool? isTrustedServiceBypassEnabled = null) + public static SynapseWorkspaceData SynapseWorkspaceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, SynapseDataLakeStorageAccountDetails defaultDataLakeStorage = null, string sqlAdministratorLoginPassword = null, string managedResourceGroupName = null, string provisioningState = null, string sqlAdministratorLogin = null, string virtualNetworkComputeSubnetId = null, IReadOnlyDictionary connectivityEndpoints = null, string managedVirtualNetwork = null, IEnumerable privateEndpointConnections = null, SynapseEncryptionDetails encryption = null, Guid? workspaceUid = null, BinaryData extraProperties = null, SynapseManagedVirtualNetworkSettings managedVirtualNetworkSettings = null, SynapseWorkspaceRepositoryConfiguration workspaceRepositoryConfiguration = null, ResourceIdentifier purviewResourceId = null, ResourceIdentifier adlaResourceId = null, WorkspacePublicNetworkAccess? publicNetworkAccess = null, Guid? initialWorkspaceAdminObjectId = null, IReadOnlyDictionary settings = null, bool? isAadOnlyAuthenticationEnabled = null, bool? isTrustedServiceBypassEnabled = null) { tags ??= new Dictionary(); connectivityEndpoints ??= new Dictionary(); privateEndpointConnections ??= new List(); - extraProperties ??= new Dictionary(); settings ??= new Dictionary(); return new SynapseWorkspaceData( @@ -2741,8 +2741,11 @@ public static SynapseManagedIntegrationRuntimeOperationResult SynapseManagedInte /// The estimated time when the self-hosted integration runtime will be updated. /// The service region of the integration runtime. /// The newer versions on download center. + /// + /// + /// An alternative option to ensure interactive authoring function when your self-hosted integration runtime is unable to establish a connection with Azure Relay. /// A new instance for mocking. - public static SynapseSelfHostedIntegrationRuntimeStatus SynapseSelfHostedIntegrationRuntimeStatus(string dataFactoryName = null, SynapseIntegrationRuntimeState? state = null, IReadOnlyDictionary additionalProperties = null, DateTimeOffset? createOn = null, string taskQueueId = null, string nodeCommunicationChannelEncryptionMode = null, SynapseIntegrationRuntimeInternalChannelEncryptionMode? internalChannelEncryption = null, string version = null, IEnumerable nodes = null, DateTimeOffset? scheduledUpdateOn = null, string updateDelayOffset = null, string localTimeZoneOffset = null, IReadOnlyDictionary capabilities = null, IEnumerable serviceUrls = null, SynapseIntegrationRuntimeAutoUpdate? autoUpdate = null, string versionStatus = null, IEnumerable links = null, string pushedVersion = null, string latestVersion = null, DateTimeOffset? autoUpdateEta = null, string serviceRegion = null, IEnumerable newerVersions = null) + public static SynapseSelfHostedIntegrationRuntimeStatus SynapseSelfHostedIntegrationRuntimeStatus(string dataFactoryName = null, SynapseIntegrationRuntimeState? state = null, IReadOnlyDictionary additionalProperties = null, DateTimeOffset? createOn = null, string taskQueueId = null, string nodeCommunicationChannelEncryptionMode = null, SynapseIntegrationRuntimeInternalChannelEncryptionMode? internalChannelEncryption = null, string version = null, IEnumerable nodes = null, DateTimeOffset? scheduledUpdateOn = null, string updateDelayOffset = null, string localTimeZoneOffset = null, IReadOnlyDictionary capabilities = null, IEnumerable serviceUrls = null, SynapseIntegrationRuntimeAutoUpdate? autoUpdate = null, string versionStatus = null, IEnumerable links = null, string pushedVersion = null, string latestVersion = null, DateTimeOffset? autoUpdateEta = null, string serviceRegion = null, IEnumerable newerVersions = null, int? osType = null, int? targetFramework = null, SelfContainedInteractiveAuthoringState? selfContainedInteractiveAuthoringEnabled = null) { additionalProperties ??= new Dictionary(); nodes ??= new List(); @@ -2774,7 +2777,10 @@ public static SynapseSelfHostedIntegrationRuntimeStatus SynapseSelfHostedIntegra latestVersion, autoUpdateEta, serviceRegion, - newerVersions?.ToList()); + newerVersions?.ToList(), + osType, + targetFramework, + selfContainedInteractiveAuthoringEnabled); } /// Initializes a new instance of . @@ -3116,5 +3122,35 @@ public static SynapseEventGridDataConnection SynapseEventGridDataConnection(Reso blobStorageEventType, provisioningState); } + + /// Initializes a new instance of . + /// The workspace name which the integration runtime belong to. + /// The state of integration runtime. + /// Additional Properties. + /// The time at which the integration runtime was created, in ISO8601 format. + /// The task queue id of the integration runtime. + /// The node communication Channel encryption mode. + /// It is used to set the encryption mode for node-node communication channel (when more than 2 self-hosted integration runtime nodes exist). + /// Version of the integration runtime. + /// The list of nodes for this integration runtime. + /// The date at which the integration runtime will be scheduled to update, in ISO8601 format. + /// The time in the date scheduled by service to update the integration runtime, e.g., PT03H is 3 hours. + /// The local time zone offset in hours. + /// Object with additional information about integration runtime capabilities. + /// The URLs for the services used in integration runtime backend service. + /// Whether Self-hosted integration runtime auto update has been turned on. + /// Status of the integration runtime version. + /// The list of linked integration runtimes that are created to share with this integration runtime. + /// The version that the integration runtime is going to update to. + /// The latest version on download center. + /// The estimated time when the self-hosted integration runtime will be updated. + /// The service region of the integration runtime. + /// The newer versions on download center. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static SynapseSelfHostedIntegrationRuntimeStatus SynapseSelfHostedIntegrationRuntimeStatus(string dataFactoryName, SynapseIntegrationRuntimeState? state, IReadOnlyDictionary additionalProperties, DateTimeOffset? createOn, string taskQueueId, string nodeCommunicationChannelEncryptionMode, SynapseIntegrationRuntimeInternalChannelEncryptionMode? internalChannelEncryption, string version, IEnumerable nodes, DateTimeOffset? scheduledUpdateOn, string updateDelayOffset, string localTimeZoneOffset, IReadOnlyDictionary capabilities, IEnumerable serviceUrls, SynapseIntegrationRuntimeAutoUpdate? autoUpdate, string versionStatus, IEnumerable links, string pushedVersion, string latestVersion, DateTimeOffset? autoUpdateEta, string serviceRegion, IEnumerable newerVersions) + { + return SynapseSelfHostedIntegrationRuntimeStatus(dataFactoryName: dataFactoryName, state: state, additionalProperties: additionalProperties, createOn: createOn, taskQueueId: taskQueueId, nodeCommunicationChannelEncryptionMode: nodeCommunicationChannelEncryptionMode, internalChannelEncryption: internalChannelEncryption, version: version, nodes: nodes, scheduledUpdateOn: scheduledUpdateOn, updateDelayOffset: updateDelayOffset, localTimeZoneOffset: localTimeZoneOffset, capabilities: capabilities, serviceUrls: serviceUrls, autoUpdate: autoUpdate, versionStatus: versionStatus, links: links, pushedVersion: pushedVersion, latestVersion: latestVersion, autoUpdateEta: autoUpdateEta, serviceRegion: serviceRegion, newerVersions: newerVersions, osType: default, targetFramework: default, selfContainedInteractiveAuthoringEnabled: default); + } } } diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/BigDataPoolLibraryInfo.Serialization.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/BigDataPoolLibraryInfo.Serialization.cs index c61dd634395b..0d40418bb673 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/BigDataPoolLibraryInfo.Serialization.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/BigDataPoolLibraryInfo.Serialization.cs @@ -49,7 +49,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("containerName"u8); writer.WriteStringValue(ContainerName); } - if (Optional.IsDefined(UploadedOn)) + if (options.Format != "W" && Optional.IsDefined(UploadedOn)) { writer.WritePropertyName("uploadedTimestamp"u8); writer.WriteStringValue(UploadedOn.Value, "O"); diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/BigDataPoolLibraryInfo.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/BigDataPoolLibraryInfo.cs index 9a71d28ecfe1..79da16608326 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/BigDataPoolLibraryInfo.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/BigDataPoolLibraryInfo.cs @@ -78,7 +78,7 @@ internal BigDataPoolLibraryInfo(string name, string path, string containerName, /// Storage blob container name. public string ContainerName { get; set; } /// The last update time of the library. - public DateTimeOffset? UploadedOn { get; set; } + public DateTimeOffset? UploadedOn { get; } /// Type of the library. public string LibraryInfoType { get; set; } /// Provisioning status of the library/package. diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/CopyComputeScaleProperties.Serialization.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/CopyComputeScaleProperties.Serialization.cs new file mode 100644 index 000000000000..d2b32eca43f2 --- /dev/null +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/CopyComputeScaleProperties.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Synapse.Models +{ + public partial class CopyComputeScaleProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(CopyComputeScaleProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DataIntegrationUnit)) + { + writer.WritePropertyName("dataIntegrationUnit"u8); + writer.WriteNumberValue(DataIntegrationUnit.Value); + } + if (Optional.IsDefined(TimeToLive)) + { + writer.WritePropertyName("timeToLive"u8); + writer.WriteNumberValue(TimeToLive.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CopyComputeScaleProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CopyComputeScaleProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCopyComputeScaleProperties(document.RootElement, options); + } + + internal static CopyComputeScaleProperties DeserializeCopyComputeScaleProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? dataIntegrationUnit = default; + int? timeToLive = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("dataIntegrationUnit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataIntegrationUnit = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("timeToLive"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeToLive = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CopyComputeScaleProperties(dataIntegrationUnit, timeToLive, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CopyComputeScaleProperties)} does not support writing '{options.Format}' format."); + } + } + + CopyComputeScaleProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCopyComputeScaleProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CopyComputeScaleProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/CopyComputeScaleProperties.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/CopyComputeScaleProperties.cs new file mode 100644 index 000000000000..40e9a25b3c95 --- /dev/null +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/CopyComputeScaleProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Synapse.Models +{ + /// CopyComputeScale properties for managed integration runtime. + public partial class CopyComputeScaleProperties + { + /// + /// 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; + + /// Initializes a new instance of . + public CopyComputeScaleProperties() + { + } + + /// Initializes a new instance of . + /// DIU number setting reserved for copy activity execution. Supported values are multiples of 4 in range 4-256. + /// Time to live (in minutes) setting of integration runtime which will execute copy activity. + /// Keeps track of any properties unknown to the library. + internal CopyComputeScaleProperties(int? dataIntegrationUnit, int? timeToLive, IDictionary serializedAdditionalRawData) + { + DataIntegrationUnit = dataIntegrationUnit; + TimeToLive = timeToLive; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// DIU number setting reserved for copy activity execution. Supported values are multiples of 4 in range 4-256. + public int? DataIntegrationUnit { get; set; } + /// Time to live (in minutes) setting of integration runtime which will execute copy activity. + public int? TimeToLive { get; set; } + } +} diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/PipelineExternalComputeScaleProperties.Serialization.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/PipelineExternalComputeScaleProperties.Serialization.cs new file mode 100644 index 000000000000..6c2ba0fa6600 --- /dev/null +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/PipelineExternalComputeScaleProperties.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Synapse.Models +{ + public partial class PipelineExternalComputeScaleProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON 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; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineExternalComputeScaleProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(TimeToLive)) + { + writer.WritePropertyName("timeToLive"u8); + writer.WriteNumberValue(TimeToLive.Value); + } + if (Optional.IsDefined(NumberOfPipelineNodes)) + { + writer.WritePropertyName("numberOfPipelineNodes"u8); + writer.WriteNumberValue(NumberOfPipelineNodes.Value); + } + if (Optional.IsDefined(NumberOfExternalNodes)) + { + writer.WritePropertyName("numberOfExternalNodes"u8); + writer.WriteNumberValue(NumberOfExternalNodes.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PipelineExternalComputeScaleProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineExternalComputeScaleProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineExternalComputeScaleProperties(document.RootElement, options); + } + + internal static PipelineExternalComputeScaleProperties DeserializePipelineExternalComputeScaleProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? timeToLive = default; + int? numberOfPipelineNodes = default; + int? numberOfExternalNodes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("timeToLive"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeToLive = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("numberOfPipelineNodes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfPipelineNodes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("numberOfExternalNodes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfExternalNodes = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineExternalComputeScaleProperties(timeToLive, numberOfPipelineNodes, numberOfExternalNodes, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PipelineExternalComputeScaleProperties)} does not support writing '{options.Format}' format."); + } + } + + PipelineExternalComputeScaleProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePipelineExternalComputeScaleProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineExternalComputeScaleProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/PipelineExternalComputeScaleProperties.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/PipelineExternalComputeScaleProperties.cs new file mode 100644 index 000000000000..2db3ff6f5075 --- /dev/null +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/PipelineExternalComputeScaleProperties.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Synapse.Models +{ + /// PipelineExternalComputeScale properties for managed integration runtime. + public partial class PipelineExternalComputeScaleProperties + { + /// + /// 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; + + /// Initializes a new instance of . + public PipelineExternalComputeScaleProperties() + { + } + + /// Initializes a new instance of . + /// Time to live (in minutes) setting of integration runtime which will execute pipeline and external activity. + /// Number of the pipeline nodes, which should be greater than 0 and less than 11. + /// Number of the the external nodes, which should be greater than 0 and less than 11. + /// Keeps track of any properties unknown to the library. + internal PipelineExternalComputeScaleProperties(int? timeToLive, int? numberOfPipelineNodes, int? numberOfExternalNodes, IDictionary serializedAdditionalRawData) + { + TimeToLive = timeToLive; + NumberOfPipelineNodes = numberOfPipelineNodes; + NumberOfExternalNodes = numberOfExternalNodes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Time to live (in minutes) setting of integration runtime which will execute pipeline and external activity. + public int? TimeToLive { get; set; } + /// Number of the pipeline nodes, which should be greater than 0 and less than 11. + public int? NumberOfPipelineNodes { get; set; } + /// Number of the the external nodes, which should be greater than 0 and less than 11. + public int? NumberOfExternalNodes { get; set; } + } +} diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SelfContainedInteractiveAuthoringState.Serialization.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SelfContainedInteractiveAuthoringState.Serialization.cs new file mode 100644 index 000000000000..2f6432bbc671 --- /dev/null +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SelfContainedInteractiveAuthoringState.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.Synapse.Models +{ + internal static partial class SelfContainedInteractiveAuthoringStateExtensions + { + public static bool ToSerialBoolean(this SelfContainedInteractiveAuthoringState value) => value switch + { + SelfContainedInteractiveAuthoringState.True => true, + SelfContainedInteractiveAuthoringState.False => false, + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SelfContainedInteractiveAuthoringState value.") + }; + + public static SelfContainedInteractiveAuthoringState ToSelfContainedInteractiveAuthoringState(this bool value) + { + if (value == true) return SelfContainedInteractiveAuthoringState.True; + if (value == false) return SelfContainedInteractiveAuthoringState.False; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SelfContainedInteractiveAuthoringState value."); + } + } +} diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SelfContainedInteractiveAuthoringState.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SelfContainedInteractiveAuthoringState.cs new file mode 100644 index 000000000000..18b6584f5bbd --- /dev/null +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SelfContainedInteractiveAuthoringState.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Synapse.Models +{ + /// An alternative option to ensure interactive authoring function when your self-hosted integration runtime is unable to establish a connection with Azure Relay. + public enum SelfContainedInteractiveAuthoringState + { + /// True. + True, + /// False. + False + } +} diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseIntegrationRuntimeComputeProperties.Serialization.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseIntegrationRuntimeComputeProperties.Serialization.cs index c623e16aeaba..10815a729ee8 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseIntegrationRuntimeComputeProperties.Serialization.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseIntegrationRuntimeComputeProperties.Serialization.cs @@ -64,6 +64,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("vNetProperties"u8); writer.WriteObjectValue(VnetProperties, options); } + if (Optional.IsDefined(CopyComputeScaleProperties)) + { + writer.WritePropertyName("copyComputeScaleProperties"u8); + writer.WriteObjectValue(CopyComputeScaleProperties, options); + } + if (Optional.IsDefined(PipelineExternalComputeScaleProperties)) + { + writer.WritePropertyName("pipelineExternalComputeScaleProperties"u8); + writer.WriteObjectValue(PipelineExternalComputeScaleProperties, options); + } foreach (var item in AdditionalProperties) { writer.WritePropertyName(item.Key); @@ -104,6 +114,8 @@ internal static SynapseIntegrationRuntimeComputeProperties DeserializeSynapseInt int? maxParallelExecutionsPerNode = default; SynapseIntegrationRuntimeDataFlowProperties dataFlowProperties = default; SynapseIntegrationRuntimeVnetProperties vNetProperties = default; + CopyComputeScaleProperties copyComputeScaleProperties = default; + PipelineExternalComputeScaleProperties pipelineExternalComputeScaleProperties = default; IDictionary additionalProperties = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -158,6 +170,24 @@ internal static SynapseIntegrationRuntimeComputeProperties DeserializeSynapseInt vNetProperties = SynapseIntegrationRuntimeVnetProperties.DeserializeSynapseIntegrationRuntimeVnetProperties(property.Value, options); continue; } + if (property.NameEquals("copyComputeScaleProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + copyComputeScaleProperties = CopyComputeScaleProperties.DeserializeCopyComputeScaleProperties(property.Value, options); + continue; + } + if (property.NameEquals("pipelineExternalComputeScaleProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + pipelineExternalComputeScaleProperties = PipelineExternalComputeScaleProperties.DeserializePipelineExternalComputeScaleProperties(property.Value, options); + continue; + } additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } additionalProperties = additionalPropertiesDictionary; @@ -168,6 +198,8 @@ internal static SynapseIntegrationRuntimeComputeProperties DeserializeSynapseInt maxParallelExecutionsPerNode, dataFlowProperties, vNetProperties, + copyComputeScaleProperties, + pipelineExternalComputeScaleProperties, additionalProperties); } diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseIntegrationRuntimeComputeProperties.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseIntegrationRuntimeComputeProperties.cs index 537e2bbe6262..06a41bdb62b9 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseIntegrationRuntimeComputeProperties.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseIntegrationRuntimeComputeProperties.cs @@ -27,8 +27,10 @@ public SynapseIntegrationRuntimeComputeProperties() /// Maximum parallel executions count per node for managed integration runtime. /// Data flow properties for managed integration runtime. /// VNet properties for managed integration runtime. + /// CopyComputeScale properties for managed integration runtime. + /// PipelineExternalComputeScale properties for managed integration runtime. /// Additional Properties. - internal SynapseIntegrationRuntimeComputeProperties(AzureLocation? location, string nodeSize, int? numberOfNodes, int? maxParallelExecutionsPerNode, SynapseIntegrationRuntimeDataFlowProperties dataFlowProperties, SynapseIntegrationRuntimeVnetProperties vnetProperties, IDictionary additionalProperties) + internal SynapseIntegrationRuntimeComputeProperties(AzureLocation? location, string nodeSize, int? numberOfNodes, int? maxParallelExecutionsPerNode, SynapseIntegrationRuntimeDataFlowProperties dataFlowProperties, SynapseIntegrationRuntimeVnetProperties vnetProperties, CopyComputeScaleProperties copyComputeScaleProperties, PipelineExternalComputeScaleProperties pipelineExternalComputeScaleProperties, IDictionary additionalProperties) { Location = location; NodeSize = nodeSize; @@ -36,6 +38,8 @@ internal SynapseIntegrationRuntimeComputeProperties(AzureLocation? location, str MaxParallelExecutionsPerNode = maxParallelExecutionsPerNode; DataFlowProperties = dataFlowProperties; VnetProperties = vnetProperties; + CopyComputeScaleProperties = copyComputeScaleProperties; + PipelineExternalComputeScaleProperties = pipelineExternalComputeScaleProperties; AdditionalProperties = additionalProperties; } @@ -51,6 +55,10 @@ internal SynapseIntegrationRuntimeComputeProperties(AzureLocation? location, str public SynapseIntegrationRuntimeDataFlowProperties DataFlowProperties { get; set; } /// VNet properties for managed integration runtime. public SynapseIntegrationRuntimeVnetProperties VnetProperties { get; set; } + /// CopyComputeScale properties for managed integration runtime. + public CopyComputeScaleProperties CopyComputeScaleProperties { get; set; } + /// PipelineExternalComputeScale properties for managed integration runtime. + public PipelineExternalComputeScaleProperties PipelineExternalComputeScaleProperties { get; set; } /// /// Additional Properties /// diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseSelfHostedIntegrationRuntime.Serialization.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseSelfHostedIntegrationRuntime.Serialization.cs index 6242b43ef563..12fe2785fefe 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseSelfHostedIntegrationRuntime.Serialization.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseSelfHostedIntegrationRuntime.Serialization.cs @@ -42,6 +42,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("linkedInfo"u8); writer.WriteObjectValue(LinkedInfo, options); } + if (Optional.IsDefined(SelfContainedInteractiveAuthoringEnabled)) + { + writer.WritePropertyName("selfContainedInteractiveAuthoringEnabled"u8); + writer.WriteStringValue(SelfContainedInteractiveAuthoringEnabled.Value.ToSerialBoolean()); + } writer.WriteEndObject(); foreach (var item in AdditionalProperties) { @@ -80,6 +85,7 @@ internal static SynapseSelfHostedIntegrationRuntime DeserializeSynapseSelfHosted IntegrationRuntimeType type = default; string description = default; SynapseLinkedIntegrationRuntimeType linkedInfo = default; + SelfContainedInteractiveAuthoringState? selfContainedInteractiveAuthoringEnabled = default; IDictionary additionalProperties = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -112,13 +118,22 @@ internal static SynapseSelfHostedIntegrationRuntime DeserializeSynapseSelfHosted linkedInfo = SynapseLinkedIntegrationRuntimeType.DeserializeSynapseLinkedIntegrationRuntimeType(property0.Value, options); continue; } + if (property0.NameEquals("selfContainedInteractiveAuthoringEnabled"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + selfContainedInteractiveAuthoringEnabled = property0.Value.GetBoolean().ToSelfContainedInteractiveAuthoringState(); + continue; + } } continue; } additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } additionalProperties = additionalPropertiesDictionary; - return new SynapseSelfHostedIntegrationRuntime(type, description, additionalProperties, linkedInfo); + return new SynapseSelfHostedIntegrationRuntime(type, description, additionalProperties, linkedInfo, selfContainedInteractiveAuthoringEnabled); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseSelfHostedIntegrationRuntime.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseSelfHostedIntegrationRuntime.cs index bb6a3c18b170..05fb2ae3dbf7 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseSelfHostedIntegrationRuntime.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseSelfHostedIntegrationRuntime.cs @@ -28,9 +28,11 @@ public SynapseSelfHostedIntegrationRuntime() /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include and . /// - internal SynapseSelfHostedIntegrationRuntime(IntegrationRuntimeType integrationRuntimeType, string description, IDictionary additionalProperties, SynapseLinkedIntegrationRuntimeType linkedInfo) : base(integrationRuntimeType, description, additionalProperties) + /// An alternative option to ensure interactive authoring function when your self-hosted integration runtime is unable to establish a connection with Azure Relay. + internal SynapseSelfHostedIntegrationRuntime(IntegrationRuntimeType integrationRuntimeType, string description, IDictionary additionalProperties, SynapseLinkedIntegrationRuntimeType linkedInfo, SelfContainedInteractiveAuthoringState? selfContainedInteractiveAuthoringEnabled) : base(integrationRuntimeType, description, additionalProperties) { LinkedInfo = linkedInfo; + SelfContainedInteractiveAuthoringEnabled = selfContainedInteractiveAuthoringEnabled; IntegrationRuntimeType = integrationRuntimeType; } @@ -40,5 +42,7 @@ internal SynapseSelfHostedIntegrationRuntime(IntegrationRuntimeType integrationR /// The available derived classes include and . /// public SynapseLinkedIntegrationRuntimeType LinkedInfo { get; set; } + /// An alternative option to ensure interactive authoring function when your self-hosted integration runtime is unable to establish a connection with Azure Relay. + public SelfContainedInteractiveAuthoringState? SelfContainedInteractiveAuthoringEnabled { get; set; } } } diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseSelfHostedIntegrationRuntimeStatus.Serialization.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseSelfHostedIntegrationRuntimeStatus.Serialization.cs index 00333c51008c..c215d5ead9c7 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseSelfHostedIntegrationRuntimeStatus.Serialization.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseSelfHostedIntegrationRuntimeStatus.Serialization.cs @@ -158,6 +158,21 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndArray(); } + if (options.Format != "W" && Optional.IsDefined(OSType)) + { + writer.WritePropertyName("osType"u8); + writer.WriteNumberValue(OSType.Value); + } + if (options.Format != "W" && Optional.IsDefined(TargetFramework)) + { + writer.WritePropertyName("targetFramework"u8); + writer.WriteNumberValue(TargetFramework.Value); + } + if (options.Format != "W" && Optional.IsDefined(SelfContainedInteractiveAuthoringEnabled)) + { + writer.WritePropertyName("selfContainedInteractiveAuthoringEnabled"u8); + writer.WriteStringValue(SelfContainedInteractiveAuthoringEnabled.Value.ToSerialBoolean()); + } writer.WriteEndObject(); foreach (var item in AdditionalProperties) { @@ -215,6 +230,9 @@ internal static SynapseSelfHostedIntegrationRuntimeStatus DeserializeSynapseSelf DateTimeOffset? autoUpdateEta = default; string serviceRegion = default; IReadOnlyList newerVersions = default; + int? osType = default; + int? targetFramework = default; + SelfContainedInteractiveAuthoringState? selfContainedInteractiveAuthoringEnabled = default; IReadOnlyDictionary additionalProperties = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -407,6 +425,33 @@ internal static SynapseSelfHostedIntegrationRuntimeStatus DeserializeSynapseSelf newerVersions = array; continue; } + if (property0.NameEquals("osType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + osType = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("targetFramework"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetFramework = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("selfContainedInteractiveAuthoringEnabled"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + selfContainedInteractiveAuthoringEnabled = property0.Value.GetBoolean().ToSelfContainedInteractiveAuthoringState(); + continue; + } } continue; } @@ -436,7 +481,10 @@ internal static SynapseSelfHostedIntegrationRuntimeStatus DeserializeSynapseSelf latestVersion, autoUpdateEta, serviceRegion, - newerVersions ?? new ChangeTrackingList()); + newerVersions ?? new ChangeTrackingList(), + osType, + targetFramework, + selfContainedInteractiveAuthoringEnabled); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseSelfHostedIntegrationRuntimeStatus.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseSelfHostedIntegrationRuntimeStatus.cs index 725b300ded45..05237f9f6b5d 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseSelfHostedIntegrationRuntimeStatus.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseSelfHostedIntegrationRuntimeStatus.cs @@ -48,7 +48,10 @@ internal SynapseSelfHostedIntegrationRuntimeStatus() /// The estimated time when the self-hosted integration runtime will be updated. /// The service region of the integration runtime. /// The newer versions on download center. - internal SynapseSelfHostedIntegrationRuntimeStatus(IntegrationRuntimeType runtimeType, string dataFactoryName, SynapseIntegrationRuntimeState? state, IReadOnlyDictionary additionalProperties, DateTimeOffset? createOn, string taskQueueId, string nodeCommunicationChannelEncryptionMode, SynapseIntegrationRuntimeInternalChannelEncryptionMode? internalChannelEncryption, string version, IReadOnlyList nodes, DateTimeOffset? scheduledUpdateOn, string updateDelayOffset, string localTimeZoneOffset, IReadOnlyDictionary capabilities, IReadOnlyList serviceUrls, SynapseIntegrationRuntimeAutoUpdate? autoUpdate, string versionStatus, IReadOnlyList links, string pushedVersion, string latestVersion, DateTimeOffset? autoUpdateEta, string serviceRegion, IReadOnlyList newerVersions) : base(runtimeType, dataFactoryName, state, additionalProperties) + /// + /// + /// An alternative option to ensure interactive authoring function when your self-hosted integration runtime is unable to establish a connection with Azure Relay. + internal SynapseSelfHostedIntegrationRuntimeStatus(IntegrationRuntimeType runtimeType, string dataFactoryName, SynapseIntegrationRuntimeState? state, IReadOnlyDictionary additionalProperties, DateTimeOffset? createOn, string taskQueueId, string nodeCommunicationChannelEncryptionMode, SynapseIntegrationRuntimeInternalChannelEncryptionMode? internalChannelEncryption, string version, IReadOnlyList nodes, DateTimeOffset? scheduledUpdateOn, string updateDelayOffset, string localTimeZoneOffset, IReadOnlyDictionary capabilities, IReadOnlyList serviceUrls, SynapseIntegrationRuntimeAutoUpdate? autoUpdate, string versionStatus, IReadOnlyList links, string pushedVersion, string latestVersion, DateTimeOffset? autoUpdateEta, string serviceRegion, IReadOnlyList newerVersions, int? osType, int? targetFramework, SelfContainedInteractiveAuthoringState? selfContainedInteractiveAuthoringEnabled) : base(runtimeType, dataFactoryName, state, additionalProperties) { CreateOn = createOn; TaskQueueId = taskQueueId; @@ -69,6 +72,9 @@ internal SynapseSelfHostedIntegrationRuntimeStatus(IntegrationRuntimeType runtim AutoUpdateEta = autoUpdateEta; ServiceRegion = serviceRegion; NewerVersions = newerVersions; + OSType = osType; + TargetFramework = targetFramework; + SelfContainedInteractiveAuthoringEnabled = selfContainedInteractiveAuthoringEnabled; RuntimeType = runtimeType; } @@ -110,5 +116,11 @@ internal SynapseSelfHostedIntegrationRuntimeStatus(IntegrationRuntimeType runtim public string ServiceRegion { get; } /// The newer versions on download center. public IReadOnlyList NewerVersions { get; } + /// Gets the os type. + public int? OSType { get; } + /// Gets the target framework. + public int? TargetFramework { get; } + /// An alternative option to ensure interactive authoring function when your self-hosted integration runtime is unable to establish a connection with Azure Relay. + public SelfContainedInteractiveAuthoringState? SelfContainedInteractiveAuthoringEnabled { get; } } } diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseWorkspaceRepositoryConfiguration.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseWorkspaceRepositoryConfiguration.cs index 05322d6ae24c..cba1db69c750 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseWorkspaceRepositoryConfiguration.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Models/SynapseWorkspaceRepositoryConfiguration.cs @@ -52,7 +52,7 @@ public SynapseWorkspaceRepositoryConfiguration() /// Initializes a new instance of . /// Type of workspace repositoryID configuration. Example WorkspaceVSTSConfiguration, WorkspaceGitHubConfiguration. - /// GitHub Enterprise host name. For example: https://github.mydomain.com. + /// GitHub Enterprise host name. For example: `https://github.mydomain.com`. /// Account name. /// VSTS project name. /// Repository name. @@ -77,7 +77,7 @@ internal SynapseWorkspaceRepositoryConfiguration(string workspaceRepositoryConfi /// Type of workspace repositoryID configuration. Example WorkspaceVSTSConfiguration, WorkspaceGitHubConfiguration. public string WorkspaceRepositoryConfigurationType { get; set; } - /// GitHub Enterprise host name. For example: https://github.mydomain.com. + /// GitHub Enterprise host name. For example: `https://github.mydomain.com`. public string HostName { get; set; } /// Account name. public string AccountName { get; set; } diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/RestOperations/SqlPoolsRestOperations.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/RestOperations/SqlPoolsRestOperations.cs index b01cdccc4c2a..153e5225b41f 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/RestOperations/SqlPoolsRestOperations.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/RestOperations/SqlPoolsRestOperations.cs @@ -716,105 +716,6 @@ public Response Resume(string subscriptionId, string resourceGroupName, string w } } - internal RequestUriBuilder CreateRenameRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string sqlPoolName, SynapseResourceMoveDefinition synapseResourceMoveDefinition) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Synapse/workspaces/", false); - uri.AppendPath(workspaceName, true); - uri.AppendPath("/sqlPools/", false); - uri.AppendPath(sqlPoolName, true); - uri.AppendPath("/move", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateRenameRequest(string subscriptionId, string resourceGroupName, string workspaceName, string sqlPoolName, SynapseResourceMoveDefinition synapseResourceMoveDefinition) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Synapse/workspaces/", false); - uri.AppendPath(workspaceName, true); - uri.AppendPath("/sqlPools/", false); - uri.AppendPath(sqlPoolName, true); - uri.AppendPath("/move", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(synapseResourceMoveDefinition, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Rename a SQL pool. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the workspace. - /// SQL pool name. - /// The resource move definition for renaming this Sql pool. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task RenameAsync(string subscriptionId, string resourceGroupName, string workspaceName, string sqlPoolName, SynapseResourceMoveDefinition synapseResourceMoveDefinition, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(sqlPoolName, nameof(sqlPoolName)); - Argument.AssertNotNull(synapseResourceMoveDefinition, nameof(synapseResourceMoveDefinition)); - - using var message = CreateRenameRequest(subscriptionId, resourceGroupName, workspaceName, sqlPoolName, synapseResourceMoveDefinition); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Rename a SQL pool. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the workspace. - /// SQL pool name. - /// The resource move definition for renaming this Sql pool. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Rename(string subscriptionId, string resourceGroupName, string workspaceName, string sqlPoolName, SynapseResourceMoveDefinition synapseResourceMoveDefinition, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - Argument.AssertNotNullOrEmpty(sqlPoolName, nameof(sqlPoolName)); - Argument.AssertNotNull(synapseResourceMoveDefinition, nameof(synapseResourceMoveDefinition)); - - using var message = CreateRenameRequest(subscriptionId, resourceGroupName, workspaceName, sqlPoolName, synapseResourceMoveDefinition); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateListByWorkspaceNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseLibraryData.Serialization.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseLibraryData.Serialization.cs index 2f538eb3517b..2f81caec9193 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseLibraryData.Serialization.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseLibraryData.Serialization.cs @@ -58,7 +58,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("containerName"u8); writer.WriteStringValue(ContainerName); } - if (Optional.IsDefined(UploadedOn)) + if (options.Format != "W" && Optional.IsDefined(UploadedOn)) { writer.WritePropertyName("uploadedTimestamp"u8); writer.WriteStringValue(UploadedOn.Value, "O"); diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseLibraryData.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseLibraryData.cs index 536c1370ccb4..7cdc4e86afad 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseLibraryData.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseLibraryData.cs @@ -89,7 +89,7 @@ internal SynapseLibraryData(ResourceIdentifier id, string name, ResourceType res /// Storage blob container name. public string ContainerName { get; set; } /// The last update time of the library. - public DateTimeOffset? UploadedOn { get; set; } + public DateTimeOffset? UploadedOn { get; } /// Type of the library. public string TypePropertiesType { get; set; } /// Provisioning status of the library/package. diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapsePrivateLinkHubResource.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapsePrivateLinkHubResource.cs index c98c541b85b8..a9141f12c53a 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapsePrivateLinkHubResource.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapsePrivateLinkHubResource.cs @@ -338,7 +338,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell try { var response = await _synapsePrivateLinkHubPrivateLinkHubsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new SynapseArmOperation(_synapsePrivateLinkHubPrivateLinkHubsClientDiagnostics, Pipeline, _synapsePrivateLinkHubPrivateLinkHubsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var operation = new SynapseArmOperation(_synapsePrivateLinkHubPrivateLinkHubsClientDiagnostics, Pipeline, _synapsePrivateLinkHubPrivateLinkHubsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -380,7 +380,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel try { var response = _synapsePrivateLinkHubPrivateLinkHubsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new SynapseArmOperation(_synapsePrivateLinkHubPrivateLinkHubsClientDiagnostics, Pipeline, _synapsePrivateLinkHubPrivateLinkHubsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var operation = new SynapseArmOperation(_synapsePrivateLinkHubPrivateLinkHubsClientDiagnostics, Pipeline, _synapsePrivateLinkHubPrivateLinkHubsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseSqlPoolResource.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseSqlPoolResource.cs index 9a790a49b3f0..c2533d32db93 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseSqlPoolResource.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseSqlPoolResource.cs @@ -1241,90 +1241,6 @@ public virtual ArmOperation Resume(WaitUntil waitUntil, Cancellation } } - /// - /// Rename a SQL pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/move - /// - /// - /// Operation Id - /// SqlPools_Rename - /// - /// - /// Default Api Version - /// 2021-06-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The resource move definition for renaming this Sql pool. - /// The cancellation token to use. - /// is null. - public virtual async Task RenameAsync(SynapseResourceMoveDefinition synapseResourceMoveDefinition, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(synapseResourceMoveDefinition, nameof(synapseResourceMoveDefinition)); - - using var scope = _synapseSqlPoolSqlPoolsClientDiagnostics.CreateScope("SynapseSqlPoolResource.Rename"); - scope.Start(); - try - { - var response = await _synapseSqlPoolSqlPoolsRestClient.RenameAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, synapseResourceMoveDefinition, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Rename a SQL pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/move - /// - /// - /// Operation Id - /// SqlPools_Rename - /// - /// - /// Default Api Version - /// 2021-06-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The resource move definition for renaming this Sql pool. - /// The cancellation token to use. - /// is null. - public virtual Response Rename(SynapseResourceMoveDefinition synapseResourceMoveDefinition, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(synapseResourceMoveDefinition, nameof(synapseResourceMoveDefinition)); - - using var scope = _synapseSqlPoolSqlPoolsClientDiagnostics.CreateScope("SynapseSqlPoolResource.Rename"); - scope.Start(); - try - { - var response = _synapseSqlPoolSqlPoolsRestClient.Rename(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, synapseResourceMoveDefinition, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Creates a restore point for a data warehouse. /// diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseWorkspaceData.Serialization.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseWorkspaceData.Serialization.cs index 07aa307e2824..12da88f90969 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseWorkspaceData.Serialization.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseWorkspaceData.Serialization.cs @@ -75,7 +75,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("virtualNetworkProfile"u8); writer.WriteObjectValue(VirtualNetworkProfile, options); } - if (Optional.IsCollectionDefined(ConnectivityEndpoints)) + if (options.Format != "W" && Optional.IsCollectionDefined(ConnectivityEndpoints)) { writer.WritePropertyName("connectivityEndpoints"u8); writer.WriteStartObject(); @@ -111,28 +111,17 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("workspaceUID"u8); writer.WriteStringValue(WorkspaceUid.Value); } - if (options.Format != "W" && Optional.IsCollectionDefined(ExtraProperties)) + if (options.Format != "W" && Optional.IsDefined(ExtraProperties)) { writer.WritePropertyName("extraProperties"u8); - writer.WriteStartObject(); - foreach (var item in ExtraProperties) - { - writer.WritePropertyName(item.Key); - if (item.Value == null) - { - writer.WriteNullValue(); - continue; - } #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(ExtraProperties); #else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif + using (JsonDocument document = JsonDocument.Parse(ExtraProperties)) + { + JsonSerializer.Serialize(writer, document.RootElement); } - writer.WriteEndObject(); +#endif } if (Optional.IsDefined(ManagedVirtualNetworkSettings)) { @@ -233,12 +222,12 @@ internal static SynapseWorkspaceData DeserializeSynapseWorkspaceData(JsonElement string provisioningState = default; string sqlAdministratorLogin = default; VirtualNetworkProfile virtualNetworkProfile = default; - IDictionary connectivityEndpoints = default; + IReadOnlyDictionary connectivityEndpoints = default; string managedVirtualNetwork = default; IList privateEndpointConnections = default; SynapseEncryptionDetails encryption = default; Guid? workspaceUID = default; - IReadOnlyDictionary extraProperties = default; + BinaryData extraProperties = default; SynapseManagedVirtualNetworkSettings managedVirtualNetworkSettings = default; SynapseWorkspaceRepositoryConfiguration workspaceRepositoryConfiguration = default; PurviewConfiguration purviewConfiguration = default; @@ -409,19 +398,7 @@ internal static SynapseWorkspaceData DeserializeSynapseWorkspaceData(JsonElement { continue; } - Dictionary dictionary = new Dictionary(); - foreach (var property1 in property0.Value.EnumerateObject()) - { - if (property1.Value.ValueKind == JsonValueKind.Null) - { - dictionary.Add(property1.Name, null); - } - else - { - dictionary.Add(property1.Name, BinaryData.FromString(property1.Value.GetRawText())); - } - } - extraProperties = dictionary; + extraProperties = BinaryData.FromString(property0.Value.GetRawText()); continue; } if (property0.NameEquals("managedVirtualNetworkSettings"u8)) @@ -545,7 +522,7 @@ internal static SynapseWorkspaceData DeserializeSynapseWorkspaceData(JsonElement privateEndpointConnections ?? new ChangeTrackingList(), encryption, workspaceUID, - extraProperties ?? new ChangeTrackingDictionary(), + extraProperties, managedVirtualNetworkSettings, workspaceRepositoryConfiguration, purviewConfiguration, diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseWorkspaceData.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseWorkspaceData.cs index f3e6287a1560..8d72c5036021 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseWorkspaceData.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseWorkspaceData.cs @@ -57,7 +57,6 @@ public SynapseWorkspaceData(AzureLocation location) : base(location) { ConnectivityEndpoints = new ChangeTrackingDictionary(); PrivateEndpointConnections = new ChangeTrackingList(); - ExtraProperties = new ChangeTrackingDictionary(); Settings = new ChangeTrackingDictionary(); } @@ -91,7 +90,7 @@ public SynapseWorkspaceData(AzureLocation location) : base(location) /// Enable or Disable AzureADOnlyAuthentication on All Workspace subresource. /// Is trustedServiceBypassEnabled for the workspace. /// Keeps track of any properties unknown to the library. - internal SynapseWorkspaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, SynapseDataLakeStorageAccountDetails defaultDataLakeStorage, string sqlAdministratorLoginPassword, string managedResourceGroupName, string provisioningState, string sqlAdministratorLogin, VirtualNetworkProfile virtualNetworkProfile, IDictionary connectivityEndpoints, string managedVirtualNetwork, IList privateEndpointConnections, SynapseEncryptionDetails encryption, Guid? workspaceUid, IReadOnlyDictionary extraProperties, SynapseManagedVirtualNetworkSettings managedVirtualNetworkSettings, SynapseWorkspaceRepositoryConfiguration workspaceRepositoryConfiguration, PurviewConfiguration purviewConfiguration, ResourceIdentifier adlaResourceId, WorkspacePublicNetworkAccess? publicNetworkAccess, CspWorkspaceAdminProperties cspWorkspaceAdminProperties, IReadOnlyDictionary settings, bool? isAadOnlyAuthenticationEnabled, bool? isTrustedServiceBypassEnabled, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal SynapseWorkspaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, SynapseDataLakeStorageAccountDetails defaultDataLakeStorage, string sqlAdministratorLoginPassword, string managedResourceGroupName, string provisioningState, string sqlAdministratorLogin, VirtualNetworkProfile virtualNetworkProfile, IReadOnlyDictionary connectivityEndpoints, string managedVirtualNetwork, IList privateEndpointConnections, SynapseEncryptionDetails encryption, Guid? workspaceUid, BinaryData extraProperties, SynapseManagedVirtualNetworkSettings managedVirtualNetworkSettings, SynapseWorkspaceRepositoryConfiguration workspaceRepositoryConfiguration, PurviewConfiguration purviewConfiguration, ResourceIdentifier adlaResourceId, WorkspacePublicNetworkAccess? publicNetworkAccess, CspWorkspaceAdminProperties cspWorkspaceAdminProperties, IReadOnlyDictionary settings, bool? isAadOnlyAuthenticationEnabled, bool? isTrustedServiceBypassEnabled, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Identity = identity; DefaultDataLakeStorage = defaultDataLakeStorage; @@ -150,7 +149,7 @@ public string VirtualNetworkComputeSubnetId } /// Connectivity endpoints. - public IDictionary ConnectivityEndpoints { get; } + public IReadOnlyDictionary ConnectivityEndpoints { get; } /// Setting this to 'default' will ensure that all compute for this workspace is in a virtual network managed on behalf of the user. public string ManagedVirtualNetwork { get; set; } /// Private endpoint connections to the workspace. @@ -162,7 +161,7 @@ public string VirtualNetworkComputeSubnetId /// /// Workspace level configs and feature flags /// - /// To assign an object to the value of this property use . + /// To assign an object to this property use . /// /// /// To assign an already formatted json string to this property use . @@ -189,7 +188,7 @@ public string VirtualNetworkComputeSubnetId /// /// /// - public IReadOnlyDictionary ExtraProperties { get; } + public BinaryData ExtraProperties { get; } /// Managed Virtual Network Settings. public SynapseManagedVirtualNetworkSettings ManagedVirtualNetworkSettings { get; set; } /// Git integration settings. diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/autorest.md b/sdk/synapse/Azure.ResourceManager.Synapse/src/autorest.md index d1b1fe5473e6..4a317c353fed 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/autorest.md +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/autorest.md @@ -9,7 +9,7 @@ csharp: true library-name: Synapse namespace: Azure.ResourceManager.Synapse # The readme.md in swagger repo contains invalid setting for C# sdk -# require: https://github.com/Azure/azure-rest-api-specs/blob/340d577969b7bff5ad0488d79543314bc17daa50/specification/synapse/resource-manager/readme.md +# require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/synapse/resource-manager/readme.md tag: package-composite-v2 output-folder: $(this-folder)/Generated clear-output-folder: true @@ -546,20 +546,20 @@ These settings apply only when --tag=package-composite-v2 is specified on the co ```yaml $(tag) == 'package-composite-v2' input-file: - - https://github.com/Azure/azure-rest-api-specs/blob/340d577969b7bff5ad0488d79543314bc17daa50/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/azureADOnlyAuthentication.json - - https://github.com/Azure/azure-rest-api-specs/blob/340d577969b7bff5ad0488d79543314bc17daa50/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/checkNameAvailability.json - - https://github.com/Azure/azure-rest-api-specs/blob/340d577969b7bff5ad0488d79543314bc17daa50/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/firewallRule.json - - https://github.com/Azure/azure-rest-api-specs/blob/340d577969b7bff5ad0488d79543314bc17daa50/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/keys.json - - https://github.com/Azure/azure-rest-api-specs/blob/340d577969b7bff5ad0488d79543314bc17daa50/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/operations.json - - https://github.com/Azure/azure-rest-api-specs/blob/340d577969b7bff5ad0488d79543314bc17daa50/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/privateEndpointConnections.json - - https://github.com/Azure/azure-rest-api-specs/blob/340d577969b7bff5ad0488d79543314bc17daa50/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/privateLinkResources.json - - https://github.com/Azure/azure-rest-api-specs/blob/340d577969b7bff5ad0488d79543314bc17daa50/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/privatelinkhub.json - - https://github.com/Azure/azure-rest-api-specs/blob/340d577969b7bff5ad0488d79543314bc17daa50/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/sqlPool.json - - https://github.com/Azure/azure-rest-api-specs/blob/340d577969b7bff5ad0488d79543314bc17daa50/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/sqlServer.json - - https://github.com/Azure/azure-rest-api-specs/blob/340d577969b7bff5ad0488d79543314bc17daa50/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/workspace.json - - https://github.com/Azure/azure-rest-api-specs/blob/340d577969b7bff5ad0488d79543314bc17daa50/specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/bigDataPool.json - - https://github.com/Azure/azure-rest-api-specs/blob/340d577969b7bff5ad0488d79543314bc17daa50/specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/library.json - - https://github.com/Azure/azure-rest-api-specs/blob/340d577969b7bff5ad0488d79543314bc17daa50/specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/integrationRuntime.json - - https://github.com/Azure/azure-rest-api-specs/blob/340d577969b7bff5ad0488d79543314bc17daa50/specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/sparkConfiguration.json - - https://github.com/Azure/azure-rest-api-specs/blob/340d577969b7bff5ad0488d79543314bc17daa50/specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/kustoPool.json + - https://github.com/Azure/azure-rest-api-specs/blob/7c52cf4d9a41dd06846b099946e8b85a9504cf1e/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/azureADOnlyAuthentication.json + - https://github.com/Azure/azure-rest-api-specs/blob/7c52cf4d9a41dd06846b099946e8b85a9504cf1e/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/checkNameAvailability.json + - https://github.com/Azure/azure-rest-api-specs/blob/7c52cf4d9a41dd06846b099946e8b85a9504cf1e/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/firewallRule.json + - https://github.com/Azure/azure-rest-api-specs/blob/7c52cf4d9a41dd06846b099946e8b85a9504cf1e/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/keys.json + - https://github.com/Azure/azure-rest-api-specs/blob/7c52cf4d9a41dd06846b099946e8b85a9504cf1e/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/operations.json + - https://github.com/Azure/azure-rest-api-specs/blob/7c52cf4d9a41dd06846b099946e8b85a9504cf1e/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/privateEndpointConnections.json + - https://github.com/Azure/azure-rest-api-specs/blob/7c52cf4d9a41dd06846b099946e8b85a9504cf1e/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/privateLinkResources.json + - https://github.com/Azure/azure-rest-api-specs/blob/7c52cf4d9a41dd06846b099946e8b85a9504cf1e/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/privatelinkhub.json + - https://github.com/Azure/azure-rest-api-specs/blob/7c52cf4d9a41dd06846b099946e8b85a9504cf1e/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/sqlPool.json + - https://github.com/Azure/azure-rest-api-specs/blob/7c52cf4d9a41dd06846b099946e8b85a9504cf1e/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/sqlServer.json + - https://github.com/Azure/azure-rest-api-specs/blob/7c52cf4d9a41dd06846b099946e8b85a9504cf1e/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/workspace.json + - https://github.com/Azure/azure-rest-api-specs/blob/7c52cf4d9a41dd06846b099946e8b85a9504cf1e/specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/bigDataPool.json + - https://github.com/Azure/azure-rest-api-specs/blob/7c52cf4d9a41dd06846b099946e8b85a9504cf1e/specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/library.json + - https://github.com/Azure/azure-rest-api-specs/blob/7c52cf4d9a41dd06846b099946e8b85a9504cf1e/specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/integrationRuntime.json + - https://github.com/Azure/azure-rest-api-specs/blob/7c52cf4d9a41dd06846b099946e8b85a9504cf1e/specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/sparkConfiguration.json + - https://github.com/Azure/azure-rest-api-specs/blob/7c52cf4d9a41dd06846b099946e8b85a9504cf1e/specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/kustoPool.json ``` diff --git a/sdk/synapse/ci.mgmt.yml b/sdk/synapse/ci.mgmt.yml index 0a089a504291..c62602416db8 100644 --- a/sdk/synapse/ci.mgmt.yml +++ b/sdk/synapse/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/synapse/ci.mgmt.yml - sdk/synapse/Azure.ResourceManager.Synapse/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/synapse/ci.mgmt.yml + - sdk/synapse/Azure.ResourceManager.Synapse/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/synapse/ci.mgmt.yml + - sdk/synapse/Azure.ResourceManager.Synapse/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/synapse/ci.mgmt.yml + - sdk/synapse/Azure.ResourceManager.Synapse/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/synapse/ci.mgmt.yml + - sdk/synapse/Azure.ResourceManager.Synapse/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/synapse/ci.mgmt.yml + - sdk/synapse/Azure.ResourceManager.Synapse/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/synapse/ci.mgmt.yml + - sdk/synapse/Azure.ResourceManager.Synapse/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/synapse/ci.mgmt.yml + - sdk/synapse/Azure.ResourceManager.Synapse/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/synapse/ci.mgmt.yml + - sdk/synapse/Azure.ResourceManager.Synapse/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/synapse/ci.mgmt.yml + - sdk/synapse/Azure.ResourceManager.Synapse/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/terraform/ci.mgmt.yml b/sdk/terraform/ci.mgmt.yml index 82c4c1f05a4c..d24dc1d13c92 100644 --- a/sdk/terraform/ci.mgmt.yml +++ b/sdk/terraform/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/terraform/ci.mgmt.yml - sdk/terraform/Azure.ResourceManager.Terraform/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/terraform/ci.mgmt.yml + - sdk/terraform/Azure.ResourceManager.Terraform/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/terraform/ci.mgmt.yml + - sdk/terraform/Azure.ResourceManager.Terraform/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/terraform/ci.mgmt.yml + - sdk/terraform/Azure.ResourceManager.Terraform/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/terraform/ci.mgmt.yml + - sdk/terraform/Azure.ResourceManager.Terraform/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/terraform/ci.mgmt.yml + - sdk/terraform/Azure.ResourceManager.Terraform/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/terraform/ci.mgmt.yml + - sdk/terraform/Azure.ResourceManager.Terraform/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/terraform/ci.mgmt.yml + - sdk/terraform/Azure.ResourceManager.Terraform/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/terraform/ci.mgmt.yml + - sdk/terraform/Azure.ResourceManager.Terraform/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/terraform/ci.mgmt.yml + - sdk/terraform/Azure.ResourceManager.Terraform/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/trafficmanager/ci.mgmt.yml b/sdk/trafficmanager/ci.mgmt.yml index 528f78b70b96..4a9d4110ee74 100644 --- a/sdk/trafficmanager/ci.mgmt.yml +++ b/sdk/trafficmanager/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/trafficmanager/ci.mgmt.yml - sdk/trafficmanager/Azure.ResourceManager.TrafficManager/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/trafficmanager/ci.mgmt.yml + - sdk/trafficmanager/Azure.ResourceManager.TrafficManager/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/trafficmanager/ci.mgmt.yml + - sdk/trafficmanager/Azure.ResourceManager.TrafficManager/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/trafficmanager/ci.mgmt.yml + - sdk/trafficmanager/Azure.ResourceManager.TrafficManager/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/trafficmanager/ci.mgmt.yml + - sdk/trafficmanager/Azure.ResourceManager.TrafficManager/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/trafficmanager/ci.mgmt.yml + - sdk/trafficmanager/Azure.ResourceManager.TrafficManager/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/trafficmanager/ci.mgmt.yml + - sdk/trafficmanager/Azure.ResourceManager.TrafficManager/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/trafficmanager/ci.mgmt.yml + - sdk/trafficmanager/Azure.ResourceManager.TrafficManager/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/trafficmanager/ci.mgmt.yml + - sdk/trafficmanager/Azure.ResourceManager.TrafficManager/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/trafficmanager/ci.mgmt.yml + - sdk/trafficmanager/Azure.ResourceManager.TrafficManager/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/trustedsigning/ci.mgmt.yml b/sdk/trustedsigning/ci.mgmt.yml index 5b67358a4477..e80fc1be64ba 100644 --- a/sdk/trustedsigning/ci.mgmt.yml +++ b/sdk/trustedsigning/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/trustedsigning/ci.mgmt.yml - sdk/trustedsigning/Azure.ResourceManager.TrustedSigning/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/trustedsigning/ci.mgmt.yml + - sdk/trustedsigning/Azure.ResourceManager.TrustedSigning/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/trustedsigning/ci.mgmt.yml + - sdk/trustedsigning/Azure.ResourceManager.TrustedSigning/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/trustedsigning/ci.mgmt.yml + - sdk/trustedsigning/Azure.ResourceManager.TrustedSigning/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/trustedsigning/ci.mgmt.yml + - sdk/trustedsigning/Azure.ResourceManager.TrustedSigning/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/trustedsigning/ci.mgmt.yml + - sdk/trustedsigning/Azure.ResourceManager.TrustedSigning/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/trustedsigning/ci.mgmt.yml + - sdk/trustedsigning/Azure.ResourceManager.TrustedSigning/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/trustedsigning/ci.mgmt.yml + - sdk/trustedsigning/Azure.ResourceManager.TrustedSigning/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/trustedsigning/ci.mgmt.yml + - sdk/trustedsigning/Azure.ResourceManager.TrustedSigning/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/trustedsigning/ci.mgmt.yml + - sdk/trustedsigning/Azure.ResourceManager.TrustedSigning/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/voiceservices/ci.mgmt.yml b/sdk/voiceservices/ci.mgmt.yml index a914d1640296..0e47ffd750d3 100644 --- a/sdk/voiceservices/ci.mgmt.yml +++ b/sdk/voiceservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/voiceservices/ci.mgmt.yml - sdk/voiceservices/Azure.ResourceManager.VoiceServices/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/voiceservices/ci.mgmt.yml + - sdk/voiceservices/Azure.ResourceManager.VoiceServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/voiceservices/ci.mgmt.yml + - sdk/voiceservices/Azure.ResourceManager.VoiceServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/voiceservices/ci.mgmt.yml + - sdk/voiceservices/Azure.ResourceManager.VoiceServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/voiceservices/ci.mgmt.yml + - sdk/voiceservices/Azure.ResourceManager.VoiceServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/voiceservices/ci.mgmt.yml + - sdk/voiceservices/Azure.ResourceManager.VoiceServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/voiceservices/ci.mgmt.yml + - sdk/voiceservices/Azure.ResourceManager.VoiceServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/voiceservices/ci.mgmt.yml + - sdk/voiceservices/Azure.ResourceManager.VoiceServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/voiceservices/ci.mgmt.yml + - sdk/voiceservices/Azure.ResourceManager.VoiceServices/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/voiceservices/ci.mgmt.yml + - sdk/voiceservices/Azure.ResourceManager.VoiceServices/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/webpubsub/ci.mgmt.yml b/sdk/webpubsub/ci.mgmt.yml index 6bcb8439a2b0..4fd475d2682a 100644 --- a/sdk/webpubsub/ci.mgmt.yml +++ b/sdk/webpubsub/ci.mgmt.yml @@ -1,5 +1,6 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -12,6 +13,114 @@ pr: - sdk/webpubsub/ci.mgmt.yml - sdk/webpubsub/Azure.ResourceManager.WebPubSub/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/webpubsub/ci.mgmt.yml + - sdk/webpubsub/Azure.ResourceManager.WebPubSub/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/webpubsub/ci.mgmt.yml + - sdk/webpubsub/Azure.ResourceManager.WebPubSub/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/webpubsub/ci.mgmt.yml + - sdk/webpubsub/Azure.ResourceManager.WebPubSub/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/webpubsub/ci.mgmt.yml + - sdk/webpubsub/Azure.ResourceManager.WebPubSub/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/webpubsub/ci.mgmt.yml + - sdk/webpubsub/Azure.ResourceManager.WebPubSub/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/webpubsub/ci.mgmt.yml + - sdk/webpubsub/Azure.ResourceManager.WebPubSub/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/webpubsub/ci.mgmt.yml + - sdk/webpubsub/Azure.ResourceManager.WebPubSub/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/webpubsub/ci.mgmt.yml + - sdk/webpubsub/Azure.ResourceManager.WebPubSub/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/webpubsub/ci.mgmt.yml + - sdk/webpubsub/Azure.ResourceManager.WebPubSub/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/websites/ci.mgmt.yml b/sdk/websites/ci.mgmt.yml index d67c580bc414..7e799c0322c2 100644 --- a/sdk/websites/ci.mgmt.yml +++ b/sdk/websites/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/websites/ci.mgmt.yml - sdk/websites/Azure.ResourceManager.AppService/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/websites/ci.mgmt.yml + - sdk/websites/Azure.ResourceManager.AppService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/websites/ci.mgmt.yml + - sdk/websites/Azure.ResourceManager.AppService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/websites/ci.mgmt.yml + - sdk/websites/Azure.ResourceManager.AppService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/websites/ci.mgmt.yml + - sdk/websites/Azure.ResourceManager.AppService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/websites/ci.mgmt.yml + - sdk/websites/Azure.ResourceManager.AppService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/websites/ci.mgmt.yml + - sdk/websites/Azure.ResourceManager.AppService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/websites/ci.mgmt.yml + - sdk/websites/Azure.ResourceManager.AppService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/websites/ci.mgmt.yml + - sdk/websites/Azure.ResourceManager.AppService/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/websites/ci.mgmt.yml + - sdk/websites/Azure.ResourceManager.AppService/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/workloadmonitor/ci.mgmt.yml b/sdk/workloadmonitor/ci.mgmt.yml index 7c6a51fbe75c..021fc9c7787d 100644 --- a/sdk/workloadmonitor/ci.mgmt.yml +++ b/sdk/workloadmonitor/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/workloadmonitor/ci.mgmt.yml - sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/workloadmonitor/ci.mgmt.yml + - sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/workloadmonitor/ci.mgmt.yml + - sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/workloadmonitor/ci.mgmt.yml + - sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/workloadmonitor/ci.mgmt.yml + - sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/workloadmonitor/ci.mgmt.yml + - sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/workloadmonitor/ci.mgmt.yml + - sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/workloadmonitor/ci.mgmt.yml + - sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/workloadmonitor/ci.mgmt.yml + - sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/workloadmonitor/ci.mgmt.yml + - sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/workloads/ci.mgmt.yml b/sdk/workloads/ci.mgmt.yml index e3457d69ceaa..44e1c83237a4 100644 --- a/sdk/workloads/ci.mgmt.yml +++ b/sdk/workloads/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,114 @@ pr: - sdk/workloads/ci.mgmt.yml - sdk/workloads/Azure.ResourceManager.Workloads/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/workloads/ci.mgmt.yml + - sdk/workloads/Azure.ResourceManager.Workloads/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/workloads/ci.mgmt.yml + - sdk/workloads/Azure.ResourceManager.Workloads/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/workloads/ci.mgmt.yml + - sdk/workloads/Azure.ResourceManager.Workloads/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/workloads/ci.mgmt.yml + - sdk/workloads/Azure.ResourceManager.Workloads/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/workloads/ci.mgmt.yml + - sdk/workloads/Azure.ResourceManager.Workloads/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/workloads/ci.mgmt.yml + - sdk/workloads/Azure.ResourceManager.Workloads/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/workloads/ci.mgmt.yml + - sdk/workloads/Azure.ResourceManager.Workloads/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/workloads/ci.mgmt.yml + - sdk/workloads/Azure.ResourceManager.Workloads/ + + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/workloads/ci.mgmt.yml + - sdk/workloads/Azure.ResourceManager.Workloads/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: